-// Copyright (C) 2007-2015 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
// pcurves
vector< int > edgeIdVec;
GetFaceEdgesIDs( faceID, edgeIdVec );
- for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
+ for ( size_t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
{
myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] );
if ( myC2d[ iE ]) delete myC2d[ iE ];
const bool isOnFace = IsFaceID( theShapeID );
double * coef = GetShapeCoef( theShapeID );
- // Find the first guess paremeters
+ // Find the first guess parameters
gp_XYZ start(0, 0, 0);
{
// find UV of thePoint on the FACE
Standard_Real U,V;
+ U=V=0;
const TFace& tface = myFace[ theFaceID - ID_FirstF ];
if ( !tface.Surface() ) return;
dy *= 1.2;
xSol = 0.5 * (xMax + xMin) ;
ySol = 0.5 * (yMax + yMin) ;
- if ( xMin == 0. && yMin == 0. && xMax == 1. && yMax == 1. ) // avoid infinit loop
+ if ( xMin == 0. && yMin == 0. && xMax == 1. && yMax == 1. ) // avoid infinite loop
{
#ifdef _DEBUG_REFINE_
cout << "SMESH_Block::refineParametersOnFace(): tface.IsUVInQuad() fails" << endl;
}
}
- // refine solution using half-division technic
+ // refine solution using half-division technique
gp_XYZ sol = theParams;
if ( saveBetterSolution( sol, theParams, thePoint.SquareDistance( tface.Point( sol ))))
{
#ifdef _DEBUG_REFINE_
- cout << "SMESH_Block::refineParametersOnFace(): dividing suceeded" << endl;
+ cout << "SMESH_Block::refineParametersOnFace(): dividing succeeded" << endl;
cout << " nbGetUV = " << nbGetUV << endl;
#endif
return true;
//================================================================================
/*!
- * \brief Finds parameters corresponding to a given UV of a given face by searching
- * around the starting solution
+ * \brief Find parameters corresponding to a given UV of a given face by searching
+ * around the starting solution
* \param [in] theUV - the UV to locate
* \param [in] tface - the face
* \param [in,out] theParams - the starting parameters to improve
//================================================================================
bool SMESH_Block::findUVAround( const gp_Pnt& thePoint,
- const gp_XY& theUV,
+ const gp_XY& /*theUV*/,
const SMESH_Block::TFace& tface,
gp_XYZ& theParams,
int nbGetWorstLimit )
}
//================================================================================
/*!
- * \brief Call it after geometry initialisation
+ * \brief Call it after geometry initialization
*/
//================================================================================
const int theNode001Index,
vector<const SMDS_MeshNode*>& theOrderedNodes)
{
- MESSAGE(" ::LoadMeshBlock()");
init();
SMDS_VolumeTool vTool;
//function : LoadBlockShapes
//purpose : Initialize block geometry with theShell,
// add sub-shapes of theBlock to theShapeIDMap so that they get
-// IDs acoording to enum TShapeID
+// IDs according to enum TShapeID
//=======================================================================
bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell,
const TopoDS_Vertex& theVertex001,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap )
{
- MESSAGE(" ::LoadBlockShapes()");
return ( FindBlockShapes( theShell, theVertex000, theVertex001, theShapeIDMap ) &&
LoadBlockShapes( theShapeIDMap ));
}
//=======================================================================
//function : LoadBlockShapes
//purpose : add sub-shapes of theBlock to theShapeIDMap so that they get
-// IDs acoording to enum TShapeID
+// IDs according to enum TShapeID
//=======================================================================
bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
const TopoDS_Vertex& theVertex001,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap )
{
- MESSAGE(" ::FindBlockShapes()");
-
// 8 vertices
TopoDS_Shape V000, V100, V010, V110, V001, V101, V011, V111;
// 12 edges
if ( V000.IsNull() ) {
// find vertex 000 - the one with smallest coordinates
- double minVal = DBL_MAX, minX, val;
+ double minVal = DBL_MAX, minX = DBL_MAX, val;
for ( int i = 1; i <= 8; i++ ) {
const TopoDS_Vertex& v = TopoDS::Vertex( vfMap.FindKey( i ));
gp_Pnt P = BRep_Tool::Pnt( v );
for ( ; eIt.More(); eIt.Next() ) {
const TopoDS_Edge& e = TopoDS::Edge( eIt.Value() );
TopoDS_Vertex v = TopExp::FirstVertex( e );
- if ( v.IsSame( V000 ))
+ if ( v.IsSame( V000 )) {
v = TopExp::LastVertex( e );
+ if ( v.IsSame( V000 ))
+ return false;
+ }
val = dir001 * gp_Vec( p000, BRep_Tool::Pnt( v )).Normalized();
if ( val > maxVal ) {
V001 = v;
return false;
}
TopTools_ListIteratorOfListOfShape f001It, f000It ( f000List );
- int i, j, iFound1, iFound2;
+ int i, j, iFound1=0, iFound2=0;
for ( j = 0; f000It.More(); f000It.Next(), j++ )
{
if ( NB_FACES_BY_VERTEX == 6 && j % 2 ) continue; // each face encounters twice
bool isForward[4];
vector< int > edgeIdVec;
GetFaceEdgesIDs( theFaceID, edgeIdVec );
- for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
+ for ( size_t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
{
if ( edgeIdVec[ iE ] > theShapeIDMap.Extent() )
return false;