| 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 |
| 5 | // |
| 6 | // This file is part of Open CASCADE Technology software library. |
| 7 | // |
| 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. |
| 13 | // |
| 14 | // Alternatively, this file may be used under the terms of Open CASCADE |
| 15 | // commercial license or contractual agreement. |
| 16 | |
| 17 | #ifndef _BRepFeat_MakeDPrism_HeaderFile |
| 18 | #define _BRepFeat_MakeDPrism_HeaderFile |
| 19 | |
| 20 | #include <Standard.hxx> |
| 21 | #include <Standard_DefineAlloc.hxx> |
| 22 | #include <Standard_Handle.hxx> |
| 23 | |
| 24 | #include <TopoDS_Face.hxx> |
| 25 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
| 26 | #include <Standard_Real.hxx> |
| 27 | #include <TColGeom_SequenceOfCurve.hxx> |
| 28 | #include <TopTools_ListOfShape.hxx> |
| 29 | #include <BRepFeat_StatusError.hxx> |
| 30 | #include <BRepFeat_Form.hxx> |
| 31 | #include <Standard_Integer.hxx> |
| 32 | #include <Standard_Boolean.hxx> |
| 33 | class Geom_Curve; |
| 34 | class Standard_ConstructionError; |
| 35 | class TopoDS_Shape; |
| 36 | class TopoDS_Face; |
| 37 | class TopoDS_Edge; |
| 38 | |
| 39 | |
| 40 | //! Describes functions to build draft |
| 41 | //! prism topologies from basis shape surfaces. These can be depressions or protrusions. |
| 42 | //! The semantics of draft prism feature creation is based on the |
| 43 | //! construction of shapes: |
| 44 | //! - along a length |
| 45 | //! - up to a limiting face |
| 46 | //! - from a limiting face to a height. |
| 47 | //! The shape defining construction of the draft prism feature can be |
| 48 | //! either the supporting edge or the concerned area of a face. |
| 49 | //! In case of the supporting edge, this contour can be attached to a |
| 50 | //! face of the basis shape by binding. When the contour is bound to this |
| 51 | //! face, the information that the contour will slide on the face |
| 52 | //! becomes available to the relevant class methods. |
| 53 | //! In case of the concerned area of a face, you could, for example, cut |
| 54 | //! it out and move it to a different height which will define the |
| 55 | //! limiting face of a protrusion or depression. |
| 56 | class BRepFeat_MakeDPrism : public BRepFeat_Form |
| 57 | { |
| 58 | public: |
| 59 | |
| 60 | DEFINE_STANDARD_ALLOC |
| 61 | |
| 62 | |
| 63 | //! A face Pbase is selected in the shape |
| 64 | //! Sbase to serve as the basis for the draft prism. The |
| 65 | //! draft will be defined by the angle Angle and Fuse offers a choice between: |
| 66 | //! - removing matter with a Boolean cut using the setting 0 |
| 67 | //! - adding matter with Boolean fusion using the setting 1. |
| 68 | //! The sketch face Skface serves to determine the type of |
| 69 | //! operation. If it is inside the basis shape, a local |
| 70 | //! operation such as glueing can be performed. |
| 71 | //! Initializes the draft prism class |
| 72 | 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) |
| 73 | { |
| 74 | Init (Sbase, Pbase, Skface, Angle, Fuse, Modify); |
| 75 | } |
| 76 | |
| 77 | BRepFeat_MakeDPrism() |
| 78 | : myAngle(RealLast()), |
| 79 | myStatusError(BRepFeat_OK) |
| 80 | { |
| 81 | } |
| 82 | |
| 83 | //! Initializes this algorithm for building draft prisms along surfaces. |
| 84 | //! A face Pbase is selected in the basis shape Sbase to |
| 85 | //! serve as the basis from the draft prism. The draft will be |
| 86 | //! defined by the angle Angle and Fuse offers a choice between: |
| 87 | //! - removing matter with a Boolean cut using the setting 0 |
| 88 | //! - adding matter with Boolean fusion using the setting 1. |
| 89 | //! The sketch face Skface serves to determine the type of |
| 90 | //! operation. If it is inside the basis shape, a local |
| 91 | //! operation such as glueing can be performed. |
| 92 | 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); |
| 93 | |
| 94 | //! Indicates that the edge <E> will slide on the face |
| 95 | //! <OnFace>. |
| 96 | //! Raises ConstructionError if the face does not belong to the |
| 97 | //! basis shape, or the edge to the prismed shape. |
| 98 | Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace); |
| 99 | |
| 100 | Standard_EXPORT void Perform (const Standard_Real Height); |
| 101 | |
| 102 | Standard_EXPORT void Perform (const TopoDS_Shape& Until); |
| 103 | |
| 104 | //! Assigns one of the following semantics |
| 105 | //! - to a height Height |
| 106 | //! - to a face Until |
| 107 | //! - from a face From to a height Until. |
| 108 | //! Reconstructs the feature topologically according to the semantic option chosen. |
| 109 | Standard_EXPORT void Perform (const TopoDS_Shape& From, const TopoDS_Shape& Until); |
| 110 | |
| 111 | //! Realizes a semi-infinite prism, limited by the position of the prism base. |
| 112 | Standard_EXPORT void PerformUntilEnd(); |
| 113 | |
| 114 | //! Realizes a semi-infinite prism, limited by the face Funtil. |
| 115 | Standard_EXPORT void PerformFromEnd (const TopoDS_Shape& FUntil); |
| 116 | |
| 117 | //! Builds an infinite prism. The infinite descendants will not be kept in the result. |
| 118 | Standard_EXPORT void PerformThruAll(); |
| 119 | |
| 120 | //! Assigns both a limiting shape, Until from |
| 121 | //! TopoDS_Shape, and a height, Height at which to stop |
| 122 | //! generation of the prism feature. |
| 123 | Standard_EXPORT void PerformUntilHeight (const TopoDS_Shape& Until, const Standard_Real Height); |
| 124 | |
| 125 | Standard_EXPORT void Curves (TColGeom_SequenceOfCurve& S); |
| 126 | |
| 127 | Standard_EXPORT Handle(Geom_Curve) BarycCurve(); |
| 128 | |
| 129 | //! Determination of TopEdges and LatEdges. |
| 130 | //! sig = 1 -> TopEdges = FirstShape of the DPrism |
| 131 | //! sig = 2 -> TOpEdges = LastShape of the DPrism |
| 132 | Standard_EXPORT void BossEdges (const Standard_Integer sig); |
| 133 | |
| 134 | //! Returns the list of TopoDS Edges of the top of the boss. |
| 135 | Standard_EXPORT const TopTools_ListOfShape& TopEdges(); |
| 136 | |
| 137 | //! Returns the list of TopoDS Edges of the bottom of the boss. |
| 138 | Standard_EXPORT const TopTools_ListOfShape& LatEdges(); |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | protected: |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | private: |
| 150 | |
| 151 | |
| 152 | |
| 153 | TopoDS_Face myPbase; |
| 154 | TopTools_DataMapOfShapeListOfShape mySlface; |
| 155 | Standard_Real myAngle; |
| 156 | TColGeom_SequenceOfCurve myCurves; |
| 157 | Handle(Geom_Curve) myBCurve; |
| 158 | TopTools_ListOfShape myTopEdges; |
| 159 | TopTools_ListOfShape myLatEdges; |
| 160 | BRepFeat_StatusError myStatusError; |
| 161 | |
| 162 | |
| 163 | }; |
| 164 | |
| 165 | #endif // _BRepFeat_MakeDPrism_HeaderFile |