The mouse selection base class In derived classes you must implement the methods initialize() and terminate() For all drawing stuff you just have to reimplement the draw() method. More...
#include <MouseSelection.h>
Public Types | |
enum | { Continue = 0, Restart = 1, Finish = 2, Cancel = 3 } |
Public Member Functions | |
AbstractMouseSelection () | |
const std::vector< SbVec2s > & | getPositions () const |
void | grabMouseModel (Gui::View3DInventorViewer *) |
virtual void | initialize ()=0 |
implement this in derived classes | |
SbBool | isInner () const |
void | redraw () |
void | releaseMouseModel (void) |
virtual void | terminate ()=0 |
implement this in derived classes | |
virtual | ~AbstractMouseSelection (void) |
Mouse events | |
int | handleEvent (const SoEvent *const ev, const SbViewportRegion &vp) |
Protected Member Functions | |
virtual void | draw () |
drawing stuff | |
virtual int | keyboardEvent (const SoKeyboardEvent *const e) |
virtual int | locationEvent (const SoLocation2Event *const e, const QPoint &pos) |
virtual int | mouseButtonEvent (const SoMouseButtonEvent *const e, const QPoint &pos) |
Protected Attributes | |
Gui::View3DInventorViewer * | _pcView3D |
SbBool | m_bInner |
QCursor | m_cPrevCursor |
int | m_iXnew |
int | m_iXold |
int | m_iYnew |
int | m_iYold |
SbBool | mustRedraw |
The mouse selection base class In derived classes you must implement the methods initialize() and terminate() For all drawing stuff you just have to reimplement the draw() method.
In general you need not to do anything else.
Definition at line 53 of file MouseSelection.h.
anonymous enum |
Definition at line 56 of file MouseSelection.h.
AbstractMouseSelection::AbstractMouseSelection | ( | ) |
Definition at line 47 of file MouseSelection.cpp.
References m_bInner, and mustRedraw.
virtual Gui::AbstractMouseSelection::~AbstractMouseSelection | ( | void | ) | [inline, virtual] |
Definition at line 59 of file MouseSelection.h.
virtual void Gui::AbstractMouseSelection::draw | ( | ) | [inline, protected, virtual] |
drawing stuff
Reimplemented in Gui::PolyPickerSelection, and Gui::RectangleSelection.
Definition at line 82 of file MouseSelection.h.
const std::vector<SbVec2s>& Gui::AbstractMouseSelection::getPositions | ( | ) | const [inline] |
Definition at line 66 of file MouseSelection.h.
Referenced by Gui::PolyClipSelection::popupMenu(), Gui::PolyPickerSelection::popupMenu(), and Gui::NavigationStyle::processEvent().
void AbstractMouseSelection::grabMouseModel | ( | Gui::View3DInventorViewer * | viewer | ) |
Definition at line 53 of file MouseSelection.cpp.
References _pcView3D, initialize(), and m_cPrevCursor.
Referenced by Gui::NavigationStyle::startSelection().
int AbstractMouseSelection::handleEvent | ( | const SoEvent *const | ev, | |
const SbViewportRegion & | vp | |||
) |
Definition at line 79 of file MouseSelection.cpp.
References Continue, keyboardEvent(), locationEvent(), mouseButtonEvent(), Restart, RobotExample::w, MovieTool::x, and MovieTool::y.
Referenced by Gui::NavigationStyle::processEvent().
virtual void Gui::AbstractMouseSelection::initialize | ( | ) | [pure virtual] |
implement this in derived classes
Implemented in Gui::PolyPickerSelection, and Gui::RectangleSelection.
Referenced by grabMouseModel().
SbBool Gui::AbstractMouseSelection::isInner | ( | ) | const [inline] |
Definition at line 67 of file MouseSelection.h.
Referenced by Gui::NavigationStyle::processEvent().
virtual int Gui::AbstractMouseSelection::keyboardEvent | ( | const SoKeyboardEvent *const | e | ) | [inline, protected, virtual] |
Reimplemented in Gui::PolyPickerSelection, and Gui::RectangleSelection.
Definition at line 79 of file MouseSelection.h.
Referenced by handleEvent().
virtual int Gui::AbstractMouseSelection::locationEvent | ( | const SoLocation2Event *const | e, | |
const QPoint & | pos | |||
) | [inline, protected, virtual] |
Reimplemented in Gui::PolyPickerSelection, and Gui::RectangleSelection.
Definition at line 78 of file MouseSelection.h.
Referenced by handleEvent().
virtual int Gui::AbstractMouseSelection::mouseButtonEvent | ( | const SoMouseButtonEvent *const | e, | |
const QPoint & | pos | |||
) | [inline, protected, virtual] |
Reimplemented in Gui::PolyPickerSelection, and Gui::RectangleSelection.
Definition at line 77 of file MouseSelection.h.
Referenced by handleEvent().
void AbstractMouseSelection::redraw | ( | ) |
Definition at line 71 of file MouseSelection.cpp.
References mustRedraw.
Referenced by Gui::NavigationStyle::redraw().
void AbstractMouseSelection::releaseMouseModel | ( | void | ) |
Definition at line 62 of file MouseSelection.cpp.
References _pcView3D, m_cPrevCursor, and terminate().
Referenced by Gui::RectangleSelection::mouseButtonEvent(), and Gui::PolyPickerSelection::mouseButtonEvent().
virtual void Gui::AbstractMouseSelection::terminate | ( | ) | [pure virtual] |
implement this in derived classes
Implemented in Gui::PolyPickerSelection, Gui::RectangleSelection, and Gui::BoxZoomSelection.
Referenced by releaseMouseModel().
Definition at line 82 of file MouseSelection.h.
Referenced by Gui::RectangleSelection::draw(), Gui::PolyPickerSelection::draw(), grabMouseModel(), Gui::PolyPickerSelection::initialize(), Gui::PolyPickerSelection::locationEvent(), Gui::PolyPickerSelection::mouseButtonEvent(), releaseMouseModel(), and Gui::BoxZoomSelection::terminate().
SbBool Gui::AbstractMouseSelection::m_bInner [protected] |
Definition at line 89 of file MouseSelection.h.
Referenced by AbstractMouseSelection(), and Gui::PolyClipSelection::popupMenu().
QCursor Gui::AbstractMouseSelection::m_cPrevCursor [protected] |
Definition at line 86 of file MouseSelection.h.
Referenced by grabMouseModel(), Gui::PolyPickerSelection::mouseButtonEvent(), and releaseMouseModel().
int Gui::AbstractMouseSelection::m_iXnew [protected] |
Definition at line 88 of file MouseSelection.h.
Referenced by Gui::RectangleSelection::draw(), Gui::PolyPickerSelection::draw(), Gui::RectangleSelection::locationEvent(), Gui::PolyPickerSelection::locationEvent(), Gui::RectangleSelection::mouseButtonEvent(), Gui::PolyPickerSelection::mouseButtonEvent(), and Gui::BoxZoomSelection::terminate().
int Gui::AbstractMouseSelection::m_iXold [protected] |
Definition at line 87 of file MouseSelection.h.
Referenced by Gui::RectangleSelection::draw(), Gui::PolyPickerSelection::draw(), Gui::RectangleSelection::mouseButtonEvent(), Gui::PolyPickerSelection::mouseButtonEvent(), and Gui::BoxZoomSelection::terminate().
int Gui::AbstractMouseSelection::m_iYnew [protected] |
Definition at line 88 of file MouseSelection.h.
Referenced by Gui::RectangleSelection::draw(), Gui::PolyPickerSelection::draw(), Gui::RectangleSelection::locationEvent(), Gui::PolyPickerSelection::locationEvent(), Gui::RectangleSelection::mouseButtonEvent(), Gui::PolyPickerSelection::mouseButtonEvent(), and Gui::BoxZoomSelection::terminate().
int Gui::AbstractMouseSelection::m_iYold [protected] |
Definition at line 87 of file MouseSelection.h.
Referenced by Gui::RectangleSelection::draw(), Gui::PolyPickerSelection::draw(), Gui::RectangleSelection::mouseButtonEvent(), Gui::PolyPickerSelection::mouseButtonEvent(), and Gui::BoxZoomSelection::terminate().
SbBool Gui::AbstractMouseSelection::mustRedraw [protected] |
Definition at line 90 of file MouseSelection.h.
Referenced by AbstractMouseSelection(), Gui::PolyPickerSelection::draw(), and redraw().