Skip to content

Commit

Permalink
data Exchange, Step Import - Adding product attributes to metadata
Browse files Browse the repository at this point in the history
Product attributes metadata for step files is now handled during import.
Attribute ReadProductMetadata is added to DESTEP_Parameters.
Method STEPCAFControl_Reader::ReadMetadata() is partially refactored.
Metadata tests for STEP are updated with new data.
Metagsta tests for GLTF are updated with new data (since original
metadata in those thests is acquired from STEP files).
  • Loading branch information
AtheneNoctuaPt committed Feb 1, 2025
1 parent 870d891 commit 978d236
Show file tree
Hide file tree
Showing 26 changed files with 478 additions and 192 deletions.
9 changes: 9 additions & 0 deletions src/DESTEP/DESTEP_ConfigurationNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ bool DESTEP_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theRe
theResource->BooleanVal("read.props", InternalParameters.ReadProps, aScope);
InternalParameters.ReadMetadata =
theResource->BooleanVal("read.metadata", InternalParameters.ReadMetadata, aScope);
InternalParameters.ReadProductMetadata =
theResource->BooleanVal("read.productmetadata", InternalParameters.ReadProductMetadata, aScope);

InternalParameters.WritePrecisionMode =
(DESTEP_Parameters::WriteMode_PrecisionMode)theResource->IntegerVal(
Expand Down Expand Up @@ -435,6 +437,13 @@ TCollection_AsciiString DESTEP_ConfigurationNode::Save() const
aResult += aScope + "read.metadata :\t " + InternalParameters.ReadMetadata + "\n";
aResult += "!\n";

aResult += "!\n";
aResult += "!Setting up the read.productmetadata parameter which is used to indicate whether to "
"read Product Metadata or not\n";
aResult += "!Default value: 0(\"OFF\"). Available values: 0(\"OFF\"), 1(\"ON\")\n";
aResult += aScope + "read.productmetadata :\t " + InternalParameters.ReadProductMetadata + "\n";
aResult += "!\n";

aResult += "!\n";
aResult += "!Write Parameters:\n";
aResult += "!\n";
Expand Down
5 changes: 0 additions & 5 deletions src/DESTEP/DESTEP_Parameters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ void DESTEP_Parameters::InitFromStatic()
ReadIdeas = Interface_Static::IVal("read.step.ideas") == 1;
ReadAllShapes = Interface_Static::IVal("read.step.all.shapes") == 1;
ReadRootTransformation = Interface_Static::IVal("read.step.root.transformation") == 1;
ReadColor = Interface_Static::IVal("read.color") == 1;
ReadName = Interface_Static::IVal("read.name") == 1;
ReadLayer = Interface_Static::IVal("read.layer") == 1;
ReadProps = Interface_Static::IVal("read.props") == 1;
ReadMetadata = Interface_Static::IVal("read.metadata") == 1;

WritePrecisionMode =
(DESTEP_Parameters::WriteMode_PrecisionMode)Interface_Static::IVal("write.precision.mode");
Expand Down
1 change: 1 addition & 0 deletions src/DESTEP/DESTEP_Parameters.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public:
bool ReadLayer = true; //<! LayerMode is used to indicate read Layers or not
bool ReadProps = true; //<! PropsMode is used to indicate read Validation properties or not
bool ReadMetadata = true; //! Parameter for metadata reading
bool ReadProductMetadata = false; //! Parameter for product metadata reading

// Write
WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //<! Specifies the mode of writing the resolution value into the STEP file
Expand Down
1 change: 1 addition & 0 deletions src/DESTEP/DESTEP_Provider.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ bool DESTEP_Provider::Read(const TCollection_AsciiString& thePath,
aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
aReader.SetPropsMode(aNode->InternalParameters.ReadProps);
aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata);
aReader.SetProductMetaMode(aNode->InternalParameters.ReadProductMetadata);
aReader.SetShapeFixParameters(aNode->ShapeFixParameters);
IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
DESTEP_Parameters aParams = aNode->InternalParameters;
Expand Down
Loading

0 comments on commit 978d236

Please sign in to comment.