mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-06-05 11:24:17 +03:00
Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots reference (#529)
Add processing of roots, which are transformed references of parts/assemblies.
This commit is contained in:
parent
784bf6d4b9
commit
275a072169
@ -127,19 +127,30 @@ void XCAFDoc_AssemblyGraph::buildGraph(const TDF_Label& theLabel)
|
||||
{
|
||||
TDF_Label aLabel = it.Value();
|
||||
|
||||
TDF_Label anOriginal;
|
||||
TDF_Label anOriginal;
|
||||
Standard_Integer aRootId, anIdToProceed;
|
||||
if (!myShapeTool->GetReferredShape(aLabel, anOriginal))
|
||||
anOriginal = aLabel;
|
||||
{
|
||||
anOriginal = aLabel;
|
||||
aRootId = addNode(anOriginal, 0);
|
||||
anIdToProceed = aRootId;
|
||||
}
|
||||
else
|
||||
{
|
||||
aRootId = addNode(aLabel, 0);
|
||||
if (aRootId == 0)
|
||||
continue;
|
||||
anIdToProceed = addNode(anOriginal, aRootId);
|
||||
}
|
||||
|
||||
const Standard_Integer aRootId = addNode(anOriginal, 0);
|
||||
if (aRootId == 0)
|
||||
if (aRootId == 0 || anIdToProceed == 0)
|
||||
continue;
|
||||
|
||||
myRoots.Add(aRootId);
|
||||
|
||||
// Add components (the objects nested into the current one).
|
||||
if (myShapeTool->IsAssembly(anOriginal))
|
||||
addComponents(anOriginal, aRootId);
|
||||
addComponents(anOriginal, anIdToProceed);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,7 +219,7 @@ Standard_Integer XCAFDoc_AssemblyGraph::addNode(const TDF_Label& theLabel,
|
||||
else
|
||||
aNodeType = NodeType_Subassembly;
|
||||
}
|
||||
else if (myShapeTool->IsComponent(theLabel))
|
||||
else if (myShapeTool->IsReference(theLabel))
|
||||
{
|
||||
aNodeType = NodeType_Occurrence;
|
||||
}
|
||||
|
17
tests/bugs/xde/ar10850
Normal file
17
tests/bugs/xde/ar10850
Normal file
@ -0,0 +1,17 @@
|
||||
puts "AR10850 - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots references"
|
||||
|
||||
pload OCAF
|
||||
Close D -silent
|
||||
XOpen [locate_data_file "ar10850_3D-EYE_chair_OCC_noscale.xbf"] D
|
||||
|
||||
XGetOneShape a D
|
||||
set ref_diag [eval distpp [bounding a]]
|
||||
|
||||
XRescaleGeometry D 0.001
|
||||
|
||||
XGetOneShape a D
|
||||
set diag [eval distpp [bounding a]]
|
||||
|
||||
checkreal "bounding box diagonal" $diag [expr $ref_diag * 0.001] 0 0.001
|
||||
|
||||
Close D
|
Loading…
x
Reference in New Issue
Block a user