bool* check) const
{
gp_Pnt2d uv( Precision::Infinite(), Precision::Infinite() );
+
const SMDS_PositionPtr Pos = n->GetPosition();
bool uvOK = false;
if(Pos->GetTypeOfPosition()==SMDS_TOP_FACE)
const SMDS_MeshNode* inEdgeNode,
bool* check)
{
- double param = 0;
+ double param = Precision::Infinite();
+
const SMDS_PositionPtr pos = n->GetPosition();
if ( pos->GetTypeOfPosition()==SMDS_TOP_EDGE )
{
Handle( Geom_Surface ) S = BRep_Tool::Surface( F, loc );
P = S->Value( uvAvg.X(), uvAvg.Y() ).Transformed( loc );
centralNode = meshDS->AddNode( P.X(), P.Y(), P.Z() );
- if ( mySetElemOnShape )
- meshDS->SetNodeOnFace( centralNode, faceID, uvAvg.X(), uvAvg.Y() );
+ // if ( mySetElemOnShape ) node is not elem!
+ meshDS->SetNodeOnFace( centralNode, faceID, uvAvg.X(), uvAvg.Y() );
myMapWithCentralNode.insert( std::make_pair( keyOfMap, centralNode ) );
return centralNode;
}
SMESH_TNodeXYZ( n4 ) ) / 4;
centralNode = meshDS->AddNode( P.X(), P.Y(), P.Z() );
- if ( mySetElemOnShape )
+ if ( !F.IsNull() )
{
- if ( !F.IsNull() )
- {
- uvAvg = (GetNodeUV(F,n1,n3) +
- GetNodeUV(F,n2,n4) +
- GetNodeUV(F,n3,n1) +
- GetNodeUV(F,n4,n2)) / 4;
- CheckNodeUV( F, centralNode, uvAvg, 2*BRep_Tool::Tolerance( F ), /*force=*/true);
- meshDS->SetNodeOnFace( centralNode, faceID, uvAvg.X(), uvAvg.Y() );
- }
- else if ( shapeID > 0 )
- meshDS->SetNodeInVolume( centralNode, shapeID );
- else if ( myShapeID > 0 )
- meshDS->SetMeshElementOnShape( centralNode, myShapeID );
+ uvAvg = (GetNodeUV(F,n1,n3) +
+ GetNodeUV(F,n2,n4) +
+ GetNodeUV(F,n3,n1) +
+ GetNodeUV(F,n4,n2)) / 4;
+ CheckNodeUV( F, centralNode, uvAvg, 2*BRep_Tool::Tolerance( F ), /*force=*/true);
+ meshDS->SetNodeOnFace( centralNode, faceID, uvAvg.X(), uvAvg.Y() );
+ }
+ else if ( shapeID > 0 )
+ {
+ meshDS->SetNodeInVolume( centralNode, shapeID );
+ }
+ else if ( myShapeID > 0 && mySetElemOnShape )
+ {
+ meshDS->SetMeshElementOnShape( centralNode, myShapeID );
}
-
myMapWithCentralNode.insert( std::make_pair( keyOfMap, centralNode ) );
return centralNode;
}
gp_XY UV = GetMiddleUV( S, uv[0], uv[1] );
gp_Pnt P = S->Value( UV.X(), UV.Y() ).Transformed(loc);
n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
- if ( mySetElemOnShape )
- meshDS->SetNodeOnFace(n12, faceID, UV.X(), UV.Y());
+ // if ( mySetElemOnShape ) node is not elem!
+ meshDS->SetNodeOnFace(n12, faceID, UV.X(), UV.Y());
myTLinkNodeMap.insert(make_pair(link,n12));
return n12;
}
gp_Pnt P = C->Value( U );
n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
- if ( mySetElemOnShape )
- meshDS->SetNodeOnEdge(n12, edgeID, U);
+ //if ( mySetElemOnShape ) node is not elem!
+ meshDS->SetNodeOnEdge(n12, edgeID, U);
myTLinkNodeMap.insert(make_pair(link,n12));
return n12;
}
double z = ( n1->Z() + n2->Z() )/2.;
n12 = meshDS->AddNode(x,y,z);
- if ( mySetElemOnShape )
+ //if ( mySetElemOnShape ) node is not elem!
{
if ( !F.IsNull() )
{
gp_XY UV = ( uv[0] + uv[1] ) / 2.;
- CheckNodeUV( F, n12, UV, 2*BRep_Tool::Tolerance( F ), /*force=*/true);
+ CheckNodeUV( F, n12, UV, 2 * BRep_Tool::Tolerance( F ), /*force=*/true);
meshDS->SetNodeOnFace(n12, faceID, UV.X(), UV.Y() );
}
else if ( !E.IsNull() )
{
double U = ( u[0] + u[1] ) / 2.;
- CheckNodeU( E, n12, U, 2*BRep_Tool::Tolerance( E ), /*force=*/true);
+ CheckNodeU( E, n12, U, 2 * BRep_Tool::Tolerance( E ), /*force=*/true);
meshDS->SetNodeOnEdge(n12, edgeID, U);
}
- else if ( myShapeID > 0 )
+ else if ( myShapeID > 0 && mySetElemOnShape )
{
meshDS->SetMeshElementOnShape(n12, myShapeID);
}
GetMeshDS()->MoveNode( n12, p.X(), p.Y(), p.Z() );
}
- if ( mySetElemOnShape )
- GetMeshDS()->SetNodeOnEdge(n12, edges[iOkEdge], u);
+ //if ( mySetElemOnShape ) node is not elem!
+ GetMeshDS()->SetNodeOnEdge(n12, edges[iOkEdge], u);
myTLinkNodeMap.insert( make_pair( SMESH_TLink(n1,n2), n12 ));
node = meshDS->AddNodeWithID( x, y, z, ID );
else
node = meshDS->AddNode( x, y, z );
- if ( mySetElemOnShape && myShapeID > 0 ) {
+ if ( mySetElemOnShape && myShapeID > 0 ) { // node is not elem ?
switch ( myShape.ShapeType() ) {
case TopAbs_SOLID: meshDS->SetNodeInVolume( node, myShapeID); break;
case TopAbs_SHELL: meshDS->SetNodeInVolume( node, myShapeID); break;