PieDock 1.4.3
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

PieDock::PieMenu Class Reference

#include <PieMenu.h>

Inheritance diagram for PieDock::PieMenu:
Inheritance graph
[legend]
Collaboration diagram for PieDock::PieMenu:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PieMenu (Application *, Surface &)
const bool cursorInCenter () const
const int & getRadius () const
BlendergetBlender ()
virtual bool update (std::string="")
virtual bool isObsolete (int, int)
virtual void draw (int, int)
virtual void turn (double)
virtual void turn (int)
virtual void setTwistForSelection ()

Protected Member Functions

virtual double getAngleDifference (double a, double b)
virtual double getValidAngle (double a)

Protected Attributes

Blender blender
int size
int maxRadius
int radius
double twist
int centerX
int centerY
int lastX
int lastY
double * turnStack
double * turnBy

Static Protected Attributes

static const double radiansPerCircle = M_PI+M_PI
static const double turnSteps []

Detailed Description

Realize a pie menu

Author:
Markus Fisch <mf@markusfisch.de>

Constructor & Destructor Documentation

PieMenu::PieMenu ( Application a,
Surface s 
)

Initialize menu

Parameters:
a- application
s- surface to draw menu into

Member Function Documentation

void PieMenu::draw ( int  x,
int  y 
) [virtual]

Draw menu

Parameters:
x- x coordinate of cursor position within target surface
y- y coordinate of cursor position within target surface

Reimplemented from PieDock::Menu.

References PieDock::Blender::blend(), getAngleDifference(), and getValidAngle().

Referenced by PieDock::PieMenuWindow::draw().

virtual double PieDock::PieMenu::getAngleDifference ( double  a,
double  b 
) [inline, protected, virtual]

Return the difference of two angles in radians; implemented here to ensure the method will be compiled inline

Parameters:
a- angle in radians
b- angle in radians

Referenced by draw().

virtual double PieDock::PieMenu::getValidAngle ( double  a) [inline, protected, virtual]

Recalculate angle to be within a valid range; implemented here to ensure the method will be compiled inline

Parameters:
a- angle in radians

Referenced by draw().

bool PieMenu::isObsolete ( int  x,
int  y 
) [virtual]

Returns true if menu needs to be redrawn

Parameters:
x- x coordinate of cursor position within target surface
y- y coordinate of cursor position within target surface

Referenced by PieDock::PieMenuWindow::draw().

void PieMenu::setTwistForSelection ( ) [virtual]

Set twist to have the last selected item selected again

Referenced by PieDock::PieMenuWindow::appear().

void PieMenu::turn ( int  c) [virtual]

Turn menu by the given number of cells

Parameters:
c- cells to turn
void PieMenu::turn ( double  r) [virtual]

Turn menu

Parameters:
r- radians to turn

Referenced by PieDock::PieMenuWindow::performAction().

bool PieMenu::update ( std::string  n = "") [virtual]

Reset and update menu

Parameters:
n- menu name (optional)

Reimplemented from PieDock::Menu.

Referenced by PieDock::PieMenuWindow::appear().


Member Data Documentation

const double PieMenu::turnSteps [static, protected]
Initial value:
 {
    .1,
    .3,
    .4,
    .5,
    .7,
    .9,
    .7,
    .5,
    .3,
    .1,
    .0 }

The documentation for this class was generated from the following files: