Gui: Update rotation center indicator after zoom

This commit is contained in:
Rexbas
2023-11-24 22:43:48 +01:00
parent 021e0a192f
commit affc49049e
3 changed files with 22 additions and 0 deletions

View File

@@ -1407,6 +1407,7 @@ void View3DInventorViewer::showRotationCenter(bool show)
material->transparency = 1.0F - float(color.alphaF());
auto translation = new SoTranslation();
translation->setName("translation");
translation->translation.setValue(center);
auto annotation = new SoAnnotation();
@@ -1433,6 +1434,20 @@ void View3DInventorViewer::showRotationCenter(bool show)
}
}
// Changes the position of the rotation center indicator
void View3DInventorViewer::changeRotationCenterPosition(const SbVec3f& newCenter) {
if (!rotationCenterGroup) {
return;
}
SoTranslation* translation = dynamic_cast<SoTranslation*>(rotationCenterGroup->getByName("translation"));
if (!translation) {
return;
}
translation->translation = newCenter;
}
void View3DInventorViewer::setNavigationType(Base::Type type)
{
if (this->navigation && this->navigation->getTypeId() == type) {