Salome HOME
d60ba91530e0ec07dcc2d28646be75a1404e5367
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IMeasureOperations.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20
21 #ifndef _GEOMImpl_IMeasureOperations_HXX_
22 #define _GEOMImpl_IMeasureOperations_HXX_
23
24 #include "GEOM_IOperations.hxx"
25
26 #include <BRepCheck_Analyzer.hxx>
27 #include <TopTools_HSequenceOfShape.hxx>
28 #include <TopTools_DataMapOfShapeListOfShape.hxx>
29 #include <TCollection_AsciiString.hxx>
30
31 class GEOM_Engine;
32 class Handle(GEOM_Object);
33
34 class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
35  public:
36   Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
37   Standard_EXPORT ~GEOMImpl_IMeasureOperations();
38
39   Standard_EXPORT Handle(GEOM_Object) GetCentreOfMass (Handle(GEOM_Object) theShape);
40
41   Standard_EXPORT void GetBasicProperties (Handle(GEOM_Object) theShape,
42                            Standard_Real& theLength,
43                            Standard_Real& theSurfArea,
44                            Standard_Real& theVolume);
45
46   Standard_EXPORT void GetInertia (Handle(GEOM_Object) theShape,
47                    Standard_Real& I11, Standard_Real& I12, Standard_Real& I13,
48                    Standard_Real& I21, Standard_Real& I22, Standard_Real& I23,
49                    Standard_Real& I31, Standard_Real& I32, Standard_Real& I33,
50                    Standard_Real& Ix , Standard_Real& Iy , Standard_Real& Iz);
51
52   Standard_EXPORT void GetBoundingBox (Handle(GEOM_Object) theShape,
53                        Standard_Real& Xmin, Standard_Real& Xmax,
54                        Standard_Real& Ymin, Standard_Real& Ymax,
55                        Standard_Real& Zmin, Standard_Real& Zmax);
56
57   Standard_EXPORT void GetTolerance (Handle(GEOM_Object) theShape,
58                      Standard_Real& FaceMin, Standard_Real& FaceMax,
59                      Standard_Real& EdgeMin, Standard_Real& EdgeMax,
60                      Standard_Real& VertMin, Standard_Real& VertMax);
61
62   Standard_EXPORT bool CheckShape (Handle(GEOM_Object)      theShape,
63                    TCollection_AsciiString& theDump);
64
65   Standard_EXPORT TCollection_AsciiString WhatIs (Handle(GEOM_Object) theShape);
66
67   Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2,
68                                 Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1,
69                                 Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2);
70
71  Standard_EXPORT void PointCoordinates( Handle(GEOM_Object) theShape,
72                         Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ );
73  
74  private:
75   void StructuralDump (const BRepCheck_Analyzer& theAna,
76                        const TopoDS_Shape&       theShape,
77                        TCollection_AsciiString&  theDump);
78
79   void GetProblemShapes (const BRepCheck_Analyzer&           theAna,
80                          const TopoDS_Shape&                 theShape,
81                          Handle(TopTools_HSequenceOfShape)&  sl,
82                          Handle(TColStd_HArray1OfInteger)&   NbProblems,
83                          TopTools_DataMapOfShapeListOfShape& theMap);
84
85   void GetProblemSub (const BRepCheck_Analyzer&           theAna,
86                       const TopoDS_Shape&                 theShape,
87                       Handle(TopTools_HSequenceOfShape)&  sl,
88                       Handle(TColStd_HArray1OfInteger)&   NbProblems,
89                       const TopAbs_ShapeEnum              Subtype,
90                       TopTools_DataMapOfShapeListOfShape& theMap);
91 };
92
93 #endif