bos #23963 - EDF 22935 : Extrusion3D, submesh problem. Fix groups handling with ticks

This commit is contained in:
jfa 2021-02-17 13:18:13 +03:00
parent f26bc594ae
commit 064bf22985

View File

@ -201,14 +201,28 @@ TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_p
{ {
CORBA::String_var anIOR = geom->GetStringFromIOR(aShape); CORBA::String_var anIOR = geom->GetStringFromIOR(aShape);
TCollection_AsciiString IOR = anIOR.in(); TCollection_AsciiString IOR = anIOR.in();
// Special treatment for groups: group value (shape) is computed on
// first demand, and its tick is set to main shape's tick after that;
// tick of modified group is decremented.
// There is a not fixed problem: if anyone modifies a group and updates
// it before call to this method, the group will not be changed in the buffer
bool isModifiedSubShape = false;
int aShapeTick = aShape->GetTick(); int aShapeTick = aShape->GetTick();
if ( !aShape->IsMainShape() ) {
int anOldTick = aShapeTick;
aShape->GetShapeType(); // compute subshape and update its tick, if not yet
aShapeTick = aShape->GetTick();
isModifiedSubShape = (anOldTick != aShapeTick);
}
std::map< TCollection_AsciiString , int >::iterator i2t = myTicksMap.find( IOR ); std::map< TCollection_AsciiString , int >::iterator i2t = myTicksMap.find( IOR );
if ( i2t != myTicksMap.end() ) { if ( i2t != myTicksMap.end() ) {
if (i2t->second != aShapeTick || isModifiedSubShape) {
// The shape was modified, clean the stored one // The shape was modified, clean the stored one
if (i2t->second != aShapeTick)
RemoveShapeFromBuffer(IOR); RemoveShapeFromBuffer(IOR);
} }
}
TopoDS_Shape S; TopoDS_Shape S;
if ( Find( IOR, S )) if ( Find( IOR, S ))
@ -255,6 +269,7 @@ TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_p
S = aCompound; S = aCompound;
} }
Bind(IOR, S, aShapeTick); Bind(IOR, S, aShapeTick);
return S; return S;
} }