HyperspaceExplorer 0.7.1
Public Slots | Public Member Functions | Private Types | Private Member Functions | Private Attributes
C4DView::Menu4D Class Reference

The menu for the C4DView and handlers for menu events. More...

#include <Menu4D.h>

Collaboration diagram for C4DView::Menu4D:
Collaboration graph
[legend]

List of all members.

Public Slots

void customFunction ()
 "Object/f:R^3 -> R/Custom function" menu item selected
void customPolarFunction ()
 "Object/f:R^3 -> R/Custom polar function" menu item selected
void customSurface ()
 "Object/Surfaces/Custom surface" menu item selected
void customComplexFunction ()
 "Object/Surfaces/f:C -> C/Custom complex function" menu item selected
void Colors ()
 "Appearance/Colors" menu item selected
void Shade ()
 "Appearance/Shading" menu item selected
void Fog ()
 "Appearance/Depth Cue" menu item selected
void Transparent ()
 "Appearance/Transparence" menu item selected
void Light ()
 "Appearance/Lighting" menu item selected
void Wireframe ()
 "Appearance/Wireframe" menu item selected
void Coordinates ()
 "Appearance/Coordinate Cross" menu item selected
void setBackground ()
 "Appearance/Set Background Color" menu item selected
void HyperFog ()
 "Appearance/4D Depth Cue" menu item selected
void setColorManager (QAction *)
 "Appearance/Coloring Scheme" submenu item selected
void RenderToImages ()
 "Animation/Render to Images" menu item selected
void AnimationSettings ()
 "Animation/Animation Settings" menu item selected
void Benchmark ()
 "Animation/Benchmark" menu item selected
void RandomAnimation ()
 "Animation/Random Animation" menu item selected
void Help ()
 "Help/Online Help" menu item selected
void about ()
 "Help/About" menu item selected
void aboutQt ()
 "Help/About Qt" menu item selected

Public Member Functions

 Menu4D (C4DView *)
 Creates the application's main menu and all its submenus.
void addToMenuBar (QMenuBar *menuBar)
 Add the menu to a QMenuBar.
void updateFunctionMenu (const QString &)
 Set the selected function as checked and uncheck all the others.
QAction *& getAction (const QString &key)
 Search for the QAction associated with a menu item.

Private Types

typedef std::map< QString,
QAction * > 
ActionMapType
 Assigns a QAction to a menu title.
typedef std::map< QMenu
*, ActionMapType
MenuMapType
 Manages an ActionMap for each submenu.

Private Member Functions

QMenu * createMenu (const DisplayableClass &node)
 Creates a menu with submenus from a DisplayableClass.
QAction * insertAction (QMenu *, const QString &, const char *=0, bool=true)
 insert a menu item with a specified slot into a specified menu
QAction * insertAction (QMenu *, const std::string &, bool=true)
 insert a menu item creating a Surface object into a specified menu

Private Attributes

C4DView_parent
 the C4DView containing this menu
QMenu * _appear
 The "Appearance" menu.
QMenu * _color
 The "Appearance/Color Schemes" submenu.
QMenu * _animation
 The "Animation" menu.
QMenu * _help
 The "Help" menu.
QMenu * generated_
 The auto-generated Displayable menu.
MenuMapType _menuMap
 Keeps the QActions belonging to the menu entries.

Detailed Description

The menu for the C4DView and handlers for menu events.

This class has been outsourced from C4DView to keep C4DView to a managable size.

Author:
Helge Preuss <lene.preuss@gmail.com>

Constructor & Destructor Documentation

C4DView::Menu4D::Menu4D ( C4DView _parent)

Creates the application's main menu and all its submenus.

This Constructor is where the menu structure is defined; if you want to change the menu, do it here.

Basically this happens by inserting all the menu items and the QActions they trigger manually. The application of TemplatedRealFunctionFactory<Function> as Factory object _helps to save a lot of redundant code, but still every menu item must be specified manually.

References _animation, _appear, _color, _help, about(), AnimationSettings(), std::vector< _Tp, _Alloc >::begin(), begin(), Benchmark(), std::cerr, Colors(), Coordinates(), copy(), createMenu(), std::vector< _Tp, _Alloc >::end(), end(), Fog(), generated_, getAction(), UI::ViewImpl::getColors(), UI::ViewImpl::getCoordinates(), UI::ViewImpl::getFog(), UI::ViewImpl::getLighting(), DisplayableClass::getRootNode(), UI::ViewImpl::getShading(), UI::ViewImpl::getSolid(), UI::ViewImpl::getTransparence(), UI::ViewImpl::getWriteImages(), Help(), HyperFog(), insertAction(), Loki::SingletonHolder< T, CreationPolicy >::Instance(), Light(), RandomAnimation(), RenderToImages(), setBackground(), setColorManager(), UI::ViewImpl::setSolid(), Shade(), Transparent(), and Wireframe().

Here is the call graph for this function:


Member Function Documentation

void C4DView::Menu4D::about ( ) [slot]

"Help/About" menu item selected

Open an "About"-Dialog telling a few basics about the software

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::aboutQt ( ) [slot]

"Help/About Qt" menu item selected

Open an "About Qt"-Dialog

void C4DView::Menu4D::addToMenuBar ( QMenuBar *  menuBar)

Add the menu to a QMenuBar.

Parameters:
menuBarThe menu bar you want augmented with the menu

References Loki::SingletonHolder< T, CreationPolicy >::Instance().

Referenced by C4DView::C4DView().

Here is the call graph for this function:

Here is the caller graph for this function:

void C4DView::Menu4D::AnimationSettings ( ) [slot]

"Animation/Animation Settings" menu item selected

Show a dialog to adjust _animation settings - where to write image files and how many files to write.

References UI::Dialogs::AnimationDialogImpl::getDir(), UI::Dialogs::AnimationDialogImpl::getFrames(), UI::Dialogs::AnimationDialogImpl::getPrefix(), and Loki::SingletonHolder< T, CreationPolicy >::Instance().

Referenced by Menu4D().

Here is the call graph for this function:

Here is the caller graph for this function:

void C4DView::Menu4D::Benchmark ( ) [slot]

"Animation/Benchmark" menu item selected

Run a benchmark test

References endl(), and ends().

Referenced by Menu4D().

Here is the call graph for this function:

Here is the caller graph for this function:

void C4DView::Menu4D::Colors ( ) [slot]

"Appearance/Colors" menu item selected

Toggle colors

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::Coordinates ( ) [slot]

"Appearance/Coordinate Cross" menu item selected

Switch coordinate cross on or off

Change menu items accordingly

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::customComplexFunction ( ) [slot]

"Object/Surfaces/f:C -> C/Custom complex function" menu item selected

Display a CustomComplexFunction object

References C4DView::CustomFunctionSlot< function >::createCustomSurface().

Here is the call graph for this function:

void C4DView::Menu4D::customFunction ( ) [slot]

"Object/f:R^3 -> R/Custom function" menu item selected

Display a CustomFunction object

References C4DView::CustomFunctionSlot< function >::createCustomFunction().

Here is the call graph for this function:

void C4DView::Menu4D::customPolarFunction ( ) [slot]

"Object/f:R^3 -> R/Custom polar function" menu item selected

Display a CustomPolarFunction object

References C4DView::CustomFunctionSlot< function >::createCustomFunction().

Here is the call graph for this function:

void C4DView::Menu4D::customSurface ( ) [slot]

"Object/Surfaces/Custom surface" menu item selected

Display a CustomSurface object

References C4DView::CustomFunctionSlot< function >::createCustomSurface().

Here is the call graph for this function:

void C4DView::Menu4D::Fog ( ) [slot]

"Appearance/Depth Cue" menu item selected

Toggle fog/depth cue

Referenced by Menu4D().

Here is the caller graph for this function:

QAction *& C4DView::Menu4D::getAction ( const QString &  key)

Search for the QAction associated with a menu item.

Parameters:
keyThe title of the wanted menu item
Returns:
The QAction associated with key

References std::map< _Key, _Tp, _Compare, _Alloc >::begin(), std::map< _Key, _Tp, _Compare, _Alloc >::count(), and std::map< _Key, _Tp, _Compare, _Alloc >::end().

Referenced by Menu4D().

Here is the call graph for this function:

Here is the caller graph for this function:

void C4DView::Menu4D::Help ( ) [slot]

"Help/Online Help" menu item selected

Display _help window

References C4DView::_helpFile.

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::HyperFog ( ) [slot]

"Appearance/4D Depth Cue" menu item selected

Switch 4D depth cue on or off Change menu items accordingly

Referenced by Menu4D().

Here is the caller graph for this function:

QAction * C4DView::Menu4D::insertAction ( QMenu *  _menu,
const QString &  title,
const char *  slot = 0,
bool  checkable = true 
) [private]

insert a menu item with a specified slot into a specified menu

Insert a menu item with a specified slot into a specified menu and into the hash map storing the actions by menu title. This is necessary to find the menus whenever you want to change the item titles.

Parameters:
_menuthe menu you want to add the item to
titlethe title of the item
slotThe function triggered by the item's selection. If it is null, you have to connect the returned action to a slot by yourself.
checkablewhether the menu item is checkable
Returns:
The generated QAction

References C4DView::_menu.

Referenced by createMenu(), and Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::Light ( ) [slot]

"Appearance/Lighting" menu item selected

Switch lighting on or off

Change menu items accordingly

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::RandomAnimation ( ) [slot]

"Animation/Random Animation" menu item selected

Animate the object whith the rotation of the animation changing randomly every couple of seconds

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::RenderToImages ( ) [slot]

"Animation/Render to Images" menu item selected

Switch rendering to files on or off

Change menu items accordingly

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::setBackground ( ) [slot]

"Appearance/Set Background Color" menu item selected

Pop up a color selector and set the background to the chosen color

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::setColorManager ( QAction *  a) [slot]

"Appearance/Coloring Scheme" submenu item selected

Set ColorManager to the selected menu item

check current menu item, uncheck others

References std::vector< _Tp, _Alloc >::begin(), std::vector< _Tp, _Alloc >::end(), and Loki::SingletonHolder< T, CreationPolicy >::Instance().

Referenced by C4DView::C4DView(), and Menu4D().

Here is the call graph for this function:

Here is the caller graph for this function:

void C4DView::Menu4D::Shade ( ) [slot]

"Appearance/Shading" menu item selected

Toggle shading

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::Transparent ( ) [slot]

"Appearance/Transparence" menu item selected

Toggle object transparency

Referenced by Menu4D().

Here is the caller graph for this function:

void C4DView::Menu4D::updateFunctionMenu ( const QString &  item)

Set the selected function as checked and uncheck all the others.

Parameters:
itemTitle of the item whose checking status is toggled
void C4DView::Menu4D::Wireframe ( ) [slot]

"Appearance/Wireframe" menu item selected

Switch between wireframe and solid display

Account for antialiasing only in wireframe mode

Change menu items accordingly

Referenced by Menu4D().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:17 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo