1 // Created on: 1996-02-13
2 // Created by: Jacques GOUSSARD
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_MakePrism_HeaderFile
18 #define _BRepFeat_MakePrism_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopoDS_Shape.hxx>
25 #include <TopTools_DataMapOfShapeListOfShape.hxx>
27 #include <TColGeom_SequenceOfCurve.hxx>
28 #include <BRepFeat_StatusError.hxx>
29 #include <BRepFeat_Form.hxx>
30 #include <Standard_Integer.hxx>
31 #include <Standard_Boolean.hxx>
32 #include <Standard_Real.hxx>
34 class Standard_ConstructionError;
41 //! Describes functions to build prism features.
42 //! These can be depressions or protrusions.
43 //! The semantics of prism feature creation is
44 //! based on the construction of shapes:
46 //! - up to a limiting face
47 //! - from a limiting face to a height.
48 //! The shape defining construction of the prism feature can be
49 //! either the supporting edge or the concerned area of a face.
50 //! In case of the supporting edge, this contour
51 //! can be attached to a face of the basis shape by
52 //! binding. When the contour is bound to this face,
53 //! the information that the contour will slide on the
54 //! face becomes available to the relevant class methods.
55 //! In case of the concerned area of a face, you
56 //! could, for example, cut it out and move it to a
57 //! different height which will define the limiting
58 //! face of a protrusion or depression.
59 class BRepFeat_MakePrism : public BRepFeat_Form
66 //! Builds a prism by projecting a
67 //! wire along the face of a shape. Initializes the prism class.
70 //! Builds a prism by projecting a
71 //! wire along the face of a shape. a face Pbase is selected in
72 //! the shape Sbase to serve as the basis for
73 //! the prism. The orientation of the prism will
74 //! be defined by the vector Direction.
75 //! Fuse offers a choice between:
76 //! - removing matter with a Boolean cut using the setting 0
77 //! - adding matter with Boolean fusion using the setting 1.
78 //! The sketch face Skface serves to determine
79 //! the type of operation. If it is inside the basis
80 //! shape, a local operation such as glueing can be performed.
82 //! Standard_ConstructionError if the face
83 //! does not belong to the basis or the prism shape.
84 BRepFeat_MakePrism(const TopoDS_Shape& Sbase, const TopoDS_Shape& Pbase, const TopoDS_Face& Skface, const gp_Dir& Direction, const Standard_Integer Fuse, const Standard_Boolean Modify);
86 //! Initializes this algorithm for building prisms along surfaces.
87 //! A face Pbase is selected in the shape Sbase
88 //! to serve as the basis for the prism. The
89 //! orientation of the prism will be defined by the vector Direction.
90 //! Fuse offers a choice between:
91 //! - removing matter with a Boolean cut using the setting 0
92 //! - adding matter with Boolean fusion using the setting 1.
93 //! The sketch face Skface serves to determine
94 //! the type of operation. If it is inside the basis
95 //! shape, a local operation such as glueing can be performed.
96 Standard_EXPORT void Init (const TopoDS_Shape& Sbase, const TopoDS_Shape& Pbase, const TopoDS_Face& Skface, const gp_Dir& Direction, const Standard_Integer Fuse, const Standard_Boolean Modify);
98 //! Indicates that the edge <E> will slide on the face
99 //! <OnFace>. Raises ConstructionError if the face does not belong to the
100 //! basis shape, or the edge to the prismed shape.
101 Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace);
103 Standard_EXPORT void Perform (const Standard_Real Length);
105 Standard_EXPORT void Perform (const TopoDS_Shape& Until);
107 //! Assigns one of the following semantics
108 //! - to a height Length
109 //! - to a face Until
110 //! - from a face From to a height Until.
111 //! Reconstructs the feature topologically according to the semantic option chosen.
112 Standard_EXPORT void Perform (const TopoDS_Shape& From, const TopoDS_Shape& Until);
114 //! Realizes a semi-infinite prism, limited by the
115 //! position of the prism base. All other faces extend infinitely.
116 Standard_EXPORT void PerformUntilEnd();
118 //! Realizes a semi-infinite prism, limited by the face Funtil.
119 Standard_EXPORT void PerformFromEnd (const TopoDS_Shape& FUntil);
121 //! Builds an infinite prism. The infinite descendants will not be kept in the result.
122 Standard_EXPORT void PerformThruAll();
124 //! Assigns both a limiting shape, Until from
125 //! TopoDS_Shape, and a height, Length at which to stop generation of the prism feature.
126 Standard_EXPORT void PerformUntilHeight (const TopoDS_Shape& Until, const Standard_Real Length);
128 //! Returns the list of curves S parallel to the axis of the prism.
129 Standard_EXPORT void Curves (TColGeom_SequenceOfCurve& S);
131 //! Generates a curve along the center of mass of the primitive.
132 Standard_EXPORT Handle(Geom_Curve) BarycCurve();
147 TopoDS_Shape myPbase;
148 TopTools_DataMapOfShapeListOfShape mySlface;
150 TColGeom_SequenceOfCurve myCurves;
151 Handle(Geom_Curve) myBCurve;
152 BRepFeat_StatusError myStatusError;
158 #include <BRepFeat_MakePrism.lxx>
164 #endif // _BRepFeat_MakePrism_HeaderFile