Commit 1175e3e1 authored by Jan Möbius's avatar Jan Möbius

Dennis: Use-the-object-marker-interface-to-dimm-objects-during move

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6641 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d97976fc
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2009 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
// $Revision: $
// $Author: $
// $Date: $
//
//=============================================================================
#include <OpenFlipper/common/Types.hh>
#include <OpenFlipper/common/BaseObjectData.hh>
#include "MoveObjectMarker.hh"
//******************************************************************************
const ACG::Vec4f base_color (0.4,0.4,0.4,1.0);
//******************************************************************************
bool MoveObjectMarker::stencilRefForObject(BaseObjectData * _obj, GLuint & _reference)
{
_reference = 1;
return true;
}
bool MoveObjectMarker::blendForStencilRefNumber(GLuint _reference, GLenum & _src, GLenum & _dst, ACG::Vec4f & _color)
{
if (_reference != 1)
return false;
_src = GL_ZERO;
_dst = GL_SRC_COLOR;
_color = base_color;
return true;
}
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2009 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
// $Revision: $
// $Author: $
// $Date: $
//
//=============================================================================
#ifndef MOVEOBJECTMARKER_HH
#define MOVEOBJECTMARKER_HH
#include <OpenFlipper/BasePlugin/ViewObjectMarker.hh>
/** Object marker to dim all Objects during Maipulator transformation
*/
class MoveObjectMarker : public ViewObjectMarker
{
public:
bool stencilRefForObject (BaseObjectData *_obj, GLuint &_reference);
bool blendForStencilRefNumber (GLuint _reference, GLenum &_src, GLenum &_dst, ACG::Vec4f &_color);
};
#endif
......@@ -399,16 +399,19 @@ void MovePlugin::setManipMode (QtTranslationManipulatorNode::ManipulatorMode _mo
resizeAction_->setChecked (true);
ratateManipAction_->setChecked (false);
ratateTranslateAction_->setChecked (false);
PluginFunctions::setViewObjectMarker (PluginFunctions::defaultViewObjectMarker ());
break;
case QtTranslationManipulatorNode::LocalRotation:
resizeAction_->setChecked (false);
ratateManipAction_->setChecked (true);
ratateTranslateAction_->setChecked (false);
PluginFunctions::setViewObjectMarker (&objectMarker_);
break;
case QtTranslationManipulatorNode::TranslationRotation:
resizeAction_->setChecked (false);
ratateManipAction_->setChecked (false);
ratateTranslateAction_->setChecked (true);
PluginFunctions::setViewObjectMarker (PluginFunctions::defaultViewObjectMarker ());
break;
}
}
......
......@@ -51,6 +51,7 @@
#include "MoveToolbar.hh"
#include "MoveProps.hh"
#include "MoveObjectMarker.hh"
enum SelectionType {VERTEX, EDGE, FACE };
......@@ -302,6 +303,9 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
/// Move selection on an object with given id
void moveSelection(ACG::Matrix4x4d mat, int _id);
/// Object marker to dimm Objects during manipulator transformation
MoveObjectMarker objectMarker_;
private:
/// Holds the current manipulator mode
......
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