Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots reference#529
Conversation
…e translation of roots references Add processing of roots, which are transformed references of parts/assemblies.
There was a problem hiding this comment.
Pull Request Overview
This pull request updates the handling of root nodes in the assembly graph by incorporating transformed references during geometry rescaling.
- Introduces new variables to manage node IDs for both original and referenced shapes.
- Changes component checking from IsComponent to IsReference to correctly classify transformed parts/assemblies.
Files not reviewed (1)
- tests/bugs/xde/ar10850: Language not supported
Comments suppressed due to low confidence (2)
src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_AssemblyGraph.cxx:143
- [nitpick] Consider renaming 'anIdToProceed' to a more descriptive identifier (e.g., 'childNodeId') for improved clarity.
anIdToProceed = addNode(anOriginal, aRootId);
src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_AssemblyGraph.cxx:153
- Verify that passing 'anIdToProceed' instead of 'aRootId' to addComponents aligns with the desired rescaling behavior for transformed references.
addComponents(anOriginal, anIdToProceed);
There was a problem hiding this comment.
Pull Request Overview
This PR addresses an issue with the rescaling of translations for roots references by updating how node IDs are assigned and how shape types are determined.
- Introduces separate node IDs for the root and its corresponding child node using aRootId and anIdToProceed.
- Updates the condition to use IsReference instead of IsComponent for proper type detection.
Files not reviewed (1)
- tests/bugs/xde/ar10850: Language not supported
Comments suppressed due to low confidence (2)
src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_AssemblyGraph.cxx:131
- [nitpick] The variable name 'anIdToProceed' is ambiguous; consider renaming it to a more descriptive name (e.g., 'childNodeId') for improved readability.
Standard_Integer aRootId, anIdToProceed;
src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_AssemblyGraph.cxx:222
- Changing the condition from IsComponent to IsReference alters how shape labels are classified; ensure that this change aligns with the overall API design and that related documentation is updated accordingly.
else if (myShapeTool->IsReference(theLabel))
| addComponents(anOriginal, anIdToProceed); | ||
| } |
There was a problem hiding this comment.
Updating the call to addComponents with 'anIdToProceed' instead of 'aRootId' changes the node context being processed; please add a clarifying inline comment or documentation to explain this decision.
| addComponents(anOriginal, anIdToProceed); | |
| } | |
| { | |
| // Use 'anIdToProceed' instead of 'aRootId' to ensure that the context | |
| // being processed reflects the correct parent-child relationship in the graph. | |
| addComponents(anOriginal, anIdToProceed); | |
| } |
…e translation of roots reference (Open-Cascade-SAS#529) Add processing of roots, which are transformed references of parts/assemblies.
Add processing of roots, which are transformed references of parts/assemblies.