{
myScript = new SMESHDS_Script(theIsEmbeddedMode);
myCurSubMesh = 0;
+ SetPersistentId(theMeshID);
}
//=======================================================================
return myIsEmbeddedMode;
}
+//================================================================================
+/*!
+ * \brief Store ID persistent during lifecycle
+ */
+//================================================================================
+
+void SMESHDS_Mesh::SetPersistentId(int id)
+{
+ if (NbNodes() == 0)
+ myPersistentID = id;
+}
+//================================================================================
+/*!
+ * \brief Return ID persistent during lifecycle
+ */
+//================================================================================
+
+int SMESHDS_Mesh::GetPersistentId() const
+{
+ return myPersistentID;
+}
+
//=======================================================================
//function : ShapeToMesh
//purpose :
return nullShape;
}
+//================================================================================
+/*!
+ * \brief Return max index of sub-mesh
+ */
+//================================================================================
+
+int SMESHDS_Mesh::MaxSubMeshIndex() const
+{
+ return myShapeIndexToSubMesh.empty() ? 0 : myShapeIndexToSubMesh.rbegin()->first;
+}
+
//=======================================================================
//function : ShapeToIndex
//purpose :
#include <NCollection_DataMap.hxx>
#include <map>
/*
- * Using of native haah_map isn't portable and don't work on WIN32 platform.
+ * Using of native hash_map isn't portable and don't work on WIN32 platform.
* So this functionality implement on new NCollection_DataMap technology
*/
#include "SMESHDS_DataMapOfShape.hxx"
public:
SMESHDS_Mesh(int theMeshID, bool theIsEmbeddedMode);
bool IsEmbeddedMode();
+ void SetPersistentId(int id);
+ int GetPersistentId() const;
void ShapeToMesh(const TopoDS_Shape & S);
TopoDS_Shape ShapeToMesh() const;
int ShapeToIndex(const TopoDS_Shape & aShape) const;
const TopoDS_Shape& IndexToShape(int ShapeIndex) const;
int MaxShapeIndex() const { return myIndexToShape.Extent(); }
+ int MaxSubMeshIndex() const;
SMESHDS_SubMesh * NewSubMesh(int Index);
int AddCompoundSubmesh(const TopoDS_Shape& S, TopAbs_ShapeEnum type = TopAbs_SHAPE);
if ( it == myShapeIndexToSubMesh.end() )
it = myShapeIndexToSubMesh.insert( std::make_pair(Index, new SMESHDS_SubMesh() )).first;
it->second->AddNode( aNode ); // add aNode to submesh
- }
+ }
/*int HashCode( const TopoDS_Shape& S, const Standard_Integer theUpper ) const
{
ShapeToHypothesis myShapeToHypothesis;
- int myMeshID;
+ int myMeshID, myPersistentID;
TopoDS_Shape myShape;
typedef std::map<int,SMESHDS_SubMesh*> TShapeIndexToSubMesh;