0030731: Modeling Data - B-Spline should have explicit data check error messages
[occt.git] / src / Geom / Geom_Plane.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-03-10
2// Created by: JCV
3// Copyright (c) 1993-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 _Geom_Plane_HeaderFile
18#define _Geom_Plane_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Geom_ElementarySurface.hxx>
24#include <Standard_Real.hxx>
25#include <Standard_Boolean.hxx>
26#include <Standard_Integer.hxx>
27class Standard_ConstructionError;
28class Standard_RangeError;
29class gp_Ax3;
30class gp_Pln;
31class gp_Pnt;
32class gp_Dir;
33class gp_Trsf;
34class gp_GTrsf2d;
35class Geom_Curve;
36class gp_Vec;
37class Geom_Geometry;
38
39
40class Geom_Plane;
41DEFINE_STANDARD_HANDLE(Geom_Plane, Geom_ElementarySurface)
42
43//! Describes a plane in 3D space.
44//! A plane is positioned in space by a coordinate system
45//! (a gp_Ax3 object) such that the plane is defined by
46//! the origin, "X Direction" and "Y Direction" of this
47//! coordinate system.
48//! This coordinate system is the "local coordinate
49//! system" of the plane. The following apply:
50//! - Its "X Direction" and "Y Direction" are respectively
51//! the u and v parametric directions of the plane.
52//! - Its origin is the origin of the u and v parameters
53//! (also called the "origin" of the plane).
54//! - Its "main Direction" is a vector normal to the plane.
55//! This normal vector gives the orientation of the
56//! plane only if the local coordinate system is "direct".
57//! (The orientation of the plane is always defined by
58//! the "X Direction" and the "Y Direction" of its local
59//! coordinate system.)
60//! The parametric equation of the plane is:
61//! P(u, v) = O + u*XDir + v*YDir
62//! where O, XDir and YDir are respectively the
63//! origin, the "X Direction" and the "Y Direction" of the
64//! local coordinate system of the plane.
65//! The parametric range of the two parameters u and v
66//! is ] -infinity, +infinity [.
67class Geom_Plane : public Geom_ElementarySurface
68{
69
70public:
71
72
73
74 //! Creates a plane located in 3D space with an axis placement
75 //! three axis. The "ZDirection" of "A3" is the direction normal
76 //! to the plane. The "Location" point of "A3" is the origin of
77 //! the plane. The "XDirection" and "YDirection" of "A3" define
78 //! the directions of the U isoparametric and V isoparametric
79 //! curves.
80 Standard_EXPORT Geom_Plane(const gp_Ax3& A3);
81
82
83 //! Creates a plane from a non transient plane from package gp.
84 Standard_EXPORT Geom_Plane(const gp_Pln& Pl);
85
86
87 //! P is the "Location" point or origin of the plane.
88 //! V is the direction normal to the plane.
89 Standard_EXPORT Geom_Plane(const gp_Pnt& P, const gp_Dir& V);
90
91
92 //! Creates a plane from its cartesian equation :
93 //! Ax + By + Cz + D = 0.0
94 //!
95 //! Raised if Sqrt (A*A + B*B + C*C) <= Resolution from gp
96 Standard_EXPORT Geom_Plane(const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D);
97
98
99 //! Set <me> so that <me> has the same geometric properties as Pl.
100 Standard_EXPORT void SetPln (const gp_Pln& Pl);
101
102 //! Converts this plane into a gp_Pln plane.
103 Standard_EXPORT gp_Pln Pln() const;
104
105
106 //! Changes the orientation of this plane in the u (or v)
107 //! parametric direction. The bounds of the plane are not
108 //! changed but the given parametric direction is
109 //! reversed. Hence the orientation of the surface is reversed.
110 Standard_EXPORT virtual void UReverse() Standard_OVERRIDE;
111
112 //! Computes the u parameter on the modified
113 //! plane, produced when reversing the u
114 //! parametric of this plane, for any point of u parameter U on this plane.
115 //! In the case of a plane, these methods return - -U.
79104795 116 Standard_EXPORT Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
42cf5bc1 117
118
119 //! Changes the orientation of this plane in the u (or v)
120 //! parametric direction. The bounds of the plane are not
121 //! changed but the given parametric direction is
122 //! reversed. Hence the orientation of the surface is reversed.
123 Standard_EXPORT virtual void VReverse() Standard_OVERRIDE;
124
125 //! Computes the v parameter on the modified
126 //! plane, produced when reversing the v
127 //! parametric of this plane, for any point of v parameter V on this plane.
128 //! In the case of a plane, these methods return -V.
79104795 129 Standard_EXPORT Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE;
42cf5bc1 130
131 //! Computes the parameters on the transformed surface for
132 //! the transform of the point of parameters U,V on <me>.
133 //! me->Transformed(T)->Value(U',V')
134 //! is the same point as
135 //! me->Value(U,V).Transformed(T)
136 //! Where U',V' are the new values of U,V after calling
137 //! me->TranformParameters(U,V,T)
138 //! This methods multiplies U and V by T.ScaleFactor()
139 Standard_EXPORT virtual void TransformParameters (Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const Standard_OVERRIDE;
140
141 //! Returns a 2d transformation used to find the new
142 //! parameters of a point on the transformed surface.
143 //! me->Transformed(T)->Value(U',V')
144 //! is the same point as
145 //! me->Value(U,V).Transformed(T)
146 //! Where U',V' are obtained by transforming U,V with
147 //! th 2d transformation returned by
148 //! me->ParametricTransformation(T)
149 //! This methods returns a scale centered on the
150 //! origin with T.ScaleFactor
151 Standard_EXPORT virtual gp_GTrsf2d ParametricTransformation (const gp_Trsf& T) const Standard_OVERRIDE;
152
153 //! Returns the parametric bounds U1, U2, V1 and V2 of this plane.
154 //! Because a plane is an infinite surface, the following is always true:
155 //! - U1 = V1 = Standard_Real::RealFirst()
156 //! - U2 = V2 = Standard_Real::RealLast().
79104795 157 Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const Standard_OVERRIDE;
42cf5bc1 158
159
160 //! Computes the normalized coefficients of the plane's
161 //! cartesian equation : Ax + By + Cz + D = 0.0
162 Standard_EXPORT void Coefficients (Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D) const;
163
164 //! return False
79104795 165 Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE;
42cf5bc1 166
167 //! return False
79104795 168 Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
42cf5bc1 169
170 //! return False.
79104795 171 Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
42cf5bc1 172
173 //! return False.
79104795 174 Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
42cf5bc1 175
176
177 //! Computes the U isoparametric curve.
178 //! This is a Line parallel to the YAxis of the plane.
79104795 179 Standard_EXPORT Handle(Geom_Curve) UIso (const Standard_Real U) const Standard_OVERRIDE;
42cf5bc1 180
181
182 //! Computes the V isoparametric curve.
183 //! This is a Line parallel to the XAxis of the plane.
79104795 184 Standard_EXPORT Handle(Geom_Curve) VIso (const Standard_Real V) const Standard_OVERRIDE;
42cf5bc1 185
186
187 //! Computes the point P (U, V) on <me>.
188 //! P = O + U * XDir + V * YDir.
189 //! where O is the "Location" point of the plane, XDir the
190 //! "XDirection" and YDir the "YDirection" of the plane's local
191 //! coordinate system.
79104795 192 Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
42cf5bc1 193
194
195 //! Computes the current point and the first derivatives in the
196 //! directions U and V.
79104795 197 Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
42cf5bc1 198
199
200 //! Computes the current point, the first and the second
201 //! derivatives in the directions U and V.
79104795 202 Standard_EXPORT void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const Standard_OVERRIDE;
42cf5bc1 203
204
205 //! Computes the current point, the first,the second and the
206 //! third derivatives in the directions U and V.
79104795 207 Standard_EXPORT void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const Standard_OVERRIDE;
42cf5bc1 208
209
210 //! Computes the derivative of order Nu in the direction u
211 //! and Nv in the direction v.
212 //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
79104795 213 Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const Standard_OVERRIDE;
42cf5bc1 214
215 //! Applies the transformation T to this plane.
79104795 216 Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
42cf5bc1 217
218 //! Creates a new object which is a copy of this plane.
79104795 219 Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
42cf5bc1 220
221
222
223
92efcf78 224 DEFINE_STANDARD_RTTIEXT(Geom_Plane,Geom_ElementarySurface)
42cf5bc1 225
226protected:
227
228
229
230
231private:
232
233
234
235
236};
237
238
239
240
241
242
243
244#endif // _Geom_Plane_HeaderFile