Skip to content

Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots reference#529

Merged
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
ikochetkova:ar10850_ika
May 14, 2025
Merged

Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots reference#529
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
ikochetkova:ar10850_ika

Conversation

@ikochetkova
Copy link
Copy Markdown
Contributor

Add processing of roots, which are transformed references of parts/assemblies.

…e translation of roots references

Add processing of roots, which are transformed references of parts/assemblies.
@ikochetkova ikochetkova changed the title Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescal… Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots reference May 13, 2025
@ikochetkova ikochetkova self-assigned this May 13, 2025
@ikochetkova ikochetkova added 2. Enhancement New feature or request 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... labels May 13, 2025
@dpasukhi dpasukhi requested a review from Copilot May 13, 2025 15:01
@dpasukhi dpasukhi added this to the Release 8.0 milestone May 13, 2025
@dpasukhi dpasukhi added the 1. Application Framework CAF/XCAF/OCAF and other cases related with OCCT document label May 13, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

@ikochetkova ikochetkova requested a review from dpasukhi May 13, 2025 16:07
@github-project-automation github-project-automation bot moved this from Todo to Integration in Maintenance May 14, 2025
@dpasukhi dpasukhi requested a review from Copilot May 14, 2025 11:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))

Comment on lines +153 to 154
addComponents(anOriginal, anIdToProceed);
}
Copy link

Copilot AI May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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);
}

Copilot uses AI. Check for mistakes.
@dpasukhi dpasukhi merged commit 1158cba into Open-Cascade-SAS:IR May 14, 2025
33 checks passed
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance May 14, 2025
dpasukhi pushed a commit to dpasukhi/OCCT that referenced this pull request May 19, 2025
…e translation of roots reference (Open-Cascade-SAS#529)

Add processing of roots, which are transformed references of parts/assemblies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Application Framework CAF/XCAF/OCAF and other cases related with OCCT document 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants