]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_PrismDriver.cxx
Salome HOME
Migration to OCCT 7.0
[modules/geom.git] / src / GEOMImpl / GEOMImpl_PrismDriver.cxx
1 // Copyright (C) 2007-2016  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(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 wether 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 #if OCC_VERSION_MAJOR < 7
260   log.SetTouched(Label());
261 #else
262   log->SetTouched(Label());
263 #endif
264
265   return 1;
266 }
267
268 //=======================================================================
269 //function : MakeScaledPrism
270 //purpose  :
271 //=======================================================================
272 TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShapeBase,
273                                                     const gp_Vec&       theVector,
274                                                     const Standard_Real theScaleFactor,
275                                                     const gp_Pnt&       theCDG,
276                                                     bool                isCDG)
277 {
278   TopoDS_Shape aShape;
279   BRep_Builder B;
280
281   // 1. aCDG = geompy.MakeCDG(theBase)
282   gp_Pnt aCDG = theCDG;
283   if (!isCDG) {
284     gp_Ax3 aPos = GEOMUtils::GetPosition(theShapeBase);
285     aCDG = aPos.Location();
286   }
287   TopoDS_Shape aShapeCDG_1 = BRepBuilderAPI_MakeVertex(aCDG).Shape();
288
289   // Process case of several given shapes
290   if (theShapeBase.ShapeType() == TopAbs_COMPOUND ||
291       theShapeBase.ShapeType() == TopAbs_SHELL) {
292     int nbSub = 0;
293     TopoDS_Shape aShapeI;
294     TopoDS_Compound aCompound;
295     B.MakeCompound(aCompound);
296     TopoDS_Iterator It (theShapeBase, Standard_True, Standard_True);
297     for (; It.More(); It.Next()) {
298       nbSub++;
299       aShapeI = MakeScaledPrism(It.Value(), theVector, theScaleFactor, aCDG, true);
300       B.Add(aCompound, aShapeI);
301     }
302     if (nbSub == 1)
303       aShape = aShapeI;
304     else if (nbSub > 1)
305       aShape = GEOMImpl_GlueDriver::GlueFaces(aCompound, Precision::Confusion(), Standard_True);
306     return aShape;
307   }
308
309   // 2. Scale = geompy.MakeScaleTransform(theBase, aCDG, theScaleFactor)
310
311   // Bug 6839: Check for standalone (not included in faces) degenerated edges
312   TopTools_IndexedDataMapOfShapeListOfShape aEFMap;
313   TopExp::MapShapesAndAncestors(theShapeBase, TopAbs_EDGE, TopAbs_FACE, aEFMap);
314   Standard_Integer i, nbE = aEFMap.Extent();
315   for (i = 1; i <= nbE; i++) {
316     TopoDS_Shape anEdgeSh = aEFMap.FindKey(i);
317     if (BRep_Tool::Degenerated(TopoDS::Edge(anEdgeSh))) {
318       const TopTools_ListOfShape& aFaces = aEFMap.FindFromIndex(i);
319       if (aFaces.IsEmpty())
320         Standard_ConstructionError::Raise
321           ("Scaling aborted : cannot scale standalone degenerated edge");
322     }
323   }
324
325   // Perform Scaling
326   gp_Trsf aTrsf;
327   aTrsf.SetScale(aCDG, theScaleFactor);
328   BRepBuilderAPI_Transform aBRepTrsf (theShapeBase, aTrsf, Standard_False);
329   TopoDS_Shape aScale = aBRepTrsf.Shape();
330
331   // 3. aBase2 = geompy.MakeTranslationVectorDistance(Scale, theVec, theH)
332   gp_Trsf aTrsf3;
333   aTrsf3.SetTranslation(theVector);
334   TopLoc_Location aLocOrig = aScale.Location();
335   gp_Trsf aTrsfOrig = aLocOrig.Transformation();
336   TopLoc_Location aLocRes (aTrsf3 * aTrsfOrig);
337   TopoDS_Shape aBase2 = aScale.Located(aLocRes);
338
339   // 4. aCDG_2 = geompy.MakeTranslationVectorDistance(aCDG, theVec, theH)
340   gp_Pnt aCDG_2 = aCDG.Translated(theVector);
341   TopoDS_Shape aShapeCDG_2 = BRepBuilderAPI_MakeVertex(aCDG_2).Shape();
342
343   // 5. Vector = geompy.MakeVector(aCDG, aCDG_2)
344   TopoDS_Shape aShapeVec = BRepBuilderAPI_MakeEdge(aCDG, aCDG_2).Shape();
345   TopoDS_Edge anEdge = TopoDS::Edge(aShapeVec);
346   TopoDS_Wire aWirePath = BRepBuilderAPI_MakeWire(anEdge);
347
348   // 6. aPrism = geompy.MakePipeWithDifferentSections([theBase, aBase2], [aCDG, aCDG_2], Vector, False, False)
349   Handle(TopTools_HSequenceOfShape) aBases = new TopTools_HSequenceOfShape;
350   aBases->Append(theShapeBase);
351   aBases->Append(aBase2);
352
353   Handle(TopTools_HSequenceOfShape) aLocs = new TopTools_HSequenceOfShape;
354   aLocs->Append(aShapeCDG_1);
355   aLocs->Append(aShapeCDG_2);
356
357   aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
358               (aWirePath, aBases, aLocs, false, false, false);
359
360   // 7. Make a solid, if possible
361   if (theShapeBase.ShapeType() == TopAbs_FACE) {
362     BRepBuilderAPI_Sewing aSewing (Precision::Confusion()*10.0);
363     TopExp_Explorer expF (aShape, TopAbs_FACE);
364     Standard_Integer ifa = 0;
365     for (; expF.More(); expF.Next()) {
366       aSewing.Add(expF.Current());
367       ifa++;
368     }
369     if (ifa > 0) {
370       aSewing.Perform();
371       TopoDS_Shape aShell;
372
373       TopoDS_Shape sh = aSewing.SewedShape();
374       if (sh.ShapeType() == TopAbs_FACE && ifa == 1) {
375         // case for creation of shell from one face
376         TopoDS_Shell ss;
377         B.MakeShell(ss);
378         B.Add(ss,sh);
379         aShell = ss;
380       }
381       else {
382         TopExp_Explorer exp (sh, TopAbs_SHELL);
383         Standard_Integer ish = 0;
384         for (; exp.More(); exp.Next()) {
385           aShell = exp.Current();
386           ish++;
387         }
388         if (ish != 1)
389           aShell = sh;
390       }
391       BRepCheck_Shell chkShell (TopoDS::Shell(aShell));
392       if (chkShell.Closed() == BRepCheck_NoError) {
393         TopoDS_Solid Sol;
394         B.MakeSolid(Sol);
395         B.Add(Sol, aShell);
396         BRepClass3d_SolidClassifier SC (Sol);
397         SC.PerformInfinitePoint(Precision::Confusion());
398         if (SC.State() == TopAbs_IN) {
399           B.MakeSolid(Sol);
400           B.Add(Sol, aShell.Reversed());
401         }
402         aShape = Sol;
403       }
404     }
405   }
406
407   return aShape;
408 }
409
410 //=======================================================================
411 //function : MakeDraftPrism
412 //purpose  :
413 //=======================================================================
414 TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitShape,
415                                                     const TopoDS_Shape& theBaseShape,
416                                                     const Standard_Real theHeight,
417                                                     const Standard_Real theAngle,
418                                                     bool                isProtrusion,
419                                                     const TopoDS_Shape& theSupport,
420                                                     bool                isInvert)
421 {
422   TopoDS_Shape aShape;
423   
424   if (theInitShape.ShapeType() == TopAbs_COMPOUND)
425     {
426       TopExp_Explorer anExp(theInitShape, TopAbs_SOLID);
427       int solidCount = 0;
428       for(;anExp.More();anExp.Next())
429       {
430         solidCount++;
431         if (solidCount > 1)
432           Standard_ConstructionError::Raise("The input shape is a compound with more than one solid");
433       }
434       if (solidCount == 0)
435         Standard_ConstructionError::Raise("The input shape is a compound without any solid");
436     }
437     
438     TopoDS_Wire aWire = TopoDS_Wire();
439     
440     if (theBaseShape.ShapeType() == TopAbs_EDGE)
441     {
442       aWire = BRepBuilderAPI_MakeWire(TopoDS::Edge(theBaseShape));
443     }
444     else if (theBaseShape.ShapeType() == TopAbs_WIRE)
445     {
446       aWire = TopoDS::Wire(theBaseShape);
447     }
448     else
449     {
450       Standard_ConstructionError::Raise("The input profile is neither a wire, nor edge");
451     }
452     
453     TopoDS_Vertex aV1, aV2;
454     TopExp::Vertices(aWire, aV1, aV2);
455     if ( !aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2) )
456       aWire.Closed( true );
457     
458     if (!aWire.Closed())
459       Standard_ConstructionError::Raise("The input profile is not closed");
460     
461     // Construction of the face if the wire hasn't any support face;
462     // the face must be planar for BRepFeat_MakeDPrism
463     TopoDS_Face aFaceBase = BRepBuilderAPI_MakeFace(aWire, /*OnlyPlane=*/true);
464
465     if(!theSupport.IsNull() && theSupport.ShapeType() == TopAbs_FACE) // If the wire has a support
466     {
467       Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(theSupport));
468       TopoDS_Face aTempFace = BRepBuilderAPI_MakeFace(aSurf, aWire);
469       
470       if(aTempFace.Orientation() != TopoDS::Face(theSupport).Orientation())
471       {
472         aFaceBase=TopoDS::Face(aTempFace.Reversed());
473       }
474       else
475         aFaceBase=aTempFace;
476     } 
477     
478     // Invert height and angle if the operation is an extruded cut
479     bool invert = isInvert? isProtrusion : !isProtrusion;
480     
481     // If the face has a reversed orientation invert for extruded boss operations
482     if(aFaceBase.Orientation() == TopAbs_REVERSED)
483       invert = !invert;
484
485     Standard_Real anAngle = theAngle;
486     Standard_Real aHeight = theHeight;
487     if(invert)
488     {
489       anAngle  = -theAngle;  // Invert angle and height
490       aHeight  = -theHeight;
491     }
492     
493     BRepFeat_MakeDPrism aPrism(theInitShape, aFaceBase, aFaceBase,
494                                anAngle*M_PI/180., isProtrusion, Standard_True); 
495     
496     aPrism.Perform(aHeight);
497     aPrism.Check();          // Raises NotDone if done is false
498     
499     aShape = aPrism.Shape();
500     
501     return aShape;
502 }
503                                                    
504 //================================================================================
505 /*!
506  * \brief Returns a name of creation operation and names and values of creation parameters
507  */
508 //================================================================================
509
510 bool GEOMImpl_PrismDriver::
511 GetCreationInformation(std::string&             theOperationName,
512                        std::vector<GEOM_Param>& theParams)
513 {
514   if (Label().IsNull()) return 0;
515   Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
516
517   GEOMImpl_IPrism aCI( function );
518   Standard_Integer aType = function->GetType();
519
520   theOperationName = "EXTRUSION";
521
522   switch ( aType ) {
523   case PRISM_BASE_VEC_H:
524   case PRISM_BASE_VEC_H_2WAYS:
525     AddParam( theParams, "Base", aCI.GetBase() );
526     AddParam( theParams, "Vector", aCI.GetVector() );
527     AddParam( theParams, "Height", aCI.GetH() );
528     AddParam( theParams, "Both Directions", aType == PRISM_BASE_VEC_H_2WAYS );
529     AddParam( theParams, "Scale base-opposite face", aCI.GetScale() );
530     break;
531   case PRISM_BASE_TWO_PNT:
532   case PRISM_BASE_TWO_PNT_2WAYS:
533     AddParam( theParams, "Base", aCI.GetBase() );
534     AddParam( theParams, "Point 1", aCI.GetFirstPoint() );
535     AddParam( theParams, "Point 2", aCI.GetLastPoint() );
536     AddParam( theParams, "Both Directions", aType == PRISM_BASE_VEC_H_2WAYS );
537     AddParam( theParams, "Scale base-opposite face", aCI.GetScale() );
538     break;
539   case PRISM_BASE_DXDYDZ:
540   case PRISM_BASE_DXDYDZ_2WAYS:
541     AddParam( theParams, "Base", aCI.GetBase() );
542     AddParam( theParams, "Dx", aCI.GetDX() );
543     AddParam( theParams, "Dy", aCI.GetDY() );
544     AddParam( theParams, "Dz", aCI.GetDZ() );
545     AddParam( theParams, "Both Directions", aType == PRISM_BASE_VEC_H_2WAYS );
546     AddParam( theParams, "Scale base-opposite face", aCI.GetScale() );
547     break;
548   case DRAFT_PRISM_FEATURE:
549     theOperationName = aCI.GetFuseFlag() ? "EXTRUDED_BOSS" : "EXTRUDED_CUT";
550     AddParam( theParams, "Initial shape", aCI.GetInitShape() );
551     AddParam( theParams, "Profile", aCI.GetBase() );
552     AddParam( theParams, "Height", aCI.GetH() );
553     AddParam( theParams, "Draft angle", aCI.GetDraftAngle() );
554     break;
555   default:
556     return false;
557   }
558
559   return true;
560 }
561
562 OCCT_IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_PrismDriver,GEOM_BaseDriver);