Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:31

0001 // Created on: 1992-09-28
0002 // Created by: Remi GILET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _GC_MakeTrimmedCone_HeaderFile
0018 #define _GC_MakeTrimmedCone_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GC_Root.hxx>
0025 #include <Geom_RectangularTrimmedSurface.hxx>
0026 
0027 class gp_Pnt;
0028 
0029 
0030 //! Implements construction algorithms for a trimmed
0031 //! cone limited by two planes orthogonal to its axis. The
0032 //! result is a Geom_RectangularTrimmedSurface surface.
0033 //! A MakeTrimmedCone provides a framework for:
0034 //! -   defining the construction of the trimmed cone,
0035 //! -   implementing the construction algorithm, and
0036 //! -   consulting the results. In particular, the Value
0037 //! function returns the constructed trimmed cone.
0038 class GC_MakeTrimmedCone  : public GC_Root
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045   //! Make a RectangularTrimmedSurface <TheCone> from Geom
0046   //! It is trimmed by P3 and P4.
0047   //! Its axis is <P1P2> and the radius of its base is
0048   //! the distance between <P3> and <P1P2>.
0049   //! The distance between <P4> and <P1P2> is the radius of
0050   //! the section passing through <P4>.
0051   //! An error iss raised if <P1>,<P2>,<P3>,<P4> are
0052   //! colinear or if <P3P4> is perpendicular to <P1P2> or
0053   //! <P3P4> is colinear to <P1P2>.
0054   Standard_EXPORT GC_MakeTrimmedCone(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const gp_Pnt& P4);
0055   
0056   //! Make a RectangularTrimmedSurface from Geom <TheCone>
0057   //! from a cone and trimmed by two points P1 and P2 and
0058   //! the two radius <R1> and <R2> of the sections passing
0059   //! through <P1> an <P2>.
0060   //! Warning
0061   //! If an error occurs (that is, when IsDone returns
0062   //! false), the Status function returns:
0063   //! -   gce_ConfusedPoints if points P1 and P2, or P3 and P4, are coincident;
0064   //! -   gce_NullAngle if:
0065   //! -   the lines joining P1 to P2 and P3 to P4 are parallel, or
0066   //! -   R1 and R2 are equal (i.e. their difference is less than gp::Resolution());
0067   //! -   gce_NullRadius if:
0068   //! -   the line joining P1 to P2 is perpendicular to the line joining P3 to P4, or
0069   //! -   the points P1, P2, P3 and P4 are collinear;
0070   //! -   gce_NegativeRadius if R1 or R2 is negative; or
0071   //! -   gce_NullAxis if points P1 and P2 are coincident (2nd syntax only).
0072   Standard_EXPORT GC_MakeTrimmedCone(const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real R1, const Standard_Real R2);
0073   
0074   //! Returns the constructed trimmed cone.
0075   //! StdFail_NotDone if no trimmed cone is constructed.
0076   Standard_EXPORT const Handle(Geom_RectangularTrimmedSurface)& Value() const;
0077 
0078   operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
0079 
0080 private:
0081   Handle(Geom_RectangularTrimmedSurface) TheCone;
0082 };
0083 
0084 #endif // _GC_MakeTrimmedCone_HeaderFile