1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMDS : implementaion of Salome mesh data structure
23 // File : SMDS_VolumeOfFaces.cxx
24 // Author : Jean-Michel BOULCOURT
28 #pragma warning(disable:4786)
31 #include "SMDS_VolumeOfFaces.hxx"
32 #include "SMDS_IteratorOfElements.hxx"
36 //=======================================================================
39 //=======================================================================
41 void SMDS_VolumeOfFaces::Print(ostream & OS) const
43 OS << "volume <" << GetID() << "> : ";
45 for (i = 0; i < NbFaces()-1; ++i) OS << myFaces[i] << ",";
46 OS << myFaces[i]<< ") " << endl;
50 int SMDS_VolumeOfFaces::NbFaces() const
55 class SMDS_VolumeOfFaces_MyIterator:public SMDS_ElemIterator
57 const SMDS_MeshFace* const *mySet;
61 SMDS_VolumeOfFaces_MyIterator(const SMDS_MeshFace* const *s, int l):
62 mySet(s),myLength(l),index(0) {}
66 return index<myLength;
69 const SMDS_MeshElement* next()
72 return mySet[index-1];
76 SMDS_ElemIteratorPtr SMDS_VolumeOfFaces::
77 elementsIterator(SMDSAbs_ElementType type) const
82 return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume);
84 return SMDS_ElemIteratorPtr(new SMDS_VolumeOfFaces_MyIterator(myFaces,myNbFaces));
86 return SMDS_ElemIteratorPtr
87 (new SMDS_IteratorOfElements
88 (this,type,SMDS_ElemIteratorPtr
89 (new SMDS_VolumeOfFaces_MyIterator(myFaces,myNbFaces))));
93 SMDS_VolumeOfFaces::SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
94 const SMDS_MeshFace * face2,
95 const SMDS_MeshFace * face3,
96 const SMDS_MeshFace * face4)
107 SMDS_VolumeOfFaces::SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
108 const SMDS_MeshFace * face2,
109 const SMDS_MeshFace * face3,
110 const SMDS_MeshFace * face4,
111 const SMDS_MeshFace * face5)
122 SMDS_VolumeOfFaces::SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
123 const SMDS_MeshFace * face2,
124 const SMDS_MeshFace * face3,
125 const SMDS_MeshFace * face4,
126 const SMDS_MeshFace * face5,
127 const SMDS_MeshFace * face6)