Salome HOME
Merge from V6_main (04/10/2012)
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IBasicOperations.hxx
1 // Copyright (C) 2007-2012  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_IBasicOperations_HXX_
23 #define _GEOMImpl_IBasicOperations_HXX_
24
25 #include "Utils_SALOME_Exception.hxx"
26 #include "GEOM_IOperations.hxx"
27 #include "GEOM_Engine.hxx"
28 #include "GEOM_Object.hxx"
29 #include <TDocStd_Document.hxx>
30
31 class GEOMImpl_IBasicOperations : public GEOM_IOperations {
32  public:
33   Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID);
34   Standard_EXPORT ~GEOMImpl_IBasicOperations();
35
36   // Point
37   Standard_EXPORT Handle(GEOM_Object) MakePointXYZ (double theX, double theY, double theZ);
38
39   Standard_EXPORT Handle(GEOM_Object) MakePointWithReference (Handle(GEOM_Object) theReference,
40                                               double theX, double theY, double theZ);
41
42   Standard_EXPORT Handle(GEOM_Object) MakePointOnCurve (Handle(GEOM_Object) theCurve,
43                                                         double theParameter);
44
45   Standard_EXPORT Handle(GEOM_Object) MakePointOnCurveByLength (Handle(GEOM_Object) theCurve,
46                                                                 double              theLength,
47                                                                 Handle(GEOM_Object) theStartPoint);
48
49   Standard_EXPORT Handle(GEOM_Object) MakePointOnCurveByCoord (Handle(GEOM_Object) theCurve,
50                                                                double theXParam,
51                                                                double theYParam,
52                                                                double theZParam);
53
54   Standard_EXPORT Handle(GEOM_Object) MakePointOnLinesIntersection
55                                       (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2);
56
57   Standard_EXPORT Handle(GEOM_Object) MakePointOnSurface (Handle(GEOM_Object) theSurface,
58                                                           double theUParameter,
59                                                           double theVParameter);
60
61   Standard_EXPORT Handle(GEOM_Object) MakePointOnSurfaceByCoord (Handle(GEOM_Object) theSurface,
62                                                                  double theXParam,
63                                                                  double theYParam,
64                                                                  double theZParam);
65
66   Standard_EXPORT Handle(GEOM_Object) MakePointOnFace (Handle(GEOM_Object) theFace);
67
68   // Vector
69   Standard_EXPORT Handle(GEOM_Object) MakeVectorDXDYDZ (double theDX, double theDY, double theDZ);
70
71   Standard_EXPORT Handle(GEOM_Object) MakeVectorTwoPnt (Handle(GEOM_Object) thePnt1,
72                                         Handle(GEOM_Object) thePnt2);
73
74   Standard_EXPORT Handle(GEOM_Object) MakeTangentOnCurve(const Handle(GEOM_Object)& theCurve, 
75                                                          double theParameter);
76
77   // Line
78   Standard_EXPORT Handle(GEOM_Object) MakeLineTwoPnt (Handle(GEOM_Object) thePnt1,
79                                       Handle(GEOM_Object) thePnt2);
80
81   Standard_EXPORT Handle(GEOM_Object) MakeLineTwoFaces (Handle(GEOM_Object) theFace1,
82                                       Handle(GEOM_Object) theFace2);
83
84   Standard_EXPORT Handle(GEOM_Object) MakeLine (Handle(GEOM_Object) thePnt,
85                                 Handle(GEOM_Object) theDir);
86
87   // Plane
88   Standard_EXPORT Handle(GEOM_Object) MakePlaneThreePnt (Handle(GEOM_Object) thePnt1,
89                                          Handle(GEOM_Object) thePnt2,
90                                          Handle(GEOM_Object) thePnt3,
91                                          double theSize);
92
93   Standard_EXPORT Handle(GEOM_Object) MakePlanePntVec (Handle(GEOM_Object) thePnt,
94                                        Handle(GEOM_Object) theVec,
95                                        double theSize);
96
97   Standard_EXPORT Handle(GEOM_Object) MakePlaneFace (Handle(GEOM_Object) theFace, double theSize);
98   
99   Standard_EXPORT Handle(GEOM_Object) MakePlane2Vec (Handle(GEOM_Object) theVec1,
100                                                      Handle(GEOM_Object) theVec2,
101                                                      double theSize);
102                                                      
103   Standard_EXPORT Handle(GEOM_Object) MakePlaneLCS (Handle(GEOM_Object) theFace, double theSize, int theOrientation);
104
105   // Marker
106   Standard_EXPORT Handle(GEOM_Object) MakeMarker (double theOX,  double theOY,  double theOZ,
107                                   double theXDX, double theXDY, double theXDZ,
108                                   double theYDX, double theYDY, double theYDZ);
109                                   
110   Standard_EXPORT Handle(GEOM_Object) MakeMarkerFromShape (const Handle(GEOM_Object)& theShape);
111   
112   Standard_EXPORT Handle(GEOM_Object) MakeMarkerPntTwoVec (const Handle(GEOM_Object)& theOrigin,
113                                                            const Handle(GEOM_Object)& theXVec,
114                                                            const Handle(GEOM_Object)& theYVec);
115
116   Standard_EXPORT Handle(GEOM_Object) MakeTangentPlaneOnFace(const Handle(GEOM_Object)& theFace,
117                                                              double theParamU,
118                                                              double theParamV,
119                                                              double theSize);
120
121   private:
122   // Private methods
123
124   //! Enumeration describes point position on geometric object (curve or surface)
125   //! Point location can be determined by parameter (or U, V parameters) or 3D coordinates
126   enum PointLocation
127   { 
128     PointOn_CurveByParam,
129     PointOn_CurveByCoord,
130     PointOn_CurveByLength,   
131     PointOn_SurfaceByParam,
132     PointOn_SurfaceByCoord,
133     PointOn_Face
134   };
135
136   Handle(GEOM_Object) makePointOnGeom (Handle(GEOM_Object) theGeomObj,
137                                        double theParam1,
138                                        double theParam2,
139                                        double theParam3,
140                                        const PointLocation theLocation,
141                                        Handle(GEOM_Object) theRefPoint = 0);
142 };
143
144 #endif