Commit f7beaf03 authored by Jan Möbius's avatar Jan Möbius

Fixed wrong rendering of selection


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15751 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ee1c7c09
......@@ -108,7 +108,7 @@ enter(GLState& _state , const DrawModes::DrawMode& _drawMode)
void
LineNode::
draw(GLState& /* _state */ , const DrawModes::DrawMode& _drawMode)
draw(GLState& _state , const DrawModes::DrawMode& _drawMode)
{
if (_drawMode & DrawModes::WIREFRAME)
{
......@@ -223,6 +223,7 @@ draw(GLState& /* _state */ , const DrawModes::DrawMode& _drawMode)
}
else
{
_state.set_color(_state.base_color());
glBegin(GL_LINE_STRIP);
ConstPointIter p_it=points_.begin(), p_end=points_.end();
for (; p_it!=p_end; ++p_it)
......
......@@ -249,10 +249,12 @@ void SelectionBasePlugin::pluginsInitialized() {
nodeName = std::string( tr("Selection Base Plugin: Lasso Selection Line").toUtf8() );
line_node_ = new ACG::SceneGraph::LineNode (ACG::SceneGraph::LineNode::PolygonMode, 0, nodeName );
PluginFunctions::addGlobalNode(line_node_);
PluginFunctions::addGlobalNode(line_node_);
line_node_->set_line_width (2.0);
line_node_->alwaysOnTop() = true;
line_node_->setTraverseMode (BaseNode::NodeFirst | BaseNode::SecondPass);
line_node_->set_color(ACG::Vec4f(1.0,0.0,0.0,1.0));
line_node_->set_base_color(ACG::Vec4f(1.0,0.0,0.0,1.0));
line_node_->hide();
}
......@@ -1245,10 +1247,13 @@ void SelectionBasePlugin::slotMouseLassoSelection(QMouseEvent* _event) {
if(!lassoSelection_) return;
if (deselection_)
line_node_->set_color(ACG::Vec4f(1.0, 0.0, 0.0, 1.0));
else
line_node_->set_color(ACG::Vec4f(0.0, 1.0, 0.0, 1.0));
if (deselection_) {
line_node_->set_color(ACG::Vec4f(1.0,0.0,0.0,1.0));
line_node_->set_base_color(ACG::Vec4f(1.0,0.0,0.0,1.0));
} else {
line_node_->set_color(ACG::Vec4f(0.0, 1.0, 0.0, 1.0));
line_node_->set_base_color(ACG::Vec4f(0.0, 1.0, 0.0, 1.0));
}
line_node_->clear();
for (std::vector< ACG::Vec3d >::iterator it = linePoints_.begin(); it != linePoints_.end(); ++it)
......@@ -1310,10 +1315,13 @@ void SelectionBasePlugin::slotMouseVolumeLassoSelection(QMouseEvent* _event) {
if(!lassoSelection_) return;
if (deselection_)
line_node_->set_color(ACG::Vec4f(1.0, 0.0, 0.0, 1.0));
else
line_node_->set_color(ACG::Vec4f(0.0, 1.0, 0.0, 1.0));
if (deselection_) {
line_node_->set_color(ACG::Vec4f(1.0,0.0,0.0,1.0));
line_node_->set_base_color(ACG::Vec4f(1.0,0.0,0.0,1.0));
} else {
line_node_->set_color(ACG::Vec4f(0.0, 1.0, 0.0, 1.0));
line_node_->set_base_color(ACG::Vec4f(0.0, 1.0, 0.0, 1.0));
}
line_node_->clear();
for (std::vector< ACG::Vec3d >::iterator it = linePoints_.begin(); it != linePoints_.end(); ++it)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment