1 // SMESH SMDS : implementaion of Salome mesh data structure
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 #include "utilities.h"
23 #include "SMDS_HexahedronOfNodes.hxx"
24 #include "SMDS_IteratorOfArray.hxx"
25 #include "SMDS_MeshNode.hxx"
27 ///////////////////////////////////////////////////////////////////////////////
28 /// Create an hexahedron. node 1,2,3,4 and 5,6,7,8 are quadrangle and
29 /// 5,1 and 7,3 are an edges.
30 ///////////////////////////////////////////////////////////////////////////////
31 SMDS_HexahedronOfNodes::SMDS_HexahedronOfNodes(
32 const SMDS_MeshNode * node1,
33 const SMDS_MeshNode * node2,
34 const SMDS_MeshNode * node3,
35 const SMDS_MeshNode * node4,
36 const SMDS_MeshNode * node5,
37 const SMDS_MeshNode * node6,
38 const SMDS_MeshNode * node7,
39 const SMDS_MeshNode * node8)
50 //=======================================================================
53 //=======================================================================
55 void SMDS_HexahedronOfNodes::Print(ostream & OS) const
57 OS << "volume <" << GetID() << "> : ";
59 for (i = 0; i < 7; ++i) OS << myNodes[i] << ",";
60 OS << myNodes[7]<< ") " << endl;
63 int SMDS_HexahedronOfNodes::NbFaces() const
68 int SMDS_HexahedronOfNodes::NbNodes() const
73 int SMDS_HexahedronOfNodes::NbEdges() const
78 SMDS_ElemIteratorPtr SMDS_HexahedronOfNodes::
79 elementsIterator(SMDSAbs_ElementType type) const
84 return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume);
86 return SMDS_ElemIteratorPtr (new SMDS_IteratorOfArray<const SMDS_MeshElement *, 8,
87 const SMDS_MeshNode*>(myNodes));
88 default: MESSAGE("ERROR : Iterator not implemented");
92 SMDSAbs_ElementType SMDS_HexahedronOfNodes::GetType() const
94 return SMDSAbs_Volume;