1 // Copyright (C) 2007-2013 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>
41 #include <TNaming_CopyShape.hxx>
44 #include <TopoDS_Shape.hxx>
45 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
46 #include <TopTools_IndexedMapOfShape.hxx>
47 #include <TopTools_ListOfShape.hxx>
48 #include <TopTools_ListIteratorOfListOfShape.hxx>
50 #include <TColStd_IndexedDataMapOfTransientTransient.hxx>
52 #include <ShapeFix_Shape.hxx>
54 #include <Standard_NullObject.hxx>
55 #include <Standard_Failure.hxx>
57 #define MSG_BAD_TOLERANCE "Tolerance is too big"
58 #define MSG_BAD_ARG_SHAPE "Argument shape is not a compound of hexahedral solids"
60 //=======================================================================
61 //function : GEOMImpl_GlueDriver
63 //=======================================================================
64 GEOMImpl_GlueDriver::GEOMImpl_GlueDriver()
68 //=======================================================================
71 //=======================================================================
72 const Standard_GUID& GEOMImpl_GlueDriver::GetID()
74 static Standard_GUID aGlueDriver("FF1BBB63-5D14-4df2-980B-3A668264EA16");
78 //=======================================================================
79 //function : GlueFacesWithWarnings
81 //=======================================================================
83 TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& theShape,
84 const Standard_Real theTolerance,
85 const Standard_Boolean doKeepNonSolids,
86 TCollection_AsciiString& theWarning) const
88 Standard_Integer iErr, iWrn;
90 GEOMAlgo_Gluer aGluer;
92 aGluer.SetShape(theShape);
93 aGluer.SetTolerance(theTolerance);
94 aGluer.SetCheckGeometry(Standard_True);
95 aGluer.SetKeepNonSolids(doKeepNonSolids);
99 iErr = aGluer.ErrorStatus();
103 Standard_Failure::Raise("No vertices found in source shape");
107 Standard_Failure::Raise(MSG_BAD_TOLERANCE " or " MSG_BAD_ARG_SHAPE);
110 Standard_Failure::Raise("Source shape is Null");
113 Standard_Failure::Raise("Result shape is Null");
116 Standard_Failure::Raise(MSG_BAD_TOLERANCE);
120 Standard_Failure::Raise(MSG_BAD_ARG_SHAPE);
123 Standard_Failure::Raise("Error occured during check of geometric coincidence");
127 // description of all errors see in GEOMAlgo_Gluer.cxx
128 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer with code ");
129 aMsg += TCollection_AsciiString(iErr);
130 Standard_Failure::Raise(aMsg.ToCString());
137 iWrn = aGluer.WarningStatus();
142 Standard_Integer nbAlone = aGluer.AloneShapes();
143 theWarning = TCollection_AsciiString(nbAlone);
144 theWarning += " solid(s) can not be glued by faces";
148 // description of all warnings see in GEOMAlgo_Gluer.cxx
149 theWarning = "Warning in GEOMAlgo_Gluer with code ";
150 theWarning += TCollection_AsciiString(iWrn);
155 aRes = aGluer.Result();
157 // SKL 18.01.2010 - patch for 20662
158 Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aRes);
159 aSfs->SetPrecision(Precision::Confusion());
161 aRes = aSfs->Shape();
163 // Fill history to be used by GetInPlace functionality
164 TopTools_IndexedMapOfShape aResIndices;
165 TopExp::MapShapes(aRes, aResIndices);
167 Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
169 // history for all argument shapes
170 TDF_LabelSequence aLabelSeq;
171 aFunction->GetDependency(aLabelSeq);
172 Standard_Integer nbArg = aLabelSeq.Length();
174 for (Standard_Integer iarg = 1; iarg <= nbArg; iarg++) {
176 TDF_Label anArgumentRefLabel = aLabelSeq.Value(iarg);
178 Handle(GEOM_Object) anArgumentObject = GEOM_Object::GetReferencedObject(anArgumentRefLabel);
179 TopoDS_Shape anArgumentShape = anArgumentObject->GetValue();
181 TopTools_IndexedMapOfShape anArgumentIndices;
182 TopExp::MapShapes(anArgumentShape, anArgumentIndices);
183 Standard_Integer nbArgumentEntities = anArgumentIndices.Extent();
185 // Find corresponding label in history
186 TDF_Label anArgumentHistoryLabel =
187 aFunction->GetArgumentHistoryEntry(anArgumentRefLabel, Standard_True);
189 for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) {
190 TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie);
191 const TopTools_ListOfShape& aModified = aGluer.Modified(anEntity);
192 Standard_Integer nbModified = aModified.Extent();
194 if (nbModified > 0) {
195 TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True);
196 Handle(TDataStd_IntegerArray) anAttr =
197 TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, nbModified);
199 TopTools_ListIteratorOfListOfShape itM (aModified);
200 for (int im = 1; itM.More(); itM.Next(), ++im) {
201 int id = aResIndices.FindIndex(itM.Value());
202 anAttr->SetValue(im, id);
211 //=======================================================================
212 //function : GlueFaces
214 //=======================================================================
215 TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
216 const Standard_Real theTolerance,
217 const Standard_Boolean doKeepNonSolids)
220 GEOMAlgo_Gluer aGluer;
222 aGluer.SetShape(theShape);
223 aGluer.SetTolerance(theTolerance);
224 aGluer.SetCheckGeometry(Standard_True);
225 aGluer.SetKeepNonSolids(doKeepNonSolids);
229 Standard_Integer iErr = aGluer.ErrorStatus();
233 Standard_Failure::Raise("No vertices found in source shape");
236 Standard_Failure::Raise("Source shape is Null");
239 Standard_Failure::Raise("Result shape is Null");
242 Standard_Failure::Raise("Error occured during check of geometric coincidence");
246 // description of all errors see in GEOMAlgo_Gluer.cxx
247 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer with code ");
248 aMsg += TCollection_AsciiString(iErr);
249 Standard_Failure::Raise(aMsg.ToCString());
256 Standard_Integer iWrn = aGluer.WarningStatus();
260 MESSAGE("Some shapes can not be glued by faces");
263 // description of all warnings see in GEOMAlgo_Gluer.cxx
264 MESSAGE("Warning in GEOMAlgo_Gluer with code " << iWrn);
269 aRes = aGluer.Result();
274 //=======================================================================
275 //function : GlueFacesByList
277 //=======================================================================
278 TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
279 const Standard_Real theTolerance,
280 const Standard_Boolean doKeepNonSolids,
281 const TopTools_MapOfShape& aFaces)
285 GEOMAlgo_Gluer1 aGluer;
286 GEOMAlgo_ListIteratorOfListOfCoupleOfShapes aItCS;
287 GEOMAlgo_CoupleOfShapes aCS;
288 GEOMAlgo_ListOfCoupleOfShapes aLCS;
290 aGluer.SetShape(theShape);
291 aGluer.SetTolerance(theTolerance);
292 aGluer.SetKeepNonSolids(doKeepNonSolids);
294 Standard_Integer iErr = aGluer.ErrorStatus();
295 if (iErr) return aRes;
297 TopTools_ListOfShape listShape;
298 const GEOMAlgo_ListOfCoupleOfShapes& aLCSG = aGluer.GluedFaces();
300 aItCS.Initialize(aLCSG);
301 for (; aItCS.More(); aItCS.Next()) {
302 const GEOMAlgo_CoupleOfShapes& aCSG = aItCS.Value();
303 const TopoDS_Shape& aF1 = aCSG.Shape1();
304 const TopoDS_Shape& aF2 = aCSG.Shape2();
305 if (aFaces.Contains(aF1) || aFaces.Contains(aF2))
307 aCS.SetShapes(aF1,aF2);
311 //cout<<"aLCS.Extent() = "<<aLCS.Extent()<<endl;
312 if (aLCS.Extent()>0) {
313 aGluer.SetFacesToUnglue(aLCS);
314 aGluer.UnglueFaces();
315 iErr = aGluer.ErrorStatus();
316 if (iErr) return aRes;
319 aRes = aGluer.Result();
325 //=======================================================================
326 //function : GlueFaces
328 //=======================================================================
329 TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
330 const Standard_Real theTolerance,
331 const Standard_Boolean doKeepNonSolids)
338 aGA.SetArgument(theShape);
339 aGA.SetTolerance(theTolerance);
340 aGA.SetKeepNonSolids(doKeepNonSolids);
342 // 2. Detect interferred shapes
345 //Standard_Integer iWrnDetect = aGA.WarningStatus();
346 //if (iWrnDetect == 2) {
347 // Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
350 Standard_Integer iErr = aGA.ErrorStatus();
354 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
358 Standard_Failure::Raise("PerformImagesToWork failed");
362 // description of all errors see in GEOMAlgo_Gluer2.cxx
363 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
364 aMsg += TCollection_AsciiString(iErr);
365 Standard_Failure::Raise(aMsg.ToCString());
372 // 3. Set shapes to glue. If the operator is absent, the whole gluing will be done
373 //aGA.SetShapesToGlue(aMSG);
377 iErr = aGA.ErrorStatus();
381 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
385 Standard_Failure::Raise("PerformImagesToWork failed");
389 // description of all errors see in GEOMAlgo_Gluer2.cxx
390 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
391 aMsg += TCollection_AsciiString(iErr);
392 Standard_Failure::Raise(aMsg.ToCString());
399 Standard_Integer iWrn = aGA.WarningStatus();
403 MESSAGE("No shapes to glue");
406 // description of all warnings see in GEOMAlgo_Gluer2.cxx
407 MESSAGE("Warning in GEOMAlgo_Gluer2 with code " << iWrn);
418 //=======================================================================
419 //function : GlueWithWarnings
421 //=======================================================================
422 TopoDS_Shape GEOMImpl_GlueDriver::GlueWithWarnings (const TopoDS_Shape& theShape,
423 const Standard_Real theTolerance,
424 const TopAbs_ShapeEnum theShapeType,
425 const Standard_Boolean doKeepNonSolids,
426 TCollection_AsciiString& theWarning) const
433 aGA.SetArgument(theShape);
434 aGA.SetTolerance(theTolerance);
435 aGA.SetKeepNonSolids(doKeepNonSolids);
437 // 2. Detect interferred shapes
440 //modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
441 #if OCC_VERSION_LARGE > 0x06050200
442 Standard_Integer iWrnDetect = aGA.WarningStatus();
443 if (iWrnDetect == 2) {
444 Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
447 //modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
449 Standard_Integer iErr = aGA.ErrorStatus();
453 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
457 Standard_Failure::Raise("PerformImagesToWork failed");
461 // description of all errors see in GEOMAlgo_Gluer2.cxx
462 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
463 aMsg += TCollection_AsciiString(iErr);
464 Standard_Failure::Raise(aMsg.ToCString());
471 if (theShapeType != TopAbs_FACE) {
472 // 3. Fill shapes to glue aMSG
473 TopTools_DataMapOfShapeListOfShape aMSG;
474 const TopTools_DataMapOfShapeListOfShape& aMSD = aGA.ShapesDetected();
475 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSD;
476 aItMSD.Initialize(aMSD);
477 for (; aItMSD.More(); aItMSD.Next()) {
478 const TopoDS_Shape& aSx = aItMSD.Key();
479 const TopTools_ListOfShape& aLSD = aItMSD.Value();
480 if (aSx.ShapeType() == theShapeType) {
481 aMSG.Bind(aSx, aLSD);
485 // 4. Set shapes to glue. If the operator is absent, the whole gluing will be done
486 aGA.SetShapesToGlue(aMSG);
491 iErr = aGA.ErrorStatus();
495 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
499 Standard_Failure::Raise("PerformImagesToWork failed");
503 // description of all errors see in GEOMAlgo_Gluer2.cxx
504 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
505 aMsg += TCollection_AsciiString(iErr);
506 Standard_Failure::Raise(aMsg.ToCString());
513 Standard_Integer iWrn = aGA.WarningStatus();
517 theWarning = "No shapes to glue";
520 // description of all warnings see in GEOMAlgo_Gluer2.cxx
521 theWarning = "Warning in GEOMAlgo_Gluer2 with code ";
522 theWarning += TCollection_AsciiString(iWrn);
530 // 7. Fill history to be used by GetInPlace functionality
531 TopTools_IndexedMapOfShape aResIndices;
532 TopExp::MapShapes(aRes, aResIndices);
534 Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
536 // history for all argument shapes
537 TDF_LabelSequence aLabelSeq;
538 aFunction->GetDependency(aLabelSeq);
539 Standard_Integer nbArg = aLabelSeq.Length();
541 for (Standard_Integer iarg = 1; iarg <= nbArg; iarg++) {
543 TDF_Label anArgumentRefLabel = aLabelSeq.Value(iarg);
545 Handle(GEOM_Object) anArgumentObject = GEOM_Object::GetReferencedObject(anArgumentRefLabel);
546 TopoDS_Shape anArgumentShape = anArgumentObject->GetValue();
548 TopTools_IndexedMapOfShape anArgumentIndices;
549 TopExp::MapShapes(anArgumentShape, anArgumentIndices);
550 Standard_Integer nbArgumentEntities = anArgumentIndices.Extent();
552 // Find corresponding label in history
553 TDF_Label anArgumentHistoryLabel =
554 aFunction->GetArgumentHistoryEntry(anArgumentRefLabel, Standard_True);
556 for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) {
557 TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie);
558 const TopTools_ListOfShape& aModified = aGA.Modified(anEntity);
559 Standard_Integer nbModified = aModified.Extent();
561 if (nbModified > 0) {
562 TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True);
563 Handle(TDataStd_IntegerArray) anAttr =
564 TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, nbModified);
566 TopTools_ListIteratorOfListOfShape itM (aModified);
567 for (int im = 1; itM.More(); itM.Next(), ++im) {
568 int id = aResIndices.FindIndex(itM.Value());
569 anAttr->SetValue(im, id);
578 //=======================================================================
579 //function : GlueByList
581 //=======================================================================
582 TopoDS_Shape GEOMImpl_GlueDriver::GlueByList (const TopoDS_Shape& theShape,
583 const Standard_Real theTolerance,
584 const Standard_Boolean doKeepNonSolids,
585 const TopTools_MapOfShape& theShapesList,
586 const Standard_Boolean doGlueAllEdges)
593 aGA.SetArgument(theShape);
594 aGA.SetTolerance(theTolerance);
595 aGA.SetKeepNonSolids(doKeepNonSolids);
597 // 2. Detect interferred shapes
600 //modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
601 #if OCC_VERSION_LARGE > 0x06050200
602 Standard_Integer iWrnDetect = aGA.WarningStatus();
603 if (iWrnDetect == 2) {
605 TopTools_ListIteratorOfListOfShape aItLS;
607 // Sticked shapes are detected
608 const TopTools_IndexedDataMapOfShapeListOfShape& aIDMSS = pGluer2->StickedShapes();
610 Standard_Integer i, aNb = aIDMSS.Extent();
611 for (i = 1; i <= aNb; ++i) {
612 // ancestor aSa (edge, wire face,..)
613 const TopoDS_Shape& aSa = aIDMSS.FindKey(i);
615 // successors aSs (vertex, edge, ...)
616 // of the ancestor that are sticked
617 // for given value of the tolerance
618 const TopTools_ListOfShape& aLSS = aIDMSS.FindFromIndex(i);
619 aItLS.Initialize(aLSS);
620 for (; aItLS.More(); aItLS.Next()) {
621 const TopoDS_Shape& aSs = aItLS.Value();
625 Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
628 //modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
630 Standard_Integer iErr = aGA.ErrorStatus();
634 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
638 Standard_Failure::Raise("PerformImagesToWork failed");
642 // description of all errors see in GEOMAlgo_Gluer2.cxx
643 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
644 aMsg += TCollection_AsciiString(iErr);
645 Standard_Failure::Raise(aMsg.ToCString());
652 // 3. Fill shapes to glue aMSG
653 TopTools_DataMapOfShapeListOfShape aMSG;
654 const TopTools_DataMapOfShapeListOfShape& aMSD = aGA.ShapesDetected();
655 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSD;
656 aItMSD.Initialize(aMSD);
657 for (; aItMSD.More(); aItMSD.Next()) {
658 const TopoDS_Shape& aSx = aItMSD.Key();
659 const TopTools_ListOfShape& aLSD = aItMSD.Value();
660 TopTools_ListIteratorOfListOfShape anItLSD (aLSD);
661 bool isToGlue = false;
662 if (doGlueAllEdges && aSx.ShapeType() == TopAbs_EDGE) {
666 for (; anItLSD.More() && !isToGlue; anItLSD.Next()) {
667 if (theShapesList.Contains(anItLSD.Value())) {
673 aMSG.Bind(aSx, aLSD);
677 // 4. Set shapes to glue. If the operator is absent, the whole gluing will be done
678 aGA.SetShapesToGlue(aMSG);
682 iErr = aGA.ErrorStatus();
686 Standard_Failure::Raise("GEOMAlgo_GlueDetector failed");
690 Standard_Failure::Raise("PerformImagesToWork failed");
694 // description of all errors see in GEOMAlgo_Gluer2.cxx
695 TCollection_AsciiString aMsg ("Error in GEOMAlgo_Gluer2 with code ");
696 aMsg += TCollection_AsciiString(iErr);
697 Standard_Failure::Raise(aMsg.ToCString());
704 Standard_Integer iWrn = aGA.WarningStatus();
708 MESSAGE("No shapes to glue");
711 // description of all warnings see in GEOMAlgo_Gluer2.cxx
712 MESSAGE("Warning in GEOMAlgo_Gluer2 with code " << iWrn);
723 //=======================================================================
726 //=======================================================================
727 Standard_Integer GEOMImpl_GlueDriver::Execute(TFunction_Logbook& log) const
729 if (Label().IsNull()) return 0;
730 Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
732 GEOMImpl_IGlue aCI (aFunction);
733 Standard_Integer aType = aFunction->GetType();
736 TCollection_AsciiString aWrn;
738 Handle(GEOM_Function) aRefBase = aCI.GetBase();
739 TopoDS_Shape aShapeBase = aRefBase->GetValue();
740 if (aShapeBase.IsNull()) {
741 Standard_NullObject::Raise("Shape for gluing is null");
744 Standard_Real tol3d = aCI.GetTolerance();
746 Standard_Boolean aKeepNonSolids = aCI.GetKeepNonSolids();
748 // Copy initial shape to prevent its modification by gluing algorithm
749 TopoDS_Shape aShapeCopy;
750 TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
751 TNaming_CopyShape::CopyTool(aShapeBase, aMapTShapes, aShapeCopy);
753 if (aType == GLUE_FACES) {
754 //aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aKeepNonSolids, aWrn);
755 aShape = GlueWithWarnings(aShapeCopy, tol3d, TopAbs_FACE, aKeepNonSolids, aWrn);
757 else if (aType == GLUE_EDGES) {
758 aShape = GlueWithWarnings(aShapeCopy, tol3d, TopAbs_EDGE, aKeepNonSolids, aWrn);
760 else if (aType == GLUE_FACES_BY_LIST || aType == GLUE_EDGES_BY_LIST) {
761 Handle(TColStd_HSequenceOfTransient) SF = aCI.GetFaces();
762 TopTools_MapOfShape aFaces;
765 // map sub-shapes to select faces from aShapeCopy
766 TopTools_IndexedMapOfShape aShapeBase_inds;
767 TopTools_IndexedMapOfShape aShapeCopy_inds;
768 TopExp::MapShapes(aShapeBase, aShapeBase_inds);
769 TopExp::MapShapes(aShapeCopy, aShapeCopy_inds);
771 for (; i <= SF->Length(); i++) {
772 Handle(Standard_Transient) anItem = SF->Value(i);
775 Handle(GEOM_Function) aRefSh = Handle(GEOM_Function)::DownCast(anItem);
778 TopoDS_Shape aFace = aRefSh->GetValue();
782 // get copy of face to correspond to aShapeCopy
783 if (aShapeBase_inds.Contains(aFace)) {
784 int ind = aShapeBase_inds.FindIndex(aFace);
785 aFace = aShapeCopy_inds.FindKey(ind);
791 Standard_Boolean aGlueAllEdges = Standard_False;
792 if (aType == GLUE_FACES_BY_LIST)
793 aGlueAllEdges = aCI.GetGlueAllEdges();
795 //aShape = GlueFacesByList(aShapeBase, tol3d, aKeepNonSolids, aFaces);
796 aShape = GlueByList(aShapeCopy, tol3d, aKeepNonSolids, aFaces, aGlueAllEdges);
799 if (aShape.IsNull()) return 0;
801 aFunction->SetValue(aShape);
803 log.SetTouched(Label());
805 if (!aWrn.IsEmpty()) {
806 Standard_Failure::Raise(aWrn.ToCString());
812 //================================================================================
814 * \brief Returns a name of creation operation and names and values of creation parameters
816 //================================================================================
818 bool GEOMImpl_GlueDriver::
819 GetCreationInformation(std::string& theOperationName,
820 std::vector<GEOM_Param>& theParams)
822 if (Label().IsNull()) return 0;
823 Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
825 GEOMImpl_IGlue aCI( function );
826 Standard_Integer aType = function->GetType();
830 theOperationName = "GLUE_FACES";
831 AddParam( theParams, "Selected shape", aCI.GetBase() );
832 AddParam( theParams, "Tolerance", aCI.GetTolerance() );
833 AddParam( theParams, "To keep non solids", aCI.GetKeepNonSolids() );
836 theOperationName = "GLUE_EDGES";
837 AddParam( theParams, "Selected shape", aCI.GetBase() );
838 AddParam( theParams, "Tolerance", aCI.GetTolerance() );
840 case GLUE_FACES_BY_LIST:
841 theOperationName = "GLUE_FACES";
842 AddParam( theParams, "Selected shape", aCI.GetBase() );
843 AddParam( theParams, "Tolerance", aCI.GetTolerance() );
844 AddParam( theParams, "Faces", aCI.GetFaces() );
845 AddParam( theParams, "To keep non solids", aCI.GetKeepNonSolids() );
846 AddParam( theParams, "To glue all edges", aCI.GetGlueAllEdges() );
848 case GLUE_EDGES_BY_LIST:
849 theOperationName = "GLUE_EDGES";
850 AddParam( theParams, "Selected shape", aCI.GetBase() );
851 AddParam( theParams, "Tolerance", aCI.GetTolerance() );
852 AddParam( theParams, "Edges", aCI.GetFaces() );
861 IMPLEMENT_STANDARD_HANDLE (GEOMImpl_GlueDriver,GEOM_BaseDriver);
862 IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_GlueDriver,GEOM_BaseDriver);