113 QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
115 QAction* typeEntry =
new QAction(tr(
"Viewer Settings"),_menu);
116 _menu->addAction( typeEntry );
117 typeEntry->setDisabled(
true);
118 _menu->addSeparator();
120 QAction* orthogonalCoordsys = 0;
122 orthogonalCoordsys =
new QAction( tr(
"Switch to Orthogonal coordinate system"), _menu );
123 orthogonalCoordsys->setIcon( QIcon(iconPath+
"orthogonal.png") );
125 orthogonalCoordsys =
new QAction( tr(
"Switch to Perspective coordinate system"), _menu );
126 orthogonalCoordsys->setIcon( QIcon(iconPath+
"perspective.png") );
129 _menu->addAction(orthogonalCoordsys);
142 QMenu* renderingOptionsMenu =
new QMenu(tr(
"Rendering Options"),_menu);
143 renderingOptionsMenu->setIcon( QIcon(iconPath+
"core_renderingOptions.png") );
144 _menu->addMenu(renderingOptionsMenu);
146 QAction* projectionAction = 0;
148 projectionAction =
new QAction( tr(
"Switch to Orthogonal Projection"), renderingOptionsMenu );
149 projectionAction->setIcon( QIcon(iconPath+
"orthogonal.png") );
150 projectionAction->setToolTip( tr(
"Switch to perspective orthogonal mode."));
152 projectionAction =
new QAction( tr(
"Switch to Perspective Projection"), renderingOptionsMenu );
153 projectionAction->setIcon( QIcon(iconPath+
"perspective.png") );
154 projectionAction->setToolTip( tr(
"Switch to perspective projection mode."));
157 projectionAction->setCheckable(
false );
158 projectionAction->setToolTip( tr(
"Switch between <b>perspective</b> and "
159 "<b>parrallel</b> projection mode."));
160 projectionAction->setWhatsThis( tr(
"Switch projection modes<br><br>"
161 "Switch between <b>perspective</b> and "
162 "<b>parrallel</b> projection mode."));
164 renderingOptionsMenu->addAction( projectionAction );
167 QAction* animation = renderingOptionsMenu->addAction(tr(
"Animation"));
169 animation->setToolTip(tr(
"Animate rotation of objects"));
170 animation->setCheckable(
true );
171 animation->setIcon( QIcon(iconPath+
"animation.png") );
178 QAction* backfaceCulling = renderingOptionsMenu->addAction(tr(
"Backface Culling"));
179 backfaceCulling->setToolTip(tr(
"Enable backface culling"));
180 backfaceCulling->setCheckable(
true );
181 backfaceCulling->setIcon( QIcon(iconPath+
"backFaceCulling.png") );
187 QAction* twoSidedLighting = renderingOptionsMenu->addAction(tr(
"Two-sided Lighting"));
188 twoSidedLighting->setToolTip(tr(
"Enable two-sided lighting"));
189 twoSidedLighting->setCheckable(
true );
190 twoSidedLighting->setIcon( QIcon(iconPath+
"twosidedLighting.png") );
196 QAction* multisampling = renderingOptionsMenu->addAction(tr(
"Multisampling"));
197 multisampling->setToolTip(tr(
"Enable Multisampling"));
198 multisampling->setCheckable(
true );
199 multisampling->setIcon( QIcon(iconPath+
"multiSampling.png") );
205 QAction* mipmapping = renderingOptionsMenu->addAction(tr(
"Mipmapping"));
206 mipmapping->setToolTip(tr(
"Enable Mipmapping"));
207 mipmapping->setCheckable(
true );
208 mipmapping->setIcon( QIcon(iconPath+
"mipmapping.png") );
216 if ( renderManager().available() > 1 ) {
217 QMenu* rendererMenu =
new QMenu(tr(
"Renderers"),_menu);
218 rendererMenu->setIcon(QIcon(iconPath+
"renderers.png"));
220 _menu->addMenu(rendererMenu);
223 QActionGroup* groupRenderer =
new QActionGroup(
this );
224 groupRenderer->setExclusive(
true );
233 QAction* showRendererDialog =
new QAction(tr(
"Show renderer manager"),
this);
235 rendererMenu->addAction(showRendererDialog);
237 QAction* showRendererObjectWidget =
new QAction(tr(
"Show render objects"),
this);
239 rendererMenu->addAction(showRendererObjectWidget);
241 rendererMenu->addSeparator();
243 for (
unsigned int i = 0 ; i < renderManager().
available() ; ++i) {
246 QAction * action =
new QAction( renderManager()[i]->name, groupRenderer );
247 action->setCheckable(
true );
251 action->setChecked(
true);
254 action->setData(QVariant(i));
258 rendererMenu->addActions( groupRenderer->actions() );
261 connect( groupRenderer , SIGNAL( triggered( QAction * ) ),
270 QMenu* viewingDirectionMenu =
new QMenu( tr(
"Viewing Direction"), _menu);
271 viewingDirectionMenu->setIcon(QIcon(iconPath+
"core_viewingDirection.png"));
272 _menu->addMenu(viewingDirectionMenu);
274 QActionGroup* dirGroup =
new QActionGroup(
this);
278 viewAction =
new QAction( tr(
"Free View"), viewingDirectionMenu );
279 viewAction->setIcon( QIcon(iconPath+
"orthogonal.png") );
280 viewAction->setCheckable(
true );
281 viewAction->setData( PluginFunctions::VIEW_FREE );
283 viewingDirectionMenu->addAction( viewAction );
284 dirGroup->addAction(viewAction);
285 viewingDirectionMenu->addSeparator();
287 viewAction =
new QAction( tr(
"Top View"), viewingDirectionMenu );
288 viewAction->setIcon( QIcon(iconPath+
"viewcontrol_top.png") );
289 viewAction->setCheckable(
true );
290 viewAction->setData( PluginFunctions::VIEW_TOP );
292 viewingDirectionMenu->addAction( viewAction );
293 dirGroup->addAction(viewAction);
295 viewAction =
new QAction( tr(
"Bottom View"), viewingDirectionMenu );
296 viewAction->setIcon( QIcon(iconPath+
"viewcontrol_bottom.png") );
297 viewAction->setCheckable(
true );
298 viewAction->setData( PluginFunctions::VIEW_BOTTOM );
300 viewingDirectionMenu->addAction( viewAction );
301 dirGroup->addAction(viewAction);
303 viewAction =
new QAction( tr(
"Left View"), viewingDirectionMenu );
304 viewAction->setIcon( QIcon(iconPath+
"viewcontrol_left.png") );
305 viewAction->setCheckable(
true );
306 viewAction->setData( PluginFunctions::VIEW_LEFT );
308 viewingDirectionMenu->addAction( viewAction );
309 dirGroup->addAction(viewAction);
311 viewAction =
new QAction( tr(
"Right View"), viewingDirectionMenu );
312 viewAction->setIcon( QIcon(iconPath+
"viewcontrol_right.png") );
313 viewAction->setCheckable(
true );
314 viewAction->setData( PluginFunctions::VIEW_RIGHT );
316 viewingDirectionMenu->addAction( viewAction );
317 dirGroup->addAction(viewAction);
319 viewAction =
new QAction( tr(
"Front View"), viewingDirectionMenu );
320 viewAction->setIcon( QIcon(iconPath+
"viewcontrol_front.png") );
321 viewAction->setCheckable(
true );
322 viewAction->setData( PluginFunctions::VIEW_FRONT );
324 viewingDirectionMenu->addAction( viewAction );
325 dirGroup->addAction(viewAction);
327 viewAction =
new QAction( tr(
"Back View"), viewingDirectionMenu );
328 viewAction->setIcon( QIcon(iconPath+
"viewcontrol_back.png") );
329 viewAction->setCheckable(
true );
330 viewAction->setData( PluginFunctions::VIEW_BACK );
332 viewingDirectionMenu->addAction( viewAction );
333 dirGroup->addAction(viewAction);
335 viewingDirectionMenu->addSeparator();
342 QAction* lockAction = viewingDirectionMenu->addAction(
"Lock rotation");
343 lockAction->setCheckable(
true );
344 lockAction->setIcon( QIcon(iconPath+
"lock_rotation.png") );
345 lockAction->setToolTip(tr(
"Lock rotation in current examiner"));
347 viewingDirectionMenu->addAction( lockAction );
349 connect( lockAction, SIGNAL(triggered(
bool)),
this, SLOT(
slotLockRotation(
bool) ) );
355 _menu->addSeparator();
363 QAction* showPostProcessorDialog =
new QAction(tr(
"Show post processor manager"),
this);
364 showPostProcessorDialog->setIcon(QIcon(iconPath+
"postprocessors.png"));
365 connect(showPostProcessorDialog,SIGNAL(triggered()),
this,SLOT(slotShowPostProcessorManager()));
366 _menu->addAction(showPostProcessorDialog);
368 _menu->addSeparator();
372 QAction* homeAction =
new QAction(tr(
"Restore home view"),_menu);
373 homeAction->setIcon( QIcon(iconPath+
"go-home.png") );
374 homeAction->setCheckable(
false );
375 homeAction->setToolTip(tr(
"Restore <b>home</b> view."));
376 homeAction->setWhatsThis( tr(
"Restore home view<br><br>"
377 "Resets the view to the home view"));
378 _menu->addAction( homeAction );
381 QAction* setHomeAction =
new QAction( tr(
"Set Home View") , _menu );
382 setHomeAction->setIcon( QIcon(iconPath+
"set-home.png") );
383 setHomeAction->setCheckable(
false );
384 setHomeAction->setToolTip(tr(
"Set <b>home</b> view"));
385 setHomeAction->setWhatsThis( tr(
"Store home view<br><br>"
386 "Stores the current view as the home view"));
387 _menu->addAction( setHomeAction);
390 QAction* viewAllAction =
new QAction( tr(
"View all"), _menu );
391 viewAllAction->setIcon( QIcon(iconPath+
"viewall.png") );
392 viewAllAction->setCheckable(
false );
393 viewAllAction->setToolTip(tr(
"View all."));
394 viewAllAction->setWhatsThis( tr(
"View all<br><br>"
395 "Move the objects in the scene so that"
396 " the whole scene is visible."));
398 _menu->addAction( viewAllAction);
401 _menu->addSeparator();
405 QAction* copyView = _menu->addAction(tr(
"Copy View"));
406 copyView->setToolTip(tr(
"Copy current view, window size and toolbar size to clipboard. Hold Ctrl to generate C/C++/JavaScipt-Style string."));
407 copyView->setIcon( QIcon(iconPath+
"edit-copy.png") );
408 connect(copyView, SIGNAL(triggered()),
this, SLOT(
slotCopyView()) );
412 QAction* pasteView = _menu->addAction(tr(
"Paste View"));
413 pasteView->setToolTip(tr(
"Paste current view from clipboard"));
414 pasteView->setIcon( QIcon(iconPath+
"edit-paste.png") );
415 connect(pasteView, SIGNAL(triggered()),
this , SLOT(
slotPasteView( ) ) );
419 QAction* pasteViewAndWindow = _menu->addAction(tr(
"Paste View and Window Size"));
420 pasteViewAndWindow->setToolTip(tr(
"Paste current view, window size and the toolbox size from clipboard"));
421 pasteViewAndWindow->setIcon( QIcon(iconPath+
"edit-paste.png") );
426 QAction* snapshot_examiner = _menu->addAction(tr(
"Examiner Snapshot"));
427 snapshot_examiner->setToolTip(tr(
"Take a snapshot of the current examiner"));
428 snapshot_examiner->setIcon( QIcon(iconPath+
"snapshot.png") );
433 QAction* snapshot_viewer = _menu->addAction(tr(
"Viewer Snapshot"));
434 snapshot_viewer->setToolTip(tr(
"Take a snapshot of the whole viewer"));
435 snapshot_viewer->setIcon( QIcon(iconPath+
"snapshot.png") );