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_MakeTrimmedCone_HeaderFile
18 #define _GC_MakeTrimmedCone_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GC_Root.hxx>
25 #include <Geom_RectangularTrimmedSurface.hxx>
27 class StdFail_NotDone;
31 //! Implements construction algorithms for a trimmed
32 //! cone limited by two planes orthogonal to its axis. The
33 //! result is a Geom_RectangularTrimmedSurface surface.
34 //! A MakeTrimmedCone provides a framework for:
35 //! - defining the construction of the trimmed cone,
36 //! - implementing the construction algorithm, and
37 //! - consulting the results. In particular, the Value
38 //! function returns the constructed trimmed cone.
39 class GC_MakeTrimmedCone : public GC_Root
46 //! Make a RectangularTrimmedSurface <TheCone> from Geom
47 //! It is trimmed by P3 and P4.
48 //! Its axis is <P1P2> and the radius of its base is
49 //! the distance between <P3> and <P1P2>.
50 //! The distance between <P4> and <P1P2> is the radius of
51 //! the section passing through <P4>.
52 //! An error iss raised if <P1>,<P2>,<P3>,<P4> are
53 //! colinear or if <P3P4> is perpendicular to <P1P2> or
54 //! <P3P4> is colinear to <P1P2>.
55 Standard_EXPORT GC_MakeTrimmedCone(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const gp_Pnt& P4);
57 //! Make a RectangularTrimmedSurface from Geom <TheCone>
58 //! from a cone and trimmed by two points P1 and P2 and
59 //! the two radius <R1> and <R2> of the sections passing
60 //! through <P1> an <P2>.
62 //! If an error occurs (that is, when IsDone returns
63 //! false), the Status function returns:
64 //! - gce_ConfusedPoints if points P1 and P2, or P3 and P4, are coincident;
65 //! - gce_NullAngle if:
66 //! - the lines joining P1 to P2 and P3 to P4 are parallel, or
67 //! - R1 and R2 are equal (i.e. their difference is less than gp::Resolution());
68 //! - gce_NullRadius if:
69 //! - the line joining P1 to P2 is perpendicular to the line joining P3 to P4, or
70 //! - the points P1, P2, P3 and P4 are collinear;
71 //! - gce_NegativeRadius if R1 or R2 is negative; or
72 //! - gce_NullAxis if points P1 and P2 are coincident (2nd syntax only).
73 Standard_EXPORT GC_MakeTrimmedCone(const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real R1, const Standard_Real R2);
75 //! Returns the constructed trimmed cone.
76 //! StdFail_NotDone if no trimmed cone is constructed.
77 Standard_EXPORT const Handle(Geom_RectangularTrimmedSurface)& Value() const;
79 operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
80 operator const Handle(Geom_Surface)& () const { return Value(); }
83 Handle(Geom_RectangularTrimmedSurface) TheCone;
86 #endif // _GC_MakeTrimmedCone_HeaderFile