Back to home page

EIC code displayed by LXR

 
 

    


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

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