1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include <Standard_Stream.hxx>
24 #include <GEOMImpl_GlueDriver.hxx>
25 #include <GEOMImpl_IGlue.hxx>
26 #include <GEOMImpl_Types.hxx>
28 #include <GEOM_Object.hxx>
29 #include <GEOM_Function.hxx>
31 #include "GEOMAlgo_Gluer2.hxx"
32 #include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
33 #include "GEOMAlgo_CoupleOfShapes.hxx"
34 #include "GEOMAlgo_ListOfCoupleOfShapes.hxx"
36 #include <Basics_OCCTVersion.hxx>
38 #include "utilities.h"
40 #include <TDataStd_IntegerArray.hxx>
43 #include <TopoDS_Shape.hxx>
44 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
45 #include <TopTools_IndexedMapOfShape.hxx>
46 #include <TopTools_ListOfShape.hxx>
47 #include <TopTools_ListIteratorOfListOfShape.hxx>
49 #include <ShapeFix_Shape.hxx>
51 #include <Standard_NullObject.hxx>
52 #include <Standard_Failure.hxx>
54 #define MSG_BAD_TOLERANCE "Tolerance is too big"
55 #define MSG_BAD_ARG_SHAPE "Argument shape is not a compound of hexahedral solids"
57 //=======================================================================
58 //function : GEOMImpl_GlueDriver
60 //=======================================================================
61 GEOMImpl_GlueDriver::GEOMImpl_GlueDriver()
65 //=======================================================================
68 //=======================================================================
69 const Standard_GUID& GEOMImpl_GlueDriver::GetID()
71 static Standard_GUID aGlueDriver("FF1BBB63-5D14-4df2-980B-3A668264EA16");
75 //=======================================================================
76 //function : GlueFacesWithWarnings
78 //=======================================================================
80 TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& theShape,
81 const Standard_Real theTolerance,
82 const Standard_Boolean doKeepNonSolids,
83 TCollection_AsciiString& theWarning) const
85 Standard_Integer iErr, iWrn;
87 GEOMAlgo_Gluer aGluer;
89 aGluer.SetShape(theShape);
90 aGluer.SetTolerance(theTolerance);
91 aGluer.SetCheckGeometry(Standard_True);
92 aGluer.SetKeepNonSolids(doKeepNonSolids);
96 iErr = aGluer.ErrorStatus();
100 Standard_Failure::Raise("No vertices found in source shape");
104 Standard_Failure::Raise(MSG_BAD_TOLERANCE " or " MSG_BAD_ARG_SHAPE);
107 Standard_Failure::Raise("Source shape is Null");
110 Standard_Failure::Raise("Result shape is Null");
113 Standard_Failure::Raise(MSG_BAD_TOLERANCE);
117 Standard_Failure::Raise(MSG_BAD_ARG_SHAPE);
120 Standard_Failure::Raise("Error occured during check of geometric coincidence");
124 // description of all errors see in GEOMAlgo_Gluer.cxx
125 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer with code ");
126 aMsg += TCollection_AsciiString(iErr);
127 Standard_Failure::Raise(aMsg.ToCString());
134 iWrn = aGluer.WarningStatus();
139 Standard_Integer nbAlone = aGluer.AloneShapes();
140 theWarning = TCollection_AsciiString(nbAlone);
141 theWarning += " solid(s) can not be glued by faces";
145 // description of all warnings see in GEOMAlgo_Gluer.cxx
146 theWarning = "Warning in GEOMAlgo_Gluer with code ";
147 theWarning += TCollection_AsciiString(iWrn);
152 aRes = aGluer.Result();
154 // SKL 18.01.2010 - patch for 20662
155 Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aRes);
156 aSfs->SetPrecision(Precision::Confusion());
158 aRes = aSfs->Shape();
160 // Fill history to be used by GetInPlace functionality
161 TopTools_IndexedMapOfShape aResIndices;
162 TopExp::MapShapes(aRes, aResIndices);
164 Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
166 // history for all argument shapes
167 TDF_LabelSequence aLabelSeq;
168 aFunction->GetDependency(aLabelSeq);
169 Standard_Integer nbArg = aLabelSeq.Length();
171 for (Standard_Integer iarg = 1; iarg <= nbArg; iarg++) {
173 TDF_Label anArgumentRefLabel = aLabelSeq.Value(iarg);
175 Handle(GEOM_Object) anArgumentObject = GEOM_Object::GetReferencedObject(anArgumentRefLabel);
176 TopoDS_Shape anArgumentShape = anArgumentObject->GetValue();
178 TopTools_IndexedMapOfShape anArgumentIndices;
179 TopExp::MapShapes(anArgumentShape, anArgumentIndices);
180 Standard_Integer nbArgumentEntities = anArgumentIndices.Extent();
182 // Find corresponding label in history
183 TDF_Label anArgumentHistoryLabel =
184 aFunction->GetArgumentHistoryEntry(anArgumentRefLabel, Standard_True);
186 for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) {
187 TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie);
188 const TopTools_ListOfShape& aModified = aGluer.Modified(anEntity);
189 Standard_Integer nbModified = aModified.Extent();
191 if (nbModified > 0) {
192 TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True);
193 Handle(TDataStd_IntegerArray) anAttr =
194 TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, nbModified);
196 TopTools_ListIteratorOfListOfShape itM (aModified);
197 for (int im = 1; itM.More(); itM.Next(), ++im) {
198 int id = aResIndices.FindIndex(itM.Value());
199 anAttr->SetValue(im, id);
208 //=======================================================================
209 //function : GlueFaces
211 //=======================================================================
212 TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
213 const Standard_Real theTolerance,
214 const Standard_Boolean doKeepNonSolids)
217 GEOMAlgo_Gluer aGluer;
219 aGluer.SetShape(theShape);
220 aGluer.SetTolerance(theTolerance);
221 aGluer.SetCheckGeometry(Standard_True);
222 aGluer.SetKeepNonSolids(doKeepNonSolids);
226 Standard_Integer iErr = aGluer.ErrorStatus();
230 Standard_Failure::Raise("No vertices found in source shape");
233 Standard_Failure::Raise("Source shape is Null");
236 Standard_Failure::Raise("Result shape is Null");
239 Standard_Failure::Raise("Error occured during check of geometric coincidence");
243 // description of all errors see in GEOMAlgo_Gluer.cxx
244 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer with code ");
245 aMsg += TCollection_AsciiString(iErr);
246 Standard_Failure::Raise(aMsg.ToCString());
253 Standard_Integer iWrn = aGluer.WarningStatus();
257 MESSAGE("Some shapes can not be glued by faces");
260 // description of all warnings see in GEOMAlgo_Gluer.cxx
261 MESSAGE("Warning in GEOMAlgo_Gluer with code " << iWrn);
266 aRes = aGluer.Result();
271 //=======================================================================
272 //function : GlueFacesByList
274 //=======================================================================
275 TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
276 const Standard_Real theTolerance,
277 const Standard_Boolean doKeepNonSolids,
278 const TopTools_MapOfShape& aFaces)
282 GEOMAlgo_Gluer1 aGluer;
283 GEOMAlgo_ListIteratorOfListOfCoupleOfShapes aItCS;
284 GEOMAlgo_CoupleOfShapes aCS;
285 GEOMAlgo_ListOfCoupleOfShapes aLCS;
287 aGluer.SetShape(theShape);
288 aGluer.SetTolerance(theTolerance);
289 aGluer.SetKeepNonSolids(doKeepNonSolids);
291 Standard_Integer iErr = aGluer.ErrorStatus();
292 if (iErr) return aRes;
294 TopTools_ListOfShape listShape;
295 const GEOMAlgo_ListOfCoupleOfShapes& aLCSG = aGluer.GluedFaces();
297 aItCS.Initialize(aLCSG);
298 for (; aItCS.More(); aItCS.Next()) {
299 const GEOMAlgo_CoupleOfShapes& aCSG = aItCS.Value();
300 const TopoDS_Shape& aF1 = aCSG.Shape1();
301 const TopoDS_Shape& aF2 = aCSG.Shape2();
302 if (aFaces.Contains(aF1) || aFaces.Contains(aF2))
304 aCS.SetShapes(aF1,aF2);
308 //cout<<"aLCS.Extent() = "<<aLCS.Extent()<<endl;
309 if (aLCS.Extent()>0) {
310 aGluer.SetFacesToUnglue(aLCS);
311 aGluer.UnglueFaces();
312 iErr = aGluer.ErrorStatus();
313 if (iErr) return aRes;
316 aRes = aGluer.Result();
322 //=======================================================================
323 //function : GlueFaces
325 //=======================================================================
326 TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
327 const Standard_Real theTolerance,
328 const Standard_Boolean doKeepNonSolids)
335 aGA.SetArgument(theShape);
336 aGA.SetTolerance(theTolerance);
337 aGA.SetKeepNonSolids(doKeepNonSolids);
339 // 2. Detect interferred shapes
341 Standard_Integer iErr = aGA.ErrorStatus();
345 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
349 Standard_Failure::Raise("PerformImagesToWork failed");
353 // description of all errors see in GEOMAlgo_Gluer2.cxx
354 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
355 aMsg += TCollection_AsciiString(iErr);
356 Standard_Failure::Raise(aMsg.ToCString());
363 // 3. Set shapes to glue. If the operator is absent, the whole gluing will be done
364 //aGA.SetShapesToGlue(aMSG);
368 iErr = aGA.ErrorStatus();
372 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
376 Standard_Failure::Raise("PerformImagesToWork failed");
380 // description of all errors see in GEOMAlgo_Gluer2.cxx
381 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
382 aMsg += TCollection_AsciiString(iErr);
383 Standard_Failure::Raise(aMsg.ToCString());
390 Standard_Integer iWrn = aGA.WarningStatus();
394 MESSAGE("No shapes to glue");
397 // description of all warnings see in GEOMAlgo_Gluer2.cxx
398 MESSAGE("Warning in GEOMAlgo_Gluer2 with code " << iWrn);
409 //=======================================================================
410 //function : GlueWithWarnings
412 //=======================================================================
413 TopoDS_Shape GEOMImpl_GlueDriver::GlueWithWarnings (const TopoDS_Shape& theShape,
414 const Standard_Real theTolerance,
415 const TopAbs_ShapeEnum theShapeType,
416 const Standard_Boolean doKeepNonSolids,
417 TCollection_AsciiString& theWarning) const
424 aGA.SetArgument(theShape);
425 aGA.SetTolerance(theTolerance);
426 aGA.SetKeepNonSolids(doKeepNonSolids);
428 // 2. Detect interferred shapes
431 //modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
432 #if OCC_VERSION_LARGE > 0x06050200
433 Standard_Integer iWrnDetect = aGA.WarningStatus();
434 if (iWrnDetect == 2) {
436 TopTools_ListIteratorOfListOfShape aItLS;
438 // Sticked shapes are detected
439 const TopTools_IndexedDataMapOfShapeListOfShape& aIDMSS = pGluer2->StickedShapes();
441 Standard_Integer i, aNb = aIDMSS.Extent();
442 for (i = 1; i <= aNb; ++i) {
443 // ancestor aSa (edge, wire face,..)
444 const TopoDS_Shape& aSa = aIDMSS.FindKey(i);
446 // successors aSs (vertex, edge, ...)
447 // of the ancestor that are sticked
448 // for given value of the tolerance
449 const TopTools_ListOfShape& aLSS = aIDMSS.FindFromIndex(i);
450 aItLS.Initialize(aLSS);
451 for (; aItLS.More(); aItLS.Next()) {
452 const TopoDS_Shape& aSs = aItLS.Value();
456 Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
457 //Standard_Failure::Raise("Sticked shapes are detected. The tolerance value is too big.");
458 //theWarning = "Sticked shapes are detected. The tolerance value is too big.";
461 //modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
463 Standard_Integer iErr = aGA.ErrorStatus();
467 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
471 Standard_Failure::Raise("PerformImagesToWork failed");
475 // description of all errors see in GEOMAlgo_Gluer2.cxx
476 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
477 aMsg += TCollection_AsciiString(iErr);
478 Standard_Failure::Raise(aMsg.ToCString());
485 if (theShapeType != TopAbs_FACE) {
486 // 3. Fill shapes to glue aMSG
487 TopTools_DataMapOfShapeListOfShape aMSG;
488 const TopTools_DataMapOfShapeListOfShape& aMSD = aGA.ShapesDetected();
489 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSD;
490 aItMSD.Initialize(aMSD);
491 for (; aItMSD.More(); aItMSD.Next()) {
492 const TopoDS_Shape& aSx = aItMSD.Key();
493 const TopTools_ListOfShape& aLSD = aItMSD.Value();
494 if (aSx.ShapeType() == theShapeType) {
495 aMSG.Bind(aSx, aLSD);
499 // 4. Set shapes to glue. If the operator is absent, the whole gluing will be done
500 aGA.SetShapesToGlue(aMSG);
505 iErr = aGA.ErrorStatus();
509 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
513 Standard_Failure::Raise("PerformImagesToWork failed");
517 // description of all errors see in GEOMAlgo_Gluer2.cxx
518 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
519 aMsg += TCollection_AsciiString(iErr);
520 Standard_Failure::Raise(aMsg.ToCString());
527 Standard_Integer iWrn = aGA.WarningStatus();
531 theWarning = "No shapes to glue";
534 // description of all warnings see in GEOMAlgo_Gluer2.cxx
535 theWarning = "Warning in GEOMAlgo_Gluer2 with code ";
536 theWarning += TCollection_AsciiString(iWrn);
544 // 7. Fill history to be used by GetInPlace functionality
545 TopTools_IndexedMapOfShape aResIndices;
546 TopExp::MapShapes(aRes, aResIndices);
548 Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
550 // history for all argument shapes
551 TDF_LabelSequence aLabelSeq;
552 aFunction->GetDependency(aLabelSeq);
553 Standard_Integer nbArg = aLabelSeq.Length();
555 for (Standard_Integer iarg = 1; iarg <= nbArg; iarg++) {
557 TDF_Label anArgumentRefLabel = aLabelSeq.Value(iarg);
559 Handle(GEOM_Object) anArgumentObject = GEOM_Object::GetReferencedObject(anArgumentRefLabel);
560 TopoDS_Shape anArgumentShape = anArgumentObject->GetValue();
562 TopTools_IndexedMapOfShape anArgumentIndices;
563 TopExp::MapShapes(anArgumentShape, anArgumentIndices);
564 Standard_Integer nbArgumentEntities = anArgumentIndices.Extent();
566 // Find corresponding label in history
567 TDF_Label anArgumentHistoryLabel =
568 aFunction->GetArgumentHistoryEntry(anArgumentRefLabel, Standard_True);
570 for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) {
571 TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie);
572 const TopTools_ListOfShape& aModified = aGA.Modified(anEntity);
573 Standard_Integer nbModified = aModified.Extent();
575 if (nbModified > 0) {
576 TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True);
577 Handle(TDataStd_IntegerArray) anAttr =
578 TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, nbModified);
580 TopTools_ListIteratorOfListOfShape itM (aModified);
581 for (int im = 1; itM.More(); itM.Next(), ++im) {
582 int id = aResIndices.FindIndex(itM.Value());
583 anAttr->SetValue(im, id);
592 //=======================================================================
593 //function : GlueByList
595 //=======================================================================
596 TopoDS_Shape GEOMImpl_GlueDriver::GlueByList (const TopoDS_Shape& theShape,
597 const Standard_Real theTolerance,
598 const Standard_Boolean doKeepNonSolids,
599 const TopTools_MapOfShape& theShapesList,
600 const Standard_Boolean doGlueAllEdges)
607 aGA.SetArgument(theShape);
608 aGA.SetTolerance(theTolerance);
609 aGA.SetKeepNonSolids(doKeepNonSolids);
611 // 2. Detect interferred shapes
613 Standard_Integer iErr = aGA.ErrorStatus();
617 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
621 Standard_Failure::Raise("PerformImagesToWork failed");
625 // description of all errors see in GEOMAlgo_Gluer2.cxx
626 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
627 aMsg += TCollection_AsciiString(iErr);
628 Standard_Failure::Raise(aMsg.ToCString());
635 // 3. Fill shapes to glue aMSG
636 TopTools_DataMapOfShapeListOfShape aMSG;
637 const TopTools_DataMapOfShapeListOfShape& aMSD = aGA.ShapesDetected();
638 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSD;
639 aItMSD.Initialize(aMSD);
640 for (; aItMSD.More(); aItMSD.Next()) {
641 const TopoDS_Shape& aSx = aItMSD.Key();
642 const TopTools_ListOfShape& aLSD = aItMSD.Value();
643 TopTools_ListIteratorOfListOfShape anItLSD (aLSD);
644 bool isToGlue = false;
645 if (doGlueAllEdges && aSx.ShapeType() == TopAbs_EDGE) {
649 for (; anItLSD.More() && !isToGlue; anItLSD.Next()) {
650 if (theShapesList.Contains(anItLSD.Value())) {
656 aMSG.Bind(aSx, aLSD);
660 // 4. Set shapes to glue. If the operator is absent, the whole gluing will be done
661 aGA.SetShapesToGlue(aMSG);
665 iErr = aGA.ErrorStatus();
669 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
673 Standard_Failure::Raise("PerformImagesToWork failed");
677 // description of all errors see in GEOMAlgo_Gluer2.cxx
678 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
679 aMsg += TCollection_AsciiString(iErr);
680 Standard_Failure::Raise(aMsg.ToCString());
687 Standard_Integer iWrn = aGA.WarningStatus();
691 MESSAGE("No shapes to glue");
694 // description of all warnings see in GEOMAlgo_Gluer2.cxx
695 MESSAGE("Warning in GEOMAlgo_Gluer2 with code " << iWrn);
706 //=======================================================================
709 //=======================================================================
710 Standard_Integer GEOMImpl_GlueDriver::Execute(TFunction_Logbook& log) const
712 if (Label().IsNull()) return 0;
713 Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
715 GEOMImpl_IGlue aCI (aFunction);
716 Standard_Integer aType = aFunction->GetType();
719 TCollection_AsciiString aWrn;
721 Handle(GEOM_Function) aRefBase = aCI.GetBase();
722 TopoDS_Shape aShapeBase = aRefBase->GetValue();
723 if (aShapeBase.IsNull()) {
724 Standard_NullObject::Raise("Shape for gluing is null");
727 Standard_Real tol3d = aCI.GetTolerance();
729 Standard_Boolean aKeepNonSolids = aCI.GetKeepNonSolids();
731 if (aType == GLUE_FACES) {
732 //aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aKeepNonSolids, aWrn);
733 aShape = GlueWithWarnings(aShapeBase, tol3d, TopAbs_FACE, aKeepNonSolids, aWrn);
735 else if (aType == GLUE_EDGES) {
736 aShape = GlueWithWarnings(aShapeBase, tol3d, TopAbs_EDGE, aKeepNonSolids, aWrn);
738 else if (aType == GLUE_FACES_BY_LIST || aType == GLUE_EDGES_BY_LIST) {
739 Handle(TColStd_HSequenceOfTransient) SF = aCI.GetFaces();
740 TopTools_MapOfShape aFaces;
742 for (; i <= SF->Length(); i++) {
743 Handle(Standard_Transient) anItem = SF->Value(i);
746 Handle(GEOM_Function) aRefSh = Handle(GEOM_Function)::DownCast(anItem);
749 TopoDS_Shape aFace = aRefSh->GetValue();
752 if (!aFaces.Contains(aFace))
756 Standard_Boolean aGlueAllEdges = Standard_False;
757 if (aType == GLUE_FACES_BY_LIST)
758 aGlueAllEdges = aCI.GetGlueAllEdges();
760 //aShape = GlueFacesByList(aShapeBase, tol3d, aKeepNonSolids, aFaces);
761 aShape = GlueByList(aShapeBase, tol3d, aKeepNonSolids, aFaces, aGlueAllEdges);
764 if (aShape.IsNull()) return 0;
766 aFunction->SetValue(aShape);
768 log.SetTouched(Label());
770 if (!aWrn.IsEmpty()) {
771 Standard_Failure::Raise(aWrn.ToCString());
777 //=======================================================================
778 //function : GEOMImpl_GlueDriver_Type_
780 //=======================================================================
781 Standard_EXPORT Handle_Standard_Type& GEOMImpl_GlueDriver_Type_()
784 static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
785 if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
786 static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
787 if (aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
788 static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
789 if (aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
792 static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
793 static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_GlueDriver",
794 sizeof(GEOMImpl_GlueDriver),
796 (Standard_Address)_Ancestors,
797 (Standard_Address)NULL);
802 //=======================================================================
803 //function : DownCast
805 //=======================================================================
806 const Handle(GEOMImpl_GlueDriver) Handle(GEOMImpl_GlueDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
808 Handle(GEOMImpl_GlueDriver) _anOtherObject;
810 if (!AnObject.IsNull()) {
811 if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_GlueDriver))) {
812 _anOtherObject = Handle(GEOMImpl_GlueDriver)((Handle(GEOMImpl_GlueDriver)&)AnObject);
816 return _anOtherObject;