File indexing completed on 2025-01-18 10:02:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _AppDef_Variational_HeaderFile
0018 #define _AppDef_Variational_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <AppDef_MultiLine.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
0027 #include <GeomAbs_Shape.hxx>
0028 #include <AppParCurves_MultiBSpCurve.hxx>
0029 #include <Standard_OStream.hxx>
0030 #include <TColStd_Array1OfReal.hxx>
0031 #include <math_Vector.hxx>
0032 #include <AppParCurves_Constraint.hxx>
0033 class AppDef_SmoothCriterion;
0034 class math_Matrix;
0035 class FEmTool_Curve;
0036 class FEmTool_Assembly;
0037 class PLib_Base;
0038
0039
0040
0041
0042
0043
0044
0045 class AppDef_Variational
0046 {
0047 public:
0048
0049 DEFINE_STANDARD_ALLOC
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 Standard_EXPORT AppDef_Variational(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);
0066
0067
0068 Standard_EXPORT void Approximate();
0069
0070
0071
0072 Standard_EXPORT Standard_Boolean IsCreated() const;
0073
0074
0075
0076 Standard_EXPORT Standard_Boolean IsDone() const;
0077
0078
0079
0080 Standard_EXPORT Standard_Boolean IsOverConstrained() const;
0081
0082
0083
0084 Standard_EXPORT AppParCurves_MultiBSpCurve Value() const;
0085
0086
0087
0088
0089 Standard_EXPORT Standard_Real MaxError() const;
0090
0091
0092 Standard_EXPORT Standard_Integer MaxErrorIndex() const;
0093
0094
0095
0096
0097 Standard_EXPORT Standard_Real QuadraticError() const;
0098
0099
0100
0101 Standard_EXPORT void Distance (math_Matrix& mat);
0102
0103
0104
0105 Standard_EXPORT Standard_Real AverageError() const;
0106
0107
0108 Standard_EXPORT const Handle(TColStd_HArray1OfReal)& Parameters() const;
0109
0110
0111 Standard_EXPORT const Handle(TColStd_HArray1OfReal)& Knots() const;
0112
0113
0114 Standard_EXPORT void Criterium (Standard_Real& VFirstOrder, Standard_Real& VSecondOrder, Standard_Real& VThirdOrder) const;
0115
0116
0117
0118 Standard_EXPORT void CriteriumWeight (Standard_Real& Percent1, Standard_Real& Percent2, Standard_Real& Percent3) const;
0119
0120
0121 Standard_EXPORT Standard_Integer MaxDegree() const;
0122
0123
0124 Standard_EXPORT Standard_Integer MaxSegment() const;
0125
0126
0127 Standard_EXPORT GeomAbs_Shape Continuity() const;
0128
0129
0130
0131 Standard_EXPORT Standard_Boolean WithMinMax() const;
0132
0133
0134 Standard_EXPORT Standard_Boolean WithCutting() const;
0135
0136
0137 Standard_EXPORT Standard_Real Tolerance() const;
0138
0139
0140 Standard_EXPORT Standard_Integer NbIterations() const;
0141
0142
0143
0144
0145
0146 Standard_EXPORT void Dump (Standard_OStream& o) const;
0147
0148
0149
0150
0151 Standard_EXPORT Standard_Boolean SetConstraints (const Handle(AppParCurves_HArray1OfConstraintCouple)& aConstrainst);
0152
0153
0154 Standard_EXPORT void SetParameters (const Handle(TColStd_HArray1OfReal)& param);
0155
0156
0157
0158
0159 Standard_EXPORT Standard_Boolean SetKnots (const Handle(TColStd_HArray1OfReal)& knots);
0160
0161
0162
0163
0164 Standard_EXPORT Standard_Boolean SetMaxDegree (const Standard_Integer Degree);
0165
0166
0167
0168
0169 Standard_EXPORT Standard_Boolean SetMaxSegment (const Standard_Integer NbSegment);
0170
0171
0172
0173
0174 Standard_EXPORT Standard_Boolean SetContinuity (const GeomAbs_Shape C);
0175
0176
0177
0178 Standard_EXPORT void SetWithMinMax (const Standard_Boolean MinMax);
0179
0180
0181
0182
0183 Standard_EXPORT Standard_Boolean SetWithCutting (const Standard_Boolean Cutting);
0184
0185
0186
0187
0188
0189 Standard_EXPORT void SetCriteriumWeight (const Standard_Real Percent1, const Standard_Real Percent2, const Standard_Real Percent3);
0190
0191
0192
0193
0194
0195
0196 Standard_EXPORT void SetCriteriumWeight (const Standard_Integer Order, const Standard_Real Percent);
0197
0198
0199 Standard_EXPORT void SetTolerance (const Standard_Real Tol);
0200
0201
0202
0203 Standard_EXPORT void SetNbIterations (const Standard_Integer Iter);
0204
0205
0206
0207
0208 protected:
0209
0210
0211
0212
0213
0214 private:
0215
0216
0217 Standard_EXPORT void TheMotor (Handle(AppDef_SmoothCriterion)& J, const Standard_Real WQuadratic, const Standard_Real WQuality, Handle(FEmTool_Curve)& TheCurve, TColStd_Array1OfReal& Ecarts);
0218
0219 Standard_EXPORT void Adjusting (Handle(AppDef_SmoothCriterion)& J, Standard_Real& WQuadratic, Standard_Real& WQuality, Handle(FEmTool_Curve)& TheCurve, TColStd_Array1OfReal& Ecarts);
0220
0221 Standard_EXPORT void Optimization (Handle(AppDef_SmoothCriterion)& J, FEmTool_Assembly& A, const Standard_Boolean ToAssemble, const Standard_Real EpsDeg, Handle(FEmTool_Curve)& Curve, const TColStd_Array1OfReal& Parameters) const;
0222
0223 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;
0224
0225 Standard_EXPORT void ACR (Handle(FEmTool_Curve)& Curve, TColStd_Array1OfReal& Ti, const Standard_Integer Decima) const;
0226
0227 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;
0228
0229 Standard_EXPORT void Init();
0230
0231 Standard_EXPORT void InitSmoothCriterion();
0232
0233 Standard_EXPORT void InitParameters (Standard_Real& Length);
0234
0235 Standard_EXPORT void InitCriterionEstimations (const Standard_Real Length, Standard_Real& J1, Standard_Real& J2, Standard_Real& J3) const;
0236
0237 Standard_EXPORT void EstTangent (const Standard_Integer ipnt, math_Vector& VTang) const;
0238
0239 Standard_EXPORT void EstSecnd (const Standard_Integer ipnt, const math_Vector& VTang1, const math_Vector& VTang2, const Standard_Real Length, math_Vector& VScnd) const;
0240
0241 Standard_EXPORT void InitCutting (const Handle(PLib_Base)& aBase, const Standard_Real CurvTol, Handle(FEmTool_Curve)& aCurve) const;
0242
0243 Standard_EXPORT void AssemblingConstraints (const Handle(FEmTool_Curve)& Curve, const TColStd_Array1OfReal& Parameters, const Standard_Real CBLONG, FEmTool_Assembly& A) const;
0244
0245 Standard_EXPORT Standard_Boolean InitTthetaF (const Standard_Integer ndimen, const AppParCurves_Constraint typcon, const Standard_Integer begin, const Standard_Integer jndex);
0246
0247
0248 AppDef_MultiLine mySSP;
0249 Standard_Integer myNbP3d;
0250 Standard_Integer myNbP2d;
0251 Standard_Integer myDimension;
0252 Standard_Integer myFirstPoint;
0253 Standard_Integer myLastPoint;
0254 Standard_Integer myNbPoints;
0255 Handle(TColStd_HArray1OfReal) myTabPoints;
0256 Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
0257 Standard_Integer myNbConstraints;
0258 Handle(TColStd_HArray1OfReal) myTabConstraints;
0259 Standard_Integer myNbPassPoints;
0260 Standard_Integer myNbTangPoints;
0261 Standard_Integer myNbCurvPoints;
0262 Handle(TColStd_HArray1OfInteger) myTypConstraints;
0263 Handle(TColStd_HArray1OfReal) myTtheta;
0264 Handle(TColStd_HArray1OfReal) myTfthet;
0265 Standard_Integer myMaxDegree;
0266 Standard_Integer myMaxSegment;
0267 Standard_Integer myNbIterations;
0268 Standard_Real myTolerance;
0269 GeomAbs_Shape myContinuity;
0270 Standard_Integer myNivCont;
0271 Standard_Boolean myWithMinMax;
0272 Standard_Boolean myWithCutting;
0273 Standard_Real myPercent[3];
0274 Standard_Real myCriterium[4];
0275 Handle(AppDef_SmoothCriterion) mySmoothCriterion;
0276 Handle(TColStd_HArray1OfReal) myParameters;
0277 Handle(TColStd_HArray1OfReal) myKnots;
0278 AppParCurves_MultiBSpCurve myMBSpCurve;
0279 Standard_Real myMaxError;
0280 Standard_Integer myMaxErrorIndex;
0281 Standard_Real myAverageError;
0282 Standard_Boolean myIsCreated;
0283 Standard_Boolean myIsDone;
0284 Standard_Boolean myIsOverConstr;
0285
0286
0287 };
0288
0289
0290
0291
0292
0293
0294
0295 #endif