50 #include "RenderPickingPlugin.hh"
58 #if QT_VERSION >= 0x050000
64 void RenderPickingPlugin::initializePlugin()
71 QMenu* menu =
new QMenu(
"Picking Renderer Target");
74 QActionGroup* pickingTargetsGroup =
new QActionGroup(
this );
75 pickingTargetsGroup->setExclusive(
true );
78 QAction * action =
new QAction(
"PICK_ANYTHING" , pickingTargetsGroup );
79 action->setCheckable(
true );
80 action->setChecked(
true);
82 action =
new QAction(
"PICK_VERTEX" , pickingTargetsGroup );
83 action->setCheckable(
true );
85 action->setChecked(
true);
87 action =
new QAction(
"PICK_EDGE" , pickingTargetsGroup );
88 action->setCheckable(
true );
90 action->setChecked(
true);
92 action =
new QAction(
"PICK_SPLINE" , pickingTargetsGroup );
93 action->setCheckable(
true );
95 action->setChecked(
true);
97 action =
new QAction(
"PICK_FACE" , pickingTargetsGroup );
98 action->setCheckable(
true );
100 action->setChecked(
true);
102 action =
new QAction(
"PICK_FRONT_VERTEX" , pickingTargetsGroup );
103 action->setCheckable(
true );
105 action->setChecked(
true);
107 action =
new QAction(
"PICK_FRONT_EDGE" , pickingTargetsGroup );
108 action->setCheckable(
true );
110 action->setChecked(
true);
112 action =
new QAction(
"PICK_CELL" , pickingTargetsGroup );
113 action->setCheckable(
true );
115 action->setChecked(
true);
117 menu->addActions(pickingTargetsGroup->actions());
119 connect(pickingTargetsGroup,SIGNAL(triggered( QAction * )),
this,SLOT(slotPickTargetChanged( QAction * )));
121 return menu->menuAction();
124 void RenderPickingPlugin::slotPickTargetChanged( QAction * _action) {
127 if ( _action->text() ==
"PICK_ANYTHING") {
129 }
else if ( _action->text() ==
"PICK_VERTEX") {
131 }
else if ( _action->text() ==
"PICK_EDGE") {
133 }
else if ( _action->text() ==
"PICK_SPLINE") {
135 }
else if ( _action->text() ==
"PICK_FACE") {
137 }
else if ( _action->text() ==
"PICK_FRONT_VERTEX") {
139 }
else if ( _action->text() ==
"PICK_FRONT_EDGE") {
141 }
else if ( _action->text() ==
"PICK_CELL") {
144 std::cerr <<
"Error : optionHandling unable to find pick mode!!! " << _action->text().toStdString() << std::endl;
150 QString RenderPickingPlugin::rendererName() {
151 return QString(
"Picking renderer");
163 glClear(GL_DEPTH_BUFFER_BIT);
175 QString RenderPickingPlugin::checkOpenGL() {
177 return QString(
"Insufficient OpenGL Version! OpenGL 2.0 or higher required");
183 #if QT_VERSION < 0x050000
Pick spline curve or surface (picks u or u,v coords respectively)
static void enable(GLenum _cap)
replaces glEnable, but supports locking
DrawMode DEFAULT
use the default (global) draw mode and not the node's own.
picks faces (should be implemented for all nodes)
pick any of the prior targets (should be implemented for all nodes)
void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode)
set draw mode (No test if this mode is available!)
bool openGLVersion(const int _major, const int _minor)
void traverse_multipass(BaseNode *_node, Action &_action, const unsigned int &_pass)
ACG::SceneGraph::BaseNode * getSceneGraphRootNode()
get scenegraph root node
QAction * optionsAction()
Return options menu.
picks verices (may not be implemented for all nodes)
picks edges (may not be implemented for all nodes)
picks only visible front verices (may not be implemented for all nodes)
void pick_init(bool _color)
initialize name/color picking stack (like glInitNames())
picks faces (may not be implemented for all nodes)
static void disable(GLenum _cap)
replaces glDisable, but supports locking
picks only visible front edges (may not be implemented for all nodes)