-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
+// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_ProjectionUtils.cxx
// Created : Fri Oct 27 10:24:28 2006
// Author : Edward AGAPOV (eap)
#include "SMESH_Hypothesis.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MeshAlgos.hxx"
+#include "SMESH_MeshEditor.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_subMeshEventListener.hxx"
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
+ void show_shape( TopoDS_Shape v, const char* msg ) // debug // todo: unused in release mode
{
if ( v.IsNull() ) cout << msg << " NULL SHAPE" << endl;
else if (v.ShapeType() == TopAbs_VERTEX) {
else {
cout << msg << " "; TopAbs::Print((v).ShapeType(),cout) <<" "<<shapeIndex((v))<<endl;}
}
- void show_list( const char* msg, const list< TopoDS_Edge >& l ) // debug
+ void show_list( const char* msg, const list< TopoDS_Edge >& l ) // debug // todo: unused in release mode
{
cout << msg << " ";
list< TopoDS_Edge >::const_iterator e = l.begin();
bool storeShapeForDebug(const TopoDS_Shape& shape)
{
+ bool toShow;
#ifdef _DEBUG_
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");
+ toShow = !theMeshDS[0]; // no show
+#else
+ toShow = theMeshDS[0]; // no show
+#endif
+ if ( toShow ) {
+ show_shape( 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;
}
}
/*!
- * \brief Convertor used in Delaunay constructor
+ * \brief Converter used in Delaunay constructor
*/
struct SideVector2UVPtStructVec
{
// b) find association of a couple of vertices and recall self.
//
+#ifdef _DEBUG_
theMeshDS[0] = theMesh1->GetMeshDS(); // debug
theMeshDS[1] = theMesh2->GetMeshDS();
+#endif
// =================================================================================
// 1) Is it the case of associating a group member -> another group? (PAL16202, 16203)
const TopoDS_Shape& v1 = vMap1(i);
if ( vMap2.Contains( v1 ))
{
- // find an egde sharing v1 and sharing at the same time another common vertex
+ // find an edge sharing v1 and sharing at the same time another common vertex
PShapeIteratorPtr edgeIt = SMESH_MesherHelper::GetAncestors( v1, *theMesh1, TopAbs_EDGE);
bool edgeFound = false;
while ( edgeIt->more() && !edgeFound )
SMDS_NodeIteratorPtr nIt = edgeSM->GetNodes();
while ( nIt->more() ) {
const SMDS_MeshNode* node = nIt->next();
- const SMDS_EdgePosition* pos =
- static_cast<const SMDS_EdgePosition*>(node->GetPosition());
+ SMDS_EdgePositionPtr pos = node->GetPosition();
pos2nodes.insert( make_pair( pos->GetUParameter(), node ));
}
if ((int) pos2nodes.size() != edgeSM->NbNodes() )
double bc[3]; // barycentric coordinates
int nodeIDs[3]; // nodes of a delaunay triangle
- const SMDS_FacePosition* pos;
_delaunay.InitTraversal( nbSrcNodes );
tgtNode = n2n->second;
tgtMesh->MoveNode( tgtNode, xyz.X(), xyz.Y(), xyz.Z() );
- if (( pos = dynamic_cast< const SMDS_FacePosition* >( tgtNode->GetPosition() )))
- const_cast<SMDS_FacePosition*>( pos )->SetParameters( uvNew.X(), uvNew.Y() );
+ if ( SMDS_FacePositionPtr pos = tgtNode->GetPosition() )
+ pos->SetParameters( uvNew.X(), uvNew.Y() );
--nbSrcNodes;
}