0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / GC / GC_MakeTrimmedCylinder.hxx
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
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 _GC_MakeTrimmedCylinder_HeaderFile
18 #define _GC_MakeTrimmedCylinder_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <GC_Root.hxx>
25 #include <Geom_RectangularTrimmedSurface.hxx>
26
27 class StdFail_NotDone;
28 class gp_Pnt;
29 class gp_Circ;
30 class gp_Ax1;
31 class gp_Cylinder;
32
33
34 //! Implements construction algorithms for a trimmed
35 //! cylinder limited by two planes orthogonal to its axis.
36 //! The result is a Geom_RectangularTrimmedSurface surface.
37 //! A MakeTrimmedCylinder provides a framework for:
38 //! -   defining the construction of the trimmed cylinder,
39 //! -   implementing the construction algorithm, and
40 //! -   consulting the results. In particular, the Value
41 //! function returns the constructed trimmed cylinder.
42 class GC_MakeTrimmedCylinder  : public GC_Root
43 {
44 public:
45
46   DEFINE_STANDARD_ALLOC
47
48   
49   //! Make a cylindricalSurface <Cyl> from Geom
50   //! Its axis is is <P1P2> and its radius is the distance
51   //! between <P3> and <P1P2>.
52   //! The height is the distance between P1 and P2.
53   Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
54   
55   //! Make a cylindricalSurface <Cyl> from gp by its base <Circ>.
56   //! Its axis is the normal to the plane defined bi <Circ>.
57   //! <Height> can be greater than zero or lower than zero.
58   //! In the first case the V parametric direction of the
59   //! result has the same orientation as the normal to <Circ>.
60   //! In the other case it has the opposite orientation.
61   Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Circ& Circ, const Standard_Real Height);
62   
63   //! Make a cylindricalSurface <Cyl> from gp by its
64   //! axis <A1> and its radius <Radius>.
65   //! It returns NullObject if <Radius> is lower than zero.
66   //! <Height> can be greater than zero or lower than zero.
67   //! In the first case the V parametric direction of the
68   //! result has the same orientation as <A1>.
69   //! In the other case it has the opposite orientation.
70   Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Ax1& A1, const Standard_Real Radius, const Standard_Real Height);
71   
72   //! Returns the constructed trimmed cylinder.
73   //! Exceptions
74   //! StdFail_NotDone if no trimmed cylinder is constructed.
75   Standard_EXPORT const Handle(Geom_RectangularTrimmedSurface)& Value() const;
76
77   operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
78
79 private:
80   Handle(Geom_RectangularTrimmedSurface) TheCyl;
81 };
82
83 #endif // _GC_MakeTrimmedCylinder_HeaderFile