0033896 - STEP Write - General Attributes#634
Conversation
…nd creates proper STEP entitities.
…der declarations.
|
How to ask for a review? |
|
PR which is not a draft, automatically means ready to review. |
There was a problem hiding this comment.
Pull Request Overview
This pull request implements support for writing string metadata attributes to STEP geometries. Currently, STEP writers only support labels and colors, but this enhancement allows writing custom object attributes stored as NamedData.
- Adds metadata writing capability through new
MetadataModeflag andwriteMetadatamethod - Exports string metadata as STEP
property_definitionentities linked to product definitions - Integrates metadata writing into the main transfer workflow alongside existing property writing
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| STEPCAFControl_Writer.hxx | Adds metadata mode flag, getter/setter methods, and writeMetadata method declaration |
| STEPCAFControl_Writer.cxx | Implements metadata writing functionality with STEP entity creation and model integration |
| DESTEP_Parameters.hxx | Adds WriteMetadata parameter to control metadata export behavior |
| bool WriteName = true; //<! NameMode is used to indicate write Name or not | ||
| bool WriteLayer = true; //<! LayerMode is used to indicate write Layers or not | ||
| bool WriteProps = true; //<! PropsMode is used to indicate write Validation properties or not | ||
| bool WriteMetadata = true; //<! MetadataMode is used to indicate write validation properties. |
There was a problem hiding this comment.
The comment incorrectly states 'write validation properties' but should describe writing metadata properties. The comment should be updated to match the actual functionality: 'MetadataMode is used to indicate write metadata properties or not'.
| bool WriteMetadata = true; //<! MetadataMode is used to indicate write validation properties. | |
| bool WriteMetadata = true; //<! MetadataMode is used to indicate write metadata properties or not. |
| Handle(TCollection_HAsciiString) aPropDesc = | ||
| new TCollection_HAsciiString("Metadata property"); |
There was a problem hiding this comment.
[nitpick] The hardcoded description 'Metadata property' should be made configurable or more descriptive. Consider using the key name in the description or making it a parameter to provide more meaningful STEP file content.
| Handle(TCollection_HAsciiString) aPropDesc = | |
| new TCollection_HAsciiString("Metadata property"); | |
| TCollection_AsciiString aDynamicDesc("Metadata property: "); | |
| aDynamicDesc += aKey.ToCString(); | |
| Handle(TCollection_HAsciiString) aPropDesc = | |
| new TCollection_HAsciiString(aDynamicDesc); |
|
Do not rely or look on review of copilot. It is just for me to detect something hidden. |
|
Thank you :) |
|
Ping :) |
|
Yes, review still on Todo. At the moment can't have a deep review according STEP ISO and manual resting. |
|
Dear @petrasvestartas Thank you for your patch. To proceed with integration, please complete signing CLA process: In case if you already have signed CLA, please share ID that OCCT team shared with your by email after accepting of CLA. |
|
I have just filled the form and uploaded. I guess, I need to wait for confirmation. |
Thank you. The only 1 missed, please put "x" in place that you signing on behalf of yourself. If it is not difficult, please send one more time the form with that update. |
|
I have made the update on the form, and sent it. |
|
My apologies for the delays. |
Added general_property and general_property_association entities to comply with recommended practices. Changed property_definition description to "user defined attribute" to comply with recommended prectices. Added support of writing integer and real metadata items. Added WriteMetadata parameter to DESTEP_Parameters. Tests group metadata/step is updated to check for written metadata.
|
Thank you! What IR branch stands for? |
|
IR branch is a weekly/biweekly collection of patches. Used to collect a few ticket and then have a huge testing on all of them. |
|
Wow, OCCT has serious testing before production code. It is nice to see this in action! |
|
We have commercial repositories of projects and some clients tests which must to perform before integration. |
|
@dpasukhi Hey Dmitry, will this feature be only available with v8 or is it available in the latest release? |
|
@paulbuechner The STP metadata export is available in 8.0.0.rc2 and latest master. |
By any chance, do you have some portfiles and patches lying around for the RC versions to load them via vcpkg, or are the current ones still applicable? |
|
Well, for RC VCPKG is quite complicated. |
Aim
The aim of this pull request is to add support for writing simple string attributes to STEP geometries. Currently, it is only possible to define labels and colors; however, object attributes are missing. Issue created with more details and discussion with @dpasukhi : https://tracker.dev.opencascade.org/view.php?id=33896
Use case:
I have tried this workflow on Ubuntu using this example.zip. Explanation how to build and run this example is recorded in the video from minute 09:30: https://youtu.be/4pvzx5mxOYA?feature=shared&t=570 . Result is visible on the right side of this image under window called Properties: