mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-25 18:22:04 +05:00
PAL13703: addition to previous integration (see GEOM_Object.cxx, GEOM_Function.cxx) to provide right treatment of groups
This commit is contained in:
parent
a25fd83519
commit
e33d834b6e
@ -17,6 +17,7 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_IGroupOperations.hxx>
|
||||
@ -81,7 +82,7 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::CreateGroup
|
||||
Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1);
|
||||
anArray->SetValue(1, -1);
|
||||
|
||||
//Add a new Fillet object
|
||||
//Add a new Sub-shape object
|
||||
Handle(GEOM_Object) aGroup = GetEngine()->AddSubShape(theMainShape, anArray);
|
||||
|
||||
//Set a GROUP type
|
||||
@ -119,9 +120,9 @@ void GEOMImpl_IGroupOperations::AddObject(Handle(GEOM_Object) theGroup, int theS
|
||||
// Check sub-shape index validity
|
||||
TDF_Label aLabel = aSSI.GetMainShape()->GetOwnerEntry();
|
||||
if (aLabel.IsRoot()) return;
|
||||
Handle(GEOM_Object) anObj = GEOM_Object::GetObject(aLabel);
|
||||
if (anObj.IsNull()) return;
|
||||
TopoDS_Shape aMainShape = anObj->GetValue();
|
||||
Handle(GEOM_Object) aMainObj = GEOM_Object::GetObject(aLabel);
|
||||
if (aMainObj.IsNull()) return;
|
||||
TopoDS_Shape aMainShape = aMainObj->GetValue();
|
||||
if (aMainShape.IsNull()) return;
|
||||
|
||||
TopTools_IndexedMapOfShape aMapOfShapes;
|
||||
@ -152,6 +153,10 @@ void GEOMImpl_IGroupOperations::AddObject(Handle(GEOM_Object) theGroup, int theS
|
||||
aSSI.SetIndices(aNewSeq);
|
||||
}
|
||||
|
||||
// As we do not recompute here our group, lets mark it as Modified
|
||||
Standard_Integer aTic = aMainObj->GetTic(); // tic of main shape
|
||||
theGroup->SetTic(aTic - 1);
|
||||
|
||||
//Make a Python command
|
||||
GEOM::TPythonDump(aFunction, /*append=*/true)
|
||||
<< "geompy.AddObject(" << theGroup << ", " << theSubShapeID << ")";
|
||||
@ -176,11 +181,12 @@ void GEOMImpl_IGroupOperations::RemoveObject (Handle(GEOM_Object) theGroup, int
|
||||
GEOM_ISubShape aSSI(aFunction);
|
||||
Handle(TColStd_HArray1OfInteger) aSeq = aSSI.GetIndices();
|
||||
if(aSeq.IsNull()) return;
|
||||
|
||||
if(aSeq->Length() == 1 && aSeq->Value(1) == -1) {
|
||||
SetErrorCode(NOT_EXISTS);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
||||
Handle(TColStd_HArray1OfInteger) aNewSeq;
|
||||
Standard_Integer aLength = aSeq->Length();
|
||||
if(aLength == 1) {
|
||||
@ -212,7 +218,14 @@ void GEOMImpl_IGroupOperations::RemoveObject (Handle(GEOM_Object) theGroup, int
|
||||
}
|
||||
|
||||
aSSI.SetIndices(aNewSeq);
|
||||
}
|
||||
|
||||
// As we do not recompute here our group, lets mark it as Modified
|
||||
TDF_Label aLabel = aSSI.GetMainShape()->GetOwnerEntry();
|
||||
if (aLabel.IsRoot()) return;
|
||||
Handle(GEOM_Object) aMainObj = GEOM_Object::GetObject(aLabel);
|
||||
if (aMainObj.IsNull()) return;
|
||||
Standard_Integer aTic = aMainObj->GetTic(); // tic of main shape
|
||||
theGroup->SetTic(aTic - 1);
|
||||
|
||||
//Make a Python command
|
||||
GEOM::TPythonDump(aFunction, /*append=*/true)
|
||||
@ -346,6 +359,10 @@ void GEOMImpl_IGroupOperations::UnionList (Handle(GEOM_Object) theGroup,
|
||||
}
|
||||
|
||||
aSSI.SetIndices(aNewSeq);
|
||||
|
||||
// As we do not recompute here our group, lets mark it as Modified
|
||||
Standard_Integer aTic = aMainObj->GetTic(); // tic of main shape
|
||||
theGroup->SetTic(aTic - 1);
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
@ -476,6 +493,10 @@ void GEOMImpl_IGroupOperations::DifferenceList (Handle(GEOM_Object) theGroup,
|
||||
}
|
||||
|
||||
aSSI.SetIndices(aNewSeq);
|
||||
|
||||
// As we do not recompute here our group, lets mark it as Modified
|
||||
Standard_Integer aTic = aMainObj->GetTic(); // tic of main shape
|
||||
theGroup->SetTic(aTic - 1);
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
@ -566,6 +587,10 @@ void GEOMImpl_IGroupOperations::UnionIDs (Handle(GEOM_Object) theGroup,
|
||||
}
|
||||
|
||||
aSSI.SetIndices(aNewSeq);
|
||||
|
||||
// As we do not recompute here our group, lets mark it as Modified
|
||||
Standard_Integer aTic = aMainObj->GetTic(); // tic of main shape
|
||||
theGroup->SetTic(aTic - 1);
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
@ -651,6 +676,10 @@ void GEOMImpl_IGroupOperations::DifferenceIDs (Handle(GEOM_Object) theGroup,
|
||||
}
|
||||
|
||||
aSSI.SetIndices(aNewSeq);
|
||||
|
||||
// As we do not recompute here our group, lets mark it as Modified
|
||||
Standard_Integer aTic = aMainObj->GetTic(); // tic of main shape
|
||||
theGroup->SetTic(aTic - 1);
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
|
Loading…
x
Reference in New Issue
Block a user