#include "Plot2d_ViewModel.h"
#include "Plot2d_ViewWindow.h"
+#include "SUIT_PreferenceMgr.h"
+#include "SUIT_ResourceMgr.h"
+
/*!
Constructor
*/
if( newWnd && clonedWnd )
emit cloneView( clonedWnd->getViewFrame(), newWnd->getViewFrame() );
}
+
+/*!
+ Fills preference manager for viewer
+*/
+int Plot2d_ViewManager::fillPreferences( SUIT_PreferenceMgr* thePrefMgr, const int theId )
+{
+ int aGrpId = thePrefMgr->addItem( tr( "PREF_GROUP_PLOT2DVIEWER" ), theId,
+ SUIT_PreferenceMgr::GroupBox );
+
+ thePrefMgr->addItem( tr( "PREF_SHOW_LEGEND" ), aGrpId,
+ SUIT_PreferenceMgr::Bool, "Plot2d", "ShowLegend" );
+
+ int legendPosition = thePrefMgr->addItem( tr( "PREF_LEGEND_POSITION" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "LegendPos" );
+ QStringList aLegendPosList;
+ aLegendPosList.append( tr("PREF_LEFT") );
+ aLegendPosList.append( tr("PREF_RIGHT") );
+ aLegendPosList.append( tr("PREF_TOP") );
+ aLegendPosList.append( tr("PREF_BOTTOM") );
+
+ QList<QVariant> anIndexesList;
+ anIndexesList.append(0);
+ anIndexesList.append(1);
+ anIndexesList.append(2);
+ anIndexesList.append(3);
+
+ thePrefMgr->setItemProperty( "strings", aLegendPosList, legendPosition );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, legendPosition );
+
+ int curveType = thePrefMgr->addItem( tr( "PREF_CURVE_TYPE" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "CurveType" );
+ QStringList aCurveTypesList;
+ aCurveTypesList.append( tr("PREF_POINTS") );
+ aCurveTypesList.append( tr("PREF_LINES") );
+ aCurveTypesList.append( tr("PREF_SPLINE") );
+
+ anIndexesList.clear();
+ anIndexesList.append(0);
+ anIndexesList.append(1);
+ anIndexesList.append(2);
+
+ thePrefMgr->setItemProperty( "strings", aCurveTypesList, curveType );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, curveType );
+
+ int markerSize = thePrefMgr->addItem( tr( "PREF_MARKER_SIZE" ), aGrpId,
+ SUIT_PreferenceMgr::IntSpin, "Plot2d", "MarkerSize" );
+
+ thePrefMgr->setItemProperty( "min", 0, markerSize );
+ thePrefMgr->setItemProperty( "max", 100, markerSize );
+
+ QStringList aScaleModesList;
+ aScaleModesList.append( tr("PREF_LINEAR") );
+ aScaleModesList.append( tr("PREF_LOGARITHMIC") );
+
+ anIndexesList.clear();
+ anIndexesList.append(0);
+ anIndexesList.append(1);
+
+ int horScale = thePrefMgr->addItem( tr( "PREF_HOR_AXIS_SCALE" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "HorScaleMode" );
+
+ thePrefMgr->setItemProperty( "strings", aScaleModesList, horScale );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, horScale );
+
+ int verScale = thePrefMgr->addItem( tr( "PREF_VERT_AXIS_SCALE" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "VerScaleMode" );
+
+ thePrefMgr->setItemProperty( "strings", aScaleModesList, verScale );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, verScale );
+
+ thePrefMgr->addItem( tr( "PREF_VIEWER_BACKGROUND" ), aGrpId,
+ SUIT_PreferenceMgr::Color, "Plot2d", "Background" );
+
+ return aGrpId;
+}
#include "SUIT_ViewManager.h"
class SUIT_Desktop;
+class SUIT_PreferenceMgr;
class Plot2d_Viewer;
class Plot2d_ViewFrame;
Plot2d_Viewer* getPlot2dModel() const;
+ static int fillPreferences( SUIT_PreferenceMgr*, const int );
+
protected:
bool insertView(SUIT_ViewWindow* theView);
msgid "Plot2d_ViewManager::PLOT2D_VIEW_TITLE"
msgstr "Plot2d scene:%M - viewer:%V"
+
+msgid "Plot2d_ViewManager::PREF_GROUP_PLOT2DVIEWER"
+msgstr "Plot2d Viewer"
+
+msgid "Plot2d_ViewManager::PREF_SHOW_LEGEND"
+msgstr "Show legend"
+
+msgid "Plot2d_ViewManager::PREF_LEGEND_POSITION"
+msgstr "Legend position:"
+
+msgid "Plot2d_ViewManager::PREF_LEFT"
+msgstr "Left"
+
+msgid "Plot2d_ViewManager::PREF_RIGHT"
+msgstr "Right"
+
+msgid "Plot2d_ViewManager::PREF_TOP"
+msgstr "Top"
+
+msgid "Plot2d_ViewManager::PREF_BOTTOM<"
+msgstr "Bottom"
+
+msgid "Plot2d_ViewManager::PREF_CURVE_TYPE"
+msgstr "Curve type:"
+
+msgid "Plot2d_ViewManager::PREF_POINTS"
+msgstr "Points"
+
+msgid "Plot2d_ViewManager::PREF_LINES"
+msgstr "Lines"
+
+msgid "Plot2d_ViewManager::PREF_SPLINE"
+msgstr "Spline"
+
+msgid "Plot2d_ViewManager::PREF_MARKER_SIZE"
+msgstr "Marker size:"
+
+msgid "Plot2d_ViewManager::PREF_LINEAR"
+msgstr "Linear"
+
+msgid "Plot2d_ViewManager::PREF_LOGARITHMIC"
+msgstr "Logarithmic"
+
+msgid "Plot2d_ViewManager::PREF_HOR_AXIS_SCALE"
+msgstr "Horizontal axis scale:"
+
+msgid "Plot2d_ViewManager::PREF_VERT_AXIS_SCALE"
+msgstr "Vertical axis scale:"
+
+msgid "Plot2d_ViewManager::PREF_VIEWER_BACKGROUND"
+msgstr "Background color"
+
<source>PLOT2D_VIEW_TITLE</source>
<translation>Plot2d scene:%M - viewer:%V</translation>
</message>
+ <message>
+ <source>PREF_GROUP_PLOT2DVIEWER</source>
+ <translation>Plot2d Viewer</translation>
+ </message>
+ <message>
+ <source>PREF_SHOW_LEGEND</source>
+ <translation>Show legend</translation>
+ </message>
+ <message>
+ <source>PREF_LEGEND_POSITION</source>
+ <translation>Legend position:</translation>
+ </message>
+ <message>
+ <source>PREF_LEFT</source>
+ <translation>Left</translation>
+ </message>
+ <message>
+ <source>PREF_RIGHT</source>
+ <translation>Right</translation>
+ </message>
+ <message>
+ <source>PREF_TOP</source>
+ <translation>Top</translation>
+ </message>
+ <message>
+ <source>PREF_BOTTOM</source>
+ <translation>Bottom</translation>
+ </message>
+ <message>
+ <source>PREF_CURVE_TYPE</source>
+ <translation>Curve type:</translation>
+ </message>
+ <message>
+ <source>PREF_POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>PREF_LINES</source>
+ <translation>Lines</translation>
+ </message>
+ <message>
+ <source>PREF_SPLINE</source>
+ <translation>Spline</translation>
+ </message>
+ <message>
+ <source>PREF_MARKER_SIZE</source>
+ <translation>Marker size:</translation>
+ </message>
+ <message>
+ <source>PREF_LINEAR</source>
+ <translation>Linear</translation>
+ </message>
+ <message>
+ <source>PREF_LOGARITHMIC</source>
+ <translation>Logarithmic</translation>
+ </message>
+ <message>
+ <source>PREF_HOR_AXIS_SCALE</source>
+ <translation>Horizontal axis scale:</translation>
+ </message>
+ <message>
+ <source>PREF_VERT_AXIS_SCALE</source>
+ <translation>Vertical axis scale:</translation>
+ </message>
+ <message>
+ <source>PREF_VIEWER_BACKGROUND</source>
+ <translation>Background color</translation>
+ </message>
</context>
</TS>
#include <VTKViewer_ViewManager.h>
+#include <SUIT_PreferenceMgr.h>
+#include <SUIT_ResourceMgr.h>
+
/*!
Constructor
*/
{
return myDesktop;
}
+
+/*!
+ Fills preference manager for viewer
+*/
+int SVTK_ViewManager::fillPreferences( SUIT_PreferenceMgr* thePrefMgr, const int theId )
+{
+ int aGrpId = thePrefMgr->addItem( tr( "PREF_GROUP_VTKVIEWER" ), theId,
+ SUIT_PreferenceMgr::GroupBox );
+
+ int vtkTS = thePrefMgr->addItem( tr( "PREF_TRIHEDRON_SIZE" ), aGrpId,
+ SUIT_PreferenceMgr::DblSpin, "VTKViewer", "trihedron_size" );
+ thePrefMgr->addItem( tr( "PREF_RELATIVE_SIZE" ), aGrpId, SUIT_PreferenceMgr::Bool,
+ "VTKViewer", "relative_size" );
+ thePrefMgr->addItem( tr( "PREF_VIEWER_BACKGROUND" ), aGrpId,
+ SUIT_PreferenceMgr::Color, "VTKViewer", "background" );
+
+ thePrefMgr->setItemProperty( "min", 1.0E-06, vtkTS );
+ thePrefMgr->setItemProperty( "max", 150, vtkTS );
+
+ return aGrpId;
+}
+
+/**
+ * Fills values from resources
+ */
+void SVTK_ViewManager::fillFrom( SUIT_ResourceMgr* theMgr )
+{
+ SVTK_Viewer* aModel = dynamic_cast<SVTK_Viewer*>( getViewModel() );
+ if ( !aModel )
+ return;
+
+ aModel->setBackgroundColor( theMgr->colorValue( "VTKViewer", "background",
+ aModel->backgroundColor() ) );
+ aModel->setTrihedronSize(
+ theMgr->doubleValue( "VTKViewer", "trihedron_size", aModel->trihedronSize() ),
+ theMgr->booleanValue( "VTKViewer", "relative_size", aModel->trihedronRelative() ) );
+}
#include "SVTK.h"
class SUIT_Desktop;
+class SUIT_PreferenceMgr;
+class SUIT_ResourceMgr;
//! Extend SUIT_ViewManager to deal with SVTK_Viewer
class SVTK_EXPORT SVTK_ViewManager : public SUIT_ViewManager
virtual ~SVTK_ViewManager();
SUIT_Desktop* getDesktop();
+
+ static int fillPreferences( SUIT_PreferenceMgr*, const int );
+ void fillFrom( SUIT_ResourceMgr* );
};
#endif
msgid "SVTK_ViewManager::VTK_VIEW_TITLE"
msgstr "VTK scene:%1 - viewer:%2"
+msgid "SVTK_ViewManager::PREF_TRIHEDRON_SIZE"
+msgstr "Trihedron size"
+
+msgid "SVTK_ViewManager::PREF_VIEWER_BACKGROUND"
+msgstr "Background color"
+
+msgid "SVTK_ViewManager::PREF_RELATIVE_SIZE"
+msgstr "Relative size"
+
msgid "MNU_SHOW_TRIHEDRON"
msgstr "Show/Hide trihedron"
<source>VTK_VIEW_TITLE</source>
<translation>VTK scene:%1 - viewer:%2</translation>
</message>
+ <message>
+ <source>PREF_GROUP_VTKVIEWER</source>
+ <translation>VTK Viewer 3d</translation>
+ </message>
+ <message>
+ <source>PREF_TRIHEDRON_SIZE</source>
+ <translation>Trihedron size</translation>
+ </message>
+ <message>
+ <source>PREF_VIEWER_BACKGROUND</source>
+ <translation>Background color</translation>
+ </message>
+ <message>
+ <source>PREF_RELATIVE_SIZE</source>
+ <translation>Relative size</translation>
+ </message>
</context>
<context>
<name>SVTK_Viewer</name>
#include <SUIT_Study.h>
#include <SUIT_Desktop.h>
+#include <SUIT_PreferenceMgr.h>
+#include <SUIT_ResourceMgr.h>
/*!
Constructor
emit cloneView( clonedWnd->getViewFrame(), newWnd->getViewFrame() );
}
*/
+
+/*!
+ Fills preference manager for viewer
+*/
+int TableViewer_ViewManager::fillPreferences( SUIT_PreferenceMgr* thePrefMgr, const int theId )
+{
+ int aGrpId = thePrefMgr->addItem( tr( "PREF_GROUP_TABLEVIEWER" ), theId,
+ SUIT_PreferenceMgr::GroupBox );
+ return aGrpId;
+}
+
+/**
+ * Fills values from resources
+ */
+void TableViewer_ViewManager::fillFrom( SUIT_ResourceMgr* theMgr )
+{
+
+}
class SUIT_Study;
class SUIT_Desktop;
+class SUIT_PreferenceMgr;
+class SUIT_ResourceMgr;
class TableViewer_Viewer;
class TableViewer_ViewFrame;
TableViewer_Viewer* getTableModel() const;
+ static int fillPreferences( SUIT_PreferenceMgr*, const int );
+ void fillFrom( SUIT_ResourceMgr* );
+
+
//protected:
// bool insertView(SUIT_ViewWindow* theView);
<!DOCTYPE TS><TS>
<context>
<name>@default</name>
- <message>
- <source>TABLE_VIEWER_VIEW_TITLE</source>
- <translation>TableViewer scene:%M - viewer %V</translation>
- </message>
<message>
<source>LBL_TOOLBAR_LABEL</source>
<translation>View operations</translation>
<translation>Export table to file</translation>
</message>
</context>
+<context>
+ <name>TableViewer_ViewManager</name>
+ <message>
+ <source>TABLE_VIEWER_VIEW_TITLE</source>
+ <translation>TableViewer scene:%M - viewer %V</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_TABLEVIEWER</source>
+ <translation>Table Viewer</translation>
+ </message>
+</context>
</TS>
#include "VTKViewer_ViewManager.h"
#include "VTKViewer_ViewModel.h"
+#include <SUIT_PreferenceMgr.h>
+#include <SUIT_ResourceMgr.h>
+
/*!Constructor.Initialize SIUT_ViewManager by \a study and \a theDesktop.
* Create new instance of VTKViewer_Viewer and set view model by it.
*/
{
/*!Do nothing.*/
}
+
+/*!
+ Fills preference manager for viewer
+*/
+int VTKViewer_ViewManager::fillPreferences( SUIT_PreferenceMgr* thePrefMgr, const int theId )
+{
+ int aGrpId = thePrefMgr->addItem( tr( "PREF_GROUP_VTKVIEWER" ), theId,
+ SUIT_PreferenceMgr::GroupBox );
+
+ int vtkTS = thePrefMgr->addItem( tr( "PREF_TRIHEDRON_SIZE" ), aGrpId,
+ SUIT_PreferenceMgr::DblSpin, "VTKViewer", "trihedron_size" );
+ thePrefMgr->addItem( tr( "PREF_RELATIVE_SIZE" ), aGrpId, SUIT_PreferenceMgr::Bool,
+ "VTKViewer", "relative_size" );
+ thePrefMgr->addItem( tr( "PREF_VIEWER_BACKGROUND" ), aGrpId,
+ SUIT_PreferenceMgr::Color, "VTKViewer", "background" );
+
+ thePrefMgr->setItemProperty( "min", 1.0E-06, vtkTS );
+ thePrefMgr->setItemProperty( "max", 150, vtkTS );
+
+ return aGrpId;
+}
+
+/**
+ * Fills values from resources
+ */
+void VTKViewer_ViewManager::fillFrom( SUIT_ResourceMgr* theMgr )
+{
+ VTKViewer_Viewer* aModel = dynamic_cast<VTKViewer_Viewer*>( getViewModel() );
+ if ( !aModel )
+ return;
+
+ aModel->setBackgroundColor( theMgr->colorValue( "VTKViewer", "background",
+ aModel->backgroundColor() ) );
+}
#include <SUIT_ViewManager.h>
class SUIT_Desktop;
+class SUIT_PreferenceMgr;
+class SUIT_ResourceMgr;
/*!View manager.*/
class VTKVIEWER_EXPORT VTKViewer_ViewManager : public SUIT_ViewManager
public:
VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* );
virtual ~VTKViewer_ViewManager();
+
+ static int fillPreferences( SUIT_PreferenceMgr*, const int );
+ void fillFrom( SUIT_ResourceMgr* );
};
#endif
msgid "VTKViewer_ViewManager::VTK_VIEW_TITLE"
msgstr "VTK scene:%M - viewer:%V"
+msgid "VTKViewer_ViewManager::PREF_GROUP_VTKVIEWER"
+msgstr "VTK Viewer 3d"
+
+msgid "VTKViewer_ViewManager::PREF_TRIHEDRON_SIZE"
+msgstr "Trihedron size"
+
+msgid "VTKViewer_ViewManager::PREF_VIEWER_BACKGROUND"
+msgstr "Background color"
+
+msgid "VTKViewer_ViewManager::PREF_RELATIVE_SIZE"
+msgstr "Relative size"
+
msgid "MNU_SHOW_TRIHEDRON"
msgstr "Show/Hide trihedron"
<source>VTK_VIEW_TITLE</source>
<translation>VTK scene:%M - viewer:%V</translation>
</message>
+ <message>
+ <source>PREF_GROUP_VTKVIEWER</source>
+ <translation>VTK Viewer 3d</translation>
+ </message>
+ <message>
+ <source>PREF_TRIHEDRON_SIZE</source>
+ <translation>Trihedron size</translation>
+ </message>
+ <message>
+ <source>PREF_VIEWER_BACKGROUND</source>
+ <translation>Background color</translation>
+ </message>
+ <message>
+ <source>PREF_RELATIVE_SIZE</source>
+ <translation>Relative size</translation>
+ </message>
</context>
<context>
<name>VTKViewer_Viewer</name>