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 "SMDS_FaceOfEdges.hxx"
23 #include "SMDS_IteratorOfElements.hxx"
24 #include "SMDS_MeshNode.hxx"
26 //=======================================================================
29 //=======================================================================
31 int SMDS_FaceOfEdges::NbEdges() const
33 return myEdges.size();
36 int SMDS_FaceOfEdges::NbFaces() const
40 //=======================================================================
43 //=======================================================================
45 void SMDS_FaceOfEdges::Print(ostream & OS) const
47 OS << "face <" << GetID() << " > : ";
49 for (i = 0; i < NbEdges() - 1; i++) OS << myEdges[i] << ",";
50 OS << myEdges[i] << ") " << endl;
53 SMDSAbs_ElementType SMDS_FaceOfEdges::GetType() const
58 class SMDS_FaceOfEdges_MyIterator:public SMDS_ElemIterator
60 const vector<const SMDS_MeshEdge*>& mySet;
63 SMDS_FaceOfEdges_MyIterator(const vector<const SMDS_MeshEdge*>& s):
68 return index<mySet.size();
71 const SMDS_MeshElement* next()
74 return mySet[index-1];
77 SMDS_ElemIteratorPtr SMDS_FaceOfEdges::
78 elementsIterator(SMDSAbs_ElementType type) const
83 return SMDS_MeshElement::elementsIterator(SMDSAbs_Face);
85 return SMDS_ElemIteratorPtr(new SMDS_FaceOfEdges_MyIterator(myEdges));
87 return SMDS_ElemIteratorPtr
88 (new SMDS_IteratorOfElements
89 (this,type, SMDS_ElemIteratorPtr(new SMDS_FaceOfEdges_MyIterator(myEdges))));
93 SMDS_FaceOfEdges::SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
94 const SMDS_MeshEdge* edge2,
95 const SMDS_MeshEdge* edge3)
103 SMDS_FaceOfEdges::SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
104 const SMDS_MeshEdge* edge2,
105 const SMDS_MeshEdge* edge3,
106 const SMDS_MeshEdge* edge4)
115 /*bool operator<(const SMDS_FaceOfEdges& f1, const SMDS_FaceOfEdges& f2)
117 set<SMDS_MeshNode> set1,set2;
118 SMDS_ElemIteratorPtr it;
119 const SMDS_MeshNode * n;
121 it=f1.nodesIterator();
125 n=static_cast<const SMDS_MeshNode *>(it->next());
130 it=f2.nodesIterator();
134 n=static_cast<const SMDS_MeshNode *>(it->next());