-// SMESH SMESH : implementaion of SMESH idl descriptions
+// 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
//
-// 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
+// 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 SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FaceSide.hxx
// Created : Wed Jan 31 18:41:25 2007
// Author : Edward AGAPOV (eap)
// Module : SMESH
-
+//
#include "StdMeshers_FaceSide.hxx"
#include "SMDS_EdgePosition.hxx"
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#ifdef _DEBUG_
if ( normPar > 1 || normPar < 0) {
dump("DEBUG");
- cout << "WRONG normPar: "<<normPar<< " prevNormPar="<<prevNormPar
- << " u="<<u << " myFirst[i]="<<myFirst[i]<< " myLast[i]="<<myLast[i]
- << " paramSize="<<paramSize<<endl;
+ MESSAGE ( "WRONG normPar: "<<normPar<< " prevNormPar="<<prevNormPar
+ << " u="<<u << " myFirst[i]="<<myFirst[i]<< " myLast[i]="<<myLast[i]
+ << " paramSize="<<paramSize );
}
#endif
u2node.insert( make_pair( normPar, node ));
#ifdef _DEBUG_
if ( EdgeIndex >= myEdge.size() ) {
dump("DEBUG");
- cout << "WRONg EdgeIndex " << 1+EdgeIndex
- << " myNormPar.size()="<<myNormPar.size()
- << " myNormPar["<< EdgeIndex<<"]="<< myNormPar[ EdgeIndex ]
- << " uvPt.normParam="<<uvPt.normParam <<endl;
+ MESSAGE ( "WRONg EdgeIndex " << 1+EdgeIndex
+ << " myNormPar.size()="<<myNormPar.size()
+ << " myNormPar["<< EdgeIndex<<"]="<< myNormPar[ EdgeIndex ]
+ << " uvPt.normParam="<<uvPt.normParam );
}
#endif
paramSize = myNormPar[ EdgeIndex ] - prevNormPar;
void StdMeshers_FaceSide::dump(const char* msg) const
{
#ifdef _DEBUG_
- cout << endl;
- if (msg) cout << msg <<endl;
- cout<<"NB EDGES: "<< myEdge.size() <<endl;
- cout << "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() <<endl;
+ if (msg) MESSAGE ( std::endl << msg );
+ MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
+ MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() );
for ( int i=0; i<myEdge.size(); ++i)
{
- cout << "\t"<<i+1<<endl;
- cout << "\tEDGE: ";
- if (myEdge[i].IsNull())
- cout<<"NULL"<<endl;
+ MESSAGE_ADD ( "\t"<<i+1 );
+ MESSAGE_ADD ( "\tEDGE: " );
+ if (myEdge[i].IsNull()) {
+ MESSAGE_ADD ( "NULL" );
+ }
else {
TopAbs::Print(myEdge[i].Orientation(),cout)<<" "<<myEdge[i].TShape().operator->()<<endl;
- cout << "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->()
- << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() << endl;
+ MESSAGE_ADD ( "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->()
+ << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
}
- cout << "\tC2d: ";
- if (myC2d[i].IsNull()) cout<<"NULL"<<endl;
- else cout << myC2d[i].operator->()<<endl;
- cout << "\tF: "<<myFirst[i]<< " L: "<< myLast[i]<<endl;
- cout << "\tnormPar: "<<myNormPar[i]<<endl;
+ MESSAGE_ADD ( "\tC2d: ");
+
+ if (myC2d[i].IsNull()) {
+ MESSAGE_ADD ( "NULL" );
+ }
+ else {
+ MESSAGE_ADD ( myC2d[i].operator->() );
+ }
+
+ MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
+ MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
}
#endif
}
return TSideVector(0);
}
}
+ // find out side orientation, which is important if there are several wires (PAL19080)
+ bool isForward = true;
+ if ( nbWires > 1 ) {
+ TopExp_Explorer e( theFace, TopAbs_EDGE );
+ while ( ! e.Current().IsSame( wireEdges.back() ))
+ e.Next();
+ isForward = ( e.Current().Orientation() == wireEdges.back().Orientation() );
+ }
+
StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
- true, theIgnoreMediumNodes);
+ isForward, theIgnoreMediumNodes);
wires[ iW ] = StdMeshers_FaceSidePtr( wire );
from = to;
}
return wires;
}
-