Commit ba551373 authored by Marlin Frickenschmidt's avatar Marlin Frickenschmidt

+Implemented orthogonal projection mode for coordinate system. Switching...

+Implemented orthogonal projection mode for coordinate system. Switching to/from this new projection mode can be done via the right-click context menu of the coordinate system. This will not change how the scene in the current viewer is rendered.
+Changed the "Lock view" behaviour. Selecting any of the six fixed views from the coordinate system's right-click context menu's "Viewing Direction" will now lock the rotation, and "Free view" will unlock it. It is still possible to use "Lock rotation" to lock the currently selected rotation.
+Fixed small error in Stereo Viewer

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10478 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6f97f99b
This diff is collapsed.
......@@ -96,6 +96,7 @@
#include <ACG/QtWidgets/QtSceneGraphWidget.hh>
#include <ACG/Scenegraph/DrawModes.hh>
#include <ACG/Scenegraph/CoordsysNode.hh>
#include <OpenFlipper/INIFile/INIFile.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
......@@ -1003,6 +1004,12 @@ public:
/// Toggle projection mode of the active viewer.
void slotContextSwitchProjection();
/// Toggle coordsys projection mode of the active viewer.
ACG::SceneGraph::CoordsysNode::ProjectionMode getCoordsysProjection();
/// Toggle coordsys projection mode of the active viewer.
void slotContextSwitchCoordsysProjection();
/// Toggle projection mode of all viewers to perspective projection
void slotGlobalPerspectiveProjection();
......
......@@ -53,6 +53,7 @@
#include "CoreWidget.hh"
#include <ACG/Scenegraph/CoordsysNode.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/widgets/snapshotDialog/SnapshotDialog.hh>
......@@ -169,6 +170,37 @@ void CoreWidget::slotContextSwitchProjection() {
examiner_widgets_[PluginFunctions::activeExaminer()]->toggleProjectionMode();
}
/// Toggle coordsys projection mode of the active viewer
ACG::SceneGraph::CoordsysNode::ProjectionMode CoreWidget::getCoordsysProjection() {
// Find coordsys node
ACG::SceneGraph::BaseNode* node = 0;
node = PluginFunctions::getSceneGraphRootNode()->find("Core Coordsys Node");
if (node != 0) {
return dynamic_cast<ACG::SceneGraph::CoordsysNode*> (node)->getProjectionMode();
} else {
emit statusMessage(QString(tr("getCoordsysProjection(): Could not find coordsys node. Assuming default orthographic projection.")));
return ACG::SceneGraph::CoordsysNode::ORTHOGRAPHIC_PROJECTION;
}
}
/// Toggle coordsys projection mode of the active viewer
void CoreWidget::slotContextSwitchCoordsysProjection() {
// Find coordsys node
ACG::SceneGraph::BaseNode* node = 0;
node = PluginFunctions::getSceneGraphRootNode()->find("Core Coordsys Node");
if (node != 0) {
ACG::SceneGraph::CoordsysNode* cnode = dynamic_cast<ACG::SceneGraph::CoordsysNode*> (node);
if (cnode->getProjectionMode() == ACG::SceneGraph::CoordsysNode::PERSPECTIVE_PROJECTION) {
cnode->setProjectionMode(ACG::SceneGraph::CoordsysNode::ORTHOGRAPHIC_PROJECTION);
}
else {
cnode->setProjectionMode(ACG::SceneGraph::CoordsysNode::PERSPECTIVE_PROJECTION);
}
} else {
emit statusMessage(QString(tr("slotContextSwitchCoordsysProjection(): Could not find coordsys node, thus its projection mode will not be toggled.")));
}
}
/// Toggle projection mode of all viewers to perspective projection
void CoreWidget::slotGlobalPerspectiveProjection() {
for ( int i = 0 ; i < PluginFunctions::viewers() ; ++i )
......@@ -724,11 +756,18 @@ if (_visible)
void CoreWidget::slotSetViewingDirection(QAction* _action) {
PluginFunctions::setFixedView( _action->data().toInt() );
if (_action->data().toInt() != PluginFunctions::VIEW_FREE)
PluginFunctions::allowRotation( false, PluginFunctions::activeExaminer() );
// Update view
examiner_widgets_[PluginFunctions::activeExaminer()]->updateGL();
}
void CoreWidget::slotLockRotation(bool _lock) {
PluginFunctions::allowRotation( !_lock, PluginFunctions::activeExaminer() );
if (!_lock)
PluginFunctions::setFixedView( PluginFunctions::VIEW_FREE );
}
void CoreWidget::moveBack() {
......
......@@ -196,8 +196,6 @@ void glViewer::drawScenePhilipsStereo() {
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, vp_l, vp_b, vp_w, vp_h);
pDepthStencilTexture_.disable();
glClearColor(.5, .4, .3, 0);
// Turn on shader program
pProgram_->use();
......@@ -242,7 +240,7 @@ void glViewer::drawScenePhilipsStereo() {
// ======================================================================================================
// Clear buffers
// ======================================================================================================
glClearColor(.5, .4, .3, 0);
glClearColor(.0, .0, .0, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// ======================================================================================================
......
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