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