-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
//
#include "StdMeshers_ProjectionUtils.hxx"
-#include "StdMeshers_ProjectionSource1D.hxx"
-#include "StdMeshers_ProjectionSource2D.hxx"
-#include "StdMeshers_ProjectionSource3D.hxx"
-
#include "SMDS_EdgePosition.hxx"
+#include "SMESHDS_Mesh.hxx"
#include "SMESH_Algo.hxx"
#include "SMESH_Block.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_HypoFilter.hxx"
#include "SMESH_Hypothesis.hxx"
#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_subMeshEventListener.hxx"
-#include "SMESH_MeshAlgos.hxx"
+#include "StdMeshers_ProjectionSource1D.hxx"
+#include "StdMeshers_ProjectionSource2D.hxx"
+#include "StdMeshers_ProjectionSource3D.hxx"
#include "utilities.h"
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define CONT_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); continue; }
#define SHOW_SHAPE(v,msg) \
-// { \
-// if ( (v).IsNull() ) cout << msg << " NULL SHAPE" << endl; \
-// else if ((v).ShapeType() == TopAbs_VERTEX) {\
-// gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( (v) ));\
-// cout<<msg<<" "<<shapeIndex((v))<<" ( "<<p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;} \
-// else {\
-// cout << msg << " "; TopAbs::Print((v).ShapeType(),cout) <<" "<<shapeIndex((v))<<endl;}\
-// }
+ // { show_shape((v),(msg)); }
#define SHOW_LIST(msg,l) \
-// { \
-// cout << msg << " ";\
-// list< TopoDS_Edge >::const_iterator e = l.begin();\
-// for ( int i = 0; e != l.end(); ++e, ++i ) {\
-// cout << i << "V (" << TopExp::FirstVertex( *e, true ).TShape().operator->() << ") "\
-// << i << "E (" << e->TShape().operator->() << "); "; }\
-// cout << endl;\
-// }
+ // { show_list((msg),(l)); }
namespace HERE = StdMeshers_ProjectionUtils;
return max(theMeshDS[0]->ShapeToIndex(S), theMeshDS[1]->ShapeToIndex(S) );
return long(S.TShape().operator->());
}
-
+ void show_shape( TopoDS_Shape v, const char* msg ) // debug
+ {
+ if ( v.IsNull() ) cout << msg << " NULL SHAPE" << endl;
+ else if (v.ShapeType() == TopAbs_VERTEX) {
+ gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( v ));
+ cout<<msg<<" "<<shapeIndex((v))<<" ( "<<p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;}
+ else {
+ cout << msg << " "; TopAbs::Print((v).ShapeType(),cout) <<" "<<shapeIndex((v))<<endl;}
+ }
+ void show_list( const char* msg, const list< TopoDS_Edge >& l ) // debug
+ {
+ cout << msg << " ";
+ list< TopoDS_Edge >::const_iterator e = l.begin();
+ for ( int i = 0; e != l.end(); ++e, ++i ) {
+ cout << i << "V (" << TopExp::FirstVertex( *e, true ).TShape().operator->() << ") "
+ << i << "E (" << e->TShape().operator->() << "); "; }
+ cout << endl;
+ }
//================================================================================
/*!
* \brief Write shape for debug purposes
const char* type[] ={"COMPOUND","COMPSOLID","SOLID","SHELL","FACE","WIRE","EDGE","VERTEX"};
BRepTools::Write( shape, SMESH_Comment("/tmp/") << type[shape.ShapeType()] << "_"
<< shape.TShape().operator->() << ".brep");
+ if ( !theMeshDS[0] ) {
+ show_shape( TopoDS_Shape(), "avoid warning: show_shape() defined but not used");
+ show_list( "avoid warning: show_list() defined but not used", list< TopoDS_Edge >() );
+ }
#endif
return false;
}
const gp_Pnt2d& uv,
const double& tol2d )
{
- TopoDS_Vertex VV[2];
- TopExp::Vertices( edge, VV[0], VV[1], true);
- gp_Pnt2d v1UV = BRep_Tool::Parameters( VV[vIndex], face);
+ TopoDS_Vertex V = SMESH_MesherHelper::IthVertex( vIndex, edge, /*CumOri=*/true );
+ gp_Pnt2d v1UV = BRep_Tool::Parameters( V, face);
double dist2d = v1UV.Distance( uv );
return dist2d < tol2d;
}
for ( ; eIt1 != edges1.end(); ++eIt1, ++eIt2 )
{
InsertAssociation( *eIt1, *eIt2, theMap );
- VV1[0] = TopExp::FirstVertex( *eIt1, true );
- VV2[0] = TopExp::FirstVertex( *eIt2, true );
+ VV1[0] = SMESH_MesherHelper::IthVertex( 0, *eIt1, true );
+ VV2[0] = SMESH_MesherHelper::IthVertex( 0, *eIt2, true );
InsertAssociation( VV1[0], VV2[0], theMap );
}
InsertAssociation( theShape1, theShape2, theMap );
int prevChainSize = aChain.Extent();
if ( aChain.Add(anOppE) > prevChainSize ) { // ... anOppE is not in aChain
// Add found edge to the chain oriented so that to
- // have it co-directed with a forward MainEdge
+ // have it co-directed with a fromEdge
TopAbs_Orientation ori = anE.Orientation();
if ( anOppE.Orientation() == fourEdges[found].Orientation() )
ori = TopAbs::Reverse( ori );
helper1.SetSubShape( face1 );
helper2.SetSubShape( face2 );
- if ( helper1.HasSeam() != helper2.HasSeam() )
+ if ( helper1.HasRealSeam() != helper2.HasRealSeam() )
RETURN_BAD_RESULT("Different faces' geometry");
// Data to call SMESH_MeshEditor::FindMatchingNodes():
static_cast<const SMDS_EdgePosition*>(node->GetPosition());
pos2nodes.insert( make_pair( pos->GetUParameter(), node ));
}
- if ( pos2nodes.size() != edgeSM->NbNodes() )
+ if ((int) pos2nodes.size() != edgeSM->NbNodes() )
RETURN_BAD_RESULT("Equal params of nodes on edge "
<< smDS->ShapeToIndex( edge ) << " of face " << is2 );
}
string algoType = algo->GetName();
if ( algoType.substr(0, 11) != "Projection_")
- return gen->Compute( *mesh, shape, /*shapeOnly=*/true );
+ return gen->Compute( *mesh, shape, SMESH_Gen::SHAPE_ONLY );
// try to compute source mesh
srcMesh = mesh;
if ( MakeComputed( srcMesh->GetSubMesh( srcShape ), iterationNb + 1 ) &&
- gen->Compute( *mesh, shape, /*shapeOnly=*/true ))
+ gen->Compute( *mesh, shape, SMESH_Gen::SHAPE_ONLY ))
return sm->IsMeshComputed();
return false;