//================================================================================
SMESH_MesherHelper::SMESH_MesherHelper(SMESH_Mesh& theMesh)
- : myParIndex(0), myMesh(&theMesh), myShapeID(0), myCreateQuadratic(false)
+ : myParIndex(0), myMesh(&theMesh), myShapeID(0), myCreateQuadratic(false),
+ myFixNodeParameters(false)
{
myPar1[0] = myPar2[0] = myPar1[1] = myPar2[1] = 0;
mySetElemOnShape = ( ! myMesh->HasShapeToMesh() );
((SMESH_MesherHelper*)this)->myNodePosShapesValidity.insert( make_pair( shapeID, ok));
}
+//=======================================================================
+//function : ToFixNodeParameters
+//purpose : Enables fixing node parameters on EDGEs and FACEs in
+// GetNodeU(...,check=true), GetNodeUV(...,check=true), CheckNodeUV() and
+// CheckNodeU() in case if a node lies on a shape set via SetSubShape().
+// Default is False
+//=======================================================================
+
+void SMESH_MesherHelper::ToFixNodeParameters(bool toFix)
+{
+ myFixNodeParameters = toFix;
+}
+
+
//=======================================================================
//function : GetUVOnSeam
//purpose : Select UV on either of 2 pcurves of a seam edge, closest to the given UV
return false;
}
// store the fixed UV on the face
- if ( myShape.IsSame(F) && shapeID == myShapeID )
+ if ( myShape.IsSame(F) && shapeID == myShapeID && myFixNodeParameters )
const_cast<SMDS_MeshNode*>(n)->SetPosition
( SMDS_PositionPtr( new SMDS_FacePosition( U, V )));
}
return false;
}
// store the fixed U on the edge
- if ( myShape.IsSame(E) && shapeID == myShapeID )
+ if ( myShape.IsSame(E) && shapeID == myShapeID && myFixNodeParameters )
const_cast<SMDS_MeshNode*>(n)->SetPosition
( SMDS_PositionPtr( new SMDS_EdgePosition( U )));
}
if ( getenv("NO_FixQuadraticElements") )
return;
- // 0. Apply algorithm to solids or geom faces
+ // 0. Apply algorithm to SOLIDs or FACEs
// ----------------------------------------------
if ( myShape.IsNull() ) {
if ( !myMesh->HasShapeToMesh() ) return;
SMESH_MesherHelper h(*myMesh);
h.SetSubShape( fIt.Key() );
h.FixQuadraticElements(true);
+ h.ToFixNodeParameters(true);
}
//perf_print_all_meters(1);
return;
const std::vector<int>& quantities,
const int ID=0,
const bool force3d = true);
+ /*!
+ * \brief Enables fixing node parameters on EDGEs and FACEs by
+ * GetNodeU(...,check=true), GetNodeUV(...,check=true), CheckNodeUV() and
+ * CheckNodeU() in case if a node lies on a shape set via SetSubShape().
+ * Default is False
+ */
+ void ToFixNodeParameters(bool toFix);
+
/*!
* \brief Return U of the given node on the edge
*/
SMESH_Mesh* myMesh;
int myShapeID;
- // to create quadratic elements
bool myCreateQuadratic;
bool mySetElemOnShape;
+ bool myFixNodeParameters;
std::map< int,bool > myNodePosShapesValidity;
bool toCheckPosOnShape(int shapeID ) const;