1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0030870: Data Exchange - Add the support for empty draughting models and empty presentation layer assignments for step import

Protections to avoid exception in the methods  RWStepVisual_RWDraughtingModel::ReadStep and RWStepVisual_RWPresentationLayerAssignment::ReadStep for case when assigned items are absent were added
This commit is contained in:
drazmyslovich 2019-08-07 11:04:53 +03:00 committed by bugmaster
parent fa68c1e116
commit 9063f1e089
2 changed files with 17 additions and 15 deletions

View File

@ -56,6 +56,8 @@ void RWStepVisual_RWDraughtingModel::ReadStep (const Handle(StepData_StepReaderD
if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
Standard_Integer num2 = sub2;
Standard_Integer nb0 = data->NbParams(num2);
if (nb0 > 0)
{
aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
Handle(StepRepr_RepresentationItem) anIt0;
@ -63,6 +65,7 @@ void RWStepVisual_RWDraughtingModel::ReadStep (const Handle(StepData_StepReaderD
aRepresentation_Items->SetValue(i0, anIt0);
}
}
}
Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);

View File

@ -54,9 +54,8 @@ void RWStepVisual_RWPresentationLayerAssignment::ReadStep
Standard_Integer nsub3;
if (data->ReadSubList (num,3,"assigned_items",ach,nsub3)) {
Standard_Integer nb3 = data->NbParams(nsub3);
if (nb3)
if (nb3 > 0)
{
aAssignedItems = new StepVisual_HArray1OfLayeredItem (1, nb3);
for (Standard_Integer i3 = 1; i3 <= nb3; i3 ++) {
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed