Version: 6.3.1

src/SMDS/SMDS_MeshNode.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SMESH SMDS : implementaion of Salome mesh data structure
00024 //  File   : SMDS_MeshNode.hxx
00025 //  Module : SMESH
00026 //
00027 #ifndef _SMDS_MeshNode_HeaderFile
00028 #define _SMDS_MeshNode_HeaderFile
00029 
00030 #include "SMESH_SMDS.hxx"
00031 
00032 #include "SMDS_MeshElement.hxx"
00033 #include "SMDS_Position.hxx"
00034 #include "ObjectPool.hxx"
00035 
00036 class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement
00037 {
00038 public:
00039   friend class SMESHDS_Mesh;
00040   friend class SMDS_Mesh;
00041   friend class ObjectPool<SMDS_MeshNode>;
00042   friend class SMDS_VtkFace;
00043 
00044   void Print(std::ostream & OS) const;
00045   double X() const;
00046   double Y() const;
00047   double Z() const;
00048   SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
00049   int NbInverseElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
00050   const SMDS_PositionPtr& GetPosition() const;
00051   SMDSAbs_ElementType GetType() const;
00052   virtual vtkIdType GetVtkType() const;
00053   SMDSAbs_EntityType  GetEntityType() const {return SMDSEntity_Node;}
00054   int NbNodes() const;
00055 
00056   friend bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2);
00057 
00058   void SetPosition(const SMDS_PositionPtr& aPos);
00059   void setXYZ(double x, double y, double z);
00060 
00061   static int nbNodes;
00062 
00063 protected:
00064   SMDS_MeshNode();
00065   SMDS_MeshNode(int id, int meshId, int shapeId = -1, double x=0, double y=0, double z=0);
00066   virtual ~SMDS_MeshNode();
00067   void init(int id, int meshId, int shapeId = -1, double x=0, double y=0, double z=0);
00068   inline void setVtkId(int vtkId) { myVtkID = vtkId; };
00069   double* getCoord() const;
00070   void AddInverseElement(const SMDS_MeshElement * ME);
00071   void RemoveInverseElement(const SMDS_MeshElement * parent);
00072   void ClearInverseElements();
00073   bool emptyInverseElements();
00074 
00075   SMDS_ElemIteratorPtr
00076   elementsIterator(SMDSAbs_ElementType type) const;
00077 
00078 private:
00079   SMDS_PositionPtr myPosition;
00080 };
00081 
00082 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS