Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-31 09:17:21

0001 // Created on: 1993-06-08
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_Trsf_HeaderFile
0018 #define _BRepSweep_Trsf_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopLoc_Location.hxx>
0024 #include <BRepSweep_NumLinearRegularSweep.hxx>
0025 #include <TopAbs_Orientation.hxx>
0026 class BRep_Builder;
0027 class TopoDS_Shape;
0028 class Sweep_NumShape;
0029 
0030 //! This class is inherited from NumLinearRegularSweep
0031 //! to  implement the  simple   swept primitives built
0032 //! moving a Shape with a Trsf.  It  often is possible
0033 //! to  build  the constructed subshapes  by  a simple
0034 //! move of the  generating subshapes (shared topology
0035 //! and geometry).   So two  ways of construction  are
0036 //! proposed :
0037 //!
0038 //! - sharing  basis elements  (the generatrice can be
0039 //! modified , for  example  PCurves can be added  on
0040 //! faces);
0041 //!
0042 //! - copying everything.
0043 class BRepSweep_Trsf : public BRepSweep_NumLinearRegularSweep
0044 {
0045 public:
0046   DEFINE_STANDARD_ALLOC
0047 
0048   //! ends  the  construction  of the   swept  primitive
0049   //! calling the virtual geometric functions that can't
0050   //! be called in the initialize.
0051   Standard_EXPORT void Init();
0052 
0053   //! function called to analyze the way of construction
0054   //! of the shapes generated by aGenS and aDirV.
0055   Standard_EXPORT Standard_Boolean Process(const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirV);
0056 
0057   //! Builds the vertex addressed by [aGenV,aDirV], with its
0058   //! geometric part, but without subcomponents.
0059   Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex(const TopoDS_Shape&   aGenV,
0060                                                        const Sweep_NumShape& aDirV) = 0;
0061 
0062   //! Builds the edge addressed by [aGenV,aDirE], with its
0063   //! geometric part, but without subcomponents.
0064   Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge(const TopoDS_Shape&   aGenV,
0065                                                               const Sweep_NumShape& aDirE) = 0;
0066 
0067   //! Builds the edge addressed by [aGenE,aDirV], with its
0068   //! geometric part, but without subcomponents.
0069   Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge(const TopoDS_Shape&   aGenE,
0070                                                                const Sweep_NumShape& aDirV) = 0;
0071 
0072   //! Sets the  parameters of the new  vertex  on the new
0073   //! face. The new face and  new vertex where generated
0074   //! from aGenF, aGenV and aDirV .
0075   Standard_EXPORT virtual void SetParameters(const TopoDS_Shape&   aNewFace,
0076                                              TopoDS_Shape&         aNewVertex,
0077                                              const TopoDS_Shape&   aGenF,
0078                                              const TopoDS_Shape&   aGenV,
0079                                              const Sweep_NumShape& aDirV) = 0;
0080 
0081   //! Sets the  parameter of the new  vertex  on the new
0082   //! edge. The new edge and  new vertex where generated
0083   //! from aGenV aDirE, and aDirV.
0084   Standard_EXPORT virtual void SetDirectingParameter(const TopoDS_Shape&   aNewEdge,
0085                                                      TopoDS_Shape&         aNewVertex,
0086                                                      const TopoDS_Shape&   aGenV,
0087                                                      const Sweep_NumShape& aDirE,
0088                                                      const Sweep_NumShape& aDirV) = 0;
0089 
0090   //! Sets the  parameter of the new  vertex  on the new
0091   //! edge. The new edge and  new vertex where generated
0092   //! from aGenE, aGenV and aDirV .
0093   Standard_EXPORT virtual void SetGeneratingParameter(const TopoDS_Shape&   aNewEdge,
0094                                                       TopoDS_Shape&         aNewVertex,
0095                                                       const TopoDS_Shape&   aGenE,
0096                                                       const TopoDS_Shape&   aGenV,
0097                                                       const Sweep_NumShape& aDirV) = 0;
0098 
0099   //! Builds  the face addressed  by [aGenS,aDirS], with
0100   //! its geometric part, but without subcomponents. The
0101   //! couple aGenS, aDirS can be  a "generating face and
0102   //! a  directing vertex" or "a   generating edge and a
0103   //! directing  edge".
0104   Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace(const TopoDS_Shape&   aGenS,
0105                                                      const Sweep_NumShape& aDirS) = 0;
0106 
0107   //! Sets the PCurve for a new edge on a new face. The
0108   //! new edge and  the  new face were generated  using
0109   //! aGenF, aGenE and aDirV.
0110   Standard_EXPORT virtual void SetPCurve(const TopoDS_Shape&      aNewFace,
0111                                          TopoDS_Shape&            aNewEdge,
0112                                          const TopoDS_Shape&      aGenF,
0113                                          const TopoDS_Shape&      aGenE,
0114                                          const Sweep_NumShape&    aDirV,
0115                                          const TopAbs_Orientation orien) = 0;
0116 
0117   //! Sets the PCurve for a new edge on a new face. The
0118   //! new edge and  the  new face were generated  using
0119   //! aGenE, aDirE and aDirV.
0120   Standard_EXPORT virtual void SetGeneratingPCurve(const TopoDS_Shape&      aNewFace,
0121                                                    TopoDS_Shape&            aNewEdge,
0122                                                    const TopoDS_Shape&      aGenE,
0123                                                    const Sweep_NumShape&    aDirE,
0124                                                    const Sweep_NumShape&    aDirV,
0125                                                    const TopAbs_Orientation orien) = 0;
0126 
0127   //! Sets the PCurve for a new edge on a new face. The
0128   //! new edge and  the  new face were generated  using
0129   //! aGenE, aDirE and aGenV.
0130   Standard_EXPORT virtual void SetDirectingPCurve(const TopoDS_Shape&      aNewFace,
0131                                                   TopoDS_Shape&            aNewEdge,
0132                                                   const TopoDS_Shape&      aGenE,
0133                                                   const TopoDS_Shape&      aGenV,
0134                                                   const Sweep_NumShape&    aDirE,
0135                                                   const TopAbs_Orientation orien) = 0;
0136 
0137   //! Returns   true   if  aNewSubShape    (addressed by
0138   //! aSubGenS  and aDirS)  must  be added  in aNewShape
0139   //! (addressed by aGenS and aDirS).
0140   Standard_EXPORT virtual Standard_Boolean GGDShapeIsToAdd(const TopoDS_Shape&   aNewShape,
0141                                                            const TopoDS_Shape&   aNewSubShape,
0142                                                            const TopoDS_Shape&   aGenS,
0143                                                            const TopoDS_Shape&   aSubGenS,
0144                                                            const Sweep_NumShape& aDirS) const = 0;
0145 
0146   //! Returns   true   if  aNewSubShape    (addressed by
0147   //! aGenS  and aSubDirS)  must  be added  in aNewShape
0148   //! (addressed by aGenS and aDirS).
0149   Standard_EXPORT virtual Standard_Boolean GDDShapeIsToAdd(
0150     const TopoDS_Shape&   aNewShape,
0151     const TopoDS_Shape&   aNewSubShape,
0152     const TopoDS_Shape&   aGenS,
0153     const Sweep_NumShape& aDirS,
0154     const Sweep_NumShape& aSubDirS) const = 0;
0155 
0156   //! In  some  particular  cases  the   topology  of  a
0157   //! generated  face must be  composed  of  independent
0158   //! closed wires,  in this case  this function returns
0159   //! true.
0160   Standard_EXPORT virtual Standard_Boolean SeparatedWires(const TopoDS_Shape&   aNewShape,
0161                                                           const TopoDS_Shape&   aNewSubShape,
0162                                                           const TopoDS_Shape&   aGenS,
0163                                                           const TopoDS_Shape&   aSubGenS,
0164                                                           const Sweep_NumShape& aDirS) const = 0;
0165 
0166   //! Returns true   if aDirS   and aGenS  addresses   a
0167   //! resulting Shape. In some  specific cases the shape
0168   //! can  be    geometrically   inexsistant,  then this
0169   //! function returns false.
0170   Standard_EXPORT virtual Standard_Boolean HasShape(const TopoDS_Shape&   aGenS,
0171                                                     const Sweep_NumShape& aDirS) const = 0;
0172 
0173   //! Returns  true if  the geometry   of  aGenS is  not
0174   //! modified by the trsf of the BRepSweep Trsf.
0175   Standard_EXPORT virtual Standard_Boolean IsInvariant(const TopoDS_Shape& aGenS) const = 0;
0176 
0177   //! Called to propagate the continuity of  every vertex
0178   //! between two edges of the  generating wire  aGenS on
0179   //! the generated edge and faces.
0180   Standard_EXPORT void SetContinuity(const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
0181 
0182 protected:
0183   //! Initialize  the Trsf BrepSweep, if  aCopy  is true
0184   //! the  basis elements  are    shared  as   often  as
0185   //! possible, else everything is copied.
0186   Standard_EXPORT BRepSweep_Trsf(const BRep_Builder&    aBuilder,
0187                                  const TopoDS_Shape&    aGenShape,
0188                                  const Sweep_NumShape&  aDirWire,
0189                                  const TopLoc_Location& aLocation,
0190                                  const Standard_Boolean aCopy);
0191 
0192   TopLoc_Location  myLocation;
0193   Standard_Boolean myCopy;
0194 
0195 private:
0196 };
0197 
0198 #endif // _BRepSweep_Trsf_HeaderFile