12 #ifndef MESH_TOPO_CLASS 13 #define MESH_TOPO_CLASS 22 #define MESH_TOPO_INVALID_REF -101 23 #define MESH_TOPO_INDEX_UNUSED -101 40 static FNVHash hashInit();
43 static FNVHash hash(
MLINT data, FNVHash hash);
46 const static FNVHash fnv_init_;
47 const static FNVHash fnv_prime_;
48 const static FNVHash fnv_num_octets_;
52 #define FNV1_32_INIT ((pwiFnvHash::FNVHash)0x811c9dc5) 53 #define FNV1_64_INIT ((pwiFnvHash::FNVHash)0xcbf29ce484222325ULL) 54 #define FNV1_32_PRIME ((pwiFnvHash::FNVHash)0x01000193) 55 #define FNV1_64_PRIME ((pwiFnvHash::FNVHash)0x100000001b3ULL) 73 gref_(MESH_TOPO_INVALID_REF),
74 mid_(MESH_TOPO_INVALID_REF),
146 const std::string &name );
156 const std::string &ref,
160 const std::string &name );
163 virtual MLINT getID()
const;
166 virtual MLINT getGref()
const;
169 virtual MLINT getAref()
const;
176 virtual void getName(
const char **name)
const;
179 virtual const std::string & getName()
const;
182 virtual const std::string & getRef()
const;
188 virtual void addParamVertex(
ParamVertex *pv,
bool mapID);
193 virtual ParamVertex * getParamVertByVref(
const std::string & vref)
const;
201 virtual MLINT getNumParamVerts()
const;
204 void getParamVerts(std::vector<const ParamVertex *> &pv)
const;
213 virtual void setID(
MLINT id );
218 virtual void setGref(
MLINT gref );
223 virtual void setAref(
MLINT aref );
228 virtual void setRef(
const char *ref);
236 void setName(
const std::string &name);
244 void setName(
const char *name);
250 bool hasGref()
const;
253 bool hasAref()
const;
259 std::string getNextName();
262 virtual const std::string &getBaseName()
const;
264 virtual MLUINT &getNameCounter();
267 void setOrderCounter(
MLUINT counter);
270 MLUINT getOrderCounter()
const ;
342 const std::string &name,
355 const std::string &ref,
359 const std::string &name,
400 pwiFnvHash::FNVHash
getHash()
const;
440 const std::string &name,
452 const std::string &ref,
456 const std::string &name,
493 for (
int i = 0; i < 2; ++i) {
503 for (
int i = 0; i < 2; ++i) {
522 pwiFnvHash::FNVHash
getHash()
const;
567 const std::string &name,
580 const std::string &ref,
584 const std::string &name,
600 const std::string &name,
613 const std::string &ref,
617 const std::string &name,
647 for (
int i = 0; i < 4; ++i) {
657 for (
int i = 0; i < 4; ++i) {
678 pwiFnvHash::FNVHash
getHash()
const;
682 MLINT i4 = MESH_TOPO_INDEX_UNUSED);
MLINT getID() const
Return this entity's ID.
std::map< MLINT, std::string > ParamVertIDToVrefMap
MLINT i2_
The index of the second point.
virtual const std::string & getBaseName() const
Return the base name used for generating unique names for edges.
MLINT i1_
The index of this point.
ParamVertVrefMap paramVertVrefMap_
ParamVertex objects mapped to this entity by application-defined reference string.
MLREAL v_
The parametric V value.
MeshEdge & operator=(const MeshEdge &other)
Copy operator.
MLINT gref_
The geometry reference ID.
std::map< std::string, MeshEdge * > MeshEdgeNameMap
static MLUINT nameCounter_
The unique name counter for points.
static pwiFnvHash::FNVHash computeHash(MLINT i1)
Compute a point hash value for the given index value.
std::map< std::string, ParamVertex * > ParamVertVrefMap
MLUINT orderCounter_
creation order counter in parent entity
ParamVertex()
Default constructor.
std::string name_
The name of the mesh entity.
Storage for mesh topology and geometry associativity data.
MLUINT64 MLUINT
Standard unsigned integer - value depends on IS64BIT macro.
virtual const std::string & getBaseName() const
Return the base name used for generating unique names for points.
MLINT getNumParamVerts() const
Return number of ParamVertices associated with the MeshFace.
std::map< std::string, MeshFace * > MeshFaceNameMap
std::vector< MeshTopo * > MeshTopoArray
ParamVertex *const getParamVert() const
Return ParamVertex associated with the MeshPoint.
MeshEdge()
Hidden default constructor.
static MLUINT nameCounter_
The unique name counter for faces.
3D (volume) mesh topology
MeshFace()
Hidden default constructor.
MLINT i4_
The index of the fourth point.
2D (surface) mesh topology
MLINT getParamVerts(ParamVertex *const **pvs) const
Return array of ParamVertices associated with the MeshPoint.
virtual const std::string & getBaseName() const
Return the base name used for generating unique names for faces.
std::string ref_
The application-defined reference string.
MLINT getNumParamVerts() const
Return number of ParamVertices associated with the MeshEdge.
std::map< std::string, std::string > MeshTopoRefToNameMap
static MLUINT nameCounter_
The unique name counter.
MLINT getParamVerts(ParamVertex *const **pvs) const
Return array of ParamVertices associated with the MeshFace.
MLINT i2_
The index of the ending point in the edge.
ParamVertIDToVrefMap paramVertIDToVrefMap_
ParamVertex objects mapped to this entity by unique entity ID.
void getInds(MLINT *inds, MLINT *numInds) const
Return array of vertex indices associated with the MeshFace.
static pwiFnvHash::FNVHash computeHash(MLINT i1, MLINT i2, MLINT i3, MLINT i4=MESH_TOPO_INDEX_UNUSED)
Return a hash value for the given point indices.
static pwiFnvHash::FNVHash computeHash(MLINT i1, MLINT i2)
Return a hash value for the given point indices.
std::map< MLINT, std::string > MeshTopoIDToNameMap
virtual MLUINT & getNameCounter()
Return the current value used for generating unique names for faces.
const std::string & getVref() const
Return the MeshPoint vertex reference.
pwiFnvHash::FNVHash getHash() const
Return the hash value for this face.
MeshPoint()
Hidden default constructor.
MLINT aref_
The attribute reference ID (AttID)
ParamVertex * paramVerts_[4]
The array of ParamVertex objects associated with the face points.
MLINT i1_
The index of the first point.
MLINT gref_
The geometry reference ID.
std::map< std::string, MeshPoint * > MeshPointNameMap
ParamVertex * paramVert_
The ParamVertex associated with this point.
MLINT getGref() const
Return the associated geometry GID.
static MLUINT nameCounter_
The unique name counter for edges.
virtual MLUINT & getNameCounter()
Return the current value used for generating unique names for points.
void getInds(MLINT *inds, MLINT *numInds) const
Return array of vertex indices associated with the MeshEdge.
MLREAL u_
The parametric U value.
ParamVertex(const std::string &vref, MLINT gref, MLINT mid, MLREAL u, MLREAL v)
ParamVertex * paramVerts_[2]
The ParamVertex objects associated with the points in the edge.
pwiFnvHash::FNVHash getHash() const
Return the hash value for this point.
MLINT getParamVerts(ParamVertex *const **pvs) const
Return pointer to array of ParamVertices associated with the MeshEdge.
MLINT i1_
The index of the starting point in the edge.
virtual MLUINT & getNameCounter()
Return the current value used for generating unique names for edges.
void getParamVerts(std::vector< ParamVertex * > &pvs) const
Return vector of pointers to ParamVertices associated with the MeshEdge.
MLINT i3_
The index of the third point.
MLINT mid_
The unique entity ID.
std::string vref_
The application-defined reference string.
Base class for mesh topology entities.
Parametric geometry data.
MLINT64 MLINT
Standard integer - value depends on IS64BIT macro.
pwiFnvHash::FNVHash getHash() const
Return the hash value for this edge.
void getParamVerts(std::vector< ParamVertex * > &pvs) const
Return vector of pointers to ParamVertices associated with the MeshFace.
void getUV(MLREAL *u, MLREAL *v) const
Return the associated geometry parametric coordinates.