Gui: Update rotation center indicator after zoom
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user