1 -- Created on: 1997-05-05
2 -- Created by: Jerome LEMONIER
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 class PointConstraint from GeomPlate inherits TShared from MMgt
23 -- Defines points as constraints to be used to deform a surface.
29 SLProps from GeomLProp
32 ConstructionError from Standard
35 Create (Pt : Pnt from gp;
36 Order: Integer from Standard ;
37 TolDist : Real from Standard = 0.0001)
38 returns PointConstraint from GeomPlate
39 raises ConstructionError from Standard;
40 ---Purpose: Constructs a point constraint object defined by Pt, a 3D point
41 -- Order gives the order of constraint, one of:
42 -- - -1 i.e. none, or 0 i.e.G0 when assigned to Pt
43 -- - -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when
44 -- assigned to U, V and Surf.
45 -- In this constructor, only TolDist is given.
46 -- Distance tolerance represents the greatest distance
47 -- allowed between the constraint and the target surface.
48 -- Angular tolerance represents the largest angle allowed
49 -- between the constraint and the target surface. Curvature
50 -- tolerance represents the greatest difference in curvature
51 -- allowed between the constraint and the target surface.
52 -- Raises ConstructionError if Order is not 0 or -1
54 Create (U,V : Real from Standard;
55 Surf : Surface from Geom;
56 Order: Integer from Standard;
57 TolDist : Real from Standard=0.0001;
58 TolAng : Real from Standard=0.01;
59 TolCurv: Real from Standard=0.1)
60 returns PointConstraint from GeomPlate;
62 ---Purpose: Constructs a point constraint object defined by
63 -- the intersection point of U and V on the surface Surf.
64 -- Order gives the order of constraint, one of:
65 -- - -1 i.e. none, or 0 i.e.G0 when assigned to Pt
66 -- - -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when
67 -- assigned to U, V and Surf.
68 -- In this constructor the surface to be generated must
69 -- respect several tolerance values only:
70 -- - the distance tolerance TolDist
71 -- - the angular tolerance TolAng
72 -- - the curvature tolerance, TolCurv.
73 -- Distance tolerance represents the greatest distance
74 -- allowed between the constraint and the target surface.
75 -- Angular tolerance represents the largest angle allowed
76 -- between the constraint and the target surface. Curvature
77 -- tolerance represents the greatest difference in curvature
78 -- allowed between the constraint and the target surface.Creates a punctual constraint.
80 SetOrder(me : mutable ; Order: Integer from Standard);
82 Order(me) returns Integer from Standard;
84 -- Returns the order of constraint: G0, G1, and G2,
85 -- controlled respectively by G0Criterion G1Criterion and G2Criterion.
87 SetG0Criterion(me : mutable; TolDist : Real from Standard) ;
89 -- Allows you to set the G0 criterion. This is the law
90 -- defining the greatest distance allowed between the
91 -- constraint and the target surface. If this criterion is not
92 -- set, {TolDist, the distance tolerance from the constructor, is used
94 SetG1Criterion(me : mutable; TolAng : Real from Standard)
95 raises ConstructionError from Standard;
97 -- Allows you to set the G1 criterion. This is the law
98 -- defining the greatest angle allowed between the
99 -- constraint and the target surface. If this criterion is not
100 -- set, TolAng, the angular tolerance from the constructor, is used.
101 -- Raises ConstructionError if the point is not on the surface
103 SetG2Criterion(me : mutable; TolCurv : Real from Standard)
104 raises ConstructionError from Standard;
106 -- Allows you to set the G2 criterion. This is the law
107 -- defining the greatest difference in curvature allowed
108 -- between the constraint and the target surface. If this
109 -- criterion is not set, TolCurv, the curvature tolerance from
110 -- the constructor, is used.
111 -- Raises ConstructionError if the point is not on the surface
113 G0Criterion(me) returns Real from Standard ;
115 -- Returns the G0 criterion. This is the greatest distance
116 -- allowed between the constraint and the target surface.
118 G1Criterion(me) returns Real from Standard
119 raises ConstructionError from Standard;
121 -- Returns the G1 criterion. This is the greatest angle
122 -- allowed between the constraint and the target surface.
123 -- Raises ConstructionError if the point is not on the surface.
125 G2Criterion(me) returns Real from Standard
126 raises ConstructionError from Standard;
128 -- Returns the G2 criterion. This is the greatest difference
129 -- in curvature allowed between the constraint and the target surface.
130 -- Raises ConstructionError if the point is not on the surface
132 D0(me ;P : out Pnt) ;
134 D1(me ;P : out Pnt; V1, V2 : out Vec )
135 raises ConstructionError from Standard;
136 --if the point is not on the surface
138 D2(me ;P : out Pnt; V1, V2 , V3, V4, V5 : out Vec)
139 raises ConstructionError from Standard;
140 --if the point is not on the surface
143 HasPnt2dOnSurf(me) returns Boolean;
145 SetPnt2dOnSurf(me : mutable; Pnt :Pnt2d from gp);
147 Pnt2dOnSurf (me) returns Pnt2d from gp;
149 LPropSurf (me : mutable)
151 returns SLProps from GeomLProp
152 raises ConstructionError;
153 --if the curve is not on a surface
157 myLProp : SLProps from GeomLProp;
158 myPoint : Pnt from gp;
159 myPt2d : Pnt2d from gp;
160 mySurf : Surface from Geom;
166 myU : Real from Standard;
167 myV : Real from Standard;
168 myTolDist : Real from Standard;
169 myTolAng : Real from Standard;
170 myTolCurv : Real from Standard;
171 myOrder : Integer from Standard is protected;
172 hasPnt2dOnSurf : Boolean;