0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
[occt.git] / src / gce / gce_MakeCone.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-08-26
2// Created by: Remi GILET
3// Copyright (c) 1992-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 _gce_MakeCone_HeaderFile
18#define _gce_MakeCone_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <gp_Cone.hxx>
25#include <gce_Root.hxx>
26#include <Standard_Real.hxx>
27class StdFail_NotDone;
28class gp_Ax2;
29class gp_Cone;
30class gp_Pnt;
31class gp_Ax1;
32class gp_Lin;
33
34
35//! This class implements the following algorithms used
36//! to create a Cone from gp.
37//! * Create a Cone coaxial to another and passing
38//! through a point.
39//! * Create a Cone coaxial to another at a distance
40//! <Dist>.
41//! * Create a Cone by 4 points.
42//! * Create a Cone by its axis and 2 points.
43//! * Create a Cone by 2 points and 2 radius.
44//! * Create a Cone by an Ax2 an angle and the radius of
45//! its reference section.
46class gce_MakeCone : public gce_Root
47{
48public:
49
50 DEFINE_STANDARD_ALLOC
51
52
53
54 //! Creates an infinite conical surface. A2 locates the cone
55 //! in the space and defines the reference plane of the surface.
56 //! Ang is the conical surface semi-angle between 0 and PI/2 radians.
57 //! Radius is the radius of the circle in the reference plane of
58 //! the cone.
59 //! If Radius is lower than 0.0 the status is "
60 //! If Ang < Resolution from gp or Ang >= (PI/2) - Resolution.
61 Standard_EXPORT gce_MakeCone(const gp_Ax2& A2, const Standard_Real Ang, const Standard_Real Radius);
62
63 //! Makes a Cone from gp <TheCone> coaxial to another
64 //! Cone <Cone> and passing through a Pnt <Point>.
65 Standard_EXPORT gce_MakeCone(const gp_Cone& Cone, const gp_Pnt& Point);
66
67 //! Makes a Cone from gp <TheCone> coaxial to another
68 //! Cone <Cone> at the distance <Dist> which can
69 //! be greater or lower than zero.
70 Standard_EXPORT gce_MakeCone(const gp_Cone& Cone, const Standard_Real Dist);
71
72 //! Makes a Cone from gp <TheCone> by four points <P1>,
73 //! <P2>,<P3> and <P4>.
74 //! Its axis is <P1P2> and the radius of its base is
75 //! the distance between <P3> and <P1P2>.
76 //! The distance between <P4> and <P1P2> is the radius of
77 //! the section passing through <P4>.
78 //! If <P1> and <P2> are confused or <P3> and <P4> are
79 //! confused we have the status "ConfusedPoints"
80 //! if <P1>,<P2>,<P3>,<P4> are colinear we have the
81 //! status "ColinearPoints"
82 //! If <P3P4> is perpendicular to <P1P2> we have the
83 //! status "NullAngle".
84 //! <P3P4> is colinear to <P1P2> we have the status
85 //! "NullAngle".
86 Standard_EXPORT gce_MakeCone(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const gp_Pnt& P4);
87
23fe70ec 88 //! Makes a Cone by its axis <Axis> and two points.
42cf5bc1 89 //! The distance between <P1> and the axis is the radius
90 //! of the section passing through <P1>.
91 //! The distance between <P2> and the axis is the radius
92 //! of the section passing through <P2>.
93 //! If <P1P2> is colinear to <Axis> we have the status
94 //! "NullAngle"
95 //! If <P3P4> is perpendicular to <Axis> we have the status
96 //! "NullAngle"
97 //! If <P1> and <P2> are confused we have the status
98 //! "ConfusedPoints"
99 Standard_EXPORT gce_MakeCone(const gp_Ax1& Axis, const gp_Pnt& P1, const gp_Pnt& P2);
100
23fe70ec 101 //! Makes a Cone by its axis <Axis> and two points.
42cf5bc1 102 //! The distance between <P1> and the axis is the radius
103 //! of the section passing through <P1>
104 //! The distance between <P2> and the axis is the radius
105 //! of the section passing through <P2>
106 //! If <P1P2> is colinear to <Axis> we have the status
107 //! "NullAngle"
108 //! If <P3P4> is perpendicular to <Axis> we have the status
109 //! "NullAngle"
110 //! If <P1> and <P2> are confused we have the status
111 //! "ConfusedPoints"
112 Standard_EXPORT gce_MakeCone(const gp_Lin& Axis, const gp_Pnt& P1, const gp_Pnt& P2);
113
114 //! Makes a Cone with two points and two radius.
115 //! The axis of the solution is the line passing through
116 //! <P1> and <P2>.
117 //! <R1> is the radius of the section passing through <P1>
118 //! and <R2> the radius of the section passing through <P2>.
119 //! If <P1> and <P2> are confused we have the status "NullAxis".
120 //! Warning
121 //! If an error occurs (that is, when IsDone returns
122 //! false), the Status function returns:
123 //! - gce_NegativeRadius if Radius, R1 or R2 is less than 0.0;
124 //! - gce_BadAngle if Ang is less than
125 //! gp::Resolution() or greater than Pi/2.- gp::Resolution();
126 //! - gce_ConfusedPoints if P1 and P2 or P3 and P4 are coincident;
127 //! - gce_NullAxis if the points P1 and P2, are coincident (5th syntax only);
128 //! - gce_NullAngle if:
129 //! - the vector joining P1 to P2 is parallel to either
130 //! Axis or the line joining P3 to P4, or
131 //! - R1 and R2 are equal, (that is, their difference is
132 //! less than gp::Resolution()); or
133 //! - gce_NullRadius if:
134 //! - the vector joining P1 to P2 is perpendicular to the line joining P3 to P4,
135 //! - the vector joining P1 to P2 is perpendicular to Axis, or
136 //! - P1, P2, P3, and P4 are collinear.
137 Standard_EXPORT gce_MakeCone(const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real R1, const Standard_Real R2);
138
139 //! Returns the constructed cone.
140 //! Exceptions StdFail_NotDone if no cone is constructed.
141 Standard_EXPORT const gp_Cone& Value() const;
142
143 Standard_EXPORT const gp_Cone& Operator() const;
144Standard_EXPORT operator gp_Cone() const;
145
146
147
148
149protected:
150
151
152
153
154
155private:
156
157
158
159 gp_Cone TheCone;
160
161
162};
163
164
165
166
167
168
169
170#endif // _gce_MakeCone_HeaderFile