Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-10-12
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-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 _BRepPrimAPI_MakeRevol_HeaderFile
0018 #define _BRepPrimAPI_MakeRevol_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepSweep_Revol.hxx>
0025 #include <TopTools_ListOfShape.hxx>
0026 #include <BRepPrimAPI_MakeSweep.hxx>
0027 #include <BRepTools_History.hxx>
0028 class TopoDS_Shape;
0029 class gp_Ax1;
0030 
0031 
0032 //! Class to make revolved sweep topologies.
0033 //!
0034 //! a revolved sweep is defined by :
0035 //!
0036 //! * A basis topology which is swept.
0037 //!
0038 //! The   basis topology  must   not  contain solids
0039 //! (neither composite solids.).
0040 //!
0041 //! The basis topology  may be copied  or  shared in
0042 //! the result.
0043 //!
0044 //! * A rotation axis and angle :
0045 //!
0046 //! - The axis is an Ax1 from gp.
0047 //!
0048 //! - The angle is in [0, 2*Pi].
0049 //!
0050 //! - The angle default value is 2*Pi.
0051 //!
0052 //! The result is a topology with a higher dimension :
0053 //!
0054 //! - Vertex -> Edge.
0055 //! - Edge   -> Face.
0056 //! - Wire   -> Shell.
0057 //! - Face   -> Solid.
0058 //! - Shell  -> CompSolid.
0059 //!
0060 //! Sweeping a Compound sweeps  the elements  of the
0061 //! compound  and creates    a  compound with    the
0062 //! results.
0063 class BRepPrimAPI_MakeRevol  : public BRepPrimAPI_MakeSweep
0064 {
0065 public:
0066 
0067   DEFINE_STANDARD_ALLOC
0068   
0069   //! Builds the Revol of base S, axis  A and angle  D. If C
0070   //! is true, S is copied.
0071   Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Real D, const Standard_Boolean Copy = Standard_False);
0072   
0073   //! Builds the Revol of base S, axis  A and angle 2*Pi. If
0074   //! C is true, S is copied.
0075   Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Boolean Copy = Standard_False);
0076   
0077   //! Returns the internal sweeping algorithm.
0078   Standard_EXPORT const BRepSweep_Revol& Revol() const;
0079   
0080   //! Builds the resulting shape (redefined from MakeShape).
0081   Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0082   
0083   //! Returns the first shape of the revol  (coinciding with
0084   //! the generating shape).
0085   Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
0086   
0087   //! Returns the TopoDS Shape of the end of the revol.
0088   Standard_EXPORT TopoDS_Shape LastShape() Standard_OVERRIDE;
0089   
0090   //! Returns list of shape generated from shape S
0091   //! Warning: shape S must be shape of type VERTEX, EDGE, FACE, SOLID.
0092   //! For shapes of other types method always returns empty list
0093   Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
0094 
0095   //! Returns true if the shape S has been deleted.
0096   Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE;
0097 
0098   
0099   //! Returns the TopoDS Shape of the beginning of the revolution,
0100   //! generated with theShape  (subShape of the generating shape).
0101   Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& theShape);
0102   
0103   //! Returns the TopoDS Shape of the end of the revolution,
0104   //! generated with  theShape (subShape of the  generating shape).
0105   Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& theShape);
0106   
0107   //! Check if there are degenerated edges in the result.
0108   Standard_EXPORT Standard_Boolean HasDegenerated() const;
0109 
0110   //! Returns the list of degenerated edges
0111   Standard_EXPORT const TopTools_ListOfShape& Degenerated() const;
0112 
0113 protected:
0114 
0115   //! Checks possibilities of producing self-intersection surface
0116   //! returns true if all surfaces are valid
0117   Standard_EXPORT Standard_Boolean CheckValidity(const TopoDS_Shape& theShape, const gp_Ax1& theA);
0118 
0119 private:
0120 
0121 
0122 
0123   BRepSweep_Revol myRevol;
0124   TopTools_ListOfShape myDegenerated;
0125   Handle(BRepTools_History) myHist;
0126   Standard_Boolean myIsBuild;
0127 
0128 
0129 };
0130 
0131 
0132 
0133 
0134 
0135 
0136 
0137 #endif // _BRepPrimAPI_MakeRevol_HeaderFile