Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-02 08:22:18

0001 // Created on: 1993-02-03
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_Translation_HeaderFile
0018 #define _BRepSweep_Translation_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Vec.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <BRepSweep_Trsf.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 //! translation sweep.
0034 class BRepSweep_Translation : public BRepSweep_Trsf
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Creates  a  topology by  translating <S>  with the
0040   //! vector  <V>. If  C  is   true S Sucomponents   are
0041   //! copied. If Canonize is true then generated surfaces
0042   //! are attempted to be canonized in simple types
0043   Standard_EXPORT BRepSweep_Translation(const TopoDS_Shape&    S,
0044                                         const Sweep_NumShape&  N,
0045                                         const TopLoc_Location& L,
0046                                         const gp_Vec&          V,
0047                                         const Standard_Boolean C,
0048                                         const Standard_Boolean Canonize = Standard_True);
0049 
0050   //! Builds the vertex addressed by [aGenV,aDirV], with its
0051   //! geometric part, but without subcomponents.
0052   Standard_EXPORT TopoDS_Shape MakeEmptyVertex(const TopoDS_Shape&   aGenV,
0053                                                const Sweep_NumShape& aDirV);
0054 
0055   //! Builds the edge addressed by [aGenV,aDirE], with its
0056   //! geometric part, but without subcomponents.
0057   Standard_EXPORT TopoDS_Shape MakeEmptyDirectingEdge(const TopoDS_Shape&   aGenV,
0058                                                       const Sweep_NumShape& aDirE);
0059 
0060   //! Builds the edge addressed by [aGenE,aDirV], with its
0061   //! geometric part, but without subcomponents.
0062   Standard_EXPORT TopoDS_Shape MakeEmptyGeneratingEdge(const TopoDS_Shape&   aGenE,
0063                                                        const Sweep_NumShape& aDirV);
0064 
0065   //! Sets the  parameters of the new  vertex  on the new
0066   //! face. The new face and  new vertex where generated
0067   //! from aGenF, aGenV and aDirV .
0068   Standard_EXPORT void SetParameters(const TopoDS_Shape&   aNewFace,
0069                                      TopoDS_Shape&         aNewVertex,
0070                                      const TopoDS_Shape&   aGenF,
0071                                      const TopoDS_Shape&   aGenV,
0072                                      const Sweep_NumShape& aDirV);
0073 
0074   //! Sets the  parameter of the new  vertex  on the new
0075   //! edge. The new edge and  new vertex where generated
0076   //! from aGenV aDirE, and aDirV.
0077   Standard_EXPORT void SetDirectingParameter(const TopoDS_Shape&   aNewEdge,
0078                                              TopoDS_Shape&         aNewVertex,
0079                                              const TopoDS_Shape&   aGenV,
0080                                              const Sweep_NumShape& aDirE,
0081                                              const Sweep_NumShape& aDirV);
0082 
0083   //! Sets the  parameter of the new  vertex  on the new
0084   //! edge. The new edge and  new vertex where generated
0085   //! from aGenE, aGenV and aDirV .
0086   Standard_EXPORT void SetGeneratingParameter(const TopoDS_Shape&   aNewEdge,
0087                                               TopoDS_Shape&         aNewVertex,
0088                                               const TopoDS_Shape&   aGenE,
0089                                               const TopoDS_Shape&   aGenV,
0090                                               const Sweep_NumShape& aDirV);
0091 
0092   //! Builds the  face addressed  by [aGenS,aDirS], with
0093   //! its geometric part, but without subcomponents. The
0094   //! couple aGenS, aDirS can  be a "generating face and
0095   //! a  directing  vertex" or  "a generating edge and a
0096   //! directing  edge".
0097   Standard_EXPORT TopoDS_Shape MakeEmptyFace(const TopoDS_Shape&   aGenS,
0098                                              const Sweep_NumShape& aDirS);
0099 
0100   //! Sets the PCurve for a new edge on a new face. The
0101   //! new edge and  the  new face were generated  using
0102   //! aGenF, aGenE and aDirV.
0103   Standard_EXPORT void SetPCurve(const TopoDS_Shape&      aNewFace,
0104                                  TopoDS_Shape&            aNewEdge,
0105                                  const TopoDS_Shape&      aGenF,
0106                                  const TopoDS_Shape&      aGenE,
0107                                  const Sweep_NumShape&    aDirV,
0108                                  const TopAbs_Orientation orien);
0109 
0110   //! Sets the PCurve for a new edge on a new face. The
0111   //! new edge and  the  new face were generated  using
0112   //! aGenE, aDirE and aDirV.
0113   Standard_EXPORT void SetGeneratingPCurve(const TopoDS_Shape&      aNewFace,
0114                                            TopoDS_Shape&            aNewEdge,
0115                                            const TopoDS_Shape&      aGenE,
0116                                            const Sweep_NumShape&    aDirE,
0117                                            const Sweep_NumShape&    aDirV,
0118                                            const TopAbs_Orientation orien);
0119 
0120   //! Sets the PCurve for a new edge on a new face. The
0121   //! new edge and  the  new face were generated  using
0122   //! aGenE, aDirE and aGenV.
0123   Standard_EXPORT void SetDirectingPCurve(const TopoDS_Shape&      aNewFace,
0124                                           TopoDS_Shape&            aNewEdge,
0125                                           const TopoDS_Shape&      aGenE,
0126                                           const TopoDS_Shape&      aGenV,
0127                                           const Sweep_NumShape&    aDirE,
0128                                           const TopAbs_Orientation orien);
0129 
0130   //! Returns the Orientation of the  shell in the solid
0131   //! generated by the face aGenS  with  the edge aDirS.
0132   //! It is  REVERSED  if the surface is  swept  in  the
0133   //! direction of the normal.
0134   Standard_EXPORT TopAbs_Orientation DirectSolid(const TopoDS_Shape&   aGenS,
0135                                                  const Sweep_NumShape& aDirS);
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 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;
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 Standard_Boolean GDDShapeIsToAdd(const TopoDS_Shape&   aNewShape,
0150                                                    const TopoDS_Shape&   aNewSubShape,
0151                                                    const TopoDS_Shape&   aGenS,
0152                                                    const Sweep_NumShape& aDirS,
0153                                                    const Sweep_NumShape& aSubDirS) const;
0154 
0155   //! In  some  particular  cases  the   topology  of  a
0156   //! generated  face must be  composed  of  independent
0157   //! closed wires,  in this case  this function returns
0158   //! true.
0159   //! Here it always returns false.
0160   Standard_EXPORT 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;
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 Standard_Boolean HasShape(const TopoDS_Shape&   aGenS,
0171                                             const Sweep_NumShape& aDirS) const;
0172 
0173   //! Returns  always     false   because    here    the
0174   //! transformation is a translation.
0175   Standard_EXPORT Standard_Boolean IsInvariant(const TopoDS_Shape& aGenS) const;
0176 
0177   //! Returns the Vector of the Prism,  if it is an infinite
0178   //! prism the Vec is unitar.
0179   Standard_EXPORT gp_Vec Vec() const;
0180 
0181 protected:
0182 private:
0183   gp_Vec           myVec;
0184   Standard_Boolean myCanonize;
0185 };
0186 
0187 #endif // _BRepSweep_Translation_HeaderFile