12 #ifndef MESH_ASSOCIATIVITY_CLASS 13 #define MESH_ASSOCIATIVITY_CLASS 120 virtual void setAref(
MLINT aref);
123 bool hasAref()
const;
126 MLINT getAref()
const;
129 MLINT getXID()
const;
132 const std::string & getName()
const;
135 const std::string & getContents()
const;
144 void getQuaternion(
MLREAL xform_quaternion[4][4])
const;
189 std::string &sourceEntityRef,
190 std::string &targetEntityRef,
196 virtual void setAref(
MLINT aref);
199 bool hasAref()
const;
202 MLINT getAref()
const;
210 bool hasXref()
const;
215 virtual bool getXref(
MLINT *xref)
const;
231 virtual void getName(
const char **name)
const;
234 virtual const std::string & getName()
const;
242 void setName(
const std::string &name);
250 void setName(
const char *name);
253 std::string getNextName();
259 void getEntityRefs(std::string &sourceEntityRef, std::string &targetEntityRef)
const;
262 virtual const std::string &getBaseName()
const;
264 virtual MLUINT &getNameCounter();
314 MLINT getAttID()
const;
317 bool isGroup()
const;
321 bool isValid()
const;
327 const std::vector<MLINT> & getAttributeIDs()
const;
373 arefString_(arefString)
380 virtual const char *
getFilename()
const {
return filename_.c_str(); }
386 bool hasAref()
const {
return !arefString_.empty(); }
390 if (!hasAref()) {
return false; }
391 if (1 == sscanf(arefString_.c_str(),
"%" MLINT_FORMAT, aref)) {
439 groupIDs_.push_back(gid);
477 MeshFile(std::string &filename, std::string &arefString) :
489 modelRefs_.push_back(refName);
540 MLINT getGeometryGroupCount()
const;
545 void getGeometryGroupIDs(std::vector<MLINT> &gids)
const;
563 bool addMeshModel(
MeshModel *model,
bool mapID);
575 MeshModel * getMeshModelByName(
const std::string &name)
const;
581 MeshModel* getMeshModelByRef(
const char * ref)
const;
591 bool getMeshSheetByName(
const std::string &name,
602 bool getMeshStringByName(
const std::string &name,
637 bool setActiveGeometryKernelByName(
const char *name);
646 void clearAttributes();
655 std::vector<const MeshLinkAttribute *> getAttributes()
const;
665 void clearTransforms();
674 void getTransforms(std::vector<const MeshLinkTransform *> &xforms)
const;
677 size_t getTransformCount()
const;
681 void clearMeshElementLinkages();
695 getMeshElementLinkageByName(
const std::string &name)
const;
699 void getMeshElementLinkages(std::vector<MeshElementLinkage *> &linkages)
const;
702 size_t getMeshElementLinkageCount()
const;
705 MLINT getNumGeometryFiles()
const;
713 MLINT getNumMeshFiles()
const;
726 bool getAttribute(
MLINT attID,
const char **name,
const char **value)
const;
729 const std::vector<GeometryFile> & getGeometryFiles()
const;
732 const std::vector<MeshFile> & getMeshFiles()
const;
735 void getMeshModels(std::vector<MeshModel *> &models)
const;
738 size_t getMeshModelCount()
const;
MLINT attid_
The AttID of this attribute.
void addModelRef(const std::string &refName)
Add a MeshModel reference to this mesh file. Typically used by a MeshLinkParser when a new "MeshModel...
MeshTopoRefToNameMap meshModelRefToNameMap_
Map of mesh model reference string to MeshModel name.
GeometryKernel * active_
The active GeometryKernel.
bool getArefID(MLINT *aref) const
Return whether the file references the given attribute reference ID.
Base class for geometry kernel interface.
std::map< MLINT, MeshLinkTransform > MeshTransformIDMap
const std::vector< MLINT > & getGeometryGroupIDs() const
Return a list of all geometry group IDs associated with this GeometryFile.
static MLUINT nameCounter_
The unique name counter for linkages.
void removeKernel(GeometryKernel *kernel)
MeshAssociativity()
Default constructor.
GeometryFile()
Default constructor.
bool is_valid_
Whether this attribute is valid.
std::vector< GeometryKernel * > GeometryKernelArray
const std::vector< std::string > & getModelRefs()
std::string arefString_
The mesh file attribute reference string.
Storage for mesh topology and geometry associativity data.
MeshFile(std::string &filename, std::string &arefString)
Explicit constructor with mesh file name and attribute reference string.
std::vector< std::string > modelRefs_
The model references associated with a mesh file.
std::string name_
The name of this linkage.
MLUINT64 MLUINT
Standard unsigned integer - value depends on IS64BIT macro.
std::map< std::string, MeshElementLinkage * > MeshElementLinkageNameMap
bool is_group_
Whether this attribute is a group of other attributes.
bool setActiveByName(const char *name)
Storage for MeshLink GeometryFile and MeshFile data.
std::vector< GeometryFile > geometryFiles_
Geometry files.
3D (volume) mesh topology
std::string sourceEntityRef_
The source entity reference.
MLINT aref_
The attribute reference ID (AttID)
std::map< std::string, MeshModel * > MeshModelNameMap
std::string targetEntityRef_
The target entity reference.
GeometryFile(std::string &filename, std::string &arefString)
Explicit constructor with file name (path) of geometry file and the attribute reference string.
2D (surface) mesh topology
MeshLinkFile(std::string &filename, std::string &arefString)
Explicit constructor with file name (path) and attribute reference string.
GeometryKernel * getActive()
std::vector< MeshFile > meshFiles_
Mesh files.
Storage for MeshLink schema MeshFile data.
std::map< std::string, std::string > MeshTopoRefToNameMap
Storage for MeshLink schema GeometryFile data.
~MeshLinkFile()
Destructor.
Storage for geometry groups.
GeometryKernel * getByName(const char *name)
std::vector< MLINT > groupIDs_
The geometry group IDs in this file.
MeshAttributeIDMap meshAttributeIDMap_
Map of MeshAttribute to associated ID (aref)
static GeometryKernelManager geometry_kernel_manager_
The Singleton geometry kernel manager.
std::map< MLINT, std::string > MeshTopoIDToNameMap
std::map< std::string, MLINT > MeshTransformNameToIDMap
MeshModelNameMap meshModelNameMap_
Map of mesh model name to MeshModel.
std::string name_
The name of this attribute.
bool is_valid_
Whether this linkage is valid.
GeometryGroupManager geometry_group_manager_
The associativity geometry group manager.
std::string contents_
The application-defined contents of the attribute, from the MeshLink file.
MeshTransformNameToIDMap meshTransformNameToIDMap_
Map of MeshTransform name to associated XID (xref)
Management of geometry kernel interfaces.
std::map< MLINT, MeshLinkAttribute > MeshAttributeIDMap
GeometryKernelManager()
Default constructor, no active GeometryKernel by default.
~GeometryFile()
Destructor.
MeshTopoIDToNameMap meshModelIDToNameMap_
Map of mesh model ID to MeshModel name.
void addGeometryGroupID(MLINT gid)
Add a geometry group ID to the geometry file. Typically used by the MeshLinkParser when a new "Geomet...
bool hasAref() const
Return whether the file has an attribute reference.
Storage for MeshLink ElementLinkage data.
void addKernel(GeometryKernel *kernel)
MeshTransformIDMap meshTransformIDMap_
Map of MeshTransform to associated XID (xref)
Storage for MeshLink Attribute and AttributeGroup data.
std::string filename_
The mesh file name.
MeshElementLinkageNameMap meshElementLinkageNameMap_
Map of element linkage name to MeshElementLinkage.
GeometryKernelArray geometry_kernels_
The list of managed GeometryKernel objects.
MeshAttributeNameToIDMap meshAttributeNameToIDMap_
Map of MeshAttribute name to associated ID (aref)
std::vector< MLINT > group_arefs_
MLINT xref_
The transform reference ID (XID)
MeshFile()
Default constructor.
MeshLinkFile()
Default constructor.
std::map< std::string, MLINT > MeshAttributeNameToIDMap
MLINT64 MLINT
Standard integer - value depends on IS64BIT macro.
Storage for geometry association by entity reference.
virtual const char * getFilename() const
Return the filename specified by the MeshLinkFile.