| 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 |
| 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 | class MakePrism from BRepFeat inherits Form from BRepFeat |
| 18 | |
| 19 | ---Purpose: Describes functions to build prism features. |
| 20 | -- These can be depressions or protrusions. |
| 21 | -- The semantics of prism feature creation is |
| 22 | -- based on the construction of shapes: |
| 23 | -- - along a length |
| 24 | -- - up to a limiting face |
| 25 | -- - from a limiting face to a height. |
| 26 | -- The shape defining construction of the prism feature can be |
| 27 | -- either the supporting edge or the concerned area of a face. |
| 28 | -- In case of the supporting edge, this contour |
| 29 | -- can be attached to a face of the basis shape by |
| 30 | -- binding. When the contour is bound to this face, |
| 31 | -- the information that the contour will slide on the |
| 32 | -- face becomes available to the relevant class methods. |
| 33 | -- In case of the concerned area of a face, you |
| 34 | -- could, for example, cut it out and move it to a |
| 35 | -- different height which will define the limiting |
| 36 | -- face of a protrusion or depression. |
| 37 | |
| 38 | uses Shape from TopoDS, |
| 39 | Face from TopoDS, |
| 40 | Edge from TopoDS, |
| 41 | DataMapOfShapeListOfShape from TopTools, |
| 42 | Dir from gp, |
| 43 | DataMapOfShapeShape from TopTools, |
| 44 | SequenceOfCurve from TColGeom, |
| 45 | Curve from Geom, |
| 46 | StatusError from BRepFeat |
| 47 | |
| 48 | raises ConstructionError from Standard |
| 49 | |
| 50 | is |
| 51 | |
| 52 | |
| 53 | Create |
| 54 | |
| 55 | returns MakePrism from BRepFeat; |
| 56 | ---Purpose: Builds a prism by projecting a |
| 57 | -- wire along the face of a shape. Initializes the prism class. |
| 58 | ---C++: inline |
| 59 | |
| 60 | |
| 61 | Create(Sbase : Shape from TopoDS; |
| 62 | Pbase : Shape from TopoDS; |
| 63 | Skface : Face from TopoDS; |
| 64 | Direction : Dir from gp; |
| 65 | Fuse : Integer from Standard; |
| 66 | Modify : Boolean from Standard) |
| 67 | |
| 68 | ---Purpose: Builds a prism by projecting a |
| 69 | -- wire along the face of a shape. a face Pbase is selected in |
| 70 | -- the shape Sbase to serve as the basis for |
| 71 | -- the prism. The orientation of the prism will |
| 72 | -- be defined by the vector Direction. |
| 73 | -- Fuse offers a choice between: |
| 74 | -- - removing matter with a Boolean cut using the setting 0 |
| 75 | -- - adding matter with Boolean fusion using the setting 1. |
| 76 | -- The sketch face Skface serves to determine |
| 77 | -- the type of operation. If it is inside the basis |
| 78 | -- shape, a local operation such as glueing can be performed. |
| 79 | -- Exceptions |
| 80 | -- Standard_ConstructionError if the face |
| 81 | -- does not belong to the basis or the prism shape. |
| 82 | ---C++: inline |
| 83 | returns MakePrism from BRepFeat; |
| 84 | |
| 85 | |
| 86 | Init(me: in out; Sbase : Shape from TopoDS; |
| 87 | Pbase : Shape from TopoDS; |
| 88 | Skface : Face from TopoDS; |
| 89 | Direction : Dir from gp; |
| 90 | Fuse : Integer from Standard; |
| 91 | Modify : Boolean from Standard) |
| 92 | |
| 93 | is static; |
| 94 | ---Purpose: Initializes this algorithm for building prisms along surfaces. |
| 95 | -- A face Pbase is selected in the shape Sbase |
| 96 | -- to serve as the basis for the prism. The |
| 97 | -- orientation of the prism will be defined by the vector Direction. |
| 98 | -- Fuse offers a choice between: |
| 99 | -- - removing matter with a Boolean cut using the setting 0 |
| 100 | -- - adding matter with Boolean fusion using the setting 1. |
| 101 | -- The sketch face Skface serves to determine |
| 102 | -- the type of operation. If it is inside the basis |
| 103 | -- shape, a local operation such as glueing can be performed. |
| 104 | |
| 105 | Add(me: in out; E: Edge from TopoDS; OnFace: Face from TopoDS) |
| 106 | |
| 107 | ---Purpose: Indicates that the edge <E> will slide on the face |
| 108 | -- <OnFace>. Raises ConstructionError if the face does not belong to the |
| 109 | -- basis shape, or the edge to the prismed shape. |
| 110 | raises ConstructionError from Standard |
| 111 | |
| 112 | is static; |
| 113 | |
| 114 | |
| 115 | Perform(me: in out; Length: Real from Standard) |
| 116 | |
| 117 | is static; |
| 118 | |
| 119 | |
| 120 | Perform(me: in out; Until: Shape from TopoDS) |
| 121 | |
| 122 | is static; |
| 123 | |
| 124 | |
| 125 | Perform(me: in out; From : Shape from TopoDS; |
| 126 | Until: Shape from TopoDS) |
| 127 | |
| 128 | is static; |
| 129 | ---Purpose: Assigns one of the following semantics |
| 130 | -- - to a height Length |
| 131 | -- - to a face Until |
| 132 | -- - from a face From to a height Until. |
| 133 | -- Reconstructs the feature topologically according to the semantic option chosen. |
| 134 | |
| 135 | PerformUntilEnd(me: in out) |
| 136 | |
| 137 | is static; |
| 138 | --- Purpose: Realizes a semi-infinite prism, limited by the |
| 139 | -- position of the prism base. All other faces extend infinitely. |
| 140 | |
| 141 | PerformFromEnd(me: in out; FUntil: Shape from TopoDS) |
| 142 | |
| 143 | is static; |
| 144 | ---Purpose: Realizes a semi-infinite prism, limited by the face Funtil. |
| 145 | |
| 146 | |
| 147 | PerformThruAll(me: in out) |
| 148 | |
| 149 | is static; |
| 150 | ---Purpose: Builds an infinite prism. The infinite descendants will not be kept in the result. |
| 151 | |
| 152 | PerformUntilHeight(me: in out; Until : Shape from TopoDS; |
| 153 | Length: Real from Standard) |
| 154 | |
| 155 | is static; |
| 156 | ---Purpose: Assigns both a limiting shape, Until from |
| 157 | -- TopoDS_Shape, and a height, Length at which to stop generation of the prism feature. |
| 158 | |
| 159 | Curves(me: in out; S : in out SequenceOfCurve from TColGeom); |
| 160 | --- Purpose: Returns the list of curves S parallel to the axis of the prism. |
| 161 | |
| 162 | BarycCurve(me: in out) |
| 163 | returns Curve from Geom; |
| 164 | ---Purpose: Generates a curve along the center of mass of the primitive. |
| 165 | fields |
| 166 | |
| 167 | myPbase : Shape from TopoDS; |
| 168 | mySlface : DataMapOfShapeListOfShape from TopTools; |
| 169 | myDir : Dir from gp; |
| 170 | myCurves : SequenceOfCurve from TColGeom; |
| 171 | myBCurve : Curve from Geom; |
| 172 | myStatusError : StatusError from BRepFeat; |
| 173 | |
| 174 | end MakePrism; |