27 #ifndef _SMDS_Mesh_HeaderFile
28 #define _SMDS_Mesh_HeaderFile
50 #include <boost/shared_ptr.hpp>
54 #include <vtkSystemIncludes.h>
57 #include "Utils_SALOME_Exception.hxx"
59 #define MYASSERT(val) if (!(val)) throw SALOME_Exception(LOCALIZED("assertion not verified"));
67 friend class SMDS_MeshVolumeVtkNodes;
92 virtual SMDS_MeshNode* AddNodeWithID(
double x,
double y,
double z,
int ID);
103 virtual SMDS_MeshEdge* AddEdgeWithID(
int n1,
int n2,
int ID);
111 virtual SMDS_MeshEdge* AddEdgeWithID(
int n1,
int n2,
int n12,
int ID);
120 virtual SMDS_MeshFace* AddFaceWithID(
int n1,
int n2,
int n3,
int ID);
129 virtual SMDS_MeshFace* AddFaceWithID(
int n1,
int n2,
int n3,
int n4,
int ID);
158 int n12,
int n23,
int n31,
int ID);
175 int n12,
int n23,
int n31,
int nCenter,
int ID);
193 virtual SMDS_MeshFace* AddFaceWithID(
int n1,
int n2,
int n3,
int n4,
194 int n12,
int n23,
int n34,
int n41,
int ID);
213 virtual SMDS_MeshFace* AddFaceWithID(
int n1,
int n2,
int n3,
int n4,
214 int n12,
int n23,
int n34,
int n41,
int nCenter,
int ID);
235 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
int ID);
246 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
260 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
261 int n5,
int n6,
int ID);
276 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
277 int n5,
int n6,
int n7,
int n8,
int ID);
330 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
int n5,
int n6,
331 int n7,
int n8,
int n9,
int n10,
int n11,
int n12,
360 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
361 int n12,
int n23,
int n31,
362 int n14,
int n24,
int n34,
int ID);
386 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
int n5,
387 int n12,
int n23,
int n34,
int n41,
388 int n15,
int n25,
int n35,
int n45,
420 int n4,
int n5,
int n6,
421 int n12,
int n23,
int n31,
422 int n45,
int n56,
int n64,
423 int n14,
int n25,
int n36,
458 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
459 int n5,
int n6,
int n7,
int n8,
460 int n12,
int n23,
int n34,
int n41,
461 int n56,
int n67,
int n78,
int n85,
462 int n15,
int n26,
int n37,
int n48,
507 virtual SMDS_MeshVolume* AddVolumeWithID(
int n1,
int n2,
int n3,
int n4,
508 int n5,
int n6,
int n7,
int n8,
509 int n12,
int n23,
int n34,
int n41,
510 int n56,
int n67,
int n78,
int n85,
511 int n15,
int n26,
int n37,
int n48,
512 int n1234,
int n1256,
int n2367,
int n3478,
513 int n1458,
int n5678,
int nCenter,
571 virtual SMDS_MeshFace* AddPolygonalFaceWithID (
const std::vector<int> & nodes_ids,
574 virtual SMDS_MeshFace* AddPolygonalFaceWithID (
const std::vector<const SMDS_MeshNode*> & nodes,
577 virtual SMDS_MeshFace* AddPolygonalFace (
const std::vector<const SMDS_MeshNode*> & nodes);
579 virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(
const std::vector<int> & nodes_ids,
582 virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(
const std::vector<const SMDS_MeshNode*> & nodes,
585 virtual SMDS_MeshFace* AddQuadPolygonalFace(
const std::vector<const SMDS_MeshNode*> & nodes);
588 (
const std::vector<int> & nodes_ids,
589 const std::vector<int> & quantities,
593 (
const std::vector<const SMDS_MeshNode*> & nodes,
594 const std::vector<int> & quantities,
598 (
const std::vector<const SMDS_MeshNode*> & nodes,
599 const std::vector<int> & quantities);
601 virtual SMDS_MeshVolume* AddVolumeFromVtkIds(
const std::vector<vtkIdType>& vtkNodeIds);
603 virtual SMDS_MeshVolume* AddVolumeFromVtkIdsWithID(
const std::vector<vtkIdType>& vtkNodeIds,
606 virtual SMDS_MeshFace* AddFaceFromVtkIds(
const std::vector<vtkIdType>& vtkNodeIds);
608 virtual SMDS_MeshFace* AddFaceFromVtkIdsWithID(
const std::vector<vtkIdType>& vtkNodeIds,
610 virtual void MoveNode(
const SMDS_MeshNode *n,
double x,
double y,
double z);
613 std::list<const SMDS_MeshElement *>& removedElems,
614 std::list<const SMDS_MeshElement *>& removedNodes,
615 const bool removenodes =
false);
616 virtual void RemoveElement(
const SMDS_MeshElement * elem,
bool removenodes =
false);
629 virtual void Clear();
631 virtual bool RemoveFromParent();
632 virtual bool RemoveSubMesh(
const SMDS_Mesh * aMesh);
638 const std::vector<const SMDS_MeshNode*>& nodes,
639 const std::vector<int> & quantities);
641 virtual void Renumber (
const bool isNodes,
const int startID = 1,
const int deltaID = 1);
643 virtual void compactMesh();
649 const SMDS_MeshEdge *FindEdge(
int idnode1,
int idnode2)
const;
650 const SMDS_MeshEdge *FindEdge(
int idnode1,
int idnode2,
int idnode3)
const;
651 const SMDS_MeshFace *FindFace(
int idnode1,
int idnode2,
int idnode3)
const;
652 const SMDS_MeshFace *FindFace(
int idnode1,
int idnode2,
int idnode3,
int idnode4)
const;
653 const SMDS_MeshFace *FindFace(
int idnode1,
int idnode2,
int idnode3,
654 int idnode4,
int idnode5,
int idnode6)
const;
655 const SMDS_MeshFace *FindFace(
int idnode1,
int idnode2,
int idnode3,
int idnode4,
656 int idnode5,
int idnode6,
int idnode7,
int idnode8)
const;
687 const SMDS_MeshFace *FindFace(
const std::vector<int>& nodes_ids)
const;
688 static const SMDS_MeshFace* FindFace(
const std::vector<const SMDS_MeshNode *>& nodes);
689 static const SMDS_MeshElement* FindElement(
const std::vector<const SMDS_MeshNode *>& nodes,
691 const bool noMedium=
true);
698 static int CheckMemory(
const bool doNotRaise=
false) throw (std::bad_alloc);
700 int MaxNodeID() const;
701 int MinNodeID() const;
702 int MaxElementID() const;
703 int MinElementID() const;
708 virtual int NbElements()
const;
709 virtual int Nb0DElements()
const;
710 virtual int NbBalls()
const;
713 virtual int NbVolumes()
const;
714 virtual int NbSubMesh()
const;
716 void DumpNodes()
const;
717 void Dump0DElements()
const;
718 void DumpEdges()
const;
719 void DumpFaces()
const;
720 void DumpVolumes()
const;
721 void DebugStats()
const;
725 bool hasConstructionEdges();
726 bool hasConstructionFaces();
727 bool hasInverseElements();
728 void setConstructionEdges(
bool);
729 void setConstructionFaces(
bool);
730 void setInverseElements(
bool);
745 int fromVtkToSmds(
int vtkid);
747 void dumpGrid(std::string ficdump=
"dumpGrid");
781 void addChildrenWithNodes(std::set<const SMDS_MeshElement*>& setOfChildren,
783 std::set<const SMDS_MeshElement*>& nodes);
785 inline void adjustmyCellsCapacity(
int ID)
788 myElementIDFactory->adjustMaxId(ID);
789 if (ID >= (
int)myCells.size())
793 inline void adjustBoundingBox(
double x,
double y,
double z)
795 if (x > xmax) xmax = x;
796 else if (x < xmin) xmin = x;
797 if (y > ymax) ymax = y;
798 else if (y < ymin) ymin = y;
799 if (z > zmax) zmax = z;
800 else if (z < zmin) zmin = z;