Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:17:08

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_MakeTrimmedCylinder_HeaderFile
0018 #define _GC_MakeTrimmedCylinder_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 class gp_Circ;
0029 class gp_Ax1;
0030 
0031 //! Implements construction algorithms for trimmed cylinders.
0032 //! The result is a `Geom_RectangularTrimmedSurface`.
0033 //! A MakeTrimmedCylinder provides a framework for:
0034 //! -   defining the construction of the trimmed cylinder,
0035 //! -   implementing the construction algorithm, and
0036 //! -   consulting the results. In particular, the Value
0037 //! function returns the constructed trimmed cylinder.
0038 class GC_MakeTrimmedCylinder : public GC_Root
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   //! Creates a trimmed cylindrical surface from three points.
0044   //! @param[in] theP1 first axis point
0045   //! @param[in] theP2 second axis point
0046   //! @param[in] theP3 point defining radius
0047   //! @note The axis is the line passing through `theP1` and `theP2`.
0048   //! @note The radius is the distance from `theP3` to that axis.
0049   //! @note The height is the distance between `theP1` and `theP2`.
0050   Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Pnt& theP1,
0051                                          const gp_Pnt& theP2,
0052                                          const gp_Pnt& theP3);
0053 
0054   //! Creates a trimmed cylindrical surface from a base circle and height.
0055   //! @param[in] theCirc base circle
0056   //! @param[in] theHeight trimming height
0057   //! @note The axis is the normal to the plane defined by `theCirc`.
0058   //! @note `theHeight` can be positive or negative.
0059   //! @note If `theHeight` is positive, the V parametric direction of
0060   //!       result has the same orientation as the normal to `theCirc`.
0061   //! @note If `theHeight` is negative, it has the opposite orientation.
0062   Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Circ& theCirc, const double theHeight);
0063 
0064   //! Creates a trimmed cylindrical surface from axis, radius and height.
0065   //! @param[in] theA1 cylinder axis
0066   //! @param[in] theRadius cylinder radius
0067   //! @param[in] theHeight trimming height
0068   //! @note Status is `gce_NegativeRadius` if `theRadius` is less than zero.
0069   //! @note `theHeight` can be positive or negative.
0070   //! @note If `theHeight` is positive, the V parametric direction of
0071   //!       result has the same orientation as `theA1`.
0072   //! @note If `theHeight` is negative, it has the opposite orientation.
0073   Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Ax1& theA1,
0074                                          const double  theRadius,
0075                                          const double  theHeight);
0076 
0077   //! Returns the constructed trimmed cylinder.
0078   //! Exceptions
0079   //! StdFail_NotDone if no trimmed cylinder is constructed.
0080   //! @return resulting trimmed cylindrical surface
0081   Standard_EXPORT const occ::handle<Geom_RectangularTrimmedSurface>& Value() const;
0082 
0083   //! Conversion operator returning the constructed object.
0084   //! @return resulting object
0085   operator const occ::handle<Geom_RectangularTrimmedSurface>&() const { return Value(); }
0086 
0087 private:
0088   occ::handle<Geom_RectangularTrimmedSurface> TheCyl;
0089 };
0090 
0091 #endif // _GC_MakeTrimmedCylinder_HeaderFile