eng::GraphImporter Class Reference

Imports 3D model files as Graph objects. More...

#include <eng_import.hh>

List of all members.

Private Types

typedef map< string,
SharedPtr< Graph > > 
GraphMap

Private Member Functions

 GraphImporter (const string &fnameModel, const Vector3 &vectorScale, const Vector3 &vectorOffset)
 ~GraphImporter ()
SharedPtr< GraphGetGraph (void)
SharedPtr< GraphImport (void)
void ImportBeginPartition (const bool parsedRootPartition)
void ImportEndPartition (void)
void ImportVertexs (void)
void ImportPolygonBegin (void)
void ImportPolygonEnd (void)
void ImportPolygonColor (void)
void ImportPolygonTexture (void)
void ImportPolygonVixs (void)
void CheckStream (void)
void Error (void)
LocalVertex TransformVertex (LocalVertex v)

Private Attributes

const string mFnameModel
 .pal filename
const Vector3 mVertexScale
const Vector3 mVertexOffset
string mFileBuf
istringstream mIstream
 input stream from model
GraphMaker mGraphMaker
 ORDER-DEPENDENT helps to make a Graph.
shptr
< GraphMaker::Partition
mGraphPartition
 ORDER-DEPENDENT current partition in Graph being imported/made.
Stack< SharedPtr
< GraphMaker::Partition > > 
mGraphPartitionStack
Polygon mPolygon
 reused, cleared at beginning of every polygon
uint mDebugVertexsCnt
bool mDebugImportedPolygon
bool mDebugReturnedGraph
uint mDebugBeginPartition
 to catch mismatch <part></part>
uint mDebugEndPartition

Static Private Attributes

static GraphMap mGraphMap
 maps a model filename to a Graph
static const uint MODEL_COLOR_TRANSLUCENT = 107
static const uint COLOR_TRANSLUCENT_R = uint(0.40 * 256.0)
static const uint COLOR_TRANSLUCENT_G = uint(0.40 * 256.0)
static const uint COLOR_TRANSLUCENT_B = uint(0.45 * 256.0)
static const uint COLOR_TRANSLUCENT_A = uint(0.45 * 256.0)

Friends

SharedPtr< GraphImportGraph (const string &fnameModel, const Vector3 vertexScale, const Vector3 vertexOffset)

Classes

class  Polygon
 Holds state during parsing of a polygon. More...


Detailed Description

Imports 3D model files as Graph objects.

Clients can only use the friend function ImportGraph(). The instance is one-shot: it cannot be reused for more importing.

Implementation notes: --------------------- implementation.html documents the .pal file format. The friend function ImportGraph() is the client's interface to the private class GraphImporter. An instance is one-shot (unreusable). GraphImporter reads a 3D model .pal file exported from Blender and constructs a Graph with assistance from GraphMaker. Anticipating that more Objects will be constructed with the 3D model, imported Graphs are cached in a persistent STL map.


Member Typedef Documentation

typedef map<string,SharedPtr<Graph> > eng::GraphImporter::GraphMap [private]


Constructor & Destructor Documentation

eng::GraphImporter::GraphImporter ( const string &  fnameModel,
const Vector3 &  vectorScale,
const Vector3 &  vectorOffset 
) [private]

eng::GraphImporter::~GraphImporter (  )  [private]


Member Function Documentation

SharedPtr< Graph > eng::GraphImporter::GetGraph ( void   )  [private]

Return a clone of the imported Graph as final output. This initiates importing.

SharedPtr< Graph > eng::GraphImporter::Import ( void   )  [private]

Top-level function that parses beginning of .pal tags and defers to subroutines.

Returns:
Graph or exits program.
Precondition:
Model was never imported before.

void eng::GraphImporter::ImportBeginPartition ( const bool  parsedRootPartition  )  [private]

Begin/end a Graph Partition (part of a mesh).

void eng::GraphImporter::ImportEndPartition ( void   )  [private]

void eng::GraphImporter::ImportVertexs ( void   )  [private]

Import vertexs.

void eng::GraphImporter::ImportPolygonBegin ( void   )  [private]

Called at the beginning of a polygon.

Building of polygon-related nodes:

The importer knows that the polygon node will be below the predecessors, but that's all the importer knows about the ordering nodes. Importer defers the ordering of nodes and attaching predecessors to GraphMaker. GraphMaker and GraphMaker::NodePredecessors form a Facade to a Graph.

void eng::GraphImporter::ImportPolygonEnd ( void   )  [private]

Called at the end of a polygon.

void eng::GraphImporter::ImportPolygonColor ( void   )  [private]

Import polygon RGBA.

void eng::GraphImporter::ImportPolygonTexture ( void   )  [private]

Import a polygon's texture. <tx> f14_pirate_64 texture filename minus suffix 8 count of texture coods (8 for a quad) 0.03125 ... (<tx> needs no end tag)

void eng::GraphImporter::ImportPolygonVixs ( void   )  [private]

Import a polygon itself (its vertex indexs, ie, Blender face verts).

void eng::GraphImporter::CheckStream ( void   )  [private]

Check stream, error handling.

void eng::GraphImporter::Error ( void   )  [private]

Error during importing.

LocalVertex eng::GraphImporter::TransformVertex ( LocalVertex  v  )  [inline, private]


Friends And Related Function Documentation

SharedPtr<Graph> ImportGraph ( const string &  fnameModel,
const Vector3  vertexScale,
const Vector3  vertexOffset 
) [friend]


Member Data Documentation

GraphImporter::GraphMap eng::GraphImporter::mGraphMap [static, private]

maps a model filename to a Graph

const uint eng::GraphImporter::MODEL_COLOR_TRANSLUCENT = 107 [static, private]

const uint eng::GraphImporter::COLOR_TRANSLUCENT_R = uint(0.40 * 256.0) [static, private]

const uint eng::GraphImporter::COLOR_TRANSLUCENT_G = uint(0.40 * 256.0) [static, private]

const uint eng::GraphImporter::COLOR_TRANSLUCENT_B = uint(0.45 * 256.0) [static, private]

const uint eng::GraphImporter::COLOR_TRANSLUCENT_A = uint(0.45 * 256.0) [static, private]

const string eng::GraphImporter::mFnameModel [private]

.pal filename

const Vector3 eng::GraphImporter::mVertexScale [private]

const Vector3 eng::GraphImporter::mVertexOffset [private]

string eng::GraphImporter::mFileBuf [private]

istringstream eng::GraphImporter::mIstream [private]

input stream from model

GraphMaker eng::GraphImporter::mGraphMaker [private]

ORDER-DEPENDENT helps to make a Graph.

shptr<GraphMaker::Partition> eng::GraphImporter::mGraphPartition [private]

ORDER-DEPENDENT current partition in Graph being imported/made.

Stack<SharedPtr<GraphMaker::Partition> > eng::GraphImporter::mGraphPartitionStack [private]

Polygon eng::GraphImporter::mPolygon [private]

reused, cleared at beginning of every polygon

uint eng::GraphImporter::mDebugVertexsCnt [private]

bool eng::GraphImporter::mDebugImportedPolygon [private]

bool eng::GraphImporter::mDebugReturnedGraph [private]

uint eng::GraphImporter::mDebugBeginPartition [private]

to catch mismatch <part></part>

uint eng::GraphImporter::mDebugEndPartition [private]


The documentation for this class was generated from the following files: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:22 2007