Commit afa3f805 authored by Dirk Wilden's avatar Dirk Wilden

added stuff to show a grid in all viewers

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6795 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 206f80cd
......@@ -132,6 +132,8 @@ Core() :
coordsysMaterialNode_ = new ACG::SceneGraph::MaterialNode(root_node_scenegraph_,"Coordsys Material Node");
coordsysNode_ = new ACG::SceneGraph::CoordsysNode(coordsysMaterialNode_,"Core Coordsys Node");
coordsysNode_->setTraverseMode (BaseNode::NodeFirst | BaseNode::SecondPass);
gridNode_ = new ACG::SceneGraph::GridNode(root_node_scenegraph_,"Grid Node");
gridNode_->hide();
// Add ViewMode All
ViewMode* vm = new ViewMode();
......
......@@ -103,6 +103,7 @@
#include <OpenFlipper/Core/PluginInfo.hh>
#include <ACG/Scenegraph/CoordsysNode.hh>
#include <ACG/Scenegraph/GridNode.hh>
//== CLASS DEFINITION =========================================================
......@@ -579,6 +580,9 @@ private:
/// Node for the coordinate system
ACG::SceneGraph::CoordsysNode* coordsysNode_;
/// Node for the grid
ACG::SceneGraph::GridNode* gridNode_;
/** @} */
//===========================================================================
......
......@@ -253,6 +253,13 @@ void Core::readApplicationOptions(INIFile& _ini) {
if ( _ini.get_entry( translation, "Options" , "Translation") )
OpenFlipper::Options::translation(translation);
//============================================================================
// Load the setting for the gridVisibility
//============================================================================
bool visible = false;
if ( _ini.get_entry( visible, "Options" , "GridVisible") )
OpenFlipper::Options::gridVisible(visible);
//============================================================================
// Load the setting for the viewer layout
//============================================================================
......@@ -570,6 +577,7 @@ void Core::writeApplicationOptions(INIFile& _ini) {
_ini.add_entry("Options","DefaultViewerLayout", OpenFlipper::Options::defaultViewerLayout() );
_ini.add_entry("Options","Translation", OpenFlipper::Options::translation() );
_ini.add_entry("Options","GridVisible", OpenFlipper::Options::gridVisible() );
_ini.add_entry("Options","MultiView", OpenFlipper::Options::multiView() );
_ini.add_entry("Options","ViewerCount", OpenFlipper::Options::examinerWidgets() );
......
......@@ -119,6 +119,11 @@ void Core::applyOptions(){
if ( OpenFlipper::Options::multiView() )
coreWidget_->setViewerLayout( OpenFlipper::Options::defaultViewerLayout() );
if ( OpenFlipper::Options::gridVisible() )
gridNode_->show();
else
gridNode_->hide();
//set defaultBackgroundColor
QColor c = OpenFlipper::Options::defaultBackgroundColor() ;
......
......@@ -172,6 +172,9 @@ static int redrawDisabled_ = 0;
/// Set if a drawMode Menu should always be in the context menu
static bool drawModesInContextMenu_ = true;
/// Set if a grid should be drawn in every viewer
static bool gridVisible_ = false;
/// Store the toolbox gui Mode mode
static bool hideToolbox_ = false;
......@@ -729,6 +732,13 @@ void drawModesInContextMenu(bool _show) {
drawModesInContextMenu_ = _show;
}
bool gridVisible() {
return gridVisible_;
}
void gridVisible(bool _visible) {
gridVisible_ = _visible;
}
void multiView( bool _multiView) {
multiView_ = _multiView;
......
......@@ -583,6 +583,14 @@ bool dataDir(QString _dir);
DLLEXPORT
void drawModesInContextMenu(bool _show);
/// Get the flag if a grid should be drawn in every viewer
DLLEXPORT
bool gridVisible();
/// Set the flag if a grid should be drawn in every viewer
DLLEXPORT
void gridVisible(bool _visible);
/** @} */
//===========================================================================
......
......@@ -295,6 +295,8 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
viewerLayout->setCurrentIndex( OpenFlipper::Options::defaultViewerLayout() );
gridVisible->setChecked (OpenFlipper::Options::gridVisible());
if (OpenFlipper::Options::translation() == "en_US")
translation->setCurrentIndex(0);
else if (OpenFlipper::Options::translation() == "de_DE")
......@@ -544,6 +546,7 @@ void OptionsWidget::slotApply() {
}
OpenFlipper::Options::defaultViewerLayout( viewerLayout->currentIndex() );
OpenFlipper::Options::gridVisible( gridVisible->isChecked() );
switch ( translation->currentIndex() ){
case 0 : OpenFlipper::Options::translation("en_US"); break;
......
......@@ -23,7 +23,7 @@
<string/>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
......@@ -385,6 +385,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="gridVisible">
<property name="toolTip">
<string>show a grid in the back of every viewer</string>
</property>
<property name="text">
<string>Show grid</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
......
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