Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-09-04
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1995-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 _BRepFeat_SplitShape_HeaderFile
0018 #define _BRepFeat_SplitShape_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <LocOpe_Spliter.hxx>
0025 #include <BRepBuilderAPI_MakeShape.hxx>
0026 #include <TopTools_ListOfShape.hxx>
0027 #include <TopTools_SequenceOfShape.hxx>
0028 
0029 class LocOpe_WiresOnShape;
0030 class TopoDS_Shape;
0031 class TopoDS_Wire;
0032 class TopoDS_Face;
0033 class TopoDS_Edge;
0034 class TopoDS_Compound;
0035 
0036 
0037 //! One of the most significant aspects of BRepFeat functionality is the use of local
0038 //! operations as opposed to global ones. In a global operation, you would first construct a
0039 //! form of the type you wanted in your final feature, and then remove matter so that it could
0040 //! fit into your initial basis object. In a local operation, however, you specify the domain of
0041 //! the feature construction with aspects of the shape on which the feature is being created.
0042 //! These semantics are expressed in terms of a member shape of the basis shape from which -
0043 //! or up to which - matter will be added or removed. As a result, local operations make
0044 //! calculations simpler and faster than global operations.
0045 //! In BRepFeat, the semantics of local operations define features constructed from a contour or a
0046 //! part of the basis shape referred to as the tool. In a SplitShape object, wires or edges of a
0047 //! face in the basis shape to be used as a part of the feature are cut out and projected to a plane
0048 //! outside or inside the basis shape. By rebuilding the initial shape incorporating the edges and
0049 //! the faces of the tool, protrusion or depression features can be constructed.
0050 class BRepFeat_SplitShape  : public BRepBuilderAPI_MakeShape
0051 {
0052 public:
0053 
0054   DEFINE_STANDARD_ALLOC
0055 
0056   
0057   //! Empty constructor
0058     BRepFeat_SplitShape();
0059   
0060   //! Creates the process  with the shape <S>.
0061   BRepFeat_SplitShape(const TopoDS_Shape& S);
0062 
0063   //! Add splitting edges or wires for whole initial shape
0064   //! without additional specification edge->face, edge->edge
0065   //! This method puts edge on the corresponding faces from initial shape
0066   Standard_Boolean Add(const TopTools_SequenceOfShape& theEdges);
0067   
0068   //! Initializes the process on the shape <S>.
0069     void Init (const TopoDS_Shape& S);
0070   
0071   //! Set the flag of check internal intersections
0072   //! default value is True (to check)
0073     void SetCheckInterior (const Standard_Boolean ToCheckInterior);
0074   
0075   //! Adds the wire <W> on the face <F>.
0076   //! Raises NoSuchObject  if <F> does not belong to the original shape.
0077     void Add (const TopoDS_Wire& W, const TopoDS_Face& F);
0078   
0079   //! Adds the edge <E> on the face <F>.
0080     void Add (const TopoDS_Edge& E, const TopoDS_Face& F);
0081   
0082   //! Adds the compound <Comp> on the face <F>. The
0083   //! compound <Comp> must consist of edges lying on the
0084   //! face <F>. If edges are geometrically connected,
0085   //! they must be connected topologically, i.e. they
0086   //! must share common vertices.
0087   //!
0088   //! Raises NoSuchObject  if <F> does not belong to the original shape.
0089     void Add (const TopoDS_Compound& Comp, const TopoDS_Face& F);
0090   
0091   //! Adds the edge <E> on the existing edge <EOn>.
0092     void Add (const TopoDS_Edge& E, const TopoDS_Edge& EOn);
0093   
0094   //! Returns  the faces   which  are the  left of   the
0095   //! projected wires.
0096   Standard_EXPORT const TopTools_ListOfShape& DirectLeft() const;
0097   
0098   //! Returns the faces of the "left" part on the shape.
0099   //! (It  is build   from  DirectLeft,  with  the faces
0100   //! connected to this set, and so on...).
0101   //! Raises NotDone if IsDone returns <Standard_False>.
0102   Standard_EXPORT const TopTools_ListOfShape& Left() const;
0103   
0104   //! Returns the faces of the "right" part on the shape.
0105   Standard_EXPORT const TopTools_ListOfShape& Right() const;
0106   
0107   //! Builds the cut and the resulting faces and edges as well.
0108   Standard_EXPORT void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0109   
0110   //! Returns true if the shape has been deleted.
0111   Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE;
0112   
0113   //! Returns the list of generated Faces.
0114   Standard_EXPORT const TopTools_ListOfShape& Modified (const TopoDS_Shape& F) Standard_OVERRIDE;
0115 
0116 
0117 
0118 
0119 protected:
0120 
0121 
0122 
0123 
0124 
0125 private:
0126 
0127 
0128 
0129   LocOpe_Spliter mySShape;
0130   Handle(LocOpe_WiresOnShape) myWOnShape;
0131 
0132   mutable TopTools_ListOfShape myRight;
0133 
0134 
0135 };
0136 
0137 
0138 #include <BRepFeat_SplitShape.lxx>
0139 
0140 
0141 
0142 
0143 
0144 #endif // _BRepFeat_SplitShape_HeaderFile