Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-01-27
0002 // Created by: Philippe DAUTRY
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_NumLinearRegularSweep_HeaderFile
0018 #define _BRepSweep_NumLinearRegularSweep_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <BRepSweep_Builder.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 #include <BRepSweep_Tool.hxx>
0026 #include <Sweep_NumShapeTool.hxx>
0027 #include <TopTools_Array2OfShape.hxx>
0028 #include <TColStd_Array2OfBoolean.hxx>
0029 #include <TopAbs_Orientation.hxx>
0030 
0031 
0032 //! This  a generic  class  is  used   to build Sweept
0033 //! primitives   with    a  generating  "shape"  and a
0034 //! directing "line".
0035 //!
0036 //! The indexation and type analysis services required
0037 //! for the generatrix are given by <Tool from BRepSweep>.
0038 //!
0039 //! The indexation and type analysis services required
0040 //! for the directrix are given by <NumShapeTool from Sweep>.
0041 //!
0042 //! The iteration services required for the generatrix
0043 //! are given by <Iterator from BRepSweep>.
0044 //!
0045 //! The iteration services required  for the directrix
0046 //! are given by <NumShapeIterator from Sweep>.
0047 //!
0048 //! The topology is like a grid of shapes.  Each shape
0049 //! of the grid  must be addressable without confusion
0050 //! by one  or  two objects   from  the generating  or
0051 //! directing   shapes.  Here are  examples of correct
0052 //! associations to address:
0053 //!
0054 //! - a vertex : GenVertex - DirVertex
0055 //! - an edge  : GenVertex - DirEdge
0056 //! -          : GenEdge   - DirVertex
0057 //! - a face   : GenEdge   - DirEdge
0058 //! GenFace   - DirVertex
0059 //! ...
0060 //!
0061 //! "GenObject" is used to identify an object from the
0062 //! Generating     Shape,  and  "DirObject"  from  the
0063 //! Directing Shape.  So may they   be  from different
0064 //! types.
0065 //!
0066 //! The method Has... is given because in some special
0067 //! cases, a vertex,    an  edge or   a   face may  be
0068 //! geometricaly nonexistant or not useful.
0069 class BRepSweep_NumLinearRegularSweep 
0070 {
0071 public:
0072 
0073   DEFINE_STANDARD_ALLOC
0074 
0075   
0076   //! Builds the vertex addressed by [aGenV,aDirV], with its
0077   //! geometric part, but without subcomponents.
0078   Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
0079   Standard_EXPORT virtual ~BRepSweep_NumLinearRegularSweep();
0080   
0081   //! Builds the edge addressed by [aGenV,aDirE], with its
0082   //! geometric part, but without subcomponents.
0083   Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE) = 0;
0084   
0085   //! Builds the edge addressed by [aGenE,aDirV], with its
0086   //! geometric part, but without subcomponents.
0087   Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV) = 0;
0088   
0089   //! Sets the  parameters of the new  vertex  on the new
0090   //! face. The new face and  new vertex where generated
0091   //! from aGenF, aGenV and aDirV .
0092   Standard_EXPORT virtual void SetParameters (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
0093   
0094   //! Sets the  parameter of the new  vertex  on the new
0095   //! edge. The new edge and  new vertex where generated
0096   //! from aGenV aDirE, and aDirV.
0097   Standard_EXPORT virtual void SetDirectingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV) = 0;
0098   
0099   //! Sets the  parameter of the new  vertex  on the new
0100   //! edge. The new edge and  new vertex where generated
0101   //! from aGenE, aGenV and aDirV .
0102   Standard_EXPORT virtual void SetGeneratingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
0103   
0104   //! Builds the face  addressed by  [aGenS,aDirS], with
0105   //! its geometric part, but without subcomponents. The
0106   //! couple aGenS, aDirS  can be a "generating face and
0107   //! a directing vertex"   or "a generating  edge and a
0108   //! directing  edge".
0109   Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0;
0110   
0111   //! Sets the PCurve for a new edge on a new face. The
0112   //! new edge and  the  new face were generated  using
0113   //! aGenF, aGenE and aDirV.
0114   Standard_EXPORT virtual void SetPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0;
0115   
0116   //! Sets the PCurve for a new edge on a new face. The
0117   //! new edge and  the  new face were generated  using
0118   //! aGenE, aDirE and aDirV.
0119   Standard_EXPORT virtual void SetGeneratingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0;
0120   
0121   //! Sets the PCurve for a new edge on a new face. The
0122   //! new edge and  the  new face were generated  using
0123   //! aGenE, aDirE and aGenV.
0124   Standard_EXPORT virtual void SetDirectingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const TopAbs_Orientation orien) = 0;
0125   
0126   //! Returns the Orientation of the  shell in the solid
0127   //! generated by the face aGenS  with  the edge aDirS.
0128   //! It is  REVERSED  if the surface is  swept  in  the
0129   //! direction of the normal.
0130   Standard_EXPORT virtual TopAbs_Orientation DirectSolid (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0;
0131   
0132   //! Returns   true   if  aNewSubShape    (addressed by
0133   //! aSubGenS  and aDirS)  must  be added  in aNewShape
0134   //! (addressed by aGenS and aDirS).
0135   Standard_EXPORT virtual Standard_Boolean GGDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0;
0136   
0137   //! Returns   true   if  aNewSubShape    (addressed by
0138   //! aGenS  and aSubDirS)  must  be added  in aNewShape
0139   //! (addressed by aGenS and aDirS).
0140   Standard_EXPORT virtual Standard_Boolean GDDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS, const Sweep_NumShape& aSubDirS) const = 0;
0141   
0142   //! In  some  particular  cases  the   topology  of  a
0143   //! generated  face must be  composed  of  independent
0144   //! closed wires,  in this case  this function returns
0145   //! true.
0146   Standard_EXPORT virtual Standard_Boolean SeparatedWires (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0;
0147   
0148   //! In  some  particular  cases  the   topology  of  a
0149   //! generated  Shell must be  composed  of  independent
0150   //! closed Shells,  in this case  this function returns
0151   //! a Compound of independent Shells.
0152   Standard_EXPORT virtual TopoDS_Shape SplitShell (const TopoDS_Shape& aNewShape) const;
0153   
0154   //! Called to propagate the continuity of  every vertex
0155   //! between two edges of the  generating wire  aGenS on
0156   //! the generated edge and faces.
0157   Standard_EXPORT virtual void SetContinuity (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0;
0158   
0159   //! Returns true   if aDirS   and aGenS  addresses   a
0160   //! resulting Shape. In some  specific cases the shape
0161   //! can  be    geometrically   inexsistant,  then this
0162   //! function returns false.
0163   Standard_EXPORT virtual Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const = 0;
0164 
0165   //! Returns true if aGenS cannot be transformed.
0166   Standard_EXPORT virtual Standard_Boolean IsInvariant(const TopoDS_Shape& aGenS) const = 0;
0167 
0168   //! Returns the resulting  Shape indexed by aDirS  and
0169   //! aGenS.
0170   Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
0171   
0172   //! Returns  the resulting Shape  indexed by myDirWire
0173   //! and aGenS.
0174   Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS);
0175 
0176   //! Returns true if the initial shape aGenS  
0177   //! is used in result shape
0178   Standard_EXPORT Standard_Boolean IsUsed(const TopoDS_Shape& aGenS) const;
0179 
0180   //! Returns true if the shape, generated from theS 
0181   //! is used in result shape
0182   Standard_EXPORT Standard_Boolean GenIsUsed(const TopoDS_Shape& theS) const;
0183 
0184   //! Returns the resulting  Shape indexed by  myDirWire
0185   //! and myGenShape.
0186   Standard_EXPORT TopoDS_Shape Shape();
0187   
0188   //! Returns the resulting Shape  indexed by the  first
0189   //! Vertex  of myDirWire and myGenShape.
0190   Standard_EXPORT TopoDS_Shape FirstShape();
0191   
0192   //! Returns the  resulting Shape  indexed by the  last
0193   //! Vertex of myDirWire and myGenShape.
0194   Standard_EXPORT TopoDS_Shape LastShape();
0195   
0196   //! Returns the resulting Shape  indexed by the  first
0197   //! Vertex  of myDirWire and aGenS.
0198   Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& aGenS);
0199   
0200   //! Returns the  resulting Shape  indexed by the  last
0201   //! Vertex of myDirWire and aGenS.
0202   Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& aGenS);
0203   
0204   Standard_EXPORT Standard_Boolean Closed() const;
0205 
0206 
0207 
0208 
0209 protected:
0210 
0211   
0212   //! Creates a NumLinearRegularSweep.    <aBuilder>  gives
0213   //! basic topological services.
0214   Standard_EXPORT BRepSweep_NumLinearRegularSweep(const BRepSweep_Builder& aBuilder, const TopoDS_Shape& aGenShape, const Sweep_NumShape& aDirWire);
0215 
0216 
0217   BRepSweep_Builder myBuilder;
0218   TopoDS_Shape myGenShape;
0219   Sweep_NumShape myDirWire;
0220   BRepSweep_Tool myGenShapeTool;
0221   Sweep_NumShapeTool myDirShapeTool;
0222   TopTools_Array2OfShape myShapes;
0223   TColStd_Array2OfBoolean myBuiltShapes;
0224   TColStd_Array2OfBoolean myUsedShapes;
0225 
0226 
0227 private:
0228 
0229 
0230 
0231 
0232 
0233 };
0234 
0235 
0236 
0237 
0238 
0239 
0240 
0241 #endif // _BRepSweep_NumLinearRegularSweep_HeaderFile