Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-26 08:28:15

0001 // Created on: 1996-02-13
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1996-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_Form_HeaderFile
0018 #define _BRepFeat_Form_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0025 #include <TopoDS_Shape.hxx>
0026 #include <TopTools_ListOfShape.hxx>
0027 #include <BRepFeat_PerfSelection.hxx>
0028 #include <TopoDS_Face.hxx>
0029 #include <TopTools_DataMapOfShapeShape.hxx>
0030 #include <BRepFeat_StatusError.hxx>
0031 #include <BRepBuilderAPI_MakeShape.hxx>
0032 #include <TColGeom_SequenceOfCurve.hxx>
0033 #include <Standard_Integer.hxx>
0034 class Geom_Curve;
0035 class LocOpe_Gluer;
0036 class BRepAlgoAPI_BooleanOperation;
0037 
0038 //! Provides general functions to build form features.
0039 //! Form features can be depressions or protrusions and include the following types:
0040 //! -          Cylinder
0041 //! -          Draft Prism
0042 //! -          Prism
0043 //! -          Revolved feature
0044 //! -          Pipe
0045 //! In each case, you have a choice of operation type between the following:
0046 //! -          removing matter (a Boolean cut: Fuse setting 0)
0047 //! -          adding matter (Boolean fusion: Fuse setting 1)
0048 //! The semantics of form feature creation is based on the construction of shapes:
0049 //! -      along a length
0050 //! -      up to a limiting face
0051 //! -      from a limiting face to a  height
0052 //! -      above and/or below a plane
0053 //! The shape defining construction of the feature can be either the
0054 //! supporting edge or the concerned area of a face.
0055 //! In case of the supporting edge, this contour can be attached to a
0056 //! face of the basis shape by binding. When the contour is bound to this
0057 //! face, the information that the contour will slide on the face
0058 //! becomes available to the relevant class methods. In case of the
0059 //! concerned area of a face, you could, for example, cut it out and
0060 //! move it to a different height which will define the limiting face of a
0061 //! protrusion or depression.
0062 //! Topological definition with local operations of this sort makes
0063 //! calculations simpler and faster than a global operation. The latter
0064 //! would entail a second phase of removing unwanted matter to get the same result.
0065 class BRepFeat_Form : public BRepBuilderAPI_MakeShape
0066 {
0067 public:
0068   DEFINE_STANDARD_ALLOC
0069 
0070   //! returns the list of generated Faces.
0071   Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& F)
0072     Standard_OVERRIDE;
0073 
0074   //! returns a list of the created faces
0075   //! from the shape <S>.
0076   Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& S)
0077     Standard_OVERRIDE;
0078 
0079   Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE;
0080 
0081   //! Returns the list  of shapes created  at the bottom  of
0082   //! the created form.  It may be an empty list.
0083   Standard_EXPORT const TopTools_ListOfShape& FirstShape() const;
0084 
0085   //! Returns  the list of shapes  created at the top of the
0086   //! created form.  It may be an empty list.
0087   Standard_EXPORT const TopTools_ListOfShape& LastShape() const;
0088 
0089   //! Returns a list of the limiting and glueing edges
0090   //! generated by the feature. These edges did not originally
0091   //! exist in the basis shape.
0092   //! The list provides the information necessary for
0093   //! subsequent addition of fillets. It may be an empty list.
0094   Standard_EXPORT const TopTools_ListOfShape& NewEdges() const;
0095 
0096   //! Returns a list of the tangent edges among the limiting
0097   //! and glueing edges generated by the feature. These
0098   //! edges did not originally exist in the basis shape and are
0099   //! tangent to the face against which the feature is built.
0100   //! The list provides the information necessary for
0101   //! subsequent addition of fillets. It may be an empty list.
0102   //! If an edge is tangent, no fillet is possible, and the edge
0103   //! must subsequently be removed if you want to add a fillet.
0104   Standard_EXPORT const TopTools_ListOfShape& TgtEdges() const;
0105 
0106   //! Initializes the topological construction if the basis shape is present.
0107   void BasisShapeValid();
0108 
0109   //! Initializes the topological construction if the generated shape S is present.
0110   void GeneratedShapeValid();
0111 
0112   //! Initializes the topological construction if the shape is
0113   //! present from the specified integer on.
0114   void ShapeFromValid();
0115 
0116   //! Initializes the topological construction if the shape is
0117   //! present until the specified integer.
0118   void ShapeUntilValid();
0119 
0120   //! Initializes the topological construction if the glued face is present.
0121   void GluedFacesValid();
0122 
0123   //! Initializes the topological construction if the sketch face
0124   //! is present. If the sketch face is inside the basis shape,
0125   //! local operations such as glueing can be performed.
0126   void SketchFaceValid();
0127 
0128   //! Initializes the topological construction if the selected face is present.
0129   void PerfSelectionValid();
0130 
0131   Standard_EXPORT virtual void Curves(TColGeom_SequenceOfCurve& S) = 0;
0132 
0133   Standard_EXPORT virtual Handle(Geom_Curve) BarycCurve() = 0;
0134 
0135   Standard_EXPORT BRepFeat_StatusError CurrentStatusError() const;
0136 
0137 protected:
0138   //! Redefines the empty constructor.
0139   BRepFeat_Form();
0140 
0141   //! General perform method...
0142   Standard_EXPORT void GlobalPerform();
0143 
0144   Standard_EXPORT void UpdateDescendants(const LocOpe_Gluer& G);
0145 
0146   Standard_EXPORT void UpdateDescendants(const BRepAlgoAPI_BooleanOperation& aBOP,
0147                                          const TopoDS_Shape&                 SResult,
0148                                          const Standard_Boolean SkipFace = Standard_False);
0149 
0150   Standard_EXPORT Standard_Boolean TransformShapeFU(const Standard_Integer flag);
0151 
0152   Standard_Boolean                   myFuse;
0153   Standard_Boolean                   myModify;
0154   TopTools_DataMapOfShapeListOfShape myMap;
0155   TopoDS_Shape                       myFShape;
0156   TopoDS_Shape                       myLShape;
0157   TopTools_ListOfShape               myNewEdges;
0158   TopTools_ListOfShape               myTgtEdges;
0159   BRepFeat_PerfSelection             myPerfSelection;
0160   Standard_Boolean                   myJustGluer;
0161   Standard_Boolean                   myJustFeat;
0162   TopoDS_Shape                       mySbase;
0163   TopoDS_Face                        mySkface;
0164   TopoDS_Shape                       myGShape;
0165   TopoDS_Shape                       mySFrom;
0166   TopoDS_Shape                       mySUntil;
0167   TopTools_DataMapOfShapeShape       myGluedF;
0168 
0169 private:
0170   Standard_Boolean     mySbOK;
0171   Standard_Boolean     mySkOK;
0172   Standard_Boolean     myGSOK;
0173   Standard_Boolean     mySFOK;
0174   Standard_Boolean     mySUOK;
0175   Standard_Boolean     myGFOK;
0176   Standard_Boolean     myPSOK;
0177   BRepFeat_StatusError myStatusError;
0178 };
0179 
0180 #include <BRepFeat_Form.lxx>
0181 
0182 #endif // _BRepFeat_Form_HeaderFile