Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 09:13:59

0001 // Created on: 1993-02-15
0002 // Created by: Laurent BOURESCHE
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 _BRepSweep_Rotation_HeaderFile
0018 #define _BRepSweep_Rotation_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Ax1.hxx>
0025 #include <BRepSweep_Trsf.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <TopAbs_Orientation.hxx>
0028 class TopoDS_Shape;
0029 class Sweep_NumShape;
0030 class TopLoc_Location;
0031 
0032 //! Provides an algorithm to build object by
0033 //! Rotation sweep.
0034 class BRepSweep_Rotation : public BRepSweep_Trsf
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Creates a topology by rotating <S> around A with the
0040   //! angle D.
0041   Standard_EXPORT BRepSweep_Rotation(const TopoDS_Shape&    S,
0042                                      const Sweep_NumShape&  N,
0043                                      const TopLoc_Location& L,
0044                                      const gp_Ax1&          A,
0045                                      const double           D,
0046                                      const bool             C);
0047 
0048   //! Builds the vertex addressed by [aGenV,aDirV], with its
0049   //! geometric part, but without subcomponents.
0050   Standard_EXPORT TopoDS_Shape MakeEmptyVertex(const TopoDS_Shape&   aGenV,
0051                                                const Sweep_NumShape& aDirV) override;
0052 
0053   //! Builds the edge addressed by [aGenV,aDirE], with its
0054   //! geometric part, but without subcomponents.
0055   Standard_EXPORT TopoDS_Shape MakeEmptyDirectingEdge(const TopoDS_Shape&   aGenV,
0056                                                       const Sweep_NumShape& aDirE) override;
0057 
0058   //! Builds the edge addressed by [aGenE,aDirV], with its
0059   //! geometric part, but without subcomponents.
0060   Standard_EXPORT TopoDS_Shape MakeEmptyGeneratingEdge(const TopoDS_Shape&   aGenE,
0061                                                        const Sweep_NumShape& aDirV) override;
0062 
0063   //! Sets the parameters of the new vertex on the new
0064   //! face. The new face and new vertex where generated
0065   //! from aGenF, aGenV and aDirV .
0066   Standard_EXPORT void SetParameters(const TopoDS_Shape&   aNewFace,
0067                                      TopoDS_Shape&         aNewVertex,
0068                                      const TopoDS_Shape&   aGenF,
0069                                      const TopoDS_Shape&   aGenV,
0070                                      const Sweep_NumShape& aDirV) override;
0071 
0072   //! Sets the parameter of the new vertex on the new
0073   //! edge. The new edge and new vertex where generated
0074   //! from aGenV aDirE, and aDirV.
0075   Standard_EXPORT void SetDirectingParameter(const TopoDS_Shape&   aNewEdge,
0076                                              TopoDS_Shape&         aNewVertex,
0077                                              const TopoDS_Shape&   aGenV,
0078                                              const Sweep_NumShape& aDirE,
0079                                              const Sweep_NumShape& aDirV) override;
0080 
0081   //! Sets the parameter of the new vertex on the new
0082   //! edge. The new edge and new vertex where generated
0083   //! from aGenE, aGenV and aDirV .
0084   Standard_EXPORT void SetGeneratingParameter(const TopoDS_Shape&   aNewEdge,
0085                                               TopoDS_Shape&         aNewVertex,
0086                                               const TopoDS_Shape&   aGenE,
0087                                               const TopoDS_Shape&   aGenV,
0088                                               const Sweep_NumShape& aDirV) override;
0089 
0090   //! Builds the face addressed by [aGenS,aDirS], with
0091   //! its geometric part, but without subcomponents. The
0092   //! couple aGenS, aDirS can be a "generating face and
0093   //! a directing vertex" or "a generating edge and a
0094   //! directing edge".
0095   Standard_EXPORT TopoDS_Shape MakeEmptyFace(const TopoDS_Shape&   aGenS,
0096                                              const Sweep_NumShape& aDirS) override;
0097 
0098   //! Sets the PCurve for a new edge on a new face. The
0099   //! new edge and the new face were generated using
0100   //! aGenF, aGenE and aDirV.
0101   Standard_EXPORT void SetPCurve(const TopoDS_Shape&      aNewFace,
0102                                  TopoDS_Shape&            aNewEdge,
0103                                  const TopoDS_Shape&      aGenF,
0104                                  const TopoDS_Shape&      aGenE,
0105                                  const Sweep_NumShape&    aDirV,
0106                                  const TopAbs_Orientation orien) override;
0107 
0108   //! Sets the PCurve for a new edge on a new face. The
0109   //! new edge and the new face were generated using
0110   //! aGenE, aDirE and aDirV.
0111   Standard_EXPORT void SetGeneratingPCurve(const TopoDS_Shape&      aNewFace,
0112                                            TopoDS_Shape&            aNewEdge,
0113                                            const TopoDS_Shape&      aGenE,
0114                                            const Sweep_NumShape&    aDirE,
0115                                            const Sweep_NumShape&    aDirV,
0116                                            const TopAbs_Orientation orien) override;
0117 
0118   //! Sets the PCurve for a new edge on a new face. The
0119   //! new edge and the new face were generated using
0120   //! aGenE, aDirE and aGenV.
0121   Standard_EXPORT void SetDirectingPCurve(const TopoDS_Shape&      aNewFace,
0122                                           TopoDS_Shape&            aNewEdge,
0123                                           const TopoDS_Shape&      aGenE,
0124                                           const TopoDS_Shape&      aGenV,
0125                                           const Sweep_NumShape&    aDirE,
0126                                           const TopAbs_Orientation orien) override;
0127 
0128   //! Returns the Orientation of the shell in the solid
0129   //! generated by the face aGenS with the edge aDirS.
0130   //! It is REVERSED if the surface is swept in the
0131   //! direction of the normal.
0132   Standard_EXPORT TopAbs_Orientation DirectSolid(const TopoDS_Shape&   aGenS,
0133                                                  const Sweep_NumShape& aDirS) override;
0134 
0135   //! Returns true if aNewSubShape (addressed by
0136   //! aSubGenS and aDirS) must be added in aNewShape
0137   //! (addressed by aGenS and aDirS).
0138   Standard_EXPORT bool GGDShapeIsToAdd(const TopoDS_Shape&   aNewShape,
0139                                        const TopoDS_Shape&   aNewSubShape,
0140                                        const TopoDS_Shape&   aGenS,
0141                                        const TopoDS_Shape&   aSubGenS,
0142                                        const Sweep_NumShape& aDirS) const override;
0143 
0144   //! Returns true if aNewSubShape (addressed by
0145   //! aGenS and aSubDirS) must be added in aNewShape
0146   //! (addressed by aGenS and aDirS).
0147   Standard_EXPORT bool GDDShapeIsToAdd(const TopoDS_Shape&   aNewShape,
0148                                        const TopoDS_Shape&   aNewSubShape,
0149                                        const TopoDS_Shape&   aGenS,
0150                                        const Sweep_NumShape& aDirS,
0151                                        const Sweep_NumShape& aSubDirS) const override;
0152 
0153   //! In some particular cases the topology of a
0154   //! generated face must be composed of independent
0155   //! closed wires, in this case this function returns
0156   //! true. The only case in which the function may
0157   //! return true is a planar face in a closed revol.
0158   Standard_EXPORT bool SeparatedWires(const TopoDS_Shape&   aNewShape,
0159                                       const TopoDS_Shape&   aNewSubShape,
0160                                       const TopoDS_Shape&   aGenS,
0161                                       const TopoDS_Shape&   aSubGenS,
0162                                       const Sweep_NumShape& aDirS) const override;
0163 
0164   //! In some particular cases the topology of a
0165   //! generated Shell must be composed of independent
0166   //! closed Shells, in this case this function returns
0167   //! a Compound of independent Shells.
0168   Standard_EXPORT TopoDS_Shape SplitShell(const TopoDS_Shape& aNewShape) const override;
0169 
0170   //! Returns true if aDirS and aGenS addresses a
0171   //! resulting Shape. In some specific cases the shape
0172   //! can be geometrically inexsistant, then this
0173   //! function returns false.
0174   Standard_EXPORT bool HasShape(const TopoDS_Shape&   aGenS,
0175                                 const Sweep_NumShape& aDirS) const override;
0176 
0177   //! Returns true when the geometry of aGenS is not
0178   //! modified by the rotation.
0179   Standard_EXPORT bool IsInvariant(const TopoDS_Shape& aGenS) const override;
0180 
0181   //! returns the axis
0182   Standard_EXPORT gp_Ax1 Axe() const;
0183 
0184   //! returns the angle.
0185   Standard_EXPORT double Angle() const;
0186 
0187 private:
0188   double myAng;
0189   gp_Ax1 myAxe;
0190 };
0191 
0192 #endif // _BRepSweep_Rotation_HeaderFile