Salome HOME
[bos #39942] EDF 25230 - New problem with XYZtoUV
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IMeasureOperations.hxx
index 9712e33c277f24a7e73c23e20092279642ac9adb..d80bef1eb77c93d8645c8dc7d7c408f47db7d035 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #include <Precision.hxx>
 
 class GEOM_Engine;
-class Handle(GEOM_Object);
+class GEOM_Object;
 
 class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
  public:
-  Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
+  Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine);
   Standard_EXPORT ~GEOMImpl_IMeasureOperations();
 
   enum ShapeKind {
@@ -78,10 +78,16 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
     SK_ARC_ELLIPSE,  // arc of ellipse
     SK_LINE,         // infinite segment
     SK_SEGMENT,      // segment
+    SK_CRV_BSPLINE,  // B-Spline curve (open or closed)
+    SK_CRV_BEZIER,   // Bezier curve (open or closed)
+    SK_HYPERBOLA,    // hyperbola
+    SK_PARABOLA,     // parabola
     SK_EDGE,         // other edge
     // VERTEX
-    SK_VERTEX,
+    SK_VERTEX,       // vertex
     // ADVANCED shapes
+    SK_LCS,          // local coordinate system
+    // (other advanced shapes)
     SK_ADVANCED,     // all advanced shapes (temporary implementation)
   };
 
@@ -111,12 +117,14 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) GetCentreOfMass (Handle(GEOM_Object) theShape);
 
   Standard_EXPORT Handle(GEOM_Object) GetVertexByIndex (Handle(GEOM_Object) theShape,
-                                                        Standard_Integer theIndex);
+                                                        Standard_Integer theIndex,
+                                                        Standard_Boolean theUseOri);
 
   Standard_EXPORT Handle(GEOM_Object) GetNormal (Handle(GEOM_Object) theFace,
                                                  Handle(GEOM_Object) theOptionalPoint);
 
   Standard_EXPORT void GetBasicProperties (Handle(GEOM_Object) theShape,
+                                           const Standard_Real theTolerance,
                                            Standard_Real& theLength,
                                            Standard_Real& theSurfArea,
                                            Standard_Real& theVolume);
@@ -158,6 +166,13 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
                                                const SICheckLevel  theCheckLevel,
                                                Handle(TColStd_HSequenceOfInteger)& theIntersections);
   
+  Standard_EXPORT bool CheckSelfIntersectionsFast (Handle(GEOM_Object) theShape,
+                                                   float  deflection, 
+                                                   double tolerance,
+                                                   Handle(TColStd_HSequenceOfInteger)& theIntersections);
+
+  Standard_EXPORT bool CheckBOPArguments (const Handle(GEOM_Object) &theShape);
+  
   Standard_EXPORT bool FastIntersect (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2,
                                       double tolerance, float deflection,
                                       Handle(TColStd_HSequenceOfInteger)& theIntersections1,
@@ -187,8 +202,9 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
 
   Standard_EXPORT Standard_Real GetAngleBtwVectors (Handle(GEOM_Object) theVec1, Handle(GEOM_Object) theVec2);
 
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) PatchFace(Handle(GEOM_Object) theShape);
 
-  // Methods for recieving radiuses of curvature of curves and surfaces
+  // Methods for receiving radiuses of curvature of curves and surfaces
   // in the given point
   Standard_EXPORT Standard_Real CurveCurvatureByParam (Handle(GEOM_Object) theCurve,
                                                        Standard_Real& theParam);
@@ -205,6 +221,54 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
   Standard_EXPORT Standard_Real MinSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
                                                             Handle(GEOM_Object) thePoint);
 
+  // Methods checking the shapes which are not applicable to modelling operations
+  typedef std::pair< Handle(GEOM_Object), Handle(GEOM_Object)> CoupleOfObjects;
+  struct FailedChecks
+  {
+    Standard_Integer TypeOfCheck;
+    CoupleOfObjects FailedShapes;
+  };
+
+  Standard_EXPORT std::list<CoupleOfObjects> SelfIntersected2D(const std::list<FailedChecks>& theChecks);
+  Standard_EXPORT std::list<CoupleOfObjects> InterferingSubshapes(const std::list<FailedChecks>& theChecks,
+                                                                  const int theShapeType1,
+                                                                  const int theShapeType2);
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) SmallEdges(const std::list<FailedChecks>& theChecks);
+  Standard_EXPORT std::list<CoupleOfObjects> DistantShapes(const std::list<FailedChecks>& theChecks,
+                                                           const int theShapeType,
+                                                           const int theSubShapeType,
+                                                           double theTolerance);
+  Standard_EXPORT void CheckConformityShape(Handle(GEOM_Object) theShape, std::list<FailedChecks>& theChecks);
+
+  Standard_EXPORT double ComputeTolerance(Handle(GEOM_Object) theEdge, Handle(GEOM_Object) theFace);
+  Standard_EXPORT double UpdateTolerance(Handle(GEOM_Object) theShape);
+
+  Standard_EXPORT Handle(GEOM_Object) SurfaceCurvatureByPointAndDirection
+                                      (Handle(GEOM_Object) theSurf,
+                                       Handle(GEOM_Object) thePoint,
+                                       Handle(GEOM_Object) theDirection);
+
+  // Methods to convert X,Y,Z coordinates of point to U,V parameters on surface and back
+  Standard_EXPORT Handle(TColStd_HArray1OfReal) XYZtoUV
+                                      (Handle(GEOM_Object) theSurf,
+                                       const Handle(TColStd_HArray1OfReal)& theXYZlist,
+                                       bool isNormalized);
+
+  Standard_EXPORT Handle(TColStd_HArray1OfReal) UVtoXYZ
+                                      (Handle(GEOM_Object) theSurf,
+                                       const Handle(TColStd_HArray1OfReal)& theUVlist,
+                                       bool isNormalized);
+
+  // Methods to compute proximity between two shapes
+  Standard_EXPORT Handle(GEOM_Object) ShapeProximityCalculator(Handle(GEOM_Object) theShape1,
+                                                               Handle(GEOM_Object) theShape2);
+  Standard_EXPORT Standard_Real GetCoarseProximity(Handle(GEOM_Object) theCalculator,
+                                                   bool doPythonDump = true);
+  Standard_EXPORT Standard_Real GetPreciseProximity(Handle(GEOM_Object) theCalculator);
+  Standard_EXPORT void SetShapeSampling(Handle(GEOM_Object) theCalculator,
+                                        Handle(GEOM_Object) theShape,
+                                        const Standard_Integer theNbSamples);
+
  private:
 
    void FillErrorsSub