- **Sketch fully constraint color** selects default color for a sketch with zero degrees of freedom.
- **Zoom trihedron arrows** if this control is checked then arrows of a view trihedron will be scaled according to current view scale
- **Axis arrow size** relative size of trihedron arrows. It has effect only in case if **Zoom trihedron arrows** is On.
+- **Enable automatic rotation** enables the perpetual rotation animation in the viewer.
To redefine any color click on the corresponding line to access **Select color** dialog box
<source>Keep trihedron arrows view size constant</source>
<translation>Maintenir la taille de la vue des flèches trièdres constante</translation>
</message>
+ <message>
+ <source>Enable automatic rotation</source>
+ <translation>Activer la rotation automatique</translation>
+ </message>
<message>
<source>General</source>
<translation>Général</translation>
Config_PropManager::registerProp("Visualization", "zoom_trihedron_arrows",
"Keep trihedron arrows view size constant", Config_Prop::Boolean, "false");
+ Config_PropManager::registerProp("Visualization", "use_auto_rotation",
+ "Enable automatic rotation", Config_Prop::Boolean, "false");
+
Config_PropManager::registerProp("Visualization", "axis_arrow_size",
"Trihedron arrows constant size", Config_Prop::IntSpin, "10");
#include <OCCViewer_ViewModel.h>
#include <OCCViewer_ViewPort3d.h>
+#include <OCCViewer_ViewManager.h>
#include <SUIT_Selector.h>
#include <SUIT_Desktop.h>
myWorkshop->selectionActivate()->updateSelectionModes();
myWorkshop->synchronizeViewer();
}
+ if (theMgr->getType() == OCCViewer_Viewer::Type()) {
+ // Set the auto rotate flag in the new viewer based on the current preference
+ OCCViewer_ViewManager *aVM = (OCCViewer_ViewManager*)theMgr;
+ bool aAutoRotation = Config_PropManager::boolean("Visualization", "use_auto_rotation");
+ aVM->setAutoRotation(aAutoRotation);
+
+ connect(theMgr, SIGNAL(viewCreated(SUIT_ViewWindow*)),
+ myProxyViewer, SLOT(onViewCreated(SUIT_ViewWindow*)));
+ }
}
//******************************************************
}
}
}
+ if (theParam == "use_auto_rotation") {
+ bool aAutoRotation = Config_PropManager::boolean("Visualization", "use_auto_rotation");
+ // Update the auto rotation flag in all OCC 3D view windows
+ ViewManagerList lst;
+ getApp()->viewManagers(OCCViewer_Viewer::Type(), lst);
+ for ( auto it = lst.begin(); it != lst.end(); ++it )
+ {
+ OCCViewer_ViewManager *aVMgr = dynamic_cast<OCCViewer_ViewManager*>(*it);
+ if (aVMgr) {
+ aVMgr->setAutoRotation(aAutoRotation);
+ }
+ }
+ }
}
else if (theSection == ModuleBase_Preferences::GENERAL_SECTION && theParam == "create_init_part") {
bool aCreate = ModuleBase_Preferences::resourceMgr()->booleanValue(
#include <OCCViewer_ViewPort3d.h>
#include <OCCViewer_ViewFrame.h>
+#include <OCCViewer_ViewManager.h>
#include <SOCC_ViewModel.h>
#include <SUIT_ViewManager.h>
OCCViewer_ViewPort3d* aViewPort = aWnd->getViewPort();
if (aViewPort)
connect(aViewPort, SIGNAL(vpMapped(OCCViewer_ViewPort3d*)), this, SLOT(onViewPortMapped()));
+
+ OCCViewer_ViewManager* aMgr = dynamic_cast<OCCViewer_ViewManager*>(aWnd->getViewManager());
+ if (aMgr) aWnd->enableAutoRotation(aMgr->isAutoRotation());
}
reconnectActions(aWnd, true);
connect(aWnd, SIGNAL(vpTransformationFinished(OCCViewer_ViewWindow::OperationType)),
this, SLOT(onViewTransformed(OCCViewer_ViewWindow::OperationType)));
reconnectActions(aWnd, true);
+ OCCViewer_ViewManager* aOCCMgr = dynamic_cast<OCCViewer_ViewManager*>(aMgr);
+ if (aOCCMgr) aWnd->enableAutoRotation(aOCCMgr->isAutoRotation());
}
} else {
foreach (SUIT_ViewWindow* aView, aViews) {
SIGNAL(vpTransformationFinished(OCCViewer_ViewWindow::OperationType)),
this, SLOT(onViewTransformed(OCCViewer_ViewWindow::OperationType)));
reconnectActions(aWnd, false);
+ aWnd->enableAutoRotation(false);
}
}
}