]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx
Salome HOME
Fix error in creation information - wrong operation type in case of MakeEdge
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IMeasureOperations.hxx
index 8d484b7168c15754efd5bf94a32b496749a23709..86d0a9c7b2b83125f67acb9e36dda8658b4c5ab4 100644 (file)
@@ -1,38 +1,40 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef _GEOMImpl_IMeasureOperations_HXX_
 #define _GEOMImpl_IMeasureOperations_HXX_
 
 #include "GEOM_IOperations.hxx"
 
 #include <BRepCheck_Analyzer.hxx>
+#include <BRepCheck_Status.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopTools_HSequenceOfShape.hxx>
-#include <TopTools_DataMapOfShapeListOfShape.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <TColStd_HSequenceOfInteger.hxx>
 #include <TColStd_HSequenceOfReal.hxx>
-#include <gp_Ax3.hxx>
+#include <TopTools_DataMapOfIntegerListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 #include <Geom_Surface.hxx>
+#include <Precision.hxx>
 
 class GEOM_Engine;
 class Handle(GEOM_Object);
@@ -78,7 +80,9 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
     SK_SEGMENT,      // segment
     SK_EDGE,         // other edge
     // VERTEX
-    SK_VERTEX
+    SK_VERTEX,
+    // ADVANCED shapes
+    SK_ADVANCED,     // all advanced shapes (temporary implementation)
   };
 
   Standard_EXPORT ShapeKind KindOfShape (Handle(GEOM_Object) theShape,
@@ -92,6 +96,9 @@ 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_EXPORT Handle(GEOM_Object) GetNormal (Handle(GEOM_Object) theFace,
                                                  Handle(GEOM_Object) theOptionalPoint);
 
@@ -107,31 +114,59 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
                                    Standard_Real& Ix , Standard_Real& Iy , Standard_Real& Iz);
 
   Standard_EXPORT void GetBoundingBox (Handle(GEOM_Object) theShape,
+                                       const Standard_Boolean precise,
                                        Standard_Real& Xmin, Standard_Real& Xmax,
                                        Standard_Real& Ymin, Standard_Real& Ymax,
                                        Standard_Real& Zmin, Standard_Real& Zmax);
 
+  Standard_EXPORT Handle(GEOM_Object) GetBoundingBox (Handle(GEOM_Object) theShape,
+                                                      const Standard_Boolean precise);
+
   Standard_EXPORT void GetTolerance (Handle(GEOM_Object) theShape,
                                      Standard_Real& FaceMin, Standard_Real& FaceMax,
                                      Standard_Real& EdgeMin, Standard_Real& EdgeMax,
                                      Standard_Real& VertMin, Standard_Real& VertMax);
 
-  Standard_EXPORT bool CheckShape (Handle(GEOM_Object)      theShape,
-                                   const Standard_Boolean   theIsCheckGeom,
-                                   TCollection_AsciiString& theDump);
+  struct ShapeError {
+    BRepCheck_Status error;
+    std::list<int>   incriminated;
+  };
+
+  Standard_EXPORT bool CheckShape (Handle(GEOM_Object)     theShape,
+                                   const Standard_Boolean  theIsCheckGeom,
+                                   std::list<ShapeError>  &theErrors);
+
+  Standard_EXPORT TCollection_AsciiString PrintShapeErrors
+                                  (Handle(GEOM_Object)          theShape,
+                                   const std::list<ShapeError> &theErrors);
+
+  Standard_EXPORT bool CheckSelfIntersections (Handle(GEOM_Object) theShape,
+                                               Handle(TColStd_HSequenceOfInteger)& theIntersections);
+
+  Standard_EXPORT TCollection_AsciiString IsGoodForSolid (Handle(GEOM_Object) theShape);
 
   Standard_EXPORT TCollection_AsciiString WhatIs (Handle(GEOM_Object) theShape);
 
+  Standard_EXPORT std::vector<bool> AreCoordsInside (Handle(GEOM_Object) theShape,
+                                                     const std::vector<double>& coords,
+                                                     double tolerance = Precision::Confusion());
+
   Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1,
                                                 Handle(GEOM_Object) theShape2,
                                                 Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1,
                                                 Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2);
 
+  Standard_EXPORT Standard_Integer ClosestPoints (Handle(GEOM_Object) theShape1,
+                                                  Handle(GEOM_Object) theShape2,
+                                                  Handle(TColStd_HSequenceOfReal)& theDoubles);
+
   Standard_EXPORT void PointCoordinates (Handle(GEOM_Object) theShape,
                                          Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ);
 
   Standard_EXPORT Standard_Real GetAngle (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2);
 
+  Standard_EXPORT Standard_Real GetAngleBtwVectors (Handle(GEOM_Object) theVec1, Handle(GEOM_Object) theVec2);
+
 
   // Methods for recieving radiuses of curvature of curves and surfaces
   // in the given point
@@ -150,26 +185,22 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
   Standard_EXPORT Standard_Real MinSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
                                                             Handle(GEOM_Object) thePoint);
 
- public:
-  Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
-
  private:
-  void StructuralDump (const BRepCheck_Analyzer& theAna,
-                       const TopoDS_Shape&       theShape,
-                       TCollection_AsciiString&  theDump);
-
-  void GetProblemShapes (const BRepCheck_Analyzer&           theAna,
-                         const TopoDS_Shape&                 theShape,
-                         Handle(TopTools_HSequenceOfShape)&  sl,
-                         Handle(TColStd_HArray1OfInteger)&   NbProblems,
-                         TopTools_DataMapOfShapeListOfShape& theMap);
-
-  void GetProblemSub (const BRepCheck_Analyzer&           theAna,
-                      const TopoDS_Shape&                 theShape,
-                      Handle(TopTools_HSequenceOfShape)&  sl,
-                      Handle(TColStd_HArray1OfInteger)&   NbProblems,
-                      const TopAbs_ShapeEnum              Subtype,
-                      TopTools_DataMapOfShapeListOfShape& theMap);
+
+   void FillErrorsSub
+           (const BRepCheck_Analyzer                   &theAna,
+            const TopoDS_Shape                         &theShape,
+            const TopAbs_ShapeEnum                     theSubType,
+                  TopTools_DataMapOfIntegerListOfShape &theMapErrors) const;
+   void FillErrors
+             (const BRepCheck_Analyzer                   &theAna,
+              const TopoDS_Shape                         &theShape,
+                    TopTools_DataMapOfIntegerListOfShape &theMapErrors,
+                    TopTools_MapOfShape                  &theMapShapes) const;
+
+  void FillErrors (const BRepCheck_Analyzer &theAna,
+                   const TopoDS_Shape       &theShape,
+                   std::list<ShapeError>    &theErrors) const;
 
   Standard_Real getSurfaceCurvatures (const Handle(Geom_Surface)& aSurf,
                                       Standard_Real theUParam,