Commit 4e3d671f authored by Jan Möbius's avatar Jan Möbius
Browse files

Added convenience functions to get a hexahedral or polyhedral mesh directly from the object id.

closes #2199

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18779 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a59baa43
......@@ -120,6 +120,15 @@ HexahedralMesh* hexahedralMesh( BaseObjectData* _object ) {
return 0;
}
HexahedralMesh* hexahedralMesh( int _identifier ) {
HexahedralMeshObject* object = hexahedralMeshObject(_identifier);
if ( object == 0)
return 0;
else
return object->mesh();
}
HexahedralMeshObject* hexahedralMeshObject( BaseObjectData* _object ) {
if ( ! _object->dataType(DATA_HEXAHEDRAL_MESH) )
......
......@@ -91,6 +91,14 @@ bool getObject( int _identifier, HexahedralMeshObject*& _object );
DLLEXPORT
HexahedralMesh* hexahedralMesh( BaseObjectData* _object );
/** \brief Get a HexahedralMesh from an object id.
*
* @param _identifier Identifier of the object. If its a HexahedralMesh mesh, the function will return the pointer to the mesh
* otherwise 0
*/
DLLEXPORT
HexahedralMesh* hexahedralMesh( int _identifier );
/** \brief Cast an BaseObject to an HexahedralMeshObject if possible
*
* @param _object The object should be of type BaseDataObject. If the content is
......
......@@ -120,6 +120,15 @@ PolyhedralMesh* polyhedralMesh( BaseObjectData* _object ) {
return 0;
}
PolyhedralMesh* polyhedralMesh( int _identifier ) {
PolyhedralMeshObject* object = polyhedralMeshObject(_identifier);
if ( object == 0)
return 0;
else
return object->mesh();
}
PolyhedralMeshObject* polyhedralMeshObject( BaseObjectData* _object ) {
if ( ! _object->dataType(DATA_POLYHEDRAL_MESH) )
......
......@@ -91,6 +91,14 @@ bool getObject( int _identifier, PolyhedralMeshObject*& _object );
DLLEXPORT
PolyhedralMesh* polyhedralMesh( BaseObjectData* _object );
/** \brief Get a PolyhedralMesh from an object id.
*
* @param _identifier Identifier of the object. If its a PolyhedralMesh mesh, the function will return the pointer to the mesh
* otherwise 0
*/
DLLEXPORT
PolyhedralMesh* polyhedralMesh( int _identifier );
/** \brief Cast an BaseObject to an PolyhedralMeshObject if possible
*
* @param _object The object should be of type BaseDataObject. If the content is
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment