1 // Created on: 1992-09-28
2 // Created by: Remi GILET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GC_MakeConicalSurface_HeaderFile
18 #define _GC_MakeConicalSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GC_Root.hxx>
25 #include <Geom_ConicalSurface.hxx>
27 class StdFail_NotDone;
35 //! This class implements the following algorithms used
36 //! to create a ConicalSurface from Geom.
37 //! * Create a ConicalSurface parallel to another and passing
39 //! * Create a ConicalSurface parallel to another at a distance
41 //! * Create a ConicalSurface by 4 points.
42 //! * Create a ConicalSurface by its axis and 2 points.
43 //! * Create a ConicalSurface by 2 points and 2 radius.
44 //! The local coordinate system of the ConicalSurface is defined
45 //! with an axis placement (see class ElementarySurface).
47 //! The "ZAxis" is the symmetry axis of the ConicalSurface,
48 //! it gives the direction of increasing parametric value V.
49 //! The apex of the surface is on the negative side of this axis.
51 //! The parametrization range is :
52 //! U [0, 2*PI], V ]-infinite, + infinite[
54 //! The "XAxis" and the "YAxis" define the placement plane of the
55 //! surface (Z = 0, and parametric value V = 0) perpendicular to
56 //! the symmetry axis. The "XAxis" defines the origin of the
57 //! parameter U = 0. The trigonometric sense gives the positive
58 //! orientation for the parameter U.
60 //! When you create a ConicalSurface the U and V directions of
61 //! parametrization are such that at each point of the surface the
62 //! normal is oriented towards the "outside region".
63 class GC_MakeConicalSurface : public GC_Root
71 //! A2 defines the local coordinate system of the conical surface.
72 //! Ang is the conical surface semi-angle ]0, PI/2[.
73 //! Radius is the radius of the circle Viso in the placement plane
74 //! of the conical surface defined with "XAxis" and "YAxis".
75 //! The "ZDirection" of A2 defines the direction of the surface's
77 //! If the location point of A2 is the apex of the surface
79 //! At the creation the parametrization of the surface is defined
80 //! such that the normal Vector (N = D1U ^ D1V) is oriented towards
81 //! the "outside region" of the surface.
82 //! Status is "NegativeRadius" if Radius < 0.0 or "BadAngle" if
83 //! Ang < Resolution from gp or Ang >= PI/ - Resolution
84 Standard_EXPORT GC_MakeConicalSurface(const gp_Ax2& A2, const Standard_Real Ang, const Standard_Real Radius);
86 //! Creates a ConicalSurface from a non persistent Cone from package gp.
87 Standard_EXPORT GC_MakeConicalSurface(const gp_Cone& C);
89 //! Make a ConicalSurface from Geom <TheCone> passing through 3
90 //! Pnt <P1>,<P2>,<P3>.
91 //! Its axis is <P1P2> and the radius of its base is
92 //! the distance between <P3> and <P1P2>.
93 //! The distance between <P4> and <P1P2> is the radius of
94 //! the section passing through <P4>.
95 //! An error iss raised if <P1>,<P2>,<P3>,<P4> are
96 //! colinear or if <P3P4> is perpendicular to <P1P2> or
97 //! <P3P4> is colinear to <P1P2>.
98 Standard_EXPORT GC_MakeConicalSurface(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const gp_Pnt& P4);
100 //! Make a ConicalSurface with two points and two radius.
101 //! The axis of the solution is the line passing through
103 //! <R1> is the radius of the section passing through <P1>
104 //! and <R2> the radius of the section passing through <P2>.
105 Standard_EXPORT GC_MakeConicalSurface(const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real R1, const Standard_Real R2);
107 //! Returns the constructed cone.
109 //! StdFail_NotDone if no cone is constructed.
110 Standard_EXPORT const Handle(Geom_ConicalSurface)& Value() const;
112 operator const Handle(Geom_ConicalSurface)& () const { return Value(); }
115 Handle(Geom_ConicalSurface) TheCone;
118 #endif // _GC_MakeConicalSurface_HeaderFile