0027111: Add generalized copy constructor in handle class for old compilers
[occt.git] / src / GC / GC_MakeTrimmedCylinder.hxx
CommitLineData
42cf5bc1 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>
d1a67b9d 25#include <Geom_RectangularTrimmedSurface.hxx>
26
42cf5bc1 27class StdFail_NotDone;
28class gp_Pnt;
29class gp_Circ;
30class gp_Ax1;
31class 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.
42class GC_MakeTrimmedCylinder : public GC_Root
43{
44public:
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 //! Make a RectangularTrimmedSurface <Cylinder> from gp by
73 //! a cylinder from gp.
74 //! It is trimmed by the point <P> and the heigh <Heigh>.
75 //! <Height> can be greater than zero or lower than zero.
76 //! in the first case the limit section is in the side of
77 //! the positives V paramters of <Cyl> and in the other
78 //! side if <Heigh> is lower than zero.
79 Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Cylinder& Cyl, const gp_Pnt& P, const Standard_Real Height);
80
81 //! Make a RectangularTrimmedSurface <Cylinder> from gp by
82 //! a cylinder from gp.
83 //! It is trimmed by the two points <P1> and <P2>.
84 //! Warning
85 //! If an error occurs (that is, when IsDone returns
86 //! false), the Status function returns:
87 //! - gce_NegativeRadius if Radius is less than 0.0, or
88 //! - gce_ConfusedPoints if the points P1 and P2 are coincident.
89 //! - gce_ColinearPoints if the points P1, P2 and P3 are collinear.
90 Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Cylinder& Cyl, const gp_Pnt& P1, const gp_Pnt& P2);
91
92 //! Returns the constructed trimmed cylinder.
93 //! Exceptions
94 //! StdFail_NotDone if no trimmed cylinder is constructed.
95 Standard_EXPORT const Handle(Geom_RectangularTrimmedSurface)& Value() const;
42cf5bc1 96
d1a67b9d 97 operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
42cf5bc1 98
99private:
42cf5bc1 100 Handle(Geom_RectangularTrimmedSurface) TheCyl;
42cf5bc1 101};
102
42cf5bc1 103#endif // _GC_MakeTrimmedCylinder_HeaderFile