#include "utilities.h"
+#include <BRep_Builder.hxx>
+#include <ShapeFix_Shape.hxx>
#include <TDataStd_IntegerArray.hxx>
-
#include <TopExp.hxx>
-#include <TopoDS_Shape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
-
-#include <ShapeFix_Shape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopoDS_Shape.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_Failure.hxx>
aGA.Detect();
//modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
-#if OCC_VERSION_LARGE > 0x06050200
Standard_Integer iWrnDetect = aGA.WarningStatus();
if (iWrnDetect == 2) {
Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
}
-#endif
//modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
Standard_Integer iErr = aGA.ErrorStatus();
aGA.Detect();
//modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
-#if OCC_VERSION_LARGE > 0x06050200
Standard_Integer iWrnDetect = aGA.WarningStatus();
if (iWrnDetect == 2) {
/*
*/
Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
}
-#endif
//modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
Standard_Integer iErr = aGA.ErrorStatus();
TopoDS_Shape aShape;
TCollection_AsciiString aWrn;
- Handle(GEOM_Function) aRefBase = aCI.GetBase();
- TopoDS_Shape aShapeBase = aRefBase->GetValue();
+ TopoDS_Shape aShapeBase;
+ Handle(TColStd_HSequenceOfTransient) aRefBases = aCI.GetBase();
+ if ( aRefBases && !aRefBases->IsEmpty() )
+ {
+ if ( aRefBases->Length() == 1 )
+ {
+ Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aRefBases->Value(1));
+ if ( !aRefShape.IsNull() )
+ aShapeBase = aRefShape->GetValue();
+ }
+ else
+ {
+ TopoDS_Compound compound;
+ BRep_Builder builder;
+ builder.MakeCompound( compound );
+ int ind = 1;
+ for ( ; ind <= aRefBases->Length(); ind++)
+ {
+ Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aRefBases->Value(ind));
+ if ( aRefShape.IsNull() ) break;
+ TopoDS_Shape aShape = aRefShape->GetValue();
+ if (aShape.IsNull()) break;
+ builder.Add( compound, aShape );
+ }
+ if ( ind > aRefBases->Length() )
+ aShapeBase = compound;
+ else
+ aShapeBase.Nullify();
+ }
+ }
if (aShapeBase.IsNull()) {
Standard_NullObject::Raise("Shape for gluing is null");
}
switch ( aType ) {
case GLUE_FACES:
theOperationName = "GLUE_FACES";
- AddParam( theParams, "Selected shape", aCI.GetBase() );
+ AddParam( theParams, "Selected shapes", aCI.GetBase() );
AddParam( theParams, "Tolerance", aCI.GetTolerance() );
AddParam( theParams, "To keep non solids", aCI.GetKeepNonSolids() );
break;
case GLUE_EDGES:
theOperationName = "GLUE_EDGES";
- AddParam( theParams, "Selected shape", aCI.GetBase() );
+ AddParam( theParams, "Selected shapes", aCI.GetBase() );
AddParam( theParams, "Tolerance", aCI.GetTolerance() );
break;
case GLUE_FACES_BY_LIST:
theOperationName = "GLUE_FACES";
- AddParam( theParams, "Selected shape", aCI.GetBase() );
+ AddParam( theParams, "Selected shapes", aCI.GetBase() );
AddParam( theParams, "Tolerance", aCI.GetTolerance() );
AddParam( theParams, "Faces", aCI.GetFaces() );
AddParam( theParams, "To keep non solids", aCI.GetKeepNonSolids() );
break;
case GLUE_EDGES_BY_LIST:
theOperationName = "GLUE_EDGES";
- AddParam( theParams, "Selected shape", aCI.GetBase() );
+ AddParam( theParams, "Selected shapes", aCI.GetBase() );
AddParam( theParams, "Tolerance", aCI.GetTolerance() );
AddParam( theParams, "Edges", aCI.GetFaces() );
break;