+//=============================================================================
+/*!
+ * GetShapesOnQuadrangleIDs
+ */
+//=============================================================================
+GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
+ (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theShapeType,
+ GEOM::GEOM_Object_ptr theTopLeftPoint,
+ GEOM::GEOM_Object_ptr theTopRigthPoint,
+ GEOM::GEOM_Object_ptr theBottomLeftPoint,
+ GEOM::GEOM_Object_ptr theBottomRigthPoint,
+ GEOM::shape_state theState)
+{
+ GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theShape == NULL ||
+ theTopLeftPoint == NULL ||
+ theTopRigthPoint == NULL ||
+ theBottomLeftPoint == NULL ||
+ theBottomRigthPoint == NULL )
+ return aSeq._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+ Handle(GEOM_Object) aTopLeftPoint = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theTopLeftPoint->GetEntry());
+ Handle(GEOM_Object) aTopRigthPoint = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theTopRigthPoint->GetEntry());
+ Handle(GEOM_Object) aBottomLeftPoint = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theBottomLeftPoint->GetEntry());
+ Handle(GEOM_Object) aBottomRigthPoint = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theBottomRigthPoint->GetEntry());
+
+ if (aShape.IsNull() ||
+ aTopLeftPoint.IsNull() ||
+ aTopRigthPoint.IsNull() ||
+ aBottomLeftPoint.IsNull() ||
+ aBottomRigthPoint.IsNull() )
+ return aSeq._retn();
+
+ //Get Shapes On Quadrangle
+ Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
+ (aShape, theShapeType,
+ aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
+ 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();
+
+ if ( theShape == NULL || theBox == NULL )
+ return aSeq._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+ Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theBox->GetEntry());
+
+ 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();
+
+ if ( theShape == NULL || theBox == NULL )
+ return aSeq._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+ Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theBox->GetEntry());
+
+ 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();
+
+ if ( theShape == NULL || theCheckShape == NULL )
+ return aSeq._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+ Handle(GEOM_Object) aCheckShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theCheckShape->GetEntry());
+
+ 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();
+
+ if ( theShape == NULL || theCheckShape == NULL )
+ return aGEOMObject._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+ Handle(GEOM_Object) aCheckShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theCheckShape->GetEntry());
+
+ 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();
+
+ if ( theShape == NULL || theCheckShape == NULL )
+ return aSeq._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+ Handle(GEOM_Object) aCheckShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theCheckShape->GetEntry());
+
+ 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();
+}
+
+