+ //Get the IDs of <theSubShapes> inside <theMainShape>
+ Handle(TColStd_HSequenceOfInteger) aHSeq =
+ GetOperations()->GetSubShapesIndices(aMainShapeRef, aShapes);
+
+ 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();
+}
+
+
+//=============================================================================
+/*!
+ * GetTopologyIndex
+ */
+//=============================================================================
+CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
+ (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
+{
+ //Get the reference shapes
+ Handle(::GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
+ Handle(::GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
+
+ if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
+
+ //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
+ CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
+ if (!GetOperations()->IsDone())
+ return -1;
+
+ return anID;
+}
+
+//=============================================================================
+/*!
+ * GetShapeTypeString
+ */
+//=============================================================================
+char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
+{
+ //Get the reference shape
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
+ if (aShape.IsNull()) return NULL;
+
+ // Get shape parameters
+ TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
+ return CORBA::string_dup(aDescription.ToCString());
+}
+
+//=============================================================================
+/*!
+ * IsSubShapeBelongsTo
+ */
+//=============================================================================
+CORBA::Boolean GEOM_IShapesOperations_i::IsSubShapeBelongsTo( GEOM::GEOM_Object_ptr theSubObject,
+ const CORBA::Long theSubObjectIndex,
+ GEOM::GEOM_Object_ptr theObject,
+ const CORBA::Long theObjectIndex)
+{
+ Handle(::GEOM_Object) aSubObject = GetObjectImpl( theSubObject );
+ Handle(::GEOM_Object) anObject = GetObjectImpl( theObject );
+ if( anObject.IsNull() || aSubObject.IsNull() )
+ return false;
+
+ // Get parameters
+ return GetOperations()->IsSubShapeBelongsTo( aSubObject, theSubObjectIndex, anObject, theObjectIndex );
+}
+
+//=============================================================================
+/*!
+ * NumberOfFaces
+ */
+//=============================================================================
+CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
+{
+ return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_FACE));
+}
+
+//=============================================================================
+/*!
+ * NumberOfEdges
+ */
+//=============================================================================
+CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
+{
+ return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_EDGE));
+}
+
+//=============================================================================
+/*!
+ * NumberOfSubShapes
+ */
+//=============================================================================
+CORBA::Long GEOM_IShapesOperations_i::NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType)
+{
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
+ if (aShape.IsNull()) return -1;
+
+ CORBA::Long aNb = GetOperations()->NumberOfSubShapes(aShape, theShapeType);
+ if (!GetOperations()->IsDone()) return -1;
+
+ return aNb;
+}
+
+//=============================================================================
+/*!
+ * ChangeOrientation
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
+ (GEOM::GEOM_Object_ptr theShape)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference objects
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
+ if (aShape.IsNull()) return aGEOMObject._retn();
+
+ //Create the Solid
+ Handle(::GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ * GetFreeFacesIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
+
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
+ if (aShape.IsNull()) return aSeq._retn();
+
+ Handle(TColStd_HSequenceOfInteger) aHSeq =
+ GetOperations()->GetFreeFacesIDs(aShape);
+ 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();
+}
+
+//=============================================================================
+/*!
+ * GetSharedShapes
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
+ (GEOM::GEOM_Object_ptr theShape1,
+ GEOM::GEOM_Object_ptr theShape2,
+ const CORBA::Long theShapeType)
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ Handle(::GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+ Handle(::GEOM_Object) aShape2 = GetObjectImpl(theShape2);
+
+ if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
+
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->GetSharedShapes(aShape1, aShape2, 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();
+}
+
+//=============================================================================
+/*!
+ * GetSharedShapesMulti
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapesMulti
+ (const GEOM::ListOfGO& theShapes,
+ const CORBA::Long theShapeType,
+ CORBA::Boolean theMultiShare)
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Get the shapes
+ std::list<Handle(::GEOM_Object)> aShapes;
+ if (! GetListOfObjectsImpl( theShapes, aShapes ))
+ return aSeq._retn();
+
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->GetSharedShapes(aShapes, theShapeType, theMultiShare);
+ 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;
+
+ switch (theState) {
+ case GEOM::ST_ON:
+ aState = GEOMAlgo_ST_ON;
+ break;
+ case GEOM::ST_OUT:
+ aState = GEOMAlgo_ST_OUT;
+ break;
+ case GEOM::ST_ONOUT:
+ aState = GEOMAlgo_ST_ONOUT;
+ break;
+ case GEOM::ST_IN:
+ aState = GEOMAlgo_ST_IN;
+ break;
+ case GEOM::ST_ONIN:
+ aState = GEOMAlgo_ST_ONIN;
+ break;
+ default:
+ break;
+ }
+
+ return aState;
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnPlane
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAx1,
+ 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) anAx1 = GetObjectImpl(theAx1);
+
+ if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Plane
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnPlaneWithLocation
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAx1,
+ GEOM::GEOM_Object_ptr thePnt,
+ 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) anAx1 = GetObjectImpl(theAx1);
+ Handle(::GEOM_Object) anPnt = GetObjectImpl(thePnt);
+
+ if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Plane
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnCylinder
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAxis,
+ 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);
+
+ if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Cylinder
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
+ (aShape, theShapeType, anAxis, 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();
+}
+
+//=============================================================================
+/*!
+ * 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
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theCenter,
+ 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) aCenter = GetObjectImpl(theCenter);
+
+ if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Sphere
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
+ (aShape, theShapeType, aCenter, 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnQuadrangle
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
+ (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theTopLeftPoint,
+ GEOM::GEOM_Object_ptr theTopRightPoint,
+ GEOM::GEOM_Object_ptr theBottomLeftPoint,
+ GEOM::GEOM_Object_ptr theBottomRightPoint,
+ 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) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
+ Handle(::GEOM_Object) aTopRightPoint = GetObjectImpl(theTopRightPoint);
+ Handle(::GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
+ Handle(::GEOM_Object) aBottomRightPoint = GetObjectImpl(theBottomRightPoint);
+
+ if (aShape.IsNull() ||
+ aTopLeftPoint.IsNull() ||
+ aTopRightPoint.IsNull() ||
+ aBottomLeftPoint.IsNull() ||
+ aBottomRightPoint.IsNull())
+ return aSeq._retn();
+
+ //Get Shapes On Quadrangle
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
+ (aShape, theShapeType,
+ aTopLeftPoint, aTopRightPoint, aBottomLeftPoint, aBottomRightPoint,
+ 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnPlaneIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAx1,
+ 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) anAx1 = GetObjectImpl(theAx1);
+
+ if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Plane
+ Handle(TColStd_HSequenceOfInteger) aHSeq =
+ GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnPlaneWithLocationIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAx1,
+ GEOM::GEOM_Object_ptr thePnt,
+ 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) anAx1 = GetObjectImpl(theAx1);
+ Handle(::GEOM_Object) anPnt = GetObjectImpl(thePnt);
+
+ if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Plane
+ Handle(TColStd_HSequenceOfInteger) aHSeq =
+ GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
+ anAx1, anPnt, 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnCylinderIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theAxis,
+ 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);
+
+ if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Cylinder
+ Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
+ (aShape, theShapeType, anAxis, 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();
+}
+
+//=============================================================================
+/*!
+ * 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
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theCenter,
+ 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) aCenter = GetObjectImpl(theCenter);
+
+ if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
+
+ //Get Shapes On Sphere
+ Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
+ (aShape, theShapeType, aCenter, 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnQuadrangleIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
+ (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theTopLeftPoint,
+ GEOM::GEOM_Object_ptr theTopRightPoint,
+ GEOM::GEOM_Object_ptr theBottomLeftPoint,
+ GEOM::GEOM_Object_ptr theBottomRightPoint,
+ 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) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
+ Handle(::GEOM_Object) aTopRightPoint = GetObjectImpl(theTopRightPoint);
+ Handle(::GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
+ Handle(::GEOM_Object) aBottomRightPoint = GetObjectImpl(theBottomRightPoint);
+
+ if (aShape.IsNull() ||
+ aTopLeftPoint.IsNull() ||
+ aTopRightPoint.IsNull() ||
+ aBottomLeftPoint.IsNull() ||
+ aBottomRightPoint.IsNull() )
+ return aSeq._retn();
+
+ //Get Shapes On Quadrangle
+ Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
+ (aShape, theShapeType,
+ aTopLeftPoint, aTopRightPoint, aBottomLeftPoint, aBottomRightPoint,
+ 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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnBox
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
+ (GEOM::GEOM_Object_ptr theBox,
+ GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theShapeType,
+ 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) aBox = GetObjectImpl(theBox);
+
+ if (aShape.IsNull() || aBox.IsNull() )
+ return aSeq._retn();
+
+ //Get Shapes On Box
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
+ (aBox,aShape, theShapeType,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();
+}
+
+//=============================================================================
+/*!
+ * GetShapesOnQuadrangleIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
+ (GEOM::GEOM_Object_ptr theBox,
+ GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theShapeType,
+ 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) aBox = GetObjectImpl(theBox);
+
+ if (aShape.IsNull() || aBox.IsNull() )
+ return aSeq._retn();
+
+ //Get Shapes On Box
+ Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
+ (aBox,aShape, theShapeType,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();
+}
+
+
+//=============================================================================
+/*!
+ * GetShapesOnShape
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
+ (GEOM::GEOM_Object_ptr theCheckShape,
+ GEOM::GEOM_Object_ptr theShape,
+ CORBA::Short theShapeType,
+ 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) aCheckShape = GetObjectImpl(theCheckShape);
+
+ if (aShape.IsNull() || aCheckShape.IsNull() )
+ return aSeq._retn();
+
+ //Get Shapes On Shape
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
+ (aCheckShape,aShape, theShapeType,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();
+}
+
+
+//=============================================================================
+/*!
+ * GetShapesOnShapeAsCompound
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
+ (GEOM::GEOM_Object_ptr theCheckShape,
+ GEOM::GEOM_Object_ptr theShape,
+ CORBA::Short theShapeType,
+ GEOM::shape_state theState)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference objects
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
+
+ if (aShape.IsNull() || aCheckShape.IsNull() )
+ return aGEOMObject._retn();
+
+ //Get Shapes On Shape
+ Handle(::GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
+ (aCheckShape,aShape, theShapeType,ShapeState(theState));
+
+ if (anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+
+//=============================================================================
+/*!
+ * GetShapesOnShapeIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
+ (GEOM::GEOM_Object_ptr theCheckShape,
+ GEOM::GEOM_Object_ptr theShape,
+ CORBA::Short theShapeType,
+ 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) aCheckShape = GetObjectImpl(theCheckShape);
+
+ if (aShape.IsNull() || aCheckShape.IsNull() )
+ return aSeq._retn();
+
+ //Get Shapes On Shape
+ Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
+ (aCheckShape,aShape, theShapeType,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();