-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 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
#include <TColStd_HSequenceOfTransient.hxx>
#include <TColStd_HArray1OfInteger.hxx>
+#include <vector>
+
/**
* This function converts GEOM::comparison_condition type into
* GEOMUtils::ComparisonCondition type.
//Get the shapes
std::list<Handle(::GEOM_Object)> aConstraints;
- for( int ind = 0; ind < theConstraints.length(); ind++ ) {
+ for( CORBA::ULong ind = 0; ind < theConstraints.length(); ind++ ) {
Handle(::GEOM_Object) anObject = GetObjectImpl( theConstraints[ind] );
aConstraints.push_back(anObject);
}
const GEOM::ListOfLong& theIndices)
{
GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
- Standard_Integer i;
//Set a not done flag
GetOperations()->SetNotDone();
if (aShape.IsNull()) return aSeq._retn();
Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger (1, theIndices.length());
- for (i = 0; i < theIndices.length(); i++)
+ for (CORBA::ULong i = 0; i < theIndices.length(); i++)
anArray->SetValue(i+1, theIndices[i]);
Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakeSubShapes(aShape, anArray);
Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
- for (i = 0; i < aLength; i++)
+ for (int i = 0; i < aLength; i++)
aSeq[i] = GetObject(Handle(::GEOM_Object)::DownCast(aHSeq->Value(i+1)));
return aSeq._retn();
(GEOM::GEOM_Object_ptr theShape,
CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theTopLeftPoint,
- GEOM::GEOM_Object_ptr theTopRigthPoint,
+ GEOM::GEOM_Object_ptr theTopRightPoint,
GEOM::GEOM_Object_ptr theBottomLeftPoint,
- GEOM::GEOM_Object_ptr theBottomRigthPoint,
+ GEOM::GEOM_Object_ptr theBottomRightPoint,
GEOM::shape_state theState)
{
GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Get the reference objects
Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
Handle(::GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
- Handle(::GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
+ Handle(::GEOM_Object) aTopRightPoint = GetObjectImpl(theTopRightPoint);
Handle(::GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
- Handle(::GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
+ Handle(::GEOM_Object) aBottomRightPoint = GetObjectImpl(theBottomRightPoint);
if (aShape.IsNull() ||
aTopLeftPoint.IsNull() ||
- aTopRigthPoint.IsNull() ||
+ aTopRightPoint.IsNull() ||
aBottomLeftPoint.IsNull() ||
- aBottomRigthPoint.IsNull())
+ aBottomRightPoint.IsNull())
return aSeq._retn();
//Get Shapes On Quadrangle
Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
(aShape, theShapeType,
- aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
+ aTopLeftPoint, aTopRightPoint, aBottomLeftPoint, aBottomRightPoint,
ShapeState(theState));
if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
(GEOM::GEOM_Object_ptr theShape,
CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theTopLeftPoint,
- GEOM::GEOM_Object_ptr theTopRigthPoint,
+ GEOM::GEOM_Object_ptr theTopRightPoint,
GEOM::GEOM_Object_ptr theBottomLeftPoint,
- GEOM::GEOM_Object_ptr theBottomRigthPoint,
+ GEOM::GEOM_Object_ptr theBottomRightPoint,
GEOM::shape_state theState)
{
GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
//Get the reference objects
Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
Handle(::GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
- Handle(::GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
+ Handle(::GEOM_Object) aTopRightPoint = GetObjectImpl(theTopRightPoint);
Handle(::GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
- Handle(::GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
+ Handle(::GEOM_Object) aBottomRightPoint = GetObjectImpl(theBottomRightPoint);
if (aShape.IsNull() ||
aTopLeftPoint.IsNull() ||
- aTopRigthPoint.IsNull() ||
+ aTopRightPoint.IsNull() ||
aBottomLeftPoint.IsNull() ||
- aBottomRigthPoint.IsNull() )
+ aBottomRightPoint.IsNull() )
return aSeq._retn();
//Get Shapes On Quadrangle
Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
(aShape, theShapeType,
- aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
+ aTopLeftPoint, aTopRightPoint, aBottomLeftPoint, aBottomRightPoint,
ShapeState(theState));
if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * GetInPlaceMap
+ */
+//=============================================================================
+GEOM::ListOfListOfLong*
+GEOM_IShapesOperations_i::GetInPlaceMap (GEOM::GEOM_Object_ptr theShapeWhere,
+ GEOM::GEOM_Object_ptr theShapeWhat)
+{
+ GEOM::ListOfListOfLong_var aResult = new GEOM::ListOfListOfLong();
+
+ //Get the reference objects
+ Handle(::GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
+ Handle(::GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
+
+ if (!aShapeWhere.IsNull() &&
+ !aShapeWhat.IsNull())
+ {
+ std::vector< std::vector< int > > resVec;
+ GetOperations()->GetInPlaceMap(aShapeWhere, aShapeWhat, resVec);
+
+ aResult->length( resVec.size() );
+ for ( size_t i = 0; i < resVec.size(); ++i )
+ {
+ //if ( !resVec[i].empty() )
+ aResult[i].length( resVec[i].size() );
+ for ( size_t j = 0; j < resVec[i].size(); ++j )
+ aResult[i][j] = resVec[i][j];
+ }
+ }
+ return aResult._retn();
+}
+
//=============================================================================
/*!
* GetSame