1 // Created on: 1996-09-03
2 // Created by: Olga PILLOT
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepFeat_MakeDPrism_HeaderFile
18 #define _BRepFeat_MakeDPrism_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopTools_DataMapOfShapeListOfShape.hxx>
25 #include <Standard_Real.hxx>
26 #include <TopTools_ListOfShape.hxx>
27 #include <BRepFeat_StatusError.hxx>
28 #include <BRepFeat_Form.hxx>
29 #include <Standard_Integer.hxx>
35 //! Describes functions to build draft
36 //! prism topologies from basis shape surfaces. These can be depressions or protrusions.
37 //! The semantics of draft prism feature creation is based on the
38 //! construction of shapes:
40 //! - up to a limiting face
41 //! - from a limiting face to a height.
42 //! The shape defining construction of the draft prism feature can be
43 //! either the supporting edge or the concerned area of a face.
44 //! In case of the supporting edge, this contour can be attached to a
45 //! face of the basis shape by binding. When the contour is bound to this
46 //! face, the information that the contour will slide on the face
47 //! becomes available to the relevant class methods.
48 //! In case of the concerned area of a face, you could, for example, cut
49 //! it out and move it to a different height which will define the
50 //! limiting face of a protrusion or depression.
51 class BRepFeat_MakeDPrism : public BRepFeat_Form
58 //! A face Pbase is selected in the shape
59 //! Sbase to serve as the basis for the draft prism. The
60 //! draft will be defined by the angle Angle and Fuse offers a choice between:
61 //! - removing matter with a Boolean cut using the setting 0
62 //! - adding matter with Boolean fusion using the setting 1.
63 //! The sketch face Skface serves to determine the type of
64 //! operation. If it is inside the basis shape, a local
65 //! operation such as glueing can be performed.
66 //! Initializes the draft prism class
67 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)
69 Init (Sbase, Pbase, Skface, Angle, Fuse, Modify);
73 : myAngle(RealLast()),
74 myStatusError(BRepFeat_OK)
78 //! Initializes this algorithm for building draft prisms along surfaces.
79 //! A face Pbase is selected in the basis shape Sbase to
80 //! serve as the basis from the draft prism. The draft will be
81 //! defined by the angle Angle and Fuse offers a choice between:
82 //! - removing matter with a Boolean cut using the setting 0
83 //! - adding matter with Boolean fusion using the setting 1.
84 //! The sketch face Skface serves to determine the type of
85 //! operation. If it is inside the basis shape, a local
86 //! operation such as glueing can be performed.
87 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);
89 //! Indicates that the edge <E> will slide on the face
91 //! Raises ConstructionError if the face does not belong to the
92 //! basis shape, or the edge to the prismed shape.
93 Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace);
95 Standard_EXPORT void Perform (const Standard_Real Height);
97 Standard_EXPORT void Perform (const TopoDS_Shape& Until);
99 //! Assigns one of the following semantics
100 //! - to a height Height
101 //! - to a face Until
102 //! - from a face From to a height Until.
103 //! Reconstructs the feature topologically according to the semantic option chosen.
104 Standard_EXPORT void Perform (const TopoDS_Shape& From, const TopoDS_Shape& Until);
106 //! Realizes a semi-infinite prism, limited by the position of the prism base.
107 Standard_EXPORT void PerformUntilEnd();
109 //! Realizes a semi-infinite prism, limited by the face Funtil.
110 Standard_EXPORT void PerformFromEnd (const TopoDS_Shape& FUntil);
112 //! Builds an infinite prism. The infinite descendants will not be kept in the result.
113 Standard_EXPORT void PerformThruAll();
115 //! Assigns both a limiting shape, Until from
116 //! TopoDS_Shape, and a height, Height at which to stop
117 //! generation of the prism feature.
118 Standard_EXPORT void PerformUntilHeight (const TopoDS_Shape& Until, const Standard_Real Height);
120 Standard_EXPORT void Curves (TColGeom_SequenceOfCurve& S);
122 Standard_EXPORT Handle(Geom_Curve) BarycCurve();
124 //! Determination of TopEdges and LatEdges.
125 //! sig = 1 -> TopEdges = FirstShape of the DPrism
126 //! sig = 2 -> TOpEdges = LastShape of the DPrism
127 Standard_EXPORT void BossEdges (const Standard_Integer sig);
129 //! Returns the list of TopoDS Edges of the top of the boss.
130 Standard_EXPORT const TopTools_ListOfShape& TopEdges();
132 //! Returns the list of TopoDS Edges of the bottom of the boss.
133 Standard_EXPORT const TopTools_ListOfShape& LatEdges();
149 TopTools_DataMapOfShapeListOfShape mySlface;
150 Standard_Real myAngle;
151 TColGeom_SequenceOfCurve myCurves;
152 Handle(Geom_Curve) myBCurve;
153 TopTools_ListOfShape myTopEdges;
154 TopTools_ListOfShape myLatEdges;
155 BRepFeat_StatusError myStatusError;
160 #endif // _BRepFeat_MakeDPrism_HeaderFile