Salome HOME
bdf0231121f1bd85733b28d92c5d6ac77f4796ed
[modules/geom.git] / src / GEOMImpl / GEOMImpl_PrismDriver.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include <GEOMImpl_PrismDriver.hxx>
24
25 #include <GEOMImpl_IPrism.hxx>
26 #include <GEOMImpl_GlueDriver.hxx>
27 #include <GEOMImpl_PipeDriver.hxx>
28 #include <GEOMImpl_Types.hxx>
29
30 #include <GEOM_Function.hxx>
31 #include <GEOM_Object.hxx>
32
33 #include <GEOMUtils.hxx>
34
35 #include <BRepPrimAPI_MakePrism.hxx>
36 #include <BRepFeat_MakeDPrism.hxx>
37
38 #include <BRep_Builder.hxx>
39 #include <BRepBuilderAPI_MakeEdge.hxx>
40 #include <BRepBuilderAPI_MakeWire.hxx>
41 #include <BRepBuilderAPI_MakeFace.hxx>
42 #include <BRepBuilderAPI_MakeVertex.hxx>
43 #include <BRepBuilderAPI_Sewing.hxx>
44 #include <BRepBuilderAPI_Transform.hxx>
45 #include <BRepCheck_Shell.hxx>
46 #include <BRepClass3d_SolidClassifier.hxx>
47 #include <BRep_Tool.hxx>
48 #include <BRepTools.hxx>
49
50 #include <TopAbs.hxx>
51 #include <TopExp.hxx>
52 #include <TopExp_Explorer.hxx>
53 #include <TopoDS.hxx>
54 #include <TopoDS_Compound.hxx>
55 #include <TopoDS_Edge.hxx>
56 #include <TopoDS_Shape.hxx>
57 #include <TopoDS_Shell.hxx>
58 #include <TopoDS_Solid.hxx>
59 #include <TopoDS_Vertex.hxx>
60 #include <TopTools_HSequenceOfShape.hxx>
61 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
62
63 #include <Precision.hxx>
64 #include <gp_Ax3.hxx>
65 #include <gp_Pnt.hxx>
66 #include <gp_Vec.hxx>
67 #include <gp_Trsf.hxx>
68
69 #include <Standard_Stream.hxx>
70
71 #include <Standard_ConstructionError.hxx>
72
73 #include "utilities.h"
74
75 //=======================================================================
76 //function : GetID
77 //purpose  :
78 //=======================================================================
79 const Standard_GUID& GEOMImpl_PrismDriver::GetID()
80 {
81   static Standard_GUID aPrismDriver("FF1BBB17-5D14-4df2-980B-3A668264EA16");
82   return aPrismDriver;
83 }
84
85
86 //=======================================================================
87 //function : GEOMImpl_PrismDriver
88 //purpose  :
89 //=======================================================================
90 GEOMImpl_PrismDriver::GEOMImpl_PrismDriver()
91 {
92 }
93
94 //=======================================================================
95 //function : Execute
96 //purpose  :
97 //=======================================================================
98 Standard_Integer GEOMImpl_PrismDriver::Execute(Handle(TFunction_Logbook)& log) const
99 {
100   if (Label().IsNull()) return 0;
101   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
102
103   GEOMImpl_IPrism aCI (aFunction);
104   Standard_Integer aType = aFunction->GetType();
105
106   TopoDS_Shape aShape;
107
108   if (aType == PRISM_BASE_VEC_H || aType == PRISM_BASE_VEC_H_2WAYS) {
109     Handle(GEOM_Function) aRefBase = aCI.GetBase();
110     Handle(GEOM_Function) aRefVector = aCI.GetVector();
111     TopoDS_Shape aShapeBase = aRefBase->GetValue();
112     TopoDS_Shape aShapeVec = aRefVector->GetValue();
113     if (aShapeVec.ShapeType() == TopAbs_EDGE) {
114       TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
115       TopoDS_Vertex V1, V2;
116       TopExp::Vertices(anE, V1, V2, Standard_True);
117       if (!V1.IsNull() && !V2.IsNull()) {
118         gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
119         if (Abs(aCI.GetH()) < Precision::Confusion()) {
120           Standard_ConstructionError::Raise("Absolute value of prism height is too small");
121         }
122         if (aV.Magnitude() > Precision::Confusion()) {
123           aV.Normalize();
124           if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
125             aShape = MakeScaledPrism(aShapeBase, aV * aCI.GetH(), aCI.GetScale());
126           }
127           else {
128             if (aType == PRISM_BASE_VEC_H_2WAYS) {
129               gp_Trsf aTrsf;
130               aTrsf.SetTranslation((-aV) * aCI.GetH());
131               BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
132               aShapeBase = aTransformation.Shape();
133               aCI.SetH(aCI.GetH()*2);
134             }
135             aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape();
136           }
137         }
138       }
139     }
140   } else if (aType == PRISM_BASE_TWO_PNT || aType == PRISM_BASE_TWO_PNT_2WAYS) {
141     Handle(GEOM_Function) aRefBase = aCI.GetBase();
142     Handle(GEOM_Function) aRefPnt1 = aCI.GetFirstPoint();
143     Handle(GEOM_Function) aRefPnt2 = aCI.GetLastPoint();
144     TopoDS_Shape aShapeBase = aRefBase->GetValue();
145     TopoDS_Shape aShapePnt1 = aRefPnt1->GetValue();
146     TopoDS_Shape aShapePnt2 = aRefPnt2->GetValue();
147     if (aShapePnt1.ShapeType() == TopAbs_VERTEX &&
148         aShapePnt2.ShapeType() == TopAbs_VERTEX) {
149       TopoDS_Vertex V1 = TopoDS::Vertex(aShapePnt1);
150       TopoDS_Vertex V2 = TopoDS::Vertex(aShapePnt2);
151       if (!V1.IsNull() && !V2.IsNull()) {
152         gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
153         if (aV.Magnitude() > gp::Resolution()) {
154           if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
155             aShape = MakeScaledPrism(aShapeBase, aV, aCI.GetScale());
156           }
157           else {
158             if (aType == PRISM_BASE_TWO_PNT_2WAYS) {
159               gp_Trsf aTrsf;
160               aTrsf.SetTranslation(-aV);
161               BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
162               aShapeBase = aTransformation.Shape();
163               aV = aV * 2;
164             }
165             aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
166           }
167         }
168       }
169     }
170   } else if (aType == PRISM_BASE_DXDYDZ || aType == PRISM_BASE_DXDYDZ_2WAYS) {
171     Handle(GEOM_Function) aRefBase = aCI.GetBase();
172     TopoDS_Shape aShapeBase = aRefBase->GetValue();
173     gp_Vec aV (aCI.GetDX(), aCI.GetDY(), aCI.GetDZ());
174     if (aV.Magnitude() > gp::Resolution()) {
175       if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
176         aShape = MakeScaledPrism(aShapeBase, aV, aCI.GetScale());
177       }
178       else {
179         if (aType == PRISM_BASE_DXDYDZ_2WAYS) {
180           gp_Trsf aTrsf;
181           aTrsf.SetTranslation(-aV);
182           BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
183           aShapeBase = aTransformation.Shape();
184           aV = aV * 2;
185         }
186         aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
187       }
188     }
189   }
190   
191   else if (aType == DRAFT_PRISM_FEATURE) {
192     Handle(GEOM_Function) aRefInit = aCI.GetInitShape();
193     Handle(GEOM_Function) aRefBase = aCI.GetBase();   
194     TopoDS_Shape anInitShape = aRefInit->GetValue();        // Initial shape
195     TopoDS_Shape aSketch     = aRefBase->GetValue();  
196     Standard_Real aHeight    = aCI.GetH();                  // Height of the extrusion
197     Standard_Real anAngle    = aCI.GetDraftAngle();         // Draft angle
198     Standard_Boolean isProtrusion = (aCI.GetFuseFlag()==1); 
199     Standard_Boolean isInvert = aCI.GetInvertFlag();
200     // Flag to know whether the feature is a protrusion (fuse) or a depression (cut)
201     
202     // history of the Base wire (RefBase)
203     Handle(GEOM_Object) aSuppObj;
204     TDF_LabelSequence aLabelSeq;
205     aRefBase->GetDependency(aLabelSeq);
206     
207     // If the base wire has only one dependency we use it
208     // to determine the right normal of the face which
209     // must be oriented towards outside of the solid (like the support face)
210     if (aLabelSeq.Length()==1)  
211     {
212       TDF_Label anArgumentRefLabel = aLabelSeq.Value(1);
213       aSuppObj = GEOM_Object::GetReferencedObject(anArgumentRefLabel);   
214     }
215     
216     TopoDS_Shape aSupport;
217     
218     if(!aSuppObj.IsNull())      // If the wire has a support
219       aSupport = aSuppObj->GetValue();
220     
221     aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport, isInvert);
222   }
223
224   if (aShape.IsNull()) return 0;
225   
226   
227   if (aType == DRAFT_PRISM_FEATURE)
228   {
229     TopoDS_Shape aRes = aShape;
230     
231     // If the result is a compound with only one solid,
232     // return the solid
233     if (aShape.ShapeType() == TopAbs_COMPOUND)  
234     {
235       TopExp_Explorer anExp(aShape, TopAbs_SOLID);
236       
237       int solidNb = 0;
238       TopoDS_Solid aSolid;
239       
240       for(;anExp.More();anExp.Next())
241       {
242         aSolid = TopoDS::Solid(anExp.Current());
243         solidNb++;
244         if (solidNb > 1)
245           break;
246       }
247       if (solidNb == 1)
248         aRes = aSolid;
249     } 
250     
251     aFunction->SetValue(aRes);
252   }
253   else
254   {
255     TopoDS_Shape aRes = GEOMUtils::CompsolidToCompound(aShape);
256     aFunction->SetValue(aRes);
257   }
258   
259   log->SetTouched(Label());
260
261   return 1;
262 }
263
264 //=======================================================================
265 //function : MakeScaledPrism
266 //purpose  :
267 //=======================================================================
268 TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShapeBase,
269                                                     const gp_Vec&       theVector,
270                                                     const Standard_Real theScaleFactor,
271                                                     const gp_Pnt&       theCDG,
272                                                     bool                isCDG)
273 {
274   TopoDS_Shape aShape;
275   BRep_Builder B;
276
277   // 1. aCDG = geompy.MakeCDG(theBase)
278   gp_Pnt aCDG = theCDG;
279   if (!isCDG) {
280     gp_Ax3 aPos = GEOMUtils::GetPosition(theShapeBase);
281     aCDG = aPos.Location();
282   }
283   TopoDS_Shape aShapeCDG_1 = BRepBuilderAPI_MakeVertex(aCDG).Shape();
284
285   // Process case of several given shapes
286   if (theShapeBase.ShapeType() == TopAbs_COMPOUND ||
287       theShapeBase.ShapeType() == TopAbs_SHELL) {
288     int nbSub = 0;
289     TopoDS_Shape aShapeI;
290     TopoDS_Compound aCompound;
291     B.MakeCompound(aCompound);
292     TopoDS_Iterator It (theShapeBase, Standard_True, Standard_True);
293     for (; It.More(); It.Next()) {
294       nbSub++;
295       aShapeI = MakeScaledPrism(It.Value(), theVector, theScaleFactor, aCDG, true);
296       B.Add(aCompound, aShapeI);
297     }
298     if (nbSub == 1)
299       aShape = aShapeI;
300     else if (nbSub > 1)
301       aShape = GEOMImpl_GlueDriver::GlueFaces(aCompound, Precision::Confusion(), Standard_True);
302     return aShape;
303   }
304
305   // 2. Scale = geompy.MakeScaleTransform(theBase, aCDG, theScaleFactor)
306
307   // Bug 6839: Check for standalone (not included in faces) degenerated edges
308   TopTools_IndexedDataMapOfShapeListOfShape aEFMap;
309   TopExp::MapShapesAndAncestors(theShapeBase, TopAbs_EDGE, TopAbs_FACE, aEFMap);
310   Standard_Integer i, nbE = aEFMap.Extent();
311   for (i = 1; i <= nbE; i++) {
312     TopoDS_Shape anEdgeSh = aEFMap.FindKey(i);
313     if (BRep_Tool::Degenerated(TopoDS::Edge(anEdgeSh))) {
314       const TopTools_ListOfShape& aFaces = aEFMap.FindFromIndex(i);
315       if (aFaces.IsEmpty())
316         Standard_ConstructionError::Raise
317           ("Scaling aborted : cannot scale standalone degenerated edge");
318     }
319   }
320
321   // Perform Scaling
322   gp_Trsf aTrsf;
323   aTrsf.SetScale(aCDG, theScaleFactor);
324   BRepBuilderAPI_Transform aBRepTrsf (theShapeBase, aTrsf, Standard_False);
325   TopoDS_Shape aScale = aBRepTrsf.Shape();
326
327   // 3. aBase2 = geompy.MakeTranslationVectorDistance(Scale, theVec, theH)
328   gp_Trsf aTrsf3;
329   aTrsf3.SetTranslation(theVector);
330   TopLoc_Location aLocOrig = aScale.Location();
331   gp_Trsf aTrsfOrig = aLocOrig.Transformation();
332   TopLoc_Location aLocRes (aTrsf3 * aTrsfOrig);
333   TopoDS_Shape aBase2 = aScale.Located(aLocRes);
334
335   // 4. aCDG_2 = geompy.MakeTranslationVectorDistance(aCDG, theVec, theH)
336   gp_Pnt aCDG_2 = aCDG.Translated(theVector);
337   TopoDS_Shape aShapeCDG_2 = BRepBuilderAPI_MakeVertex(aCDG_2).Shape();
338
339   // 5. Vector = geompy.MakeVector(aCDG, aCDG_2)
340   TopoDS_Shape aShapeVec = BRepBuilderAPI_MakeEdge(aCDG, aCDG_2).Shape();
341   TopoDS_Edge anEdge = TopoDS::Edge(aShapeVec);
342   TopoDS_Wire aWirePath = BRepBuilderAPI_MakeWire(anEdge);
343
344   // 6. aPrism = geompy.MakePipeWithDifferentSections([theBase, aBase2], [aCDG, aCDG_2], Vector, False, False)
345   Handle(TopTools_HSequenceOfShape) aBases = new TopTools_HSequenceOfShape;
346   aBases->Append(theShapeBase);
347   aBases->Append(aBase2);
348
349   Handle(TopTools_HSequenceOfShape) aLocs = new TopTools_HSequenceOfShape;
350   aLocs->Append(aShapeCDG_1);
351   aLocs->Append(aShapeCDG_2);
352
353   aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
354               (aWirePath, aBases, aLocs, false, false, false);
355
356   // 7. Make a solid, if possible
357   if (theShapeBase.ShapeType() == TopAbs_FACE) {
358     BRepBuilderAPI_Sewing aSewing (Precision::Confusion()*10.0);
359     TopExp_Explorer expF (aShape, TopAbs_FACE);
360     Standard_Integer ifa = 0;
361     for (; expF.More(); expF.Next()) {
362       aSewing.Add(expF.Current());
363       ifa++;
364     }
365     if (ifa > 0) {
366       aSewing.Perform();
367       TopoDS_Shape aShell;
368
369       TopoDS_Shape sh = aSewing.SewedShape();
370       if (sh.ShapeType() == TopAbs_FACE && ifa == 1) {
371         // case for creation of shell from one face
372         TopoDS_Shell ss;
373         B.MakeShell(ss);
374         B.Add(ss,sh);
375         aShell = ss;
376       }
377       else {
378         TopExp_Explorer exp (sh, TopAbs_SHELL);
379         Standard_Integer ish = 0;
380         for (; exp.More(); exp.Next()) {
381           aShell = exp.Current();
382           ish++;
383         }
384         if (ish != 1)
385           aShell = sh;
386       }
387       BRepCheck_Shell chkShell (TopoDS::Shell(aShell));
388       if (chkShell.Closed() == BRepCheck_NoError) {
389         TopoDS_Solid Sol;
390         B.MakeSolid(Sol);
391         B.Add(Sol, aShell);
392         BRepClass3d_SolidClassifier SC (Sol);
393         SC.PerformInfinitePoint(Precision::Confusion());
394         if (SC.State() == TopAbs_IN) {
395           B.MakeSolid(Sol);
396           B.Add(Sol, aShell.Reversed());
397         }
398         aShape = Sol;
399       }
400     }
401   }
402
403   return aShape;
404 }
405
406 //=======================================================================
407 //function : MakeDraftPrism
408 //purpose  :
409 //=======================================================================
410 TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitShape,
411                                                     const TopoDS_Shape& theBaseShape,
412                                                     const Standard_Real theHeight,
413                                                     const Standard_Real theAngle,
414                                                     bool                isProtrusion,
415                                                     const TopoDS_Shape& theSupport,
416                                                     bool                isInvert)
417 {
418   TopoDS_Shape aShape;
419   
420   if (theInitShape.ShapeType() == TopAbs_COMPOUND)
421     {
422       TopExp_Explorer anExp(theInitShape, TopAbs_SOLID);
423       int solidCount = 0;
424       for(;anExp.More();anExp.Next())
425       {
426         solidCount++;
427         if (solidCount > 1)
428           Standard_ConstructionError::Raise("The input shape is a compound with more than one solid");
429       }
430       if (solidCount == 0)
431         Standard_ConstructionError::Raise("The input shape is a compound without any solid");
432     }
433     
434     TopoDS_Wire aWire = TopoDS_Wire();
435     
436     if (theBaseShape.ShapeType() == TopAbs_EDGE)
437     {
438       aWire = BRepBuilderAPI_MakeWire(TopoDS::Edge(theBaseShape));
439     }
440     else if (theBaseShape.ShapeType() == TopAbs_WIRE)
441     {
442       aWire = TopoDS::Wire(theBaseShape);
443     }
444     else
445     {
446       Standard_ConstructionError::Raise("The input profile is neither a wire, nor edge");
447     }
448     
449     TopoDS_Vertex aV1, aV2;
450     TopExp::Vertices(aWire, aV1, aV2);
451     if ( !aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2) )
452       aWire.Closed( true );
453     
454     if (!aWire.Closed())
455       Standard_ConstructionError::Raise("The input profile is not closed");
456     
457     // Construction of the face if the wire hasn't any support face;
458     // the face must be planar for BRepFeat_MakeDPrism
459     TopoDS_Face aFaceBase = BRepBuilderAPI_MakeFace(aWire, /*OnlyPlane=*/true);
460
461     if(!theSupport.IsNull() && theSupport.ShapeType() == TopAbs_FACE) // If the wire has a support
462     {
463       Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(theSupport));
464       TopoDS_Face aTempFace = BRepBuilderAPI_MakeFace(aSurf, aWire);
465       
466       if(aTempFace.Orientation() != TopoDS::Face(theSupport).Orientation())
467       {
468         aFaceBase=TopoDS::Face(aTempFace.Reversed());
469       }
470       else
471         aFaceBase=aTempFace;
472     } 
473     
474     // Invert height and angle if the operation is an extruded cut
475     bool invert = isInvert? isProtrusion : !isProtrusion;
476     
477     // If the face has a reversed orientation invert for extruded boss operations
478     if(aFaceBase.Orientation() == TopAbs_REVERSED)
479       invert = !invert;
480
481     Standard_Real anAngle = theAngle;
482     Standard_Real aHeight = theHeight;
483     if(invert)
484     {
485       anAngle  = -theAngle;  // Invert angle and height
486       aHeight  = -theHeight;
487     }
488     
489     BRepFeat_MakeDPrism aPrism(theInitShape, aFaceBase, aFaceBase,
490                                anAngle*M_PI/180., isProtrusion, Standard_True); 
491     
492     aPrism.Perform(aHeight);
493     aPrism.Check();          // Raises NotDone if done is false
494     
495     aShape = aPrism.Shape();
496     
497     return aShape;
498 }
499                                                    
500 //================================================================================
501 /*!
502  * \brief Returns a name of creation operation and names and values of creation parameters
503  */
504 //================================================================================
505
506 bool GEOMImpl_PrismDriver::
507 GetCreationInformation(std::string&             theOperationName,
508                        std::vector<GEOM_Param>& theParams)
509 {
510   if (Label().IsNull()) return 0;
511   Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
512
513   GEOMImpl_IPrism aCI( function );
514   Standard_Integer aType = function->GetType();
515
516   theOperationName = "EXTRUSION";
517
518   switch ( aType ) {
519   case PRISM_BASE_VEC_H:
520   case PRISM_BASE_VEC_H_2WAYS:
521     AddParam( theParams, "Base", aCI.GetBase() );
522     AddParam( theParams, "Vector", aCI.GetVector() );
523     AddParam( theParams, "Height", aCI.GetH() );
524     AddParam( theParams, "Both Directions", aType == PRISM_BASE_VEC_H_2WAYS );
525     AddParam( theParams, "Scale base-opposite face", aCI.GetScale() );
526     break;
527   case PRISM_BASE_TWO_PNT:
528   case PRISM_BASE_TWO_PNT_2WAYS:
529     AddParam( theParams, "Base", aCI.GetBase() );
530     AddParam( theParams, "Point 1", aCI.GetFirstPoint() );
531     AddParam( theParams, "Point 2", aCI.GetLastPoint() );
532     AddParam( theParams, "Both Directions", aType == PRISM_BASE_VEC_H_2WAYS );
533     AddParam( theParams, "Scale base-opposite face", aCI.GetScale() );
534     break;
535   case PRISM_BASE_DXDYDZ:
536   case PRISM_BASE_DXDYDZ_2WAYS:
537     AddParam( theParams, "Base", aCI.GetBase() );
538     AddParam( theParams, "Dx", aCI.GetDX() );
539     AddParam( theParams, "Dy", aCI.GetDY() );
540     AddParam( theParams, "Dz", aCI.GetDZ() );
541     AddParam( theParams, "Both Directions", aType == PRISM_BASE_VEC_H_2WAYS );
542     AddParam( theParams, "Scale base-opposite face", aCI.GetScale() );
543     break;
544   case DRAFT_PRISM_FEATURE:
545     theOperationName = aCI.GetFuseFlag() ? "EXTRUDED_BOSS" : "EXTRUDED_CUT";
546     AddParam( theParams, "Initial shape", aCI.GetInitShape() );
547     AddParam( theParams, "Profile", aCI.GetBase() );
548     AddParam( theParams, "Height", aCI.GetH() );
549     AddParam( theParams, "Draft angle", aCI.GetDraftAngle() );
550     break;
551   default:
552     return false;
553   }
554
555   return true;
556 }
557
558 IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_PrismDriver,GEOM_BaseDriver)