Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:15:30

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 //! Implements construction algorithms for trimmed cones.
0030 //! The result is a `Geom_RectangularTrimmedSurface`.
0031 //! A MakeTrimmedCone provides a framework for:
0032 //! -   defining the construction of the trimmed cone,
0033 //! -   implementing the construction algorithm, and
0034 //! -   consulting the results. In particular, the Value
0035 //! function returns the constructed trimmed cone.
0036 class GC_MakeTrimmedCone : public GC_Root
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Creates a rectangular trimmed conical surface from four points.
0042   //! @param[in] theP1 first axis point
0043   //! @param[in] theP2 second axis point
0044   //! @param[in] theP3 point defining first trimming section
0045   //! @param[in] theP4 point defining second trimming section
0046   //! @note The surface is trimmed by points P3 and P4.
0047   //! @note The axis is defined by points P1 and P2; the base radius is
0048   //!       the distance from point P3 to that axis.
0049   //! @note The distance from point P4 to that axis is the radius of
0050   //!       the section passing through P4.
0051   //! @note Construction fails if points P1, P2, P3 and P4 are
0052   //!       collinear, or if vector P3P4 is perpendicular/collinear
0053   //!       to vector P1P2.
0054   Standard_EXPORT GC_MakeTrimmedCone(const gp_Pnt& theP1,
0055                                      const gp_Pnt& theP2,
0056                                      const gp_Pnt& theP3,
0057                                      const gp_Pnt& theP4);
0058 
0059   //! Creates a rectangular trimmed conical surface from two points and two radii.
0060   //! @param[in] theP1 first axis point
0061   //! @param[in] theP2 second axis point
0062   //! @param[in] theR1 radius at P1
0063   //! @param[in] theR2 radius at P2
0064   //! @note The two radii correspond to sections passing through the two axis points.
0065   //! @note On failure, status is propagated from
0066   //!       `GC_MakeConicalSurface(theP1, theP2, theR1, theR2)`.
0067   Standard_EXPORT GC_MakeTrimmedCone(const gp_Pnt& theP1,
0068                                      const gp_Pnt& theP2,
0069                                      const double  theR1,
0070                                      const double  theR2);
0071 
0072   //! Returns the constructed trimmed cone.
0073   //! StdFail_NotDone if no trimmed cone is constructed.
0074   //! @return resulting trimmed conical surface
0075   Standard_EXPORT const occ::handle<Geom_RectangularTrimmedSurface>& Value() const;
0076 
0077   //! Conversion operator returning the constructed object.
0078   //! @return resulting object
0079   operator const occ::handle<Geom_RectangularTrimmedSurface>&() const { return Value(); }
0080 
0081 private:
0082   occ::handle<Geom_RectangularTrimmedSurface> TheCone;
0083 };
0084 
0085 #endif // _GC_MakeTrimmedCone_HeaderFile