mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0026715: Problems in reading STEP short names in complex entities
Add function to find next part of complex entity by name or short name. Add missing short names. Test cases for issue CR26715
This commit is contained in:
@@ -35,7 +35,7 @@ void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::ReadStep
|
||||
// sln 09.10.2001. BUC61003. Correction of looking for items of complex entity in case of them do not saticfy to alphabetical order
|
||||
// CONVERSION_BASED_UNIT
|
||||
Standard_Integer num = 0;//num0;
|
||||
data->NamedForComplex("CONVERSION_BASED_UNIT CNBSUN",num0,num,ach);
|
||||
data->NamedForComplex("CONVERSION_BASED_UNIT", "CNBSUN",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num,1,"name",ach,aName);
|
||||
@@ -44,14 +44,14 @@ void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::ReadStep
|
||||
|
||||
// NAMED_UNIT
|
||||
//num = 0; //gka TRJ9 c2-id-214.stp
|
||||
data->NamedForComplex("NAMED_UNIT NMDUNT",num0,num,ach);
|
||||
data->NamedForComplex("NAMED_UNIT", "NMDUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
|
||||
Handle(StepBasic_DimensionalExponents) aDimensions;
|
||||
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
|
||||
|
||||
// PLANE_ANGLE_UNIT
|
||||
//num = 0; //gka
|
||||
data->NamedForComplex("PLANE_ANGLE_UNIT PLANUN",num0,num,ach);
|
||||
data->NamedForComplex("PLANE_ANGLE_UNIT", "PLANUN",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,0,ach,"plane_angle_unit")) return;
|
||||
|
||||
ent->Init(aDimensions,aName,aConversionFactor);
|
||||
|
@@ -48,7 +48,7 @@ void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::ReadStep(const Handle(StepD
|
||||
Handle(StepBasic_DimensionalExponents) aDimensions;
|
||||
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
|
||||
|
||||
data->NamedForComplex("VOLUME_UNIT",num0,num,ach);
|
||||
data->NamedForComplex("VOLUME_UNIT","VLMUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,0,ach,"volume_unit")) return;
|
||||
|
||||
ent->Init(aDimensions,aName,aConversionFactor);
|
||||
|
@@ -34,15 +34,15 @@ void RWStepBasic_RWSiUnitAndAreaUnit::ReadStep(const Handle(StepData_StepReaderD
|
||||
const Handle(StepBasic_SiUnitAndAreaUnit)& ent) const
|
||||
{
|
||||
Standard_Integer num = 0;
|
||||
data->NamedForComplex("AREA_UNIT",num0,num,ach);
|
||||
data->NamedForComplex("AREA_UNIT","ARUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,0,ach,"area_unit")) return;
|
||||
|
||||
data->NamedForComplex("NAMED_UNIT NMDUNT",num0,num,ach);
|
||||
data->NamedForComplex("NAMED_UNIT", "NMDUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
|
||||
Handle(StepBasic_DimensionalExponents) aDimensions;
|
||||
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
|
||||
|
||||
data->NamedForComplex("SI_UNIT SUNT",num0,num,ach);
|
||||
data->NamedForComplex("SI_UNIT", "SUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,2,ach,"si_unit")) return;
|
||||
|
||||
RWStepBasic_RWSiUnit reader;
|
||||
|
@@ -35,13 +35,13 @@ void RWStepBasic_RWSiUnitAndLengthUnit::ReadStep(const Handle(StepData_StepReade
|
||||
const Handle(StepBasic_SiUnitAndLengthUnit)& ent) const
|
||||
{
|
||||
Standard_Integer num = 0; // num0;
|
||||
Standard_Boolean sorted = data->NamedForComplex("LENGTH_UNIT LNGUNT",num0,num,ach);
|
||||
Standard_Boolean sorted = data->NamedForComplex("LENGTH_UNIT", "LNGUNT",num0,num,ach);
|
||||
|
||||
// --- Instance of plex componant LengthUnit ---
|
||||
if (!data->CheckNbParams(num,0,ach,"length_unit")) return;
|
||||
|
||||
if (!sorted) num = 0; //pdn unsorted case
|
||||
sorted &=data->NamedForComplex("NAMED_UNIT NMDUNT",num0,num,ach);
|
||||
sorted &=data->NamedForComplex("NAMED_UNIT", "NMDUNT",num0,num,ach);
|
||||
|
||||
// --- Instance of common supertype NamedUnit ---
|
||||
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
|
||||
@@ -52,7 +52,7 @@ void RWStepBasic_RWSiUnitAndLengthUnit::ReadStep(const Handle(StepData_StepReade
|
||||
data->CheckDerived(num,1,"dimensions",ach,Standard_False);
|
||||
|
||||
if (!sorted) num = 0; //pdn unsorted case
|
||||
data->NamedForComplex("SI_UNIT SUNT",num0,num,ach);
|
||||
data->NamedForComplex("SI_UNIT", "SUNT",num0,num,ach);
|
||||
|
||||
// --- Instance of plex componant SiUnit ---
|
||||
if (!data->CheckNbParams(num,2,ach,"si_unit")) return;
|
||||
|
@@ -44,13 +44,13 @@ void RWStepBasic_RWSiUnitAndMassUnit::ReadStep(const Handle(StepData_StepReaderD
|
||||
const Handle(StepBasic_SiUnitAndMassUnit)& ent) const
|
||||
{
|
||||
Standard_Integer num = 0; // num0;
|
||||
Standard_Boolean sorted = data->NamedForComplex("MASS_UNIT",num0,num,ach);
|
||||
Standard_Boolean sorted = data->NamedForComplex("MASS_UNIT","MSSUNT",num0,num,ach);
|
||||
|
||||
// --- Instance of plex componant LengthUnit ---
|
||||
if (!data->CheckNbParams(num,0,ach,"mass_unit")) return;
|
||||
|
||||
if (!sorted) num = 0; //pdn unsorted case
|
||||
sorted &=data->NamedForComplex("NAMED_UNIT NMDUNT",num0,num,ach);
|
||||
sorted &=data->NamedForComplex("NAMED_UNIT", "NMDUNT",num0,num,ach);
|
||||
|
||||
// --- Instance of common supertype NamedUnit ---
|
||||
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
|
||||
@@ -61,7 +61,7 @@ void RWStepBasic_RWSiUnitAndMassUnit::ReadStep(const Handle(StepData_StepReaderD
|
||||
data->CheckDerived(num,1,"dimensions",ach,Standard_False);
|
||||
|
||||
if (!sorted) num = 0; //pdn unsorted case
|
||||
data->NamedForComplex("SI_UNIT SUNT",num0,num,ach);
|
||||
data->NamedForComplex("SI_UNIT", "SUNT",num0,num,ach);
|
||||
|
||||
// --- Instance of plex componant SiUnit ---
|
||||
if (!data->CheckNbParams(num,2,ach,"si_unit")) return;
|
||||
|
@@ -34,12 +34,12 @@ void RWStepBasic_RWSiUnitAndVolumeUnit::ReadStep(const Handle(StepData_StepReade
|
||||
const Handle(StepBasic_SiUnitAndVolumeUnit)& ent) const
|
||||
{
|
||||
Standard_Integer num = 0;
|
||||
data->NamedForComplex("NAMED_UNIT NMDUNT",num0,num,ach);
|
||||
data->NamedForComplex("NAMED_UNIT", "NMDUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
|
||||
Handle(StepBasic_DimensionalExponents) aDimensions;
|
||||
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
|
||||
|
||||
data->NamedForComplex("SI_UNIT SUNT",num0,num,ach);
|
||||
data->NamedForComplex("SI_UNIT", "SUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,2,ach,"si_unit")) return;
|
||||
|
||||
RWStepBasic_RWSiUnit reader;
|
||||
@@ -73,7 +73,7 @@ void RWStepBasic_RWSiUnitAndVolumeUnit::ReadStep(const Handle(StepData_StepReade
|
||||
return;
|
||||
}
|
||||
|
||||
data->NamedForComplex("VOLUME_UNIT",num0,num,ach);
|
||||
data->NamedForComplex("VOLUME_UNIT","VLMUNT",num0,num,ach);
|
||||
if (!data->CheckNbParams(num,0,ach,"volume_unit")) return;
|
||||
|
||||
ent->Init(hasAprefix,aPrefix,aName);
|
||||
|
Reference in New Issue
Block a user