Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1996-09-03
0002 // Created by: Olga PILLOT
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_MakeDPrism_HeaderFile
0018 #define _BRepFeat_MakeDPrism_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0025 #include <Standard_Real.hxx>
0026 #include <TopTools_ListOfShape.hxx>
0027 #include <BRepFeat_StatusError.hxx>
0028 #include <BRepFeat_Form.hxx>
0029 #include <Standard_Integer.hxx>
0030 class Geom_Curve;
0031 class TopoDS_Shape;
0032 class TopoDS_Edge;
0033 
0034 
0035 //! Describes functions to build draft
0036 //! prism topologies from basis shape surfaces. These can be depressions or protrusions.
0037 //! The semantics of draft prism feature creation is based on the
0038 //! construction of shapes:
0039 //! -          along a length
0040 //! -          up to a limiting face
0041 //! -          from a limiting face to a height.
0042 //! The shape defining construction of the draft prism feature can be
0043 //! either the supporting edge or the concerned area of a face.
0044 //! In case of the supporting edge, this contour can be attached to a
0045 //! face of the basis shape by binding. When the contour is bound to this
0046 //! face, the information that the contour will slide on the face
0047 //! becomes available to the relevant class methods.
0048 //! In case of the concerned area of a face, you could, for example, cut
0049 //! it out and move it to a different height which will define the
0050 //! limiting face of a protrusion or depression.
0051 class BRepFeat_MakeDPrism  : public BRepFeat_Form
0052 {
0053 public:
0054 
0055   DEFINE_STANDARD_ALLOC
0056 
0057   
0058   //! A face Pbase is selected in the shape
0059   //! Sbase to serve as the basis for the draft prism. The
0060   //! draft will be defined by the angle Angle and Fuse offers a choice between:
0061   //! - removing matter with a Boolean cut using the setting 0
0062   //! - adding matter with Boolean fusion using the setting 1.
0063   //! The sketch face Skface serves to determine the type of
0064   //! operation. If it is inside the basis shape, a local
0065   //! operation such as glueing can be performed.
0066   //! Initializes the draft prism class
0067   BRepFeat_MakeDPrism (const TopoDS_Shape& Sbase, const TopoDS_Face& Pbase, const TopoDS_Face& Skface, const Standard_Real Angle, const Standard_Integer Fuse, const Standard_Boolean Modify)
0068   {
0069     Init (Sbase, Pbase, Skface, Angle, Fuse, Modify);
0070   }
0071   
0072   BRepFeat_MakeDPrism()
0073   : myAngle(RealLast()),
0074     myStatusError(BRepFeat_OK)
0075   {
0076   }
0077   
0078   //! Initializes this algorithm for building draft prisms along surfaces.
0079   //! A face Pbase is selected in the basis shape Sbase to
0080   //! serve as the basis from the draft prism. The draft will be
0081   //! defined by the angle Angle and Fuse offers a choice between:
0082   //! -   removing matter with a Boolean cut using the setting 0
0083   //! -   adding matter with Boolean fusion using the setting  1.
0084   //! The sketch face Skface serves to determine the type of
0085   //! operation. If it is inside the basis shape, a local
0086   //! operation such as glueing can be performed.
0087   Standard_EXPORT void Init (const TopoDS_Shape& Sbase, const TopoDS_Face& Pbase, const TopoDS_Face& Skface, const Standard_Real Angle, const Standard_Integer Fuse, const Standard_Boolean Modify);
0088   
0089   //! Indicates that the edge <E> will slide on the face
0090   //! <OnFace>.
0091   //! Raises ConstructionError if the  face does not belong to the
0092   //! basis shape, or the edge to the prismed shape.
0093   Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace);
0094   
0095   Standard_EXPORT void Perform (const Standard_Real Height);
0096   
0097   Standard_EXPORT void Perform (const TopoDS_Shape& Until);
0098   
0099   //! Assigns one of the following semantics
0100   //! -   to a height Height
0101   //! -   to a face Until
0102   //! -   from a face From to a height Until.
0103   //! Reconstructs the feature topologically according to the semantic option chosen.
0104   Standard_EXPORT void Perform (const TopoDS_Shape& From, const TopoDS_Shape& Until);
0105   
0106   //! Realizes a semi-infinite prism, limited by the position of the prism base.
0107   Standard_EXPORT void PerformUntilEnd();
0108   
0109   //! Realizes a semi-infinite prism, limited by the face Funtil.
0110   Standard_EXPORT void PerformFromEnd (const TopoDS_Shape& FUntil);
0111   
0112   //! Builds an infinite prism. The infinite descendants will not be kept in the result.
0113   Standard_EXPORT void PerformThruAll();
0114   
0115   //! Assigns both a limiting shape, Until from
0116   //! TopoDS_Shape, and a height, Height at which to stop
0117   //! generation of the prism feature.
0118   Standard_EXPORT void PerformUntilHeight (const TopoDS_Shape& Until, const Standard_Real Height);
0119   
0120   Standard_EXPORT void Curves (TColGeom_SequenceOfCurve& S);
0121   
0122   Standard_EXPORT Handle(Geom_Curve) BarycCurve();
0123   
0124   //! Determination of TopEdges and LatEdges.
0125   //! sig = 1 -> TopEdges = FirstShape of the DPrism
0126   //! sig = 2 -> TOpEdges = LastShape of the DPrism
0127   Standard_EXPORT void BossEdges (const Standard_Integer sig);
0128   
0129   //! Returns the list of TopoDS Edges of the top of the boss.
0130   Standard_EXPORT const TopTools_ListOfShape& TopEdges();
0131   
0132   //! Returns the list of TopoDS Edges of the bottom of the boss.
0133   Standard_EXPORT const TopTools_ListOfShape& LatEdges();
0134 
0135 
0136 
0137 
0138 protected:
0139 
0140 
0141 
0142 
0143 
0144 private:
0145 
0146 
0147 
0148   TopoDS_Face myPbase;
0149   TopTools_DataMapOfShapeListOfShape mySlface;
0150   Standard_Real myAngle;
0151   TColGeom_SequenceOfCurve myCurves;
0152   Handle(Geom_Curve) myBCurve;
0153   TopTools_ListOfShape myTopEdges;
0154   TopTools_ListOfShape myLatEdges;
0155   BRepFeat_StatusError myStatusError;
0156 
0157 
0158 };
0159 
0160 #endif // _BRepFeat_MakeDPrism_HeaderFile