0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / AppDef / AppDef_MultiPointConstraint.hxx
1 // Created on: 1991-12-02
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _AppDef_MultiPointConstraint_HeaderFile
18 #define _AppDef_MultiPointConstraint_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <AppParCurves_MultiPoint.hxx>
25 #include <TColgp_Array1OfPnt.hxx>
26 #include <TColgp_Array1OfPnt2d.hxx>
27 #include <TColgp_HArray1OfVec.hxx>
28 #include <TColgp_HArray1OfVec2d.hxx>
29
30 class Standard_OutOfRange;
31 class Standard_ConstructionError;
32 class Standard_DimensionError;
33 class gp_Vec;
34 class gp_Vec2d;
35
36 //! Describes a MultiPointConstraint used in a
37 //! Multiline. MultiPointConstraints are composed
38 //! of several two or three-dimensional points.
39 //! The purpose is to define the corresponding
40 //! points that share a common constraint in order
41 //! to compute the approximation of several lines in parallel.
42 //! Notes:
43 //! -   The order of points of a MultiPointConstraints is very important.
44 //! Users must give 3D points first, and then 2D points.
45 //! -   The constraints for the points included in a
46 //! MultiPointConstraint are always identical for
47 //! all points, including the parameter.
48 //! -   If a MultiPointConstraint is a "tangency"
49 //! point, the point is also a "passing" point.
50 class AppDef_MultiPointConstraint  : public AppParCurves_MultiPoint
51 {
52 public:
53
54   DEFINE_STANDARD_ALLOC
55
56   
57   //! creates an undefined MultiPointConstraint.
58   Standard_EXPORT AppDef_MultiPointConstraint();
59   
60   //! constructs a set of Points used to approximate a Multiline.
61   //! These Points can be of 2 or 3 dimensions.
62   //! Points will be initialized with SetPoint and SetPoint2d.
63   Standard_EXPORT AppDef_MultiPointConstraint(const Standard_Integer NbPoints, const Standard_Integer NbPoints2d);
64   
65   //! creates a MultiPoint only composed of 3D points.
66   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP);
67   
68   //! creates a MultiPoint only composed of 2D points.
69   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt2d& tabP);
70   
71   //! constructs a set of Points used to approximate a Multiline.
72   //! These Points can be of 2 or 3 dimensions.
73   //! Points will be initialized with SetPoint and SetPoint2d.
74   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d);
75   
76   //! creates a MultiPointConstraint with a constraint of
77   //! Curvature.
78   //! An exception is raised if
79   //! (length of <tabP> + length of <tabP2d> ) is different
80   //! from (length of <tabVec> + length of <tabVec2d> ) or
81   //! from (length of <tabCur> + length of <tabCur2d> )
82   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec& tabVec, const TColgp_Array1OfVec2d& tabVec2d, const TColgp_Array1OfVec& tabCur, const TColgp_Array1OfVec2d& tabCur2d);
83   
84   //! creates a MultiPointConstraint with a constraint of
85   //! Tangency.
86   //! An exception is raised if
87   //! (length of <tabP> + length of <tabP2d> ) is different
88   //! from (length of <tabVec> + length of <tabVec2d> )
89   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec& tabVec, const TColgp_Array1OfVec2d& tabVec2d);
90   
91   //! creates a MultiPointConstraint only composed of 3d points
92   //! with constraints of curvature.
93   //! An exception is raised if the length of tabP is different
94   //! from the length of tabVec or from tabCur.
95   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfVec& tabVec, const TColgp_Array1OfVec& tabCur);
96   
97   //! creates a MultiPointConstraint only composed of 3d points
98   //! with constraints of tangency.
99   //! An exception is raised if the length of tabP is different
100   //! from the length of tabVec.
101   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfVec& tabVec);
102   
103   //! creates a MultiPointConstraint only composed of 2d points
104   //! with constraints of tangency.
105   //! An exception is raised if the length of tabP is different
106   //! from the length of tabVec2d.
107   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec2d& tabVec2d);
108   
109   //! creates a MultiPointConstraint only composed of 2d points
110   //! with constraints of curvature.
111   //! An exception is raised if the length of tabP is different
112   //! from the length of tabVec2d or from tabCur2d.
113   Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec2d& tabVec2d, const TColgp_Array1OfVec2d& tabCur2d);
114   
115   //! sets the value of the tangency of the point of range
116   //! Index.
117   //! An exception is raised if Index <0 or if Index > number
118   //! of 3d points.
119   //! An exception is raised if Tang has an incorrect number of
120   //! dimensions.
121   Standard_EXPORT void SetTang (const Standard_Integer Index, const gp_Vec& Tang);
122   
123   //! returns the tangency value of the point of range Index.
124   //! An exception is raised if Index < 0 or if Index > number
125   //! of 3d points.
126   Standard_EXPORT gp_Vec Tang (const Standard_Integer Index) const;
127   
128   //! sets the value of the tangency of the point of range
129   //! Index.
130   //! An exception is raised if Index <number of 3d points or if
131   //! Index > total number of Points
132   //! An exception is raised if Tang has an incorrect number of
133   //! dimensions.
134   Standard_EXPORT void SetTang2d (const Standard_Integer Index, const gp_Vec2d& Tang2d);
135   
136   //! returns the tangency value of the point of range Index.
137   //! An exception is raised if Index < number  of 3d points or
138   //! if Index > total number of points.
139   Standard_EXPORT gp_Vec2d Tang2d (const Standard_Integer Index) const;
140   
141   //! Vec sets the value of the normal vector at the
142   //! point of index Index. The norm of the normal
143   //! vector at the point of position Index is set to the normal curvature.
144   //! An exception is raised if Index <0 or if Index > number
145   //! of 3d points.
146   //! An exception is raised if Curv has an incorrect number of
147   //! dimensions.
148   Standard_EXPORT void SetCurv (const Standard_Integer Index, const gp_Vec& Curv);
149   
150   //! returns the normal vector at the point of range Index.
151   //! An exception is raised if Index < 0 or if Index > number
152   //! of 3d points.
153   Standard_EXPORT gp_Vec Curv (const Standard_Integer Index) const;
154   
155   //! Vec sets the value of the normal vector at the
156   //! point of index Index. The norm of the normal
157   //! vector at the point of position Index is set to the normal curvature.
158   //! An exception is raised if Index <0 or if Index > number
159   //! of 3d points.
160   //! An exception is raised if Curv has an incorrect number of
161   //! dimensions.
162   Standard_EXPORT void SetCurv2d (const Standard_Integer Index, const gp_Vec2d& Curv2d);
163   
164   //! returns the normal vector at the point of range Index.
165   //! An exception is raised if Index < 0 or if Index > number
166   //! of 3d points.
167   Standard_EXPORT gp_Vec2d Curv2d (const Standard_Integer Index) const;
168   
169   //! returns True if the MultiPoint has a tangency value.
170   Standard_EXPORT Standard_Boolean IsTangencyPoint() const;
171   
172   //! returns True if the MultiPoint has a curvature value.
173   Standard_EXPORT Standard_Boolean IsCurvaturePoint() const;
174   
175   //! Prints on the stream o information on the current
176   //! state of the object.
177   //! Is used to redefine the operator <<.
178   Standard_EXPORT virtual void Dump (Standard_OStream& o) const Standard_OVERRIDE;
179
180 private:
181   Handle(TColgp_HArray1OfVec) tabTang;
182   Handle(TColgp_HArray1OfVec) tabCurv;
183   Handle(TColgp_HArray1OfVec2d) tabTang2d;
184   Handle(TColgp_HArray1OfVec2d) tabCurv2d;
185 };
186
187 #endif // _AppDef_MultiPointConstraint_HeaderFile