X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_Block.hxx;h=14a032adb8d6d35c93ee9be4ca31c180af36e69b;hb=e57d64d3910c1a5f0eca72ee7244d32873495517;hp=427cc94de67f35631c5448da14fa03f38a5e2fa2;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_Block.hxx b/src/SMESHUtils/SMESH_Block.hxx index 427cc94de..14a032adb 100644 --- a/src/SMESHUtils/SMESH_Block.hxx +++ b/src/SMESHUtils/SMESH_Block.hxx @@ -246,6 +246,8 @@ public: const gp_XYZ& theParamsHint = gp_XYZ(-1,-1,-1)); // compute point parameters in the block. // Note: for edges, it is better to use EdgeParameters() + // Return false only in case of "hard" failure, use IsToleranceReached() etc + // to evaluate quality of the found solution bool VertexParameters(const int theVertexID, gp_XYZ& theParams); // return parameters of a vertex given by TShapeID @@ -253,14 +255,18 @@ public: bool EdgeParameters(const int theEdgeID, const double theU, gp_XYZ& theParams); // return parameters of a point given by theU on edge + void SetTolerance(const double tol); + // set tolerance for ComputeParameters() - public: - // --------------- - // Block geometry - // --------------- + double GetTolerance() const { return myTolerance; } + // return current tolerance of ComputeParameters() + + bool IsToleranceReached() const; + // return true if solution found by ComputeParameters() is within the tolerance + + double DistanceReached() const { return distance(); } + // return distance between solution found by ComputeParameters() and thePoint - - public: // --------- // Services @@ -352,6 +358,10 @@ public: int GetUInd() const { return myCoordInd[ 0 ]; } int GetVInd() const { return myCoordInd[ 2 ]; } void GetCoefs( int i, const gp_XYZ& theParams, double& eCoef, double& vCoef ) const; + const Adaptor3d_Surface* Surface() const { return myS; } + bool IsUVInQuad( const gp_XY& uv, + const gp_XYZ& param0, const gp_XYZ& param1, + const gp_XYZ& param2, const gp_XYZ& param3 ) const; TFace(): myS(0) { myC2d[0]=myC2d[1]=myC2d[2]=myC2d[3]=0; } ~TFace(); }; @@ -369,7 +379,9 @@ public: enum { SQUARE_DIST = 0, DRV_1, DRV_2, DRV_3 }; double distance () const { return sqrt( myValues[ SQUARE_DIST ]); } double funcValue(double sqDist) const { return mySquareFunc ? sqDist : sqrt(sqDist); } - bool computeParameters(const gp_Pnt& thePoint, gp_XYZ& theParams, const gp_XYZ& theParamsHint); + bool computeParameters(const gp_Pnt& thePoint, gp_XYZ& theParams, const gp_XYZ& theParamsHint, int); + void refineParametersOnFace( const gp_Pnt& thePoint, gp_XYZ& theParams, int theFaceID ); + bool saveBetterSolution( const gp_XYZ& theNewParams, gp_XYZ& theParams, double sqDistance ); int myFaceIndex; double myFaceParam; @@ -383,7 +395,7 @@ public: double myValues[ 4 ]; // values computed at myParam: square distance and 3 derivatives typedef std::pair TxyzPair; - TxyzPair my3x3x3GridNodes[ 27 ]; // to compute the first param guess + TxyzPair my3x3x3GridNodes[ 1000 ]; // to compute the first param guess bool myGridComputed; };