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

0025167: STEP Reader - allow NextAssemblyUsageOccurance to accept ProductDefinitionShape as child instead of ProductDefinition

Workaround to allow NextAssemblyUsageOccurance accepting ProductDefinitionShape as child instead of ProductDefinition
This commit is contained in:
drazmyslovich 2014-08-19 13:49:37 +02:00 committed by bugmaster
parent 8a8be2aabe
commit bedd79c434
2 changed files with 31 additions and 1 deletions

View File

@ -17,6 +17,8 @@
#include <RWStepRepr_RWAssemblyComponentUsage.ixx>
#include <StepRepr_ProductDefinitionShape.hxx>
//=======================================================================
//function : RWStepRepr_RWAssemblyComponentUsage
//purpose :
@ -58,9 +60,27 @@ void RWStepRepr_RWAssemblyComponentUsage::ReadStep (const Handle(StepData_StepRe
Handle(StepBasic_ProductDefinition) aProductDefinitionRelationship_RelatingProductDefinition;
data->ReadEntity (num, 4, "product_definition_relationship.relating_product_definition", ach, STANDARD_TYPE(StepBasic_ProductDefinition), aProductDefinitionRelationship_RelatingProductDefinition);
if (aProductDefinitionRelationship_RelatingProductDefinition.IsNull())
{
Handle(StepRepr_ProductDefinitionShape) aProductDefinitionShape;
data->ReadEntity (num, 4, "product_definition_relationship.relating_product_definition_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aProductDefinitionShape);
if (!aProductDefinitionShape.IsNull())
{
aProductDefinitionRelationship_RelatingProductDefinition = aProductDefinitionShape->Definition().ProductDefinition();
}
}
Handle(StepBasic_ProductDefinition) aProductDefinitionRelationship_RelatedProductDefinition;
data->ReadEntity (num, 5, "product_definition_relationship.related_product_definition", ach, STANDARD_TYPE(StepBasic_ProductDefinition), aProductDefinitionRelationship_RelatedProductDefinition);
if (aProductDefinitionRelationship_RelatedProductDefinition.IsNull())
{
Handle(StepRepr_ProductDefinitionShape) aProductDefinitionShape;
data->ReadEntity (num, 5, "product_definition_relationship.related_product_definition_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aProductDefinitionShape);
if (!aProductDefinitionShape.IsNull())
{
aProductDefinitionRelationship_RelatedProductDefinition = aProductDefinitionShape->Definition().ProductDefinition();
}
}
// Own fields of AssemblyComponentUsage

View File

@ -399,6 +399,7 @@ static void getListSDR(const Handle(StepRepr_ShapeAspect)& sa,
static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
Handle(TColStd_HSequenceOfTransient)& listSDR,
Handle(TColStd_HSequenceOfTransient)& listNAUO,
Handle(TColStd_HSequenceOfTransient)& listSDRAspect,
const Handle(Transfer_TransientProcess)& TP)
{
@ -448,6 +449,15 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
getListSDR(sa,listSDRAspect,TP);
continue;
}
// NAUO is used to find sub-assemblies
Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO =
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(subs4.Value());
if ( ! NAUO.IsNull() ) {
if ( PDS->Definition().ProductDefinition() == NAUO->RelatingProductDefinition() )
listNAUO->Append(NAUO);
continue;
}
}
}
@ -480,7 +490,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
Handle(StepRepr_ProductDefinitionShape) PDS =
Handle(StepRepr_ProductDefinitionShape)::DownCast(subs3.Value());
if ( ! PDS.IsNull() ) {
getSDR(PDS,listSDR,listSDRAspect,TP);
getSDR(PDS,listSDR,listNAUO,listSDRAspect,TP);
continue;
}
// NAUO is used to find sub-assemblies