-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakeEdgeWire
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeWire
+ (GEOM::GEOM_Object_ptr theWire,
+ const CORBA::Double theLinearTolerance,
+ const CORBA::Double theAngularTolerance)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the source wire
+ Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
+
+ if (aWire.IsNull()) return aGEOMObject._retn();
+
+ //Create the Edge
+ Handle(GEOM_Object) anObject = GetOperations()->MakeEdgeWire(aWire, theLinearTolerance, theAngularTolerance);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakeWire
GetOperations()->SetNotDone();
int ind, aLen;
- list<Handle(GEOM_Object)> aShapes;
+ std::list<Handle(GEOM_Object)> aShapes;
//Get the shapes
aLen = theEdgesAndWires.length();
GetOperations()->SetNotDone();
int ind, aLen;
- list<Handle(GEOM_Object)> aShapes;
+ std::list<Handle(GEOM_Object)> aShapes;
//Get the shapes
aLen = theWires.length();
GetOperations()->SetNotDone();
int ind, aLen;
- list<Handle(GEOM_Object)> aShapes;
+ std::list<Handle(GEOM_Object)> aShapes;
//Get the shapes
aLen = theFacesAndShells.length();
Handle(GEOM_Object) aShell = GetObjectImpl(theShell);
if (aShell.IsNull()) return aGEOMObject._retn();
+ std::list<Handle(GEOM_Object)> aShapes;
+ aShapes.push_back(aShell);
+
//Create the Solid
- Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShell(aShell);
+ Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShells(aShapes);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
GetOperations()->SetNotDone();
int ind, aLen;
- list<Handle(GEOM_Object)> aShapes;
+ std::list<Handle(GEOM_Object)> aShapes;
//Get the shapes
aLen = theShells.length();
GetOperations()->SetNotDone();
int ind, aLen;
- list<Handle(GEOM_Object)> aShapes;
+ std::list<Handle(GEOM_Object)> aShapes;
//Get the shapes
aLen = theShapes.length();
if (aShape.IsNull()) return aGEOMObject._retn();
int ind, aLen;
- list<Handle(GEOM_Object)> aFaces;
+ std::list<Handle(GEOM_Object)> aFaces;
//Get the shapes
aLen = theFaces.length();
for (ind = 0; ind < aLen; ind++) {
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * GetExistingSubObjects
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Boolean theGroupsOnly)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ if (aShape.IsNull()) return aSeq._retn();
+
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->GetExistingSubObjects(aShape, theGroupsOnly);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
//=============================================================================
/*!
if (aShape.IsNull()) return aSeq._retn();
Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
+ GetOperations()->MakeExplode(aShape, theShapeType, isSorted, Standard_True);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakeAllSubShapes
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeAllSubShapes (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ const CORBA::Boolean isSorted)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ if (aShape.IsNull()) return aSeq._retn();
+
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakeExplode(aShape, theShapeType, isSorted, Standard_False);
if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
if (aShape.IsNull()) return aSeq._retn();
Handle(TColStd_HSequenceOfInteger) aHSeq =
- GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
+ GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted, Standard_True);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = aHSeq->Value(i);
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * GetAllSubShapesIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetAllSubShapesIDs (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ const CORBA::Boolean isSorted)
+{
+ GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
+
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ if (aShape.IsNull()) return aSeq._retn();
+
+ Handle(TColStd_HSequenceOfInteger) aHSeq =
+ GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted, Standard_False);
if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
Standard_Integer aLength = aHSeq->Length();
return aSeq._retn();
}
+//=============================================================================
+/*!
+ * GetSharedShapesMulti
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapesMulti
+ (const GEOM::ListOfGO& theShapes,
+ const CORBA::Long theShapeType)
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Get the shapes
+ std::list<Handle(GEOM_Object)> aShapes;
+ int aLen = theShapes.length();
+ for (int ind = 0; ind < aLen; ind++) {
+ Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
+ if (aSh.IsNull()) return aSeq._retn();
+ aShapes.push_back(aSh);
+ }
+
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->GetSharedShapes(aShapes, theShapeType);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
{
GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
return aSeq._retn();
}
+//=============================================================================
+/*!
+ * GetShapesOnCylinderWithLocation
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAxis,
+ GEOM::GEOM_Object_ptr thePnt,
+ const CORBA::Double theRadius,
+ const GEOM::shape_state theState)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
+ Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
+
+ if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Cylinder
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
+ (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
//=============================================================================
/*!
* GetShapesOnSphere
return aSeq._retn();
}
+//=============================================================================
+/*!
+ * GetShapesOnCylinderWithLocationIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAxis,
+ GEOM::GEOM_Object_ptr thePnt,
+ const CORBA::Double theRadius,
+ const GEOM::shape_state theState)
+{
+ GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
+ Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
+
+ if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Cylinder
+ Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
+ (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = aHSeq->Value(i);
+
+ return aSeq._retn();
+}
+
//=============================================================================
/*!
* GetShapesOnSphereIDs