SALOME - SMESH
SMDS_MeshNode.hxx
Go to the documentation of this file.
00001 //  Copyright (C) 2007-2008  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 //  SMESH SMDS : implementaion of Salome mesh data structure
00023 //  File   : SMDS_MeshNode.hxx
00024 //  Module : SMESH
00025 //
00026 #ifndef _SMDS_MeshNode_HeaderFile
00027 #define _SMDS_MeshNode_HeaderFile
00028 
00029 #include "SMESH_SMDS.hxx"
00030 
00031 #include "SMDS_MeshElement.hxx"
00032 #include "SMDS_Position.hxx"
00033 #include <NCollection_List.hxx>
00034 
00035 class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement
00036 {
00037 
00038 public:
00039   SMDS_MeshNode(double x, double y, double z);
00040   void Print(std::ostream & OS) const;
00041   double X() const;
00042   double Y() const;
00043   double Z() const;
00044   void AddInverseElement(const SMDS_MeshElement * ME);
00045   void RemoveInverseElement(const SMDS_MeshElement * parent);
00046   void ClearInverseElements();
00047   bool emptyInverseElements();
00048   SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
00049   int NbInverseElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
00050   void SetPosition(const SMDS_PositionPtr& aPos);
00051   const SMDS_PositionPtr& GetPosition() const;
00052   SMDSAbs_ElementType GetType() const;
00053   SMDSAbs_EntityType  GetEntityType() const {return SMDSEntity_Node;}
00054   int NbNodes() const;
00055   void setXYZ(double x, double y, double z);
00056   friend bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2);
00057 
00063   virtual const SMDS_MeshNode* GetNode(const int) const { return this; }
00064 
00065 protected:
00066   SMDS_ElemIteratorPtr
00067   elementsIterator(SMDSAbs_ElementType type) const;
00068 
00069 private:
00070   double myX, myY, myZ;
00071   SMDS_PositionPtr myPosition;
00072   NCollection_List<const SMDS_MeshElement*> myInverseElements;
00073 };
00074 
00075 #endif