b311480e |
1 | -- Created on: 1992-08-26 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class MakePln from gce inherits Root from gce |
18 | |
19 | ---Purpose : This class implements the following algorithms used |
ff8178ef |
20 | -- to create a Plane from gp. |
7fd59977 |
21 | -- * Create a Pln parallel to another and passing |
22 | -- through a point. |
23 | -- * Create a Pln passing through 3 points. |
24 | -- * Create a Pln by its normal. |
25 | -- Defines a non-persistent plane. |
26 | -- The plane is located in 3D space with an axis placement |
27 | -- two axis. It is the local coordinate system of the plane. |
28 | -- |
29 | -- The "Location" point and the main direction of this axis |
30 | -- placement define the "Axis" of the plane. It is the axis |
31 | -- normal to the plane which gives the orientation of the |
32 | -- plane. |
33 | -- |
34 | -- The "XDirection" and the "YDirection" of the axis |
35 | -- placement define the plane ("XAxis" and "YAxis") . |
36 | |
37 | uses Pnt from gp, |
38 | Pln from gp, |
39 | Ax1 from gp, |
40 | Ax2 from gp, |
41 | Dir from gp, |
42 | Real from Standard |
43 | |
44 | raises NotDone from StdFail |
45 | |
46 | is |
47 | |
48 | Create (A2 : Ax2 from gp) returns MakePln; |
49 | --- Purpose : |
50 | -- The coordinate system of the plane is defined with the axis |
51 | -- placement A2. |
52 | -- The "Direction" of A2 defines the normal to the plane. |
53 | -- The "Location" of A2 defines the location (origin) of the plane. |
54 | -- The "XDirection" and "YDirection" of A2 define the "XAxis" and |
55 | -- the "YAxis" of the plane used to parametrize the plane. |
56 | |
57 | |
58 | Create (P : Pnt from gp; |
59 | V : Dir from gp) returns MakePln; |
60 | --- Purpose : |
61 | -- Creates a plane with the "Location" point <P> |
62 | -- and the normal direction <V>. |
63 | |
64 | Create (A, B, C, D : Real from Standard) returns MakePln; |
65 | --- Purpose : |
66 | -- Creates a plane from its cartesian equation : |
67 | -- A * X + B * Y + C * Z + D = 0.0 |
68 | --- Purpose : |
69 | -- the status is "BadEquation" if Sqrt (A*A + B*B + C*C) <= |
70 | -- Resolution from gp. |
71 | |
72 | Create(Pln : Pln from gp; |
73 | Point : Pnt from gp) returns MakePln; |
74 | ---Purpose : Make a Pln from gp <ThePln> parallel to another |
75 | -- Pln <Pln> and passing through a Pnt <Point>. |
76 | |
77 | Create(Pln : Pln from gp ; |
78 | Dist : Real from Standard) returns MakePln; |
79 | ---Purpose : Make a Pln from gp <ThePln> parallel to another |
80 | -- Pln <Pln> at the distance <Dist> which can be greater |
81 | -- or less than zero. |
82 | -- In the first case the result is at the distance |
83 | -- <Dist> to the plane <Pln> in the direction of the |
84 | -- normal to <Pln>. |
85 | -- Otherwize it is in the opposite direction. |
86 | |
87 | Create(P1 : Pnt from gp; |
88 | P2 : Pnt from gp; |
89 | P3 : Pnt from gp) returns MakePln; |
90 | ---Purpose : Make a Pln from gp <ThePln> passing through 3 |
91 | -- Pnt <P1>,<P2>,<P3>. |
92 | -- It returns false if <P1> <P2> <P3> are confused. |
93 | |
94 | Create(P1 : Pnt from gp; |
95 | P2 : Pnt from gp) returns MakePln; |
96 | ---Purpose : Make a Pln from gp <ThePln> perpendicular to the line |
97 | -- passing through <P1>,<P2>. |
98 | -- The status is "ConfusedPoints" if <P1> <P2> are confused. |
99 | |
100 | Create(Axis : Ax1 from gp) returns MakePln; |
101 | ---Purpose: Make a pln passing through the location of <Axis>and |
102 | -- normal to the Direction of <Axis>. |
103 | -- Warning - If an error occurs (that is, when IsDone returns |
104 | -- false), the Status function returns: |
105 | -- - gce_BadEquation if Sqrt(A*A + B*B + |
106 | -- C*C) is less than or equal to gp::Resolution(), |
107 | -- - gce_ConfusedPoints if P1 and P2 are coincident, or |
108 | -- - gce_ColinearPoints if P1, P2 and P3 are collinear. |
109 | |
110 | Value(me) returns Pln from gp |
111 | raises NotDone |
112 | is static; |
113 | ---C++: return const& |
114 | ---Purpose: Returns the constructed plane. |
115 | -- Exceptions StdFail_NotDone if no plane is constructed. |
116 | |
117 | Operator(me) returns Pln from gp |
118 | is static; |
119 | ---C++: return const& |
120 | ---C++: alias "Standard_EXPORT operator gp_Pln() const;" |
121 | |
122 | fields |
123 | |
124 | ThePln : Pln from gp; |
125 | --The solution from gp. |
126 | |
127 | end MakePln; |
128 | |