summaryrefslogtreecommitdiff
path: root/inc/AppDef_TheVariational.hxx
blob: c3d6cb31c9bc8e73cb692d441d11e86cffb108eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _AppDef_TheVariational_HeaderFile
#define _AppDef_TheVariational_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _AppDef_MultiLine_HeaderFile
#include <AppDef_MultiLine.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfReal_HeaderFile
#include <Handle_TColStd_HArray1OfReal.hxx>
#endif
#ifndef _Handle_AppParCurves_HArray1OfConstraintCouple_HeaderFile
#include <Handle_AppParCurves_HArray1OfConstraintCouple.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfInteger_HeaderFile
#include <Handle_TColStd_HArray1OfInteger.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _GeomAbs_Shape_HeaderFile
#include <GeomAbs_Shape.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_AppParCurves_SmoothCriterion_HeaderFile
#include <Handle_AppParCurves_SmoothCriterion.hxx>
#endif
#ifndef _AppParCurves_MultiBSpCurve_HeaderFile
#include <AppParCurves_MultiBSpCurve.hxx>
#endif
#ifndef _Handle_AppDef_MyCriterionOfTheVariational_HeaderFile
#include <Handle_AppDef_MyCriterionOfTheVariational.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
#ifndef _Handle_FEmTool_Curve_HeaderFile
#include <Handle_FEmTool_Curve.hxx>
#endif
#ifndef _Handle_PLib_Base_HeaderFile
#include <Handle_PLib_Base.hxx>
#endif
#ifndef _AppParCurves_Constraint_HeaderFile
#include <AppParCurves_Constraint.hxx>
#endif
class TColStd_HArray1OfReal;
class AppParCurves_HArray1OfConstraintCouple;
class TColStd_HArray1OfInteger;
class AppParCurves_SmoothCriterion;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_DomainError;
class Standard_ConstructionError;
class StdFail_NotDone;
class gp_VectorWithNullMagnitude;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_MyCriterionOfTheVariational;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class FEmTool_Curve;
class TColStd_Array1OfReal;
class FEmTool_Assembly;
class math_Vector;
class PLib_Base;



class AppDef_TheVariational  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  
  Standard_EXPORT   AppDef_TheVariational(const AppDef_MultiLine& SSP,const Standard_Integer FirstPoint,const Standard_Integer LastPoint,const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints,const Standard_Integer MaxDegree = 14,const Standard_Integer MaxSegment = 100,const GeomAbs_Shape Continuity = GeomAbs_C2,const Standard_Boolean WithMinMax = Standard_False,const Standard_Boolean WithCutting = Standard_True,const Standard_Real Tolerance = 1.0,const Standard_Integer NbIterations = 2);
  
  Standard_EXPORT     void Approximate() ;
  
  Standard_EXPORT     Standard_Boolean IsCreated() const;
  
  Standard_EXPORT     Standard_Boolean IsDone() const;
  
  Standard_EXPORT     Standard_Boolean IsOverConstrained() const;
  
  Standard_EXPORT     AppParCurves_MultiBSpCurve Value() const;
  
  Standard_EXPORT     Standard_Real MaxError() const;
  
  Standard_EXPORT     Standard_Integer MaxErrorIndex() const;
  
  Standard_EXPORT     Standard_Real QuadraticError() const;
  
  Standard_EXPORT     void Distance(math_Matrix& mat) ;
  
  Standard_EXPORT     Standard_Real AverageError() const;
  
  Standard_EXPORT    const Handle_TColStd_HArray1OfReal& Parameters() const;
  
  Standard_EXPORT    const Handle_TColStd_HArray1OfReal& Knots() const;
  
  Standard_EXPORT     void Criterium(Standard_Real& VFirstOrder,Standard_Real& VSecondOrder,Standard_Real& VThirdOrder) const;
  
  Standard_EXPORT     void CriteriumWeight(Standard_Real& Percent1,Standard_Real& Percent2,Standard_Real& Percent3) const;
  
  Standard_EXPORT     Standard_Integer MaxDegree() const;
  
  Standard_EXPORT     Standard_Integer MaxSegment() const;
  
  Standard_EXPORT     GeomAbs_Shape Continuity() const;
  
  Standard_EXPORT     Standard_Boolean WithMinMax() const;
  
  Standard_EXPORT     Standard_Boolean WithCutting() const;
  
  Standard_EXPORT     Standard_Real Tolerance() const;
  
  Standard_EXPORT     Standard_Integer NbIterations() const;
  
  Standard_EXPORT     void Dump(Standard_OStream& o) const;
  
  Standard_EXPORT     Standard_Boolean SetConstraints(const Handle(AppParCurves_HArray1OfConstraintCouple)& aConstrainst) ;
  
  Standard_EXPORT     void SetParameters(const Handle(TColStd_HArray1OfReal)& param) ;
  
  Standard_EXPORT     Standard_Boolean SetKnots(const Handle(TColStd_HArray1OfReal)& knots) ;
  
  Standard_EXPORT     Standard_Boolean SetMaxDegree(const Standard_Integer Degree) ;
  
  Standard_EXPORT     Standard_Boolean SetMaxSegment(const Standard_Integer NbSegment) ;
  
  Standard_EXPORT     Standard_Boolean SetContinuity(const GeomAbs_Shape C) ;
  
  Standard_EXPORT     void SetWithMinMax(const Standard_Boolean MinMax) ;
  
  Standard_EXPORT     Standard_Boolean SetWithCutting(const Standard_Boolean Cutting) ;
  
  Standard_EXPORT     void SetCriteriumWeight(const Standard_Real Percent1,const Standard_Real Percent2,const Standard_Real Percent3) ;
  
  Standard_EXPORT     void SetCriteriumWeight(const Standard_Integer Order,const Standard_Real Percent) ;
  
  Standard_EXPORT     void SetTolerance(const Standard_Real Tol) ;
  
  Standard_EXPORT     void SetNbIterations(const Standard_Integer Iter) ;





protected:





private:

  
  Standard_EXPORT     void TheMotor(Handle(AppParCurves_SmoothCriterion)& J,const Standard_Real WQuadratic,const Standard_Real WQuality,Handle(FEmTool_Curve)& TheCurve,TColStd_Array1OfReal& Ecarts) ;
  
  Standard_EXPORT     void Adjusting(Handle(AppParCurves_SmoothCriterion)& J,Standard_Real& WQuadratic,Standard_Real& WQuality,Handle(FEmTool_Curve)& TheCurve,TColStd_Array1OfReal& Ecarts) ;
  
  Standard_EXPORT     void Optimization(Handle(AppParCurves_SmoothCriterion)& J,FEmTool_Assembly& A,const Standard_Boolean ToAssemble,const Standard_Real EpsDeg,Handle(FEmTool_Curve)& Curve,const TColStd_Array1OfReal& Parameters) const;
  
  Standard_EXPORT     void Project(const Handle(FEmTool_Curve)& C,const TColStd_Array1OfReal& Ti,TColStd_Array1OfReal& ProjTi,TColStd_Array1OfReal& Distance,Standard_Integer& NumPoints,Standard_Real& MaxErr,Standard_Real& QuaErr,Standard_Real& AveErr,const Standard_Integer NbIterations = 2) const;
  
  Standard_EXPORT     void ACR(Handle(FEmTool_Curve)& Curve,TColStd_Array1OfReal& Ti,const Standard_Integer Decima) const;
  
  Standard_EXPORT     void SplitCurve(const Handle(FEmTool_Curve)& InCurve,const TColStd_Array1OfReal& Ti,const Standard_Real CurveTol,Handle(FEmTool_Curve)& OutCurve,Standard_Boolean& iscut) const;
  
  Standard_EXPORT     void Init() ;
  
  Standard_EXPORT     void InitSmoothCriterion() ;
  
  Standard_EXPORT     void InitParameters(Standard_Real& Length) ;
  
  Standard_EXPORT     void InitCriterionEstimations(const Standard_Real Length,Standard_Real& J1,Standard_Real& J2,Standard_Real& J3) const;
  
  Standard_EXPORT     void EstTangent(const Standard_Integer ipnt,math_Vector& VTang) const;
  
  Standard_EXPORT     void EstSecnd(const Standard_Integer ipnt,const math_Vector& VTang1,const math_Vector& VTang2,const Standard_Real Length,math_Vector& VScnd) const;
  
  Standard_EXPORT     void InitCutting(const Handle(PLib_Base)& aBase,const Standard_Real CurvTol,Handle(FEmTool_Curve)& aCurve) const;
  
  Standard_EXPORT     void AssemblingConstraints(const Handle(FEmTool_Curve)& Curve,const TColStd_Array1OfReal& Parameters,const Standard_Real CBLONG,FEmTool_Assembly& A) const;
  
  Standard_EXPORT     Standard_Boolean InitTthetaF(const Standard_Integer ndimen,const AppParCurves_Constraint typcon,const Standard_Integer begin,const Standard_Integer jndex) ;


AppDef_MultiLine mySSP;
Standard_Integer myNbP3d;
Standard_Integer myNbP2d;
Standard_Integer myDimension;
Standard_Integer myFirstPoint;
Standard_Integer myLastPoint;
Standard_Integer myNbPoints;
Handle_TColStd_HArray1OfReal myTabPoints;
Handle_AppParCurves_HArray1OfConstraintCouple myConstraints;
Standard_Integer myNbConstraints;
Handle_TColStd_HArray1OfReal myTabConstraints;
Standard_Integer myNbPassPoints;
Standard_Integer myNbTangPoints;
Standard_Integer myNbCurvPoints;
Handle_TColStd_HArray1OfInteger myTypConstraints;
Handle_TColStd_HArray1OfReal myTtheta;
Handle_TColStd_HArray1OfReal myTfthet;
Standard_Integer myMaxDegree;
Standard_Integer myMaxSegment;
Standard_Integer myNbIterations;
Standard_Real myTolerance;
GeomAbs_Shape myContinuity;
Standard_Integer myNivCont;
Standard_Boolean myWithMinMax;
Standard_Boolean myWithCutting;
Standard_Real myPercent[3];
Standard_Real myCriterium[4];
Handle_AppParCurves_SmoothCriterion mySmoothCriterion;
Handle_TColStd_HArray1OfReal myParameters;
Handle_TColStd_HArray1OfReal myKnots;
AppParCurves_MultiBSpCurve myMBSpCurve;
Standard_Real myMaxError;
Standard_Integer myMaxErrorIndex;
Standard_Real myAverageError;
Standard_Boolean myIsCreated;
Standard_Boolean myIsDone;
Standard_Boolean myIsOverConstr;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif