0028966: Coding Rules - remove Adaptor2d_HCurve2d, Adaptor3d_HCurve and Adaptor3d_HSu...
[occt.git] / src / GeomPlate / GeomPlate_CurveConstraint.hxx
CommitLineData
42cf5bc1 1// Created on: 1997-05-05
2// Created by: Joelle CHAUVET
3// Copyright (c) 1997-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 _GeomPlate_CurveConstraint_HeaderFile
18#define _GeomPlate_CurveConstraint_HeaderFile
19
c22b52d6 20#include <Adaptor3d_CurveOnSurface.hxx>
42cf5bc1 21#include <GeomLProp_SLProps.hxx>
c22b52d6 22
42cf5bc1 23class Geom2d_Curve;
42cf5bc1 24class Law_Function;
25class Standard_ConstructionError;
26class GeomLProp_SLProps;
27class gp_Pnt;
28class gp_Vec;
29
42cf5bc1 30class GeomPlate_CurveConstraint;
25e59720 31DEFINE_STANDARD_HANDLE(GeomPlate_CurveConstraint, Standard_Transient)
42cf5bc1 32
33
34//! Defines curves as constraints to be used to deform a surface.
25e59720 35class GeomPlate_CurveConstraint : public Standard_Transient
42cf5bc1 36{
37
38public:
39
40
41
42 //! Initializes an empty curve constraint object.
43 Standard_EXPORT GeomPlate_CurveConstraint();
44
45 //! Create a constraint
46 //! Order is the order of the constraint. The possible values for order are -1,0,1,2.
47 //! Order i means constraints Gi
48 //! Npt is the number of points associated with the constraint.
49 //! TolDist is the maximum error to satisfy for G0 constraints
50 //! TolAng is the maximum error to satisfy for G1 constraints
51 //! TolCurv is the maximum error to satisfy for G2 constraints
52 //! These errors can be replaced by laws of criterion.
53 //! Raises ConstructionError if Order is not -1 , 0, 1, 2
c22b52d6 54 Standard_EXPORT GeomPlate_CurveConstraint(const Handle(Adaptor3d_Curve)& Boundary, const Standard_Integer Order, const Standard_Integer NPt = 10, const Standard_Real TolDist = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1);
42cf5bc1 55
56 //! Allows you to set the order of continuity required for
57 //! the constraints: G0, G1, and G2, controlled
58 //! respectively by G0Criterion G1Criterion and G2Criterion.
59 Standard_EXPORT void SetOrder (const Standard_Integer Order);
60
61 //! Returns the order of constraint, one of G0, G1 or G2.
62 Standard_EXPORT Standard_Integer Order() const;
63
64 //! Returns the number of points on the curve used as a
65 //! constraint. The default setting is 10. This parameter
66 //! affects computation time, which increases by the cube of
67 //! the number of points.
68 Standard_EXPORT Standard_Integer NbPoints() const;
69
70
71 //! Allows you to set the number of points on the curve
72 //! constraint. The default setting is 10. This parameter
73 //! affects computation time, which increases by the cube of
74 //! the number of points.
75 Standard_EXPORT void SetNbPoints (const Standard_Integer NewNb);
76
77
78 //! Allows you to set the G0 criterion. This is the law
79 //! defining the greatest distance allowed between the
80 //! constraint and the target surface for each point of the
81 //! constraint. If this criterion is not set, TolDist, the
82 //! distance tolerance from the constructor, is used.
83 Standard_EXPORT void SetG0Criterion (const Handle(Law_Function)& G0Crit);
84
85
86 //! Allows you to set the G1 criterion. This is the law
87 //! defining the greatest angle allowed between the
88 //! constraint and the target surface. If this criterion is not
89 //! set, TolAng, the angular tolerance from the constructor, is used.
90 //! Raises ConstructionError if the curve is not on a surface
91 Standard_EXPORT void SetG1Criterion (const Handle(Law_Function)& G1Crit);
92
93 Standard_EXPORT void SetG2Criterion (const Handle(Law_Function)& G2Crit);
94
95 //! Returns the G0 criterion at the parametric point U on
96 //! the curve. This is the greatest distance allowed between
97 //! the constraint and the target surface at U.
98 Standard_EXPORT Standard_Real G0Criterion (const Standard_Real U) const;
99
100 //! Returns the G1 criterion at the parametric point U on
101 //! the curve. This is the greatest angle allowed between
102 //! the constraint and the target surface at U.
103 //! Raises ConstructionError if the curve is not on a surface
104 Standard_EXPORT Standard_Real G1Criterion (const Standard_Real U) const;
105
106 //! Returns the G2 criterion at the parametric point U on
107 //! the curve. This is the greatest difference in curvature
108 //! allowed between the constraint and the target surface at U.
109 //! Raises ConstructionError if the curve is not on a surface
110 Standard_EXPORT Standard_Real G2Criterion (const Standard_Real U) const;
111
112 Standard_EXPORT Standard_Real FirstParameter() const;
113
114 Standard_EXPORT Standard_Real LastParameter() const;
115
116 Standard_EXPORT Standard_Real Length() const;
117
118 Standard_EXPORT GeomLProp_SLProps& LPropSurf (const Standard_Real U);
119
120 Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt& P) const;
121
122 Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const;
123
124 Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3, gp_Vec& V4, gp_Vec& V5) const;
125
c22b52d6 126 Standard_EXPORT Handle(Adaptor3d_Curve) Curve3d() const;
42cf5bc1 127
128 //! loads a 2d curve associated the surface resulting of the constraints
129 Standard_EXPORT void SetCurve2dOnSurf (const Handle(Geom2d_Curve)& Curve2d);
130
131 //! Returns a 2d curve associated the surface resulting of the constraints
132 Standard_EXPORT Handle(Geom2d_Curve) Curve2dOnSurf() const;
133
134 //! loads a 2d curve resulting from the normal projection of
135 //! the curve on the initial surface
c22b52d6 136 Standard_EXPORT void SetProjectedCurve (const Handle(Adaptor2d_Curve2d)& Curve2d, const Standard_Real TolU, const Standard_Real TolV);
42cf5bc1 137
138 //! Returns the projected curve resulting from the normal projection of the
139 //! curve on the initial surface
c22b52d6 140 Standard_EXPORT Handle(Adaptor2d_Curve2d) ProjectedCurve() const;
42cf5bc1 141
142
143
144
25e59720 145 DEFINE_STANDARD_RTTIEXT(GeomPlate_CurveConstraint,Standard_Transient)
42cf5bc1 146
147protected:
148
149
c22b52d6 150 Handle(Adaptor3d_CurveOnSurface) myFrontiere;
42cf5bc1 151 Standard_Integer myNbPoints;
152 Standard_Integer myOrder;
c22b52d6 153 Handle(Adaptor3d_Curve) my3dCurve;
42cf5bc1 154 Standard_Integer myTang;
155 Handle(Geom2d_Curve) my2dCurve;
c22b52d6 156 Handle(Adaptor2d_Curve2d) myHCurve2d;
42cf5bc1 157 Handle(Law_Function) myG0Crit;
158 Handle(Law_Function) myG1Crit;
159 Handle(Law_Function) myG2Crit;
160 Standard_Boolean myConstG0;
161 Standard_Boolean myConstG1;
162 Standard_Boolean myConstG2;
163 GeomLProp_SLProps myLProp;
164 Standard_Real myTolDist;
165 Standard_Real myTolAng;
166 Standard_Real myTolCurv;
167 Standard_Real myTolU;
168 Standard_Real myTolV;
169
42cf5bc1 170};
171
42cf5bc1 172#endif // _GeomPlate_CurveConstraint_HeaderFile