+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
// SMESH SMDS : implementaion of Salome mesh data structure
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
#ifdef _MSC_VER
#pragma warning(disable:4786)
#endif
//=======================================================================
SMDS_MeshNode::SMDS_MeshNode(double x, double y, double z):
- myX(x), myY(y), myZ(z),
- myPosition(SMDS_SpacePosition::originSpacePosition())
+ myX(x), myY(y), myZ(z),
+ myPosition(SMDS_SpacePosition::originSpacePosition())
{
}
void SMDS_MeshNode::Print(ostream & OS) const
{
- OS << "Node <" << GetID() << "> : X = " << myX << " Y = "
- << myY << " Z = " << myZ << endl;
+ OS << "Node <" << GetID() << "> : X = " << myX << " Y = "
+ << myY << " Z = " << myZ << endl;
}
//=======================================================================
void SMDS_MeshNode::SetPosition(const SMDS_PositionPtr& aPos)
{
- myPosition = aPos;
+ myPosition = aPos;
}
//=======================================================================
const SMDS_PositionPtr& SMDS_MeshNode::GetPosition() const
{
- return myPosition;
+ return myPosition;
}
//=======================================================================
const SMDS_MeshElement* next()
{
+ if ( !more() ) return 0;
const SMDS_MeshElement* current=myIterator.Value();
myIterator.Next();
return current;
- }
+ }
};
SMDS_ElemIteratorPtr SMDS_MeshNode::
- GetInverseElementIterator(SMDSAbs_ElementType type) const
+ GetInverseElementIterator(SMDSAbs_ElementType type) const
{
return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(myInverseElements,type));
}
};
SMDS_ElemIteratorPtr SMDS_MeshNode::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
if(type==SMDSAbs_Node)
return SMDS_MeshElement::elementsIterator(SMDSAbs_Node);
int SMDS_MeshNode::NbNodes() const
{
- return 1;
+ return 1;
}
double SMDS_MeshNode::X() const
{
- return myX;
+ return myX;
}
double SMDS_MeshNode::Y() const
{
- return myY;
+ return myY;
}
double SMDS_MeshNode::Z() const
{
- return myZ;
+ return myZ;
}
void SMDS_MeshNode::setXYZ(double x, double y, double z)
{
- myX=x;
- myY=y;
- myZ=z;
+ myX=x;
+ myY=y;
+ myZ=z;
}
SMDSAbs_ElementType SMDS_MeshNode::GetType() const
{
- return SMDSAbs_Node;
+ return SMDSAbs_Node;
}
//=======================================================================
*/
//================================================================================
-int SMDS_MeshNode::NbInverseNodes(SMDSAbs_ElementType type) const
+int SMDS_MeshNode::NbInverseElements(SMDSAbs_ElementType type) const
{
if ( type == SMDSAbs_All )
return myInverseElements.Extent();
///////////////////////////////////////////////////////////////////////////////
bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2)
{
- return e1.GetID()<e2.GetID();
- /*if(e1.myX<e2.myX) return true;
- else if(e1.myX==e2.myX)
- {
- if(e1.myY<e2.myY) return true;
- else if(e1.myY==e2.myY) return (e1.myZ<e2.myZ);
- else return false;
- }
- else return false;*/
+ return e1.GetID()<e2.GetID();
+ /*if(e1.myX<e2.myX) return true;
+ else if(e1.myX==e2.myX)
+ {
+ if(e1.myY<e2.myY) return true;
+ else if(e1.myY==e2.myY) return (e1.myZ<e2.myZ);
+ else return false;
+ }
+ else return false;*/
}