Back to index

salome-geom  6.5.0
GEOMImpl_PrismDriver.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include <GEOMImpl_PrismDriver.hxx>
00024 
00025 #include <GEOMImpl_IPrism.hxx>
00026 #include <GEOMImpl_IShapesOperations.hxx>
00027 #include <GEOMImpl_IMeasureOperations.hxx>
00028 #include <GEOMImpl_GlueDriver.hxx>
00029 #include <GEOMImpl_PipeDriver.hxx>
00030 #include <GEOMImpl_Types.hxx>
00031 #include <GEOM_Function.hxx>
00032 
00033 #include <BRepPrimAPI_MakePrism.hxx>
00034 #include <BRepFeat_MakeDPrism.hxx>
00035 
00036 #include <BRep_Builder.hxx>
00037 #include <BRepBuilderAPI_MakeEdge.hxx>
00038 #include <BRepBuilderAPI_MakeWire.hxx>
00039 #include <BRepBuilderAPI_MakeFace.hxx>
00040 #include <BRepBuilderAPI_MakeVertex.hxx>
00041 #include <BRepBuilderAPI_Sewing.hxx>
00042 #include <BRepBuilderAPI_Transform.hxx>
00043 #include <BRepCheck_Shell.hxx>
00044 #include <BRepClass3d_SolidClassifier.hxx>
00045 #include <BRep_Tool.hxx>
00046 #include <BRepTools.hxx>
00047 
00048 #include <TopAbs.hxx>
00049 #include <TopExp.hxx>
00050 #include <TopExp_Explorer.hxx>
00051 #include <TopoDS.hxx>
00052 #include <TopoDS_Compound.hxx>
00053 #include <TopoDS_Edge.hxx>
00054 #include <TopoDS_Shape.hxx>
00055 #include <TopoDS_Shell.hxx>
00056 #include <TopoDS_Solid.hxx>
00057 #include <TopoDS_Vertex.hxx>
00058 #include <TopTools_HSequenceOfShape.hxx>
00059 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
00060 
00061 #include <Precision.hxx>
00062 #include <gp_Ax3.hxx>
00063 #include <gp_Pnt.hxx>
00064 #include <gp_Vec.hxx>
00065 #include <gp_Trsf.hxx>
00066 
00067 #include <Standard_Stream.hxx>
00068 
00069 #include <Standard_ConstructionError.hxx>
00070 
00071 #include "utilities.h"
00072 
00073 //=======================================================================
00074 //function : GetID
00075 //purpose  :
00076 //=======================================================================
00077 const Standard_GUID& GEOMImpl_PrismDriver::GetID()
00078 {
00079   static Standard_GUID aPrismDriver("FF1BBB17-5D14-4df2-980B-3A668264EA16");
00080   return aPrismDriver;
00081 }
00082 
00083 
00084 //=======================================================================
00085 //function : GEOMImpl_PrismDriver
00086 //purpose  :
00087 //=======================================================================
00088 GEOMImpl_PrismDriver::GEOMImpl_PrismDriver()
00089 {
00090 }
00091 
00092 //=======================================================================
00093 //function : Execute
00094 //purpose  :
00095 //=======================================================================
00096 Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
00097 {
00098   if (Label().IsNull()) return 0;
00099   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
00100 
00101   GEOMImpl_IPrism aCI (aFunction);
00102   Standard_Integer aType = aFunction->GetType();
00103 
00104   TopoDS_Shape aShape;
00105 
00106   if (aType == PRISM_BASE_VEC_H || aType == PRISM_BASE_VEC_H_2WAYS) {
00107     Handle(GEOM_Function) aRefBase = aCI.GetBase();
00108     Handle(GEOM_Function) aRefVector = aCI.GetVector();
00109     TopoDS_Shape aShapeBase = aRefBase->GetValue();
00110     TopoDS_Shape aShapeVec = aRefVector->GetValue();
00111     if (aShapeVec.ShapeType() == TopAbs_EDGE) {
00112       TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
00113       TopoDS_Vertex V1, V2;
00114       TopExp::Vertices(anE, V1, V2, Standard_True);
00115       if (!V1.IsNull() && !V2.IsNull()) {
00116         gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
00117         if (Abs(aCI.GetH()) < Precision::Confusion()) {
00118           Standard_ConstructionError::Raise("Absolute value of prism height is too small");
00119         }
00120         if (aV.Magnitude() > Precision::Confusion()) {
00121           aV.Normalize();
00122           if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
00123             aShape = MakeScaledPrism(aShapeBase, aV * aCI.GetH(), aCI.GetScale());
00124           }
00125           else {
00126             if (aType == PRISM_BASE_VEC_H_2WAYS) {
00127               gp_Trsf aTrsf;
00128               aTrsf.SetTranslation((-aV) * aCI.GetH());
00129               BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
00130               aShapeBase = aTransformation.Shape();
00131               aCI.SetH(aCI.GetH()*2);
00132             }
00133             aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape();
00134           }
00135         }
00136       }
00137     }
00138   } else if (aType == PRISM_BASE_TWO_PNT || aType == PRISM_BASE_TWO_PNT_2WAYS) {
00139     Handle(GEOM_Function) aRefBase = aCI.GetBase();
00140     Handle(GEOM_Function) aRefPnt1 = aCI.GetFirstPoint();
00141     Handle(GEOM_Function) aRefPnt2 = aCI.GetLastPoint();
00142     TopoDS_Shape aShapeBase = aRefBase->GetValue();
00143     TopoDS_Shape aShapePnt1 = aRefPnt1->GetValue();
00144     TopoDS_Shape aShapePnt2 = aRefPnt2->GetValue();
00145     if (aShapePnt1.ShapeType() == TopAbs_VERTEX &&
00146         aShapePnt2.ShapeType() == TopAbs_VERTEX) {
00147       TopoDS_Vertex V1 = TopoDS::Vertex(aShapePnt1);
00148       TopoDS_Vertex V2 = TopoDS::Vertex(aShapePnt2);
00149       if (!V1.IsNull() && !V2.IsNull()) {
00150         gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
00151         if (aV.Magnitude() > gp::Resolution()) {
00152           if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
00153             aShape = MakeScaledPrism(aShapeBase, aV, aCI.GetScale());
00154           }
00155           else {
00156             if (aType == PRISM_BASE_TWO_PNT_2WAYS) {
00157               gp_Trsf aTrsf;
00158               aTrsf.SetTranslation(-aV);
00159               BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
00160               aShapeBase = aTransformation.Shape();
00161               aV = aV * 2;
00162             }
00163             aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
00164           }
00165         }
00166       }
00167     }
00168   } else if (aType == PRISM_BASE_DXDYDZ || aType == PRISM_BASE_DXDYDZ_2WAYS) {
00169     Handle(GEOM_Function) aRefBase = aCI.GetBase();
00170     TopoDS_Shape aShapeBase = aRefBase->GetValue();
00171     gp_Vec aV (aCI.GetDX(), aCI.GetDY(), aCI.GetDZ());
00172     if (aV.Magnitude() > gp::Resolution()) {
00173       if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
00174         aShape = MakeScaledPrism(aShapeBase, aV, aCI.GetScale());
00175       }
00176       else {
00177         if (aType == PRISM_BASE_DXDYDZ_2WAYS) {
00178           gp_Trsf aTrsf;
00179           aTrsf.SetTranslation(-aV);
00180           BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
00181           aShapeBase = aTransformation.Shape();
00182           aV = aV * 2;
00183         }
00184         aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
00185       }
00186     }
00187   }
00188   
00189   else if (aType == DRAFT_PRISM_FEATURE) {
00190     Handle(GEOM_Function) aRefInit = aCI.GetInitShape();
00191     Handle(GEOM_Function) aRefBase = aCI.GetBase();   
00192     TopoDS_Shape anInitShape = aRefInit->GetValue();        // Initial shape
00193     TopoDS_Shape aSketch     = aRefBase->GetValue();  
00194     Standard_Real aHeight    = aCI.GetH();                  // Height of the extrusion
00195     Standard_Real anAngle    = aCI.GetDraftAngle();         // Draft angle
00196     Standard_Boolean isProtrusion = (aCI.GetFuseFlag()==1); 
00197     // Flag to know wether the feature is a protrusion (fuse) or a depression (cut)
00198     
00199     // history of the Base wire (RefBase)
00200     Handle(GEOM_Object) aSuppObj;
00201     TDF_LabelSequence aLabelSeq;
00202     aRefBase->GetDependency(aLabelSeq);
00203     
00204     // If the base wire has only one dependency we use it
00205     // to determine the right normal of the face which
00206     // must be oriented towards outside of the solid (like the support face)
00207     if (aLabelSeq.Length()==1)  
00208     {
00209       TDF_Label anArgumentRefLabel = aLabelSeq.Value(1);
00210       aSuppObj = GEOM_Object::GetReferencedObject(anArgumentRefLabel);   
00211     }
00212     
00213     TopoDS_Shape aSupport;
00214     
00215     if(!aSuppObj.IsNull())      // If the wire has a support
00216       aSupport = aSuppObj->GetValue();
00217     
00218     aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport); 
00219   }
00220 
00221   if (aShape.IsNull()) return 0;
00222   
00223   
00224   if (aType == DRAFT_PRISM_FEATURE)
00225   {
00226     TopoDS_Shape aRes = aShape;
00227     
00228     // If the result is a compound with only one solid,
00229     // return the solid
00230     if (aShape.ShapeType() == TopAbs_COMPOUND)  
00231     {
00232       TopExp_Explorer anExp(aShape, TopAbs_SOLID);
00233       
00234       int solidNb = 0;
00235       TopoDS_Solid aSolid;
00236       
00237       for(;anExp.More();anExp.Next())
00238       {
00239         aSolid = TopoDS::Solid(anExp.Current());
00240         solidNb++;
00241         if (solidNb > 1)
00242           break;
00243       }
00244       if (solidNb == 1)
00245         aRes = aSolid;
00246     } 
00247     
00248     aFunction->SetValue(aRes);
00249   }
00250   else
00251   {
00252     TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
00253     aFunction->SetValue(aRes);
00254   }
00255   
00256 
00257   log.SetTouched(Label());
00258 
00259   return 1;
00260 }
00261 
00262 //=======================================================================
00263 //function : MakeScaledPrism
00264 //purpose  :
00265 //=======================================================================
00266 TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShapeBase,
00267                                                     const gp_Vec&       theVector,
00268                                                     const Standard_Real theScaleFactor,
00269                                                     const gp_Pnt&       theCDG,
00270                                                     bool                isCDG)
00271 {
00272   TopoDS_Shape aShape;
00273   BRep_Builder B;
00274 
00275   // 1. aCDG = geompy.MakeCDG(theBase)
00276   gp_Pnt aCDG = theCDG;
00277   if (!isCDG) {
00278     gp_Ax3 aPos = GEOMImpl_IMeasureOperations::GetPosition(theShapeBase);
00279     aCDG = aPos.Location();
00280   }
00281   TopoDS_Shape aShapeCDG_1 = BRepBuilderAPI_MakeVertex(aCDG).Shape();
00282 
00283   // Process case of several given shapes
00284   if (theShapeBase.ShapeType() == TopAbs_COMPOUND ||
00285       theShapeBase.ShapeType() == TopAbs_SHELL) {
00286     int nbSub = 0;
00287     TopoDS_Shape aShapeI;
00288     TopoDS_Compound aCompound;
00289     B.MakeCompound(aCompound);
00290     TopoDS_Iterator It (theShapeBase, Standard_True, Standard_True);
00291     for (; It.More(); It.Next()) {
00292       nbSub++;
00293       aShapeI = MakeScaledPrism(It.Value(), theVector, theScaleFactor, aCDG, true);
00294       B.Add(aCompound, aShapeI);
00295     }
00296     if (nbSub == 1)
00297       aShape = aShapeI;
00298     else if (nbSub > 1)
00299       aShape = GEOMImpl_GlueDriver::GlueFaces(aCompound, Precision::Confusion(), Standard_True);
00300     return aShape;
00301   }
00302 
00303   // 2. Scale = geompy.MakeScaleTransform(theBase, aCDG, theScaleFactor)
00304 
00305   // Bug 6839: Check for standalone (not included in faces) degenerated edges
00306   TopTools_IndexedDataMapOfShapeListOfShape aEFMap;
00307   TopExp::MapShapesAndAncestors(theShapeBase, TopAbs_EDGE, TopAbs_FACE, aEFMap);
00308   Standard_Integer i, nbE = aEFMap.Extent();
00309   for (i = 1; i <= nbE; i++) {
00310     TopoDS_Shape anEdgeSh = aEFMap.FindKey(i);
00311     if (BRep_Tool::Degenerated(TopoDS::Edge(anEdgeSh))) {
00312       const TopTools_ListOfShape& aFaces = aEFMap.FindFromIndex(i);
00313       if (aFaces.IsEmpty())
00314         Standard_ConstructionError::Raise
00315           ("Scaling aborted : cannot scale standalone degenerated edge");
00316     }
00317   }
00318 
00319   // Perform Scaling
00320   gp_Trsf aTrsf;
00321   aTrsf.SetScale(aCDG, theScaleFactor);
00322   BRepBuilderAPI_Transform aBRepTrsf (theShapeBase, aTrsf, Standard_False);
00323   TopoDS_Shape aScale = aBRepTrsf.Shape();
00324 
00325   // 3. aBase2 = geompy.MakeTranslationVectorDistance(Scale, theVec, theH)
00326   gp_Trsf aTrsf3;
00327   aTrsf3.SetTranslation(theVector);
00328   TopLoc_Location aLocOrig = aScale.Location();
00329   gp_Trsf aTrsfOrig = aLocOrig.Transformation();
00330   TopLoc_Location aLocRes (aTrsf3 * aTrsfOrig);
00331   TopoDS_Shape aBase2 = aScale.Located(aLocRes);
00332 
00333   // 4. aCDG_2 = geompy.MakeTranslationVectorDistance(aCDG, theVec, theH)
00334   gp_Pnt aCDG_2 = aCDG.Translated(theVector);
00335   TopoDS_Shape aShapeCDG_2 = BRepBuilderAPI_MakeVertex(aCDG_2).Shape();
00336 
00337   // 5. Vector = geompy.MakeVector(aCDG, aCDG_2)
00338   TopoDS_Shape aShapeVec = BRepBuilderAPI_MakeEdge(aCDG, aCDG_2).Shape();
00339   TopoDS_Edge anEdge = TopoDS::Edge(aShapeVec);
00340   TopoDS_Wire aWirePath = BRepBuilderAPI_MakeWire(anEdge);
00341 
00342   // 6. aPrism = geompy.MakePipeWithDifferentSections([theBase, aBase2], [aCDG, aCDG_2], Vector, False, False)
00343   Handle(TopTools_HSequenceOfShape) aBases = new TopTools_HSequenceOfShape;
00344   aBases->Append(theShapeBase);
00345   aBases->Append(aBase2);
00346 
00347   Handle(TopTools_HSequenceOfShape) aLocs = new TopTools_HSequenceOfShape;
00348   aLocs->Append(aShapeCDG_1);
00349   aLocs->Append(aShapeCDG_2);
00350 
00351   aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections(aWirePath, aBases, aLocs, false, false);
00352 
00353   // 7. Make a solid, if possible
00354   if (theShapeBase.ShapeType() == TopAbs_FACE) {
00355     BRepBuilderAPI_Sewing aSewing (Precision::Confusion()*10.0);
00356     TopExp_Explorer expF (aShape, TopAbs_FACE);
00357     Standard_Integer ifa = 0;
00358     for (; expF.More(); expF.Next()) {
00359       aSewing.Add(expF.Current());
00360       ifa++;
00361     }
00362     if (ifa > 0) {
00363       aSewing.Perform();
00364       TopoDS_Shape aShell;
00365 
00366       TopoDS_Shape sh = aSewing.SewedShape();
00367       if (sh.ShapeType() == TopAbs_FACE && ifa == 1) {
00368         // case for creation of shell from one face
00369         TopoDS_Shell ss;
00370         B.MakeShell(ss);
00371         B.Add(ss,sh);
00372         aShell = ss;
00373       }
00374       else {
00375         TopExp_Explorer exp (sh, TopAbs_SHELL);
00376         Standard_Integer ish = 0;
00377         for (; exp.More(); exp.Next()) {
00378           aShell = exp.Current();
00379           ish++;
00380         }
00381         if (ish != 1)
00382           aShell = sh;
00383       }
00384       BRepCheck_Shell chkShell (TopoDS::Shell(aShell));
00385       if (chkShell.Closed() == BRepCheck_NoError) {
00386         TopoDS_Solid Sol;
00387         B.MakeSolid(Sol);
00388         B.Add(Sol, aShell);
00389         BRepClass3d_SolidClassifier SC (Sol);
00390         SC.PerformInfinitePoint(Precision::Confusion());
00391         if (SC.State() == TopAbs_IN) {
00392           B.MakeSolid(Sol);
00393           B.Add(Sol, aShell.Reversed());
00394         }
00395         aShape = Sol;
00396       }
00397     }
00398   }
00399 
00400   return aShape;
00401 }
00402 
00403 //=======================================================================
00404 //function : MakeDraftPrism
00405 //purpose  :
00406 //=======================================================================
00407 TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitShape,
00408                                                     const TopoDS_Shape& theBaseShape,
00409                                                     const Standard_Real theHeight,
00410                                                     const Standard_Real theAngle,
00411                                                     bool                isProtrusion,
00412                                                     const TopoDS_Shape& theSupport)
00413 {
00414   TopoDS_Shape aShape;
00415   
00416   if (theInitShape.ShapeType() == TopAbs_COMPOUND)
00417     {
00418       TopExp_Explorer anExp(theInitShape, TopAbs_SOLID);
00419       int solidCount = 0;
00420       for(;anExp.More();anExp.Next())
00421       {
00422         solidCount++;
00423         if (solidCount > 1)
00424           Standard_ConstructionError::Raise("The input shape is a compound with more than one solid");
00425       }
00426       if (solidCount == 0)
00427         Standard_ConstructionError::Raise("The input shape is a compound without any solid");
00428     }
00429     
00430     TopoDS_Wire aWire = TopoDS_Wire();
00431     
00432     if (theBaseShape.ShapeType() == TopAbs_EDGE)
00433     {
00434       aWire = BRepBuilderAPI_MakeWire(TopoDS::Edge(theBaseShape));
00435     }
00436     else if (theBaseShape.ShapeType() == TopAbs_WIRE)
00437     {
00438       aWire = TopoDS::Wire(theBaseShape);
00439     }
00440     else
00441     {
00442       Standard_ConstructionError::Raise("The input profile is neither a wire, nor edge");
00443     }
00444     
00445     TopoDS_Vertex aV1, aV2;
00446     TopExp::Vertices(aWire, aV1, aV2);
00447     if ( !aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2) )
00448       aWire.Closed( true );
00449     
00450     if (!aWire.Closed())
00451       Standard_ConstructionError::Raise("The input profile is not closed");
00452     
00453     // Construction of the face if the wire hasn't any support face
00454     TopoDS_Face aFaceBase = BRepBuilderAPI_MakeFace(aWire);
00455 
00456     if(!theSupport.IsNull() && theSupport.ShapeType() == TopAbs_FACE)      // If the wire has a support
00457     {
00458       Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(theSupport));
00459       TopoDS_Face aTempFace = BRepBuilderAPI_MakeFace(aSurf, aWire);
00460       
00461       if(aTempFace.Orientation() != TopoDS::Face(theSupport).Orientation())
00462       {
00463         aFaceBase=TopoDS::Face(aTempFace.Reversed());
00464       }
00465       else
00466         aFaceBase=aTempFace;
00467     } 
00468     
00469     // Invert height and angle if the operation is an extruded cut
00470     bool invert = !isProtrusion; 
00471     
00472     // If the face has a reversed orientation invert for extruded boss operations
00473     if(aFaceBase.Orientation() == TopAbs_REVERSED)
00474       invert = isProtrusion;
00475 
00476     Standard_Real anAngle = theAngle;
00477     Standard_Real aHeight = theHeight;
00478     if(invert)
00479     {
00480       anAngle  = -theAngle;  // Invert angle and height
00481       aHeight  = -theHeight;
00482     }
00483     
00484     BRepFeat_MakeDPrism aPrism(theInitShape, aFaceBase, TopoDS_Face(),
00485                               anAngle*M_PI/180., isProtrusion, Standard_True); 
00486     
00487     aPrism.Perform(aHeight);
00488     aPrism.Check();          // Raises NotDone if done is false
00489     
00490     aShape = aPrism.Shape();
00491     
00492     return aShape;
00493 }
00494                                                    
00495 
00496 //=======================================================================
00497 //function : GEOMImpl_PrismDriver_Type_
00498 //purpose  :
00499 //=======================================================================
00500 Standard_EXPORT Handle_Standard_Type& GEOMImpl_PrismDriver_Type_()
00501 {
00502 
00503   static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
00504   if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
00505   static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
00506   if (aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
00507   static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
00508   if (aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
00509 
00510   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
00511   static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PrismDriver",
00512                                                          sizeof(GEOMImpl_PrismDriver),
00513                                                          1,
00514                                                          (Standard_Address)_Ancestors,
00515                                                          (Standard_Address)NULL);
00516 
00517   return _aType;
00518 }
00519 
00520 //=======================================================================
00521 //function : DownCast
00522 //purpose  :
00523 //=======================================================================
00524 const Handle(GEOMImpl_PrismDriver) Handle(GEOMImpl_PrismDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
00525 {
00526   Handle(GEOMImpl_PrismDriver) _anOtherObject;
00527 
00528   if (!AnObject.IsNull()) {
00529      if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_PrismDriver))) {
00530        _anOtherObject = Handle(GEOMImpl_PrismDriver)((Handle(GEOMImpl_PrismDriver)&)AnObject);
00531      }
00532   }
00533 
00534   return _anOtherObject;
00535 }