]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx
Salome HOME
0020628: EDF 1144 GEOM : In TUI, need a function to know the orientation of an edge...
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IMeasureOperations.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef _GEOMImpl_IMeasureOperations_HXX_
23 #define _GEOMImpl_IMeasureOperations_HXX_
24
25 #include "GEOM_IOperations.hxx"
26
27 #include <BRepCheck_Analyzer.hxx>
28 #include <TopoDS_Shape.hxx>
29 #include <TopTools_HSequenceOfShape.hxx>
30 #include <TopTools_DataMapOfShapeListOfShape.hxx>
31 #include <TCollection_AsciiString.hxx>
32 #include <TColStd_HSequenceOfInteger.hxx>
33 #include <TColStd_HSequenceOfReal.hxx>
34 #include <gp_Ax3.hxx>
35 #include <Geom_Surface.hxx>
36
37 class GEOM_Engine;
38 class Handle(GEOM_Object);
39
40 class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
41  public:
42   Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
43   Standard_EXPORT ~GEOMImpl_IMeasureOperations();
44
45   enum ShapeKind {
46     SK_NO_SHAPE,
47     // COMPOSITEs
48     SK_COMPOUND,
49     SK_COMPSOLID,
50     SK_SHELL,
51     SK_WIRE,
52     // SOLIDs
53     SK_SPHERE,       // full sphere
54     SK_CYLINDER,     // cylinder
55     SK_BOX,          // box with faces, parallel to global coordinate planes
56     SK_ROTATED_BOX,  // other box
57     SK_TORUS,        // full torus
58     SK_CONE,         // cone
59     SK_POLYHEDRON,   // solid, bounded by polygons
60     SK_SOLID,        // other solid
61     // FACEs
62     SK_SPHERE2D,     // spherical face (closed)
63     SK_CYLINDER2D,   // cylindrical face with defined height
64     SK_TORUS2D,      // toroidal face (closed)
65     SK_CONE2D,       // conical face with defined height
66     SK_DISK_CIRCLE,  // planar, bounded by circle
67     SK_DISK_ELLIPSE, // planar, bounded by ellipse
68     SK_POLYGON,      // planar, bounded by segments
69     SK_PLANE,        // infinite planar
70     SK_PLANAR,       // other planar
71     SK_FACE,         // other face
72     // EDGEs
73     SK_CIRCLE,       // full circle
74     SK_ARC_CIRCLE,   // arc of circle
75     SK_ELLIPSE,      // full ellipse
76     SK_ARC_ELLIPSE,  // arc of ellipse
77     SK_LINE,         // infinite segment
78     SK_SEGMENT,      // segment
79     SK_EDGE,         // other edge
80     // VERTEX
81     SK_VERTEX
82   };
83
84   Standard_EXPORT ShapeKind KindOfShape (Handle(GEOM_Object) theShape,
85                                          Handle(TColStd_HSequenceOfInteger)& theIntegers,
86                                          Handle(TColStd_HSequenceOfReal)&    theDoubles);
87
88   Standard_EXPORT void GetPosition (Handle(GEOM_Object) theShape,
89                                     Standard_Real& Ox, Standard_Real& Oy, Standard_Real& Oz,
90                                     Standard_Real& Zx, Standard_Real& Zy, Standard_Real& Zz,
91                                     Standard_Real& Xx, Standard_Real& Xy, Standard_Real& Xz);
92
93   Standard_EXPORT Handle(GEOM_Object) GetCentreOfMass (Handle(GEOM_Object) theShape);
94
95   Standard_EXPORT Handle(GEOM_Object) GetVertexByIndex (Handle(GEOM_Object) theShape,
96                                                         Standard_Integer theIndex);
97
98   Standard_EXPORT Handle(GEOM_Object) GetNormal (Handle(GEOM_Object) theFace,
99                                                  Handle(GEOM_Object) theOptionalPoint);
100
101   Standard_EXPORT void GetBasicProperties (Handle(GEOM_Object) theShape,
102                                            Standard_Real& theLength,
103                                            Standard_Real& theSurfArea,
104                                            Standard_Real& theVolume);
105
106   Standard_EXPORT void GetInertia (Handle(GEOM_Object) theShape,
107                                    Standard_Real& I11, Standard_Real& I12, Standard_Real& I13,
108                                    Standard_Real& I21, Standard_Real& I22, Standard_Real& I23,
109                                    Standard_Real& I31, Standard_Real& I32, Standard_Real& I33,
110                                    Standard_Real& Ix , Standard_Real& Iy , Standard_Real& Iz);
111
112   Standard_EXPORT void GetBoundingBox (Handle(GEOM_Object) theShape,
113                                        Standard_Real& Xmin, Standard_Real& Xmax,
114                                        Standard_Real& Ymin, Standard_Real& Ymax,
115                                        Standard_Real& Zmin, Standard_Real& Zmax);
116
117   Standard_EXPORT void GetTolerance (Handle(GEOM_Object) theShape,
118                                      Standard_Real& FaceMin, Standard_Real& FaceMax,
119                                      Standard_Real& EdgeMin, Standard_Real& EdgeMax,
120                                      Standard_Real& VertMin, Standard_Real& VertMax);
121
122   Standard_EXPORT bool CheckShape (Handle(GEOM_Object)      theShape,
123                                    const Standard_Boolean   theIsCheckGeom,
124                                    TCollection_AsciiString& theDump);
125
126   Standard_EXPORT TCollection_AsciiString WhatIs (Handle(GEOM_Object) theShape);
127
128   Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1,
129                                                 Handle(GEOM_Object) theShape2,
130                                                 Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1,
131                                                 Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2);
132
133   Standard_EXPORT void PointCoordinates (Handle(GEOM_Object) theShape,
134                                          Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ);
135
136   Standard_EXPORT Standard_Real GetAngle (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2);
137
138
139   // Methods for recieving radiuses of curvature of curves and surfaces
140   // in the given point
141   Standard_EXPORT Standard_Real CurveCurvatureByParam (Handle(GEOM_Object) theCurve,
142                                                        Standard_Real& theParam);
143   Standard_EXPORT Standard_Real CurveCurvatureByPoint (Handle(GEOM_Object) theCurve,
144                                                        Handle(GEOM_Object) thePoint);
145   Standard_EXPORT Standard_Real MaxSurfaceCurvatureByParam (Handle(GEOM_Object) theSurf,
146                                                             Standard_Real& theUParam,
147                                                             Standard_Real& theVParam);
148   Standard_EXPORT Standard_Real MaxSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
149                                                             Handle(GEOM_Object) thePoint);
150   Standard_EXPORT Standard_Real MinSurfaceCurvatureByParam (Handle(GEOM_Object) theSurf,
151                                                             Standard_Real& theUParam,
152                                                             Standard_Real& theVParam);
153   Standard_EXPORT Standard_Real MinSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
154                                                             Handle(GEOM_Object) thePoint);
155
156  public:
157   Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
158
159  private:
160   void StructuralDump (const BRepCheck_Analyzer& theAna,
161                        const TopoDS_Shape&       theShape,
162                        TCollection_AsciiString&  theDump);
163
164   void GetProblemShapes (const BRepCheck_Analyzer&           theAna,
165                          const TopoDS_Shape&                 theShape,
166                          Handle(TopTools_HSequenceOfShape)&  sl,
167                          Handle(TColStd_HArray1OfInteger)&   NbProblems,
168                          TopTools_DataMapOfShapeListOfShape& theMap);
169
170   void GetProblemSub (const BRepCheck_Analyzer&           theAna,
171                       const TopoDS_Shape&                 theShape,
172                       Handle(TopTools_HSequenceOfShape)&  sl,
173                       Handle(TColStd_HArray1OfInteger)&   NbProblems,
174                       const TopAbs_ShapeEnum              Subtype,
175                       TopTools_DataMapOfShapeListOfShape& theMap);
176
177   Standard_Real getSurfaceCurvatures (const Handle(Geom_Surface)& aSurf,
178                                       Standard_Real theUParam,
179                                       Standard_Real theVParam,
180                                       Standard_Boolean theNeedMaxCurv);
181 };
182
183 #endif