using namespace std;
-SMDS_MeshElement::SMDS_MeshElement(int ID):myID(ID), myMeshId(-1), myShapeId(0), myIdInShape(-1)
+SMDS_MeshElement::SMDS_MeshElement(int ID)
{
+ init(ID);
}
-SMDS_MeshElement::SMDS_MeshElement(int id, ShortType meshId, ShortType shapeId):
- myID(id), myMeshId(meshId), myShapeId(shapeId), myIdInShape(-1)
+SMDS_MeshElement::SMDS_MeshElement(int id, ShortType meshId, ShortType shapeId)
{
+ init(id, meshId, shapeId);
+}
+
+void SMDS_MeshElement::init(int id, ShortType meshId, ShortType shapeId )
+{
+ myID = id;
+ myMeshId = meshId;
+ myShapeId = shapeId;
+ myIdInShape = -1;
}
void SMDS_MeshElement::Print(ostream & OS) const
inline void setVtkId(int vtkId) { myVtkID = vtkId; };
SMDS_MeshElement(int ID=-1);
SMDS_MeshElement(int id, ShortType meshId, ShortType shapeId = 0);
+ virtual void init(int id = -1, ShortType meshId = -1, ShortType shapeId = 0);
virtual void Print(std::ostream & OS) const;
//! Element index in vector SMDS_Mesh::myNodes or SMDS_Mesh::myCells
void SMDS_MeshNode::init(int id, int meshId, int shapeId, double x, double y, double z)
{
+ SMDS_MeshElement::init(id, meshId, shapeId);
myVtkID = id -1;
assert(myVtkID >= 0);
- myID = id;
- myMeshId = meshId;
- myShapeId = shapeId;
- myIdInShape = -1;
//MESSAGE("Node " << myID << " " << myVtkID << " (" << x << ", " << y << ", " << z << ")");
SMDS_Mesh* mesh = SMDS_Mesh::_meshList[myMeshId];
SMDS_UnstructuredGrid * grid = mesh->getGrid();
void SMDS_VtkEdge::init(std::vector<vtkIdType> nodeIds, SMDS_Mesh* mesh)
{
+ SMDS_MeshEdge::init();
vtkUnstructuredGrid* grid = mesh->getGrid();
- myIdInShape = -1;
myMeshId = mesh->getMeshId();
vtkIdType aType = VTK_LINE;
if (nodeIds.size() == 3)
void SMDS_VtkFace::init(std::vector<vtkIdType> nodeIds, SMDS_Mesh* mesh)
{
+ SMDS_MeshFace::init();
vtkUnstructuredGrid* grid = mesh->getGrid();
- myIdInShape = -1;
myMeshId = mesh->getMeshId();
vtkIdType aType = VTK_TRIANGLE;
switch (nodeIds.size())
void SMDS_VtkFace::initPoly(std::vector<vtkIdType> nodeIds, SMDS_Mesh* mesh)
{
+ SMDS_MeshFace::init();
vtkUnstructuredGrid* grid = mesh->getGrid();
- myIdInShape = -1;
myMeshId = mesh->getMeshId();
myVtkID = grid->InsertNextLinkedCell(VTK_POLYGON, nodeIds.size(), &nodeIds[0]);
mesh->setMyModified();
*/
void SMDS_VtkVolume::init(std::vector<vtkIdType> nodeIds, SMDS_Mesh* mesh)
{
+ SMDS_MeshVolume::init();
vtkUnstructuredGrid* grid = mesh->getGrid();
- myIdInShape = -1;
myMeshId = mesh->getMeshId();
vtkIdType aType = VTK_TETRA;
switch (nodeIds.size())
//#ifdef VTK_HAVE_POLYHEDRON
void SMDS_VtkVolume::initPoly(std::vector<vtkIdType> nodeIds, std::vector<int> nbNodesPerFace, SMDS_Mesh* mesh)
{
+ SMDS_MeshVolume::init();
//MESSAGE("SMDS_VtkVolume::initPoly");
SMDS_UnstructuredGrid* grid = mesh->getGrid();
double center[3];