src/CONVERTOR/Makefile \
src/PIPELINE/Makefile \
src/OBJECT/Makefile \
- src/VVTK/Makefile \
- src/GUITOOLS/Makefile \
src/VISU_I/Makefile \
src/VISUGUI/Makefile \
src/VISU_SWIG/Makefile \
Visu_isosurfaces.png \
Visu_load_texture.png \
Visu_ok.png \
-Visu_PlaneSegmentation.png \
Visu_plot2d.png \
Visu_plot3d.png \
Visu_point_selection.png \
Visu_points.png \
-Visu_recording_pause.png \
-Visu_recording_play.png \
-Visu_recording_start.png \
Visu_recording_stop.png \
Visu_remove.png \
Visu_sameas.png \
Visu_selectionedge.png \
Visu_selectionpoint.png \
Visu_selectonly.png \
-Visu_SphereSegmentation.png \
Visu_streamlines.png \
Visu_surface.png \
Visu_tree_container.png \
Visu_tree_vectors.png \
Visu_tree_visu.png \
Visu_vectors.png \
-Visu_vvtk_switch.png \
Visu_wireframe.png \
Visu_slider_more.png \
Visu_slider_avi.png \
#
# $Header$
#
-SUBDIRS = CONVERTOR PIPELINE OBJECT GUITOOLS VVTK VISU_I VISUGUI VISU_SWIG ENGINE
+SUBDIRS = CONVERTOR PIPELINE OBJECT VISU_I VISUGUI VISU_SWIG ENGINE
VisuGUI_Slider.h \
VisuGUI_InputPane.h \
VisuGUI_FieldFilter.h \
- VisuGUI_ValuesLabelingDlg.h
+ VisuGUI_ValuesLabelingDlg.h \
+ VisuGUI_PrimitiveBox.h \
+ VisuGUI_SizeBox.h
dist_libVISU_la_SOURCES= \
VisuGUI.cxx \
VisuGUI_ClippingPanel.cxx \
VisuGUI_ClippingPlaneDlg.cxx \
VisuGUI_FilterScalarsDlg.cxx \
- VisuGUI_ValuesLabelingDlg.cxx
+ VisuGUI_ValuesLabelingDlg.cxx \
+ VisuGUI_PrimitiveBox.cxx \
+ VisuGUI_SizeBox.cxx
MOC_FILES= \
VisuGUI_moc.cxx \
VisuGUI_ClippingPanel_moc.cxx \
VisuGUI_ClippingPlaneDlg_moc.cxx \
VisuGUI_FilterScalarsDlg_moc.cxx \
- VisuGUI_ValuesLabelingDlg_moc.cxx
+ VisuGUI_ValuesLabelingDlg_moc.cxx \
+ VisuGUI_PrimitiveBox_moc.cxx \
+ VisuGUI_SizeBox_moc.cxx
nodist_libVISU_la_SOURCES=$(MOC_FILES)
$(BOOST_CPPFLAGS) \
$(GUI_CXXFLAGS) \
$(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \
- -I$(srcdir)/../VVTK -I$(srcdir)/../OBJECT -I$(srcdir)/../VISU_I -I$(srcdir)/../GUITOOLS \
+ -I$(srcdir)/../OBJECT -I$(srcdir)/../VISU_I \
-I$(top_builddir)/idl -I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE
libVISU_la_LDFLAGS= \
$(CAS_LDFLAGS) -lTKV3d \
$(KERNEL_LDFLAGS) -lSalomeNS -lSalomeDSClient \
$(GUI_LDFLAGS) -lSVTK -lSPlot2d -lSalomePrs -lOCCViewer \
- ../VVTK/libVVTK.la ../OBJECT/libVisuObject.la ../VISU_I/libVISUEngineImpl.la \
- ../GUITOOLS/libVISUGUITOOLS.la \
+ ../OBJECT/libVisuObject.la ../VISU_I/libVISUEngineImpl.la \
../../idl/libSalomeIDLVISU.la
if MED_ENABLE_MULTIPR
<source>ICON_VECTORS</source>
<translation>Visu_vectors.png</translation>
</message>
- <message>
- <source>ICON_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Visu_vvtk_switch.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Visu_PlaneSegmentation.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_PAUSE</source>
- <translation>Visu_recording_pause.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_PLAY</source>
- <translation>Visu_recording_play.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_START</source>
- <translation>Visu_recording_start.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_STOP</source>
- <translation>Visu_recording_stop.png</translation>
- </message>
<message>
<source>ICON_SWEEP_STOP</source>
<translation>Visu_recording_stop.png</translation>
</message>
- <message>
- <source>ICON_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Visu_points.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Visu_SphereSegmentation.png</translation>
- </message>
<message>
<source>ICON_WIREFRAME</source>
<translation>Visu_wireframe.png</translation>
<translation>No appropriate objects selected</translation>
</message>
</context>
- <context>
- <name>VVTK_MainWindow</name>
- <message>
- <source>DSC_VVTK_RECORDING_PAUSE</source>
- <translation>Pause recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_START</source>
- <translation>Start recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_STOP</source>
- <translation>Stop recording</translation>
- </message>
- <message>
- <source>LBL_TOOLBAR_RECORD_LABEL</source>
- <translation>Recording Operations</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_PAUSE</source>
- <translation>Pause recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_START</source>
- <translation>Start recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_STOP</source>
- <translation>Stop recording</translation>
- </message>
- <message>
- <source>MSG_NO_AVI_MAKER</source>
- <translation>Tool jpeg2yuv, necessary for AVI recording, is not available.
-Please, refer to the documentation.</translation>
- </message>
- </context>
- <context>
- <name>VVTK_MainWindow1</name>
- <message>
- <source>DSC_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Interaction Style Switch</translation>
- </message>
- <message>
- <source>DSC_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Plane Segmentation</translation>
- </message>
- <message>
- <source>DSC_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Selection Mode Switch</translation>
- </message>
- <message>
- <source>DSC_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Sphere Segmentation</translation>
- </message>
- <message>
- <source>LBL_TOOLBAR_GAUSS_LABEL</source>
- <translation>Gauss Viewer Tools</translation>
- </message>
- <message>
- <source>MNU_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Interaction Style Switch</translation>
- </message>
- <message>
- <source>MNU_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Plane Segmentation</translation>
- </message>
- <message>
- <source>MNU_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Selection Mode Switch</translation>
- </message>
- <message>
- <source>MNU_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Sphere Segmentation</translation>
- </message>
- </context>
- <context>
- <name>VVTK_PickingDlg</name>
- <message>
- <source>BELOW_POINT</source>
- <translation>Centered below the point</translation>
- </message>
- <message>
- <source>CAMERA_TITLE</source>
- <translation>Movement of the camera</translation>
- </message>
- <message>
- <source>CURSOR_SIZE</source>
- <translation>Size of the cursor :</translation>
- </message>
- <message>
- <source>CURSOR_TITLE</source>
- <translation>Cursor</translation>
- </message>
- <message>
- <source>DISPLAY_PARENT_MESH</source>
- <translation>Display parent mesh element</translation>
- </message>
- <message>
- <source>INFO_WINDOW_TITLE</source>
- <translation>Information window</translation>
- </message>
- <message>
- <source>PARENT_MESH_TITLE</source>
- <translation>Parent mesh element</translation>
- </message>
- <message>
- <source>PICKING_DLG_TITLE</source>
- <translation>Picking</translation>
- </message>
- <message>
- <source>POINT_TOLERANCE</source>
- <translation>Point tolerance :</translation>
- </message>
- <message>
- <source>POSITION</source>
- <translation>Position :</translation>
- </message>
- <message>
- <source>PYRAMID_HEIGHT</source>
- <translation>Height of the pyramids :</translation>
- </message>
- <message>
- <source>SELECTION_COLOR</source>
- <translation>Selection cursor color :</translation>
- </message>
- <message>
- <source>STEP_NUMBER</source>
- <translation>Number of steps between two positions :</translation>
- </message>
- <message>
- <source>TOLERANCE_TITLE</source>
- <translation>Tolerance</translation>
- </message>
- <message>
- <source>TOP_LEFT_CORNER</source>
- <translation>Top-left corner of the 3D view</translation>
- </message>
- <message>
- <source>TRANSPARENCY</source>
- <translation>Transparency :</translation>
- </message>
- <message>
- <source>ZOOM_FACTOR</source>
- <translation>Zoom at first selected point (ratio) :</translation>
- </message>
- <message>
- <source>DATA_POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>PARENT_ELEMENT</source>
- <translation>Parent mesh element ID:</translation>
- </message>
- <message>
- <source>LOCAL_POINT</source>
- <translation>Local Gauss Point ID:</translation>
- </message>
- </context>
- <context>
- <name>VVTK_PrimitiveBox</name>
- <message>
- <source>ALPHA_TEXTURE</source>
- <translation>Alpha Channel Texture (16x16) : </translation>
- </message>
- <message>
- <source>ALPHA_THRESHOLD</source>
- <translation>Alpha Channel Threshold : </translation>
- </message>
- <message>
- <source>CLAMP</source>
- <translation>Maximum Size (Clamp) : </translation>
- </message>
- <message>
- <source>FACE_LIMIT</source>
- <translation>Notify when number of faces exceeds : </translation>
- </message>
- <message>
- <source>FACE_NUMBER</source>
- <translation>Number of faces : </translation>
- </message>
- <message>
- <source>GEOMETRICAL_SPHERE</source>
- <translation>Geometrical Sphere</translation>
- </message>
- <message>
- <source>MAIN_TEXTURE</source>
- <translation>Main Texture (16x16) : </translation>
- </message>
- <message>
- <source>OPENGL_POINT</source>
- <translation>OpenGL Point</translation>
- </message>
- <message>
- <source>POINT_SPRITE</source>
- <translation>Point Sprite</translation>
- </message>
- <message>
- <source>PRIMITIVE_TITLE</source>
- <translation>Primitive</translation>
- </message>
- <message>
- <source>RESOLUTION</source>
- <translation>Resolution : </translation>
- </message>
- </context>
- <context>
- <name>VVTK_RecorderDlg</name>
- <message>
- <source>ALL_DISLPAYED_FRAMES</source>
- <translation>Recording all displayed frames</translation>
- </message>
- <message>
- <source>CLOSE</source>
- <translation>Close</translation>
- </message>
- <message>
- <source>DLG_RECORDER_TITLE</source>
- <translation>Recorder</translation>
- </message>
- <message>
- <source>FILE_NAME</source>
- <translation>Save to file : </translation>
- </message>
- <message>
- <source>FLT_ALL_FILES</source>
- <translation>All Files (*.*)</translation>
- </message>
- <message>
- <source>FLT_AVI_FILES</source>
- <translation>AVI Files (*.avi)</translation>
- </message>
- <message>
- <source>FPS</source>
- <translation>FPS : </translation>
- </message>
- <message>
- <source>PROGRESSIVE</source>
- <translation>Progressive</translation>
- </message>
- <message>
- <source>QUALITY</source>
- <translation>Quality : </translation>
- </message>
- <message>
- <source>RECORDING_MODE</source>
- <translation>Mode : </translation>
- </message>
- <message>
- <source>SETTINGS</source>
- <translation>Settings</translation>
- </message>
- <message>
- <source>SKIPPED_FRAMES</source>
- <translation>Recording at a given FPS</translation>
- </message>
- <message>
- <source>START</source>
- <translation>Start</translation>
- </message>
- </context>
- <context>
- <name>VVTK_SegmentationCursorDlg</name>
- <message>
- <source>DEPTH</source>
- <translation>Depth of the cursor: </translation>
- </message>
- <message>
- <source>DEPTH_TITLE</source>
- <translation>Depth</translation>
- </message>
- <message>
- <source>DIRECTION_DX</source>
- <translation>DX: </translation>
- </message>
- <message>
- <source>DIRECTION_DY</source>
- <translation>DY: </translation>
- </message>
- <message>
- <source>DIRECTION_DZ</source>
- <translation>DZ: </translation>
- </message>
- <message>
- <source>DIRECTION_TITLE</source>
- <translation>Direction</translation>
- </message>
- <message>
- <source>GAUSS_POINTS_TAB</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>INCREMENT</source>
- <translation>+/- Ratio : </translation>
- </message>
- <message>
- <source>INSIDE_GAUSS_POINTS</source>
- <translation>Inside Cursor Gauss Points Presentation</translation>
- </message>
- <message>
- <source>MAGNIFICATION</source>
- <translation>Magnification (%) : </translation>
- </message>
- <message>
- <source>MAGNIFICATION_TITLE</source>
- <translation>Magnification</translation>
- </message>
- <message>
- <source>ORIGIN_TITLE</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>ORIGIN_X</source>
- <translation>X: </translation>
- </message>
- <message>
- <source>ORIGIN_Y</source>
- <translation>Y: </translation>
- </message>
- <message>
- <source>ORIGIN_Z</source>
- <translation>Z: </translation>
- </message>
- <message>
- <source>OUTSIDE_GAUSS_POINTS</source>
- <translation>Outside Cursor Gauss Points Presentation</translation>
- </message>
- <message>
- <source>RADIUS</source>
- <translation>Radius of the cursor :</translation>
- </message>
- <message>
- <source>RADIUS_TITLE</source>
- <translation>Radius</translation>
- </message>
- <message>
- <source>RATIO</source>
- <translation>+/- Ratio :</translation>
- </message>
- <message>
- <source>SEGMENTATION_CURSOR_DLG_TITLE</source>
- <translation>Segmentation Cursor</translation>
- </message>
- <message>
- <source>SEGMENTATION_CURSOR_TAB</source>
- <translation>Segmentation Cursor</translation>
- </message>
- </context>
- <context>
- <name>VVTK_SizeBox</name>
- <message>
- <source>COLOR</source>
- <translation>Color : </translation>
- </message>
- <message>
- <source>COLOR_TITLE</source>
- <translation>Color</translation>
- </message>
- <message>
- <source>GEOM_SIZE</source>
- <translation>Size of points (%) : </translation>
- </message>
- <message>
- <source>INCREMENT</source>
- <translation>+/- Ratio : </translation>
- </message>
- <message>
- <source>MAGNIFICATION</source>
- <translation>Magnification (%) : </translation>
- </message>
- <message>
- <source>MAX_SIZE</source>
- <translation>max size (%) : </translation>
- </message>
- <message>
- <source>MIN_SIZE</source>
- <translation>Range values for min size (%) : </translation>
- </message>
- <message>
- <source>OUTSIDE_SIZE</source>
- <translation>Percentage of normal size(%) : </translation>
- </message>
- <message>
- <source>SIZE_TITLE</source>
- <translation>Size</translation>
- </message>
- <message>
- <source>UNIFORM_COLOR</source>
- <translation>Uniform Color</translation>
- </message>
- </context>
- <context>
- <name>VVTK_ViewManager</name>
- <message>
- <source>VTK_VIEW_TITLE</source>
- <translation>Gauss scene:%1 - viewer:%2</translation>
- </message>
- </context>
- <context>
- <name>VVTK_ViewWindow</name>
- <message>
- <source>LBL_TOOLBAR_LABEL</source>
- <translation>GAUSS viewer tools</translation>
- </message>
- </context>
<context>
<name>VisuGUI</name>
<message>
<translation>Time step (second):</translation>
</message>
</context>
- <context>
- <name>VisuGUI_TableDlg</name>
- <message>
- <source>EDIT_TABLE_TLT</source>
- <translation>Edit Table</translation>
- </message>
- <message>
- <source>ERR_TABLE_NOT_AVAILABLE</source>
- <translation>Table is not available</translation>
- </message>
- <message>
- <source>TABLE_OF_INTEGER_TLT</source>
- <translation>Table of integer</translation>
- </message>
- <message>
- <source>TABLE_OF_REAL_TLT</source>
- <translation>Table of real</translation>
- </message>
- <message>
- <source>VIEW_TABLE_TLT</source>
- <translation>View Table</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TableWidget</name>
- <message>
- <source>ADD_COLUMN_BTN</source>
- <translation>Add Column</translation>
- </message>
- <message>
- <source>ADD_ROW_BTN</source>
- <translation>Add Row</translation>
- </message>
- <message>
- <source>ADJUST_CELLS_BTN</source>
- <translation>Adjust Cells</translation>
- </message>
- <message>
- <source>CLEAR_BTN</source>
- <translation>Clear</translation>
- </message>
- <message>
- <source>REMOVE_COLUMN_BTN</source>
- <translation>Remove Column(s)</translation>
- </message>
- <message>
- <source>REMOVE_ROW_BTN</source>
- <translation>Remove Row(s)</translation>
- </message>
- <message>
- <source>SELECT_ALL_BTN</source>
- <translation>Select All</translation>
- </message>
- <message>
- <source>SET_TITLE_TLT</source>
- <translation>Set title</translation>
- </message>
- <message>
- <source>TITLE_LBL</source>
- <translation>Title:</translation>
- </message>
- <message>
- <source>UNITS_TLT</source>
- <translation>Units</translation>
- </message>
- </context>
<context>
<name>VisuGUI_TextPrefDlg</name>
<message>
<translation>Shrink Factor:</translation>
</message>
</context>
+ <context>
+ <name>VISU_TableDlg</name>
+ <message>
+ <source>ERR_TABLE_NOT_AVAILABLE</source>
+ <translation>Table is not available</translation>
+ </message>
+ <message>
+ <source>TABLE_OF_INTEGER_TLT</source>
+ <translation>Table of integer</translation>
+ </message>
+ <message>
+ <source>TABLE_OF_REAL_TLT</source>
+ <translation>Table of real</translation>
+ </message>
+ <message>
+ <source>TABLE_UNKNOWN_TLT</source>
+ <translation>Table of unknown</translation>
+ </message>
+ <message>
+ <source>VIEW_TABLE_TLT</source>
+ <translation>View Table</translation>
+ </message>
+ <message>
+ <source>ALLOW_EDIT_CHECK</source>
+ <translation>Enable editing</translation>
+ </message>
+ <message>
+ <source>DO_UPDATE_CHECK</source>
+ <translation>Immediate update</translation>
+ </message>
+ <message>
+ <source>ADD_COLUMN_BTN</source>
+ <translation>Add Column</translation>
+ </message>
+ <message>
+ <source>ADD_ROW_BTN</source>
+ <translation>Add Row</translation>
+ </message>
+ <message>
+ <source>ADJUST_CELLS_BTN</source>
+ <translation>Adjust Cells</translation>
+ </message>
+ <message>
+ <source>CLEAR_BTN</source>
+ <translation>Clear</translation>
+ </message>
+ <message>
+ <source>REMOVE_COLUMN_BTN</source>
+ <translation>Remove Column(s)</translation>
+ </message>
+ <message>
+ <source>REMOVE_ROW_BTN</source>
+ <translation>Remove Row(s)</translation>
+ </message>
+ <message>
+ <source>SELECT_ALL_BTN</source>
+ <translation>Select All</translation>
+ </message>
+ <message>
+ <source>SET_TITLE_TLT</source>
+ <translation>Set title</translation>
+ </message>
+ <message>
+ <source>TITLE_LBL</source>
+ <translation>Title:</translation>
+ </message>
+ <message>
+ <source>UNITS_TLT</source>
+ <translation>Units</translation>
+ </message>
+ </context>
</TS>
#include "VISU_Vectors_i.hh"
#include "VisuGUI_VectorsDlg.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "VisuGUI_FileInfoDlg.h"
#include "SALOMEconfig.h"
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
- if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
+ if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)) {
aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
-
- if( !IsSObjectTable( aSObject ) )
- return;
-
- VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
- aSObject,
- false,
- //SAL2670 Orientation of show tables
- VisuGUI_TableDlg::ttAuto,
- Qt::Vertical );
- dlg->show();
+ if( IsSObjectTable( aSObject ) ) {
+ VISU_TableDlg* dlg = new VISU_TableDlg( GetDesktop( this ),
+ GetCStudy( GetAppStudy( this ) ),
+ aTable,
+ false,
+ //SAL2670 Orientation of show tables
+ VISU_TableDlg::ttAuto,
+ Qt::Vertical );
+ dlg->show();
+ }
+ }
}
//----------------------------------------------------------------------------
#include "VisuGUI_Tools.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_PipeLine.hxx"
#include "SUIT_Desktop.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
-#include <VisuGUI_GUITools.h>
-
#include <VISU_Gen_i.hh>
#include <LightApp_Application.h>
#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
#include "VISU_Gen_i.hh"
#include "VISU_CutLines_i.hh"
//TO DO
//#include "OB_Browser.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include <QLayout>
#include <QTabWidget>
#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_CutPlanes_i.hh"
//#include "OB_Browser.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "SVTK_ViewWindow.h"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_Gen_i.hh"
#include "VISU_CutSegment_i.hh"
#include "VISU_ColoredPrs3dFactory.hh"
#include "VisuGUI_Tools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
#include "VISU_Result_i.hh"
#include "VISU_DeformedShapeAndScalarMap_i.hh"
#include "VisuGUI.h"
#include "VisuGUI_Prs3dTools.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_DeformedShape_i.hh"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
-#include <VisuGUI_GUITools.h>
-
#include <QCheckBox>
#include <QGroupBox>
#include <QKeyEvent>
#include "VisuGUI_Tools.h"
#include "VisuGUI_InputPane.h"
-
-#include <VisuGUI_GUITools.h>
+#include "VisuGUI_PrimitiveBox.h"
+#include "VisuGUI_SizeBox.h"
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_GaussPoints_i.hh"
#include "VISU_OpenGLPointSpriteMapper.hxx"
#include "VISU_Convertor.hxx"
-#include "VVTK_PrimitiveBox.h"
-#include "VVTK_SizeBox.h"
-
#include "LightApp_Application.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_IntSpinBox.h"
aVBLay->setSpacing(6);
// Primitive
- myPrimitiveBox = new VVTK_PrimitiveBox( aBox );
+ myPrimitiveBox = new VisuGUI_PrimitiveBox( aBox );
aVBLay->addWidget( myPrimitiveBox );
// Size
- mySizeBox = new VVTK_SizeBox( aBox );
+ mySizeBox = new VisuGUI_SizeBox( aBox );
aVBLay->addWidget( mySizeBox );
// Deformed Shape
myPrimitiveBox->setResolution( myPrsCopy->GetResolution() );
myPrimitiveBox->setFaceLimit( myPrsCopy->GetFaceLimit() );
- mySizeBox->setType( isResults || isDeformed ? VVTK_SizeBox::Results : VVTK_SizeBox::Geometry );
+ mySizeBox->setType( isResults || isDeformed ? VisuGUI_SizeBox::Results : VisuGUI_SizeBox::Geometry );
mySizeBox->setGeomSize( myPrsCopy->GetGeomSize() );
mySizeBox->setMinSize( myPrsCopy->GetMinSize() );
mySizeBox->setMaxSize( myPrsCopy->GetMaxSize() );
if( on )//myDefShapeButton->isChecked() )
{
myDefShapeBox->show();
- mySizeBox->setType( VVTK_SizeBox::Results );
+ mySizeBox->setType( VisuGUI_SizeBox::Results );
}
else
myDefShapeBox->hide();
class SalomeApp_Module;
class SalomeApp_IntSpinBox;
-class VVTK_PrimitiveBox;
-class VVTK_SizeBox;
+class VisuGUI_PrimitiveBox;
+class VisuGUI_SizeBox;
class VisuGUI_TextPrefDlg;
class VisuGUI_InputPane;
QRadioButton* myGeometryButton;
QRadioButton* myDefShapeButton;
- VVTK_PrimitiveBox* myPrimitiveBox;
- VVTK_SizeBox* mySizeBox;
+ VisuGUI_PrimitiveBox* myPrimitiveBox;
+ VisuGUI_SizeBox* mySizeBox;
QGroupBox* myDefShapeBox;
SalomeApp_DoubleSpinBox* myScaleSpinBox;
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
-#include <VisuGUI_GUITools.h>
-
// VTK Includes
#include "vtkRenderer.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_ViewManager_i.hh"
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library 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 2.1 of the License.
+//
+// This library 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 this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_PrimitiveBox.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VisuGUI_PrimitiveBox.h"
+#include "VisuGUI_Tools.h"
+
+#include <VISU_OpenGLPointSpriteMapper.hxx>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
+
+#include <QLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QPushButton>
+#include <QFileDialog>
+
+#include <iostream>
+
+using namespace std;
+
+VisuGUI_PrimitiveBox::VisuGUI_PrimitiveBox( QWidget* parent ) :
+ QGroupBox( parent )
+{
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ setTitle( tr( "PRIMITIVE_TITLE" ) );
+ //setColumnLayout(0, Qt::Vertical );
+ //layout()->setSpacing( 0 );
+ //layout()->setMargin( 0 );
+
+ QGridLayout* aLayout = new QGridLayout( this );
+ aLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ aLayout->setSpacing(6);
+ aLayout->setMargin(11);
+
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
+
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
+ myMainTexture = aRootDir + "sprite_texture.bmp";
+ myAlphaTexture = aRootDir + "sprite_alpha.bmp";
+
+ // Primitive Type
+ QGroupBox* aPrimitiveTypeGroup = new QGroupBox( this );
+ aPrimitiveTypeGroup->setMinimumWidth( 450 );
+ QHBoxLayout* aPrimLayout = new QHBoxLayout( aPrimitiveTypeGroup );
+ aPrimLayout->setMargin( 0 );
+
+ //QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, this, "PrimitiveTypeGroup" );
+ //aPrimitiveTypeGroup->setMinimumWidth( 450 );
+ //aPrimitiveTypeGroup->setRadioButtonExclusive( true );
+ //aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
+ //aPrimitiveTypeGroup->layout()->setMargin( 0 );
+
+ myPointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), aPrimitiveTypeGroup );
+ myOpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), aPrimitiveTypeGroup );
+ myGeomSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup );
+
+ aPrimLayout->addWidget( myPointSpriteButton );
+ aPrimLayout->addWidget( myOpenGLPointButton );
+ aPrimLayout->addWidget( myGeomSphereButton );
+
+ aLayout->addWidget( aPrimitiveTypeGroup, 0, 0, 1, 2 );
+
+ // Clamp ( Point Sprite & OpenGL Point )
+ myClampLabel = new QLabel( tr( "CLAMP" ), this );
+ myClampSpinBox = new SalomeApp_DoubleSpinBox( this );
+ VISU::initSpinBox( myClampSpinBox, 1.0, 512.0, 1.0, "parametric_precision" );
+ myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myClampLabel, 1, 0 );
+ aLayout->addWidget( myClampSpinBox, 1, 1, 1, 2 );
+
+ // Main Texture ( Point Sprite )
+ myMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), this );
+ myMainTextureLineEdit = new QLineEdit( this );
+ myMainTextureButton = new QPushButton( this );
+ myMainTextureButton->setAutoDefault( false );
+ myMainTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+ connect( myMainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) );
+
+ aLayout->addWidget( myMainTextureLabel, 2, 0 );
+ aLayout->addWidget( myMainTextureLineEdit, 2, 1 );
+ aLayout->addWidget( myMainTextureButton, 2, 2 );
+
+ // Alpha Texture ( Point Sprite )
+ myAlphaTextureLabel = new QLabel( tr( "ALPHA_TEXTURE" ), this );
+ myAlphaTextureLineEdit = new QLineEdit( this );
+ myAlphaTextureButton = new QPushButton( this );
+ myAlphaTextureButton->setAutoDefault( false );
+ myAlphaTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+ connect( myAlphaTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaTexture() ) );
+
+ aLayout->addWidget( myAlphaTextureLabel, 3, 0 );
+ aLayout->addWidget( myAlphaTextureLineEdit, 3, 1 );
+ aLayout->addWidget( myAlphaTextureButton, 3, 2 );
+
+ // Alpha Threshold ( Point Sprite )
+ myAlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), this );
+ myAlphaThresholdSpinBox = new SalomeApp_DoubleSpinBox( this );
+ VISU::initSpinBox( myAlphaThresholdSpinBox, 0.0, 1.0, 0.1, "parametric_precision" );
+ myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myAlphaThresholdLabel, 4, 0 );
+ aLayout->addWidget( myAlphaThresholdSpinBox, 4, 1, 1, 2 );
+
+ // Resolution ( Geometrical Sphere )
+ myResolutionLabel = new QLabel( tr( "RESOLUTION" ), this );
+ myResolutionSpinBox = new SalomeApp_IntSpinBox( this );
+ VISU::initSpinBox( myResolutionSpinBox, 3, 100, 1 );
+ myResolutionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ connect( myResolutionSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( onResolutionChanged( int ) ) );
+
+ aLayout->addWidget( myResolutionLabel, 5, 0 );
+ aLayout->addWidget( myResolutionSpinBox, 5, 1, 1, 2 );
+
+ // Number of faces ( Geometrical Sphere )
+ myFaceNumberLabel = new QLabel( tr( "FACE_NUMBER" ), this );
+ myFaceNumberLineEdit = new QLineEdit( this );
+ myFaceNumberLineEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myFaceNumberLineEdit->setEnabled( false );
+ //myFaceNumberLineEdit->setReadOnly( true );
+
+ aLayout->addWidget( myFaceNumberLabel, 6, 0 );
+ aLayout->addWidget( myFaceNumberLineEdit, 6, 1, 1, 2 );
+
+ // Notification ( Geometrical Sphere )
+ myFaceLimitLabel = new QLabel( tr( "FACE_LIMIT" ), this );
+ myFaceLimitSpinBox = new SalomeApp_IntSpinBox( this );
+ VISU::initSpinBox( myFaceLimitSpinBox, 10, 1000000, 10 );
+ myFaceLimitSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myFaceLimitLabel, 7, 0 );
+ aLayout->addWidget( myFaceLimitSpinBox, 7, 1, 1, 2 );
+
+ connect( myPointSpriteButton, SIGNAL( clicked() ), this, SLOT( onTogglePointSprite() ) );
+ connect( myOpenGLPointButton, SIGNAL( clicked() ), this, SLOT( onToggleOpenGLPoint() ) );
+ connect( myGeomSphereButton, SIGNAL( clicked() ), this, SLOT( onToggleGeomSphere() ) );
+}
+
+void VisuGUI_PrimitiveBox::onTogglePointSprite()
+{
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
+
+ myClampLabel->show();
+ myClampSpinBox->show();
+
+ myMainTextureLabel->show();
+ myMainTextureLineEdit->show();
+ myMainTextureButton->show();
+
+ myAlphaTextureLabel->show();
+ myAlphaTextureLineEdit->show();
+ myAlphaTextureButton->show();
+
+ myAlphaThresholdLabel->show();
+ myAlphaThresholdSpinBox->show();
+
+ myResolutionLabel->hide();
+ myResolutionSpinBox->hide();
+
+ myFaceNumberLabel->hide();
+ myFaceNumberLineEdit->hide();
+
+ myFaceLimitLabel->hide();
+ myFaceLimitSpinBox->hide();
+}
+
+void VisuGUI_PrimitiveBox::onToggleOpenGLPoint()
+{
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::OpenGLPoint;
+
+ myClampLabel->show();
+ myClampSpinBox->show();
+
+ myMainTextureLabel->hide();
+ myMainTextureLineEdit->hide();
+ myMainTextureButton->hide();
+
+ myAlphaTextureLabel->hide();
+ myAlphaTextureLineEdit->hide();
+ myAlphaTextureButton->hide();
+
+ myAlphaThresholdLabel->hide();
+ myAlphaThresholdSpinBox->hide();
+
+ myResolutionLabel->hide();
+ myResolutionSpinBox->hide();
+
+ myFaceNumberLabel->hide();
+ myFaceNumberLineEdit->hide();
+
+ myFaceLimitLabel->hide();
+ myFaceLimitSpinBox->hide();
+}
+
+void VisuGUI_PrimitiveBox::onToggleGeomSphere()
+{
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::GeomSphere;
+
+ myClampLabel->hide();
+ myClampSpinBox->hide();
+
+ myMainTextureLabel->hide();
+ myMainTextureLineEdit->hide();
+ myMainTextureButton->hide();
+
+ myAlphaTextureLabel->hide();
+ myAlphaTextureLineEdit->hide();
+ myAlphaTextureButton->hide();
+
+ myAlphaThresholdLabel->hide();
+ myAlphaThresholdSpinBox->hide();
+
+ myResolutionLabel->show();
+ myResolutionSpinBox->show();
+
+ myFaceNumberLabel->show();
+ myFaceNumberLineEdit->show();
+
+ myFaceLimitLabel->show();
+ myFaceLimitSpinBox->show();
+}
+
+void VisuGUI_PrimitiveBox::onResolutionChanged( int theResolution )
+{
+ setFaceNumber( 2 * theResolution * ( theResolution - 2 ) );
+}
+
+void VisuGUI_PrimitiveBox::setPrimitiveType( int theType )
+{
+ myPrimitiveType = theType;
+
+ switch( myPrimitiveType )
+ {
+ case VISU_OpenGLPointSpriteMapper::PointSprite :
+ myPointSpriteButton->setChecked( true );
+ onTogglePointSprite();
+ break;
+ case VISU_OpenGLPointSpriteMapper::OpenGLPoint :
+ myOpenGLPointButton->setChecked( true );
+ onToggleOpenGLPoint();
+ break;
+ case VISU_OpenGLPointSpriteMapper::GeomSphere :
+ myGeomSphereButton->setChecked( true );
+ onToggleGeomSphere();
+ break;
+ default : break;
+ }
+}
+
+float VisuGUI_PrimitiveBox::getClamp() const
+{
+ return myClampSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setClamp( float theClamp )
+{
+ myClampSpinBox->setValue( theClamp );
+}
+
+void VisuGUI_PrimitiveBox::setClampMaximum( float theClampMaximum )
+{
+ myClampSpinBox->setMaximum( theClampMaximum );
+}
+
+void VisuGUI_PrimitiveBox::setMainTexture( const QString& theMainTexture )
+{
+ myMainTexture = theMainTexture;
+ myMainTextureLineEdit->setText( theMainTexture.section( '/', -1 ) );
+}
+
+void VisuGUI_PrimitiveBox::setAlphaTexture( const QString& theAlphaTexture )
+{
+ myAlphaTexture = theAlphaTexture;
+ myAlphaTextureLineEdit->setText( theAlphaTexture.section( '/', -1 ) );
+}
+
+float VisuGUI_PrimitiveBox::getAlphaThreshold() const
+{
+ return myAlphaThresholdSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setAlphaThreshold( float theAlphaThreshold )
+{
+ myAlphaThresholdSpinBox->setValue( theAlphaThreshold );
+}
+
+int VisuGUI_PrimitiveBox::getResolution() const
+{
+ return myResolutionSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setResolution( int theResolution )
+{
+ myResolutionSpinBox->setValue( theResolution );
+}
+
+int VisuGUI_PrimitiveBox::getFaceNumber() const
+{
+ int aResolution = getResolution();
+ return 2 * aResolution * ( aResolution - 2 );
+ //return myFaceNumberLineEdit->text().toInt();
+}
+
+void VisuGUI_PrimitiveBox::setFaceNumber( int theFaceNumber )
+{
+ myFaceNumberLineEdit->setText( QString::number( theFaceNumber ) );
+}
+
+int VisuGUI_PrimitiveBox::getFaceLimit() const
+{
+ return myFaceLimitSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setFaceLimit( int theFaceLimit )
+{
+ myFaceLimitSpinBox->setValue( theFaceLimit );
+}
+
+void VisuGUI_PrimitiveBox::onBrowseMainTexture()
+{
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
+ QString aFileName = QFileDialog::getOpenFileName( this,
+ 0,
+ aRootDir,
+ "Bitmap (*.bmp *.jpg *.png)" );
+
+ if( aFileName.isNull() )
+ return;
+
+ myMainTexture = aFileName;
+ myMainTextureLineEdit->setText( aFileName.section( '/', -1 ) );
+}
+
+void VisuGUI_PrimitiveBox::onBrowseAlphaTexture()
+{
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
+ QString aFileName = QFileDialog::getOpenFileName( this,
+ 0,
+ aRootDir,
+ "Bitmap (*.bmp *.jpg *.png)" );
+
+ if( aFileName.isNull() )
+ return;
+
+ myAlphaTexture = aFileName;
+ myAlphaTextureLineEdit->setText( aFileName.section( '/', -1 ) );
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library 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 2.1 of the License.
+//
+// This library 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 this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_PrimitiveBox.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISUGUI_PRIMITIVEBOX_H
+#define VISUGUI_PRIMITIVEBOX_H
+
+#include <QGroupBox>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+
+class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
+
+class VisuGUI_PrimitiveBox : public QGroupBox
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_PrimitiveBox( QWidget* );
+ ~VisuGUI_PrimitiveBox() {}
+
+public:
+ int getPrimitiveType() const { return myPrimitiveType; }
+ void setPrimitiveType( int );
+
+ float getClamp() const;
+ void setClamp( float );
+ void setClampMaximum( float );
+
+ QString getMainTexture() const { return myMainTexture; }
+ void setMainTexture( const QString& );
+
+ QString getAlphaTexture() const { return myAlphaTexture; }
+ void setAlphaTexture( const QString& );
+
+ float getAlphaThreshold() const;
+ void setAlphaThreshold( float );
+
+ int getResolution() const;
+ void setResolution( int );
+
+ int getFaceNumber() const;
+ void setFaceNumber( int );
+
+ int getFaceLimit() const;
+ void setFaceLimit( int );
+
+protected slots:
+ void onTogglePointSprite();
+ void onToggleOpenGLPoint();
+ void onToggleGeomSphere();
+
+ void onBrowseMainTexture();
+ void onBrowseAlphaTexture();
+
+ void onResolutionChanged( int );
+
+private:
+ int myPrimitiveType;
+
+ QRadioButton* myPointSpriteButton;
+ QRadioButton* myOpenGLPointButton;
+ QRadioButton* myGeomSphereButton;
+
+ QString myMainTexture;
+ QString myAlphaTexture;
+
+ QLabel* myClampLabel;
+ SalomeApp_DoubleSpinBox* myClampSpinBox;
+
+ QLabel* myMainTextureLabel;
+ QLineEdit* myMainTextureLineEdit;
+ QPushButton* myMainTextureButton;
+
+ QLabel* myAlphaTextureLabel;
+ QLineEdit* myAlphaTextureLineEdit;
+ QPushButton* myAlphaTextureButton;
+
+ QLabel* myAlphaThresholdLabel;
+ SalomeApp_DoubleSpinBox* myAlphaThresholdSpinBox;
+
+ QLabel* myResolutionLabel;
+ SalomeApp_IntSpinBox* myResolutionSpinBox;
+
+ QLabel* myFaceNumberLabel;
+ QLineEdit* myFaceNumberLineEdit;
+
+ QLabel* myFaceLimitLabel;
+ SalomeApp_IntSpinBox* myFaceLimitSpinBox;
+};
+
+
+
+#endif
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
-
#include "SVTK_ViewWindow.h"
#include "SVTK_FontWidget.h"
//
#include "VisuGUI_SelectionPrefDlg.h"
#include "VisuGUI.h"
-
-#include <VisuGUI_GUITools.h>
+#include "VisuGUI_Tools.h"
#include "VISU_PickingSettings.h"
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library 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 2.1 of the License.
+//
+// This library 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 this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_SizeBox.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VisuGUI_SizeBox.h"
+
+#include "VisuGUI_Tools.h"
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <QtxColorButton.h>
+
+#include <QLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QPushButton>
+#include <QColorDialog>
+
+using namespace std;
+
+VisuGUI_SizeBox::VisuGUI_SizeBox( QWidget* parent ) :
+ QWidget( parent )
+{
+ QVBoxLayout* aMainLayout = new QVBoxLayout( this );
+ aMainLayout->setSpacing( 0 );
+ aMainLayout->setMargin( 0 );
+
+ // Size
+ QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), this );
+ //SizeGroup->setColumnLayout(0, Qt::Vertical );
+ //SizeGroup->layout()->setSpacing( 0 );
+ //SizeGroup->layout()->setMargin( 0 );
+
+ QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup);
+ SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ SizeGroupLayout->setSpacing(6);
+ SizeGroupLayout->setMargin(11);
+
+ // Outside Size
+ myOutsideSizeLabel = new QLabel( tr( "OUTSIDE_SIZE" ), SizeGroup );
+ myOutsideSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myOutsideSizeSpinBox, 0, 100, 1 );
+ myOutsideSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myOutsideSizeLabel, 0, 0 );
+ SizeGroupLayout->addWidget( myOutsideSizeSpinBox, 0, 1 );
+
+ // Geometry Size
+ myGeomSizeLabel = new QLabel( tr( "GEOM_SIZE" ), SizeGroup );
+ myGeomSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myGeomSizeSpinBox, 0, 100, 1 );
+ myGeomSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myGeomSizeLabel, 0, 0 );
+ SizeGroupLayout->addWidget( myGeomSizeSpinBox, 0, 1 );
+
+ // Min Size
+ myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup );
+ myMinSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myMinSizeSpinBox, 0, 100, 1 );
+ myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 );
+ SizeGroupLayout->addWidget( myMinSizeSpinBox, 1, 1 );
+
+ // Max Size
+ myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup );
+ myMaxSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myMaxSizeSpinBox, 0, 100, 1 );
+ myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 );
+ SizeGroupLayout->addWidget( myMaxSizeSpinBox, 1, 3 );
+
+ // Magnification
+ myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup );
+ myMagnificationSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myMagnificationSpinBox, 1, 10000, 10 );
+ myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMagnificationLabel, 2, 0 );
+ SizeGroupLayout->addWidget( myMagnificationSpinBox, 2, 1 );
+
+ // Increment
+ myIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup );
+ myIncrementSpinBox = new SalomeApp_DoubleSpinBox( SizeGroup );
+ VISU::initSpinBox( myIncrementSpinBox, 0.01, 10, 0.1, "parametric_precision" );
+ myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myIncrementLabel, 2, 2 );
+ SizeGroupLayout->addWidget( myIncrementSpinBox, 2, 3 );
+
+ aMainLayout->addWidget( SizeGroup );
+
+ // Color
+ myColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), this );
+ //myColorGroup->setColumnLayout(0, Qt::Vertical );
+ //myColorGroup->layout()->setSpacing( 0 );
+ //myColorGroup->layout()->setMargin( 0 );
+
+ QGridLayout* ColorGroupLayout = new QGridLayout ( myColorGroup );
+ ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
+ ColorGroupLayout->setSpacing(6);
+ ColorGroupLayout->setMargin(11);
+
+ myUniformCheckBox = new QCheckBox( tr( "UNIFORM_COLOR" ), myColorGroup );
+
+ myColorLabel = new QLabel( tr( "COLOR" ), myColorGroup );
+ myColorButton = new QtxColorButton( myColorGroup );
+
+ ColorGroupLayout->addWidget( myUniformCheckBox, 0, 0 );
+ ColorGroupLayout->addWidget( myColorLabel, 0, 1 );
+ ColorGroupLayout->addWidget( myColorButton, 0, 2 );
+
+ aMainLayout->addWidget( myColorGroup );
+
+ connect( myUniformCheckBox, SIGNAL( toggled( bool ) ), myColorButton, SLOT( setEnabled( bool ) ) );
+ //connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
+
+ setType( VisuGUI_SizeBox::Results );
+}
+
+void VisuGUI_SizeBox::onToggleResults()
+{
+ myType = VisuGUI_SizeBox::Results;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->show();
+ myMinSizeSpinBox->show();
+
+ myMaxSizeLabel->show();
+ myMaxSizeSpinBox->show();
+
+ myMagnificationLabel->show();
+ myMagnificationSpinBox->show();
+
+ myIncrementLabel->show();
+ myIncrementSpinBox->show();
+
+ myColorGroup->hide();
+
+ myUniformCheckBox->hide();
+}
+
+void VisuGUI_SizeBox::onToggleGeometry()
+{
+ myType = VisuGUI_SizeBox::Geometry;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->show();
+ myGeomSizeSpinBox->show();
+
+ myMinSizeLabel->hide();
+ myMinSizeSpinBox->hide();
+
+ myMaxSizeLabel->hide();
+ myMaxSizeSpinBox->hide();
+
+ myMagnificationLabel->show();
+ myMagnificationSpinBox->show();
+
+ myIncrementLabel->show();
+ myIncrementSpinBox->show();
+
+ myColorGroup->show();
+
+ myUniformCheckBox->hide();
+}
+
+void VisuGUI_SizeBox::onToggleInside()
+{
+ myType = VisuGUI_SizeBox::Inside;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->show();
+ myMinSizeSpinBox->show();
+
+ myMaxSizeLabel->show();
+ myMaxSizeSpinBox->show();
+
+ myMagnificationLabel->hide();
+ myMagnificationSpinBox->hide();
+
+ myIncrementLabel->hide();
+ myIncrementSpinBox->hide();
+
+ myColorGroup->hide();
+
+ myUniformCheckBox->hide();
+}
+
+void VisuGUI_SizeBox::onToggleOutside()
+{
+ myType = VisuGUI_SizeBox::Outside;
+
+ myOutsideSizeLabel->show();
+ myOutsideSizeSpinBox->show();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->hide();
+ myMinSizeSpinBox->hide();
+
+ myMaxSizeLabel->hide();
+ myMaxSizeSpinBox->hide();
+
+ myMagnificationLabel->hide();
+ myMagnificationSpinBox->hide();
+
+ myIncrementLabel->hide();
+ myIncrementSpinBox->hide();
+
+ myColorGroup->show();
+
+ myUniformCheckBox->show();
+}
+
+void VisuGUI_SizeBox::setType( int theType )
+{
+ myType = theType;
+
+ switch( myType )
+ {
+ case VisuGUI_SizeBox::Results : onToggleResults(); break;
+ case VisuGUI_SizeBox::Geometry : onToggleGeometry(); break;
+ case VisuGUI_SizeBox::Inside : onToggleInside(); break;
+ case VisuGUI_SizeBox::Outside : onToggleOutside(); break;
+ default : break;
+ }
+}
+
+float VisuGUI_SizeBox::getOutsideSize() const
+{
+ return myOutsideSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setOutsideSize( float theOutsideSize )
+{
+ myOutsideSizeSpinBox->setValue( ( int )( theOutsideSize * 100 ) );
+}
+
+float VisuGUI_SizeBox::getGeomSize() const
+{
+ return myGeomSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setGeomSize( float theGeomSize )
+{
+ myGeomSizeSpinBox->setValue( ( int )( theGeomSize * 100 ) );
+}
+
+float VisuGUI_SizeBox::getMinSize() const
+{
+ return myMinSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setMinSize( float theMinSize )
+{
+ myMinSizeSpinBox->setValue( ( int )( theMinSize * 100 ) );
+}
+
+float VisuGUI_SizeBox::getMaxSize() const
+{
+ return myMaxSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setMaxSize( float theMaxSize )
+{
+ myMaxSizeSpinBox->setValue( ( int )( theMaxSize * 100 ) );
+}
+
+float VisuGUI_SizeBox::getMagnification() const
+{
+ return myMagnificationSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setMagnification( float theMagnification )
+{
+ myMagnificationSpinBox->setValue( ( int )( theMagnification * 100 ) );
+}
+
+float VisuGUI_SizeBox::getIncrement() const
+{
+ return myIncrementSpinBox->value();
+}
+
+void VisuGUI_SizeBox::setIncrement( float theIncrement )
+{
+ myIncrementSpinBox->setValue( theIncrement );
+}
+
+bool VisuGUI_SizeBox::getUniform() const
+{
+ return myUniformCheckBox->isChecked();
+}
+
+void VisuGUI_SizeBox::setUniform( bool theUniform )
+{
+ myUniformCheckBox->setChecked( theUniform );
+ myColorButton->setEnabled( theUniform );
+}
+
+QColor VisuGUI_SizeBox::getColor() const
+{
+ return myColorButton->color();//palette().color( myColorButton->backgroundRole() );
+ //return myColorButton->paletteBackgroundColor();
+}
+
+void VisuGUI_SizeBox::setColor( const QColor& theColor )
+{
+ if ( theColor.isValid() )
+ {
+ //QPalette aPalette( myColorButton->palette() );
+ //aPalette.setColor( myColorButton->backgroundRole(), theColor );
+ myColorButton->setColor( theColor );
+ }
+ //myColorButton->setPaletteBackgroundColor( theColor );
+}
+
+void VisuGUI_SizeBox::enableSizeControls( bool enabled )
+{
+ myMagnificationSpinBox->setEnabled( enabled );
+ myMaxSizeSpinBox->setEnabled( enabled );
+ myMinSizeSpinBox->setEnabled( enabled );
+ myIncrementSpinBox->setEnabled( enabled );
+ myGeomSizeSpinBox->setEnabled( enabled );
+}
+
+/*void VisuGUI_SizeBox::onColorButtonPressed()
+{
+ QPalette aPalette( myColorButton->palette() );
+ QColor aColor = QColorDialog::
+ getColor( aPalette.color(myColorButton->backgroundRole() ), this );
+
+ if( aColor.isValid() )
+ {
+ aPalette.setColor( myColorButton->backgroundRole(), aColor );
+ myColorButton->setPalette( aPalette );
+ }
+}*/
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library 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 2.1 of the License.
+//
+// This library 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 this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_SizeBox.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISUGUI_SIZEBOX_H
+#define VISUGUI_SIZEBOX_H
+
+#include <QWidget>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QCheckBox;
+class QGroupBox;
+
+class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
+class QtxColorButton;
+
+class VisuGUI_SizeBox : public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum { Results = 0, Geometry, Inside, Outside };
+
+public:
+ VisuGUI_SizeBox( QWidget* );
+ ~VisuGUI_SizeBox() {}
+
+public:
+ int getType() const { return myType; }
+ void setType( int );
+
+ float getOutsideSize() const;
+ void setOutsideSize( float );
+
+ float getGeomSize() const;
+ void setGeomSize( float );
+
+ float getMinSize() const;
+ void setMinSize( float );
+
+ float getMaxSize() const;
+ void setMaxSize( float );
+
+ float getMagnification() const;
+ void setMagnification( float );
+
+ float getIncrement() const;
+ void setIncrement( float );
+
+ bool getUniform() const;
+ void setUniform( bool );
+
+ QColor getColor() const;
+ void setColor( const QColor& );
+
+ void enableSizeControls( bool enabled );
+
+protected slots:
+ void onToggleResults();
+ void onToggleGeometry();
+ void onToggleInside();
+ void onToggleOutside();
+
+ //void onColorButtonPressed();
+
+private:
+ int myType;
+
+ QLabel* myOutsideSizeLabel;
+ SalomeApp_IntSpinBox* myOutsideSizeSpinBox;
+
+ QLabel* myGeomSizeLabel;
+ SalomeApp_IntSpinBox* myGeomSizeSpinBox;
+
+ QLabel* myMinSizeLabel;
+ SalomeApp_IntSpinBox* myMinSizeSpinBox;
+
+ QLabel* myMaxSizeLabel;
+ SalomeApp_IntSpinBox* myMaxSizeSpinBox;
+
+ QLabel* myMagnificationLabel;
+ SalomeApp_IntSpinBox* myMagnificationSpinBox;
+
+ QLabel* myIncrementLabel;
+ SalomeApp_DoubleSpinBox* myIncrementSpinBox;
+
+ QCheckBox* myUniformCheckBox;
+
+ QGroupBox* myColorGroup;
+ QLabel* myColorLabel;
+ QtxColorButton* myColorButton;
+};
+
+
+
+#endif
// Module : VISU
//
#include "VisuGUI_Slider.h"
-
-#include <VisuGUI_GUITools.h>
+#include "VisuGUI_Tools.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_Mesh_i.hh"
#include "VISU_Gen_i.hh"
#include "VISU_StreamLines_i.hh"
// Module : VISU
//
#include "VisuGUI_Sweep.h"
-
-#include <VisuGUI_GUITools.h>
+#include "VisuGUI_Tools.h"
#include "SUIT_ResourceMgr.h"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_ViewManager_i.hh"
#include "VISU_Prs3dUtils.hh"
#include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
#include "VisuGUI_GaussPointsDlg.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_TimeAnimation.h"
#include "VISU_ScalarMap_i.hh"
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
+#include "SalomeApp_IntSpinBox.h"
+#include "SalomeApp_DoubleSpinBox.h"
#include "LightApp_DataObject.h"
#include "LightApp_SelectionMgr.h"
#include "SUIT_MessageBox.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
+#include "SUIT_ResourceMgr.h"
#include "CAM_DataModel.h"
#include <QString>
#include <QSpinBox>
#include <QDoubleSpinBox>
+#include <QVariant>
using namespace std;
theSObject = aFolder;
return true;
}
+
+ //------------------------------------------------------------
+ void initSpinBox( SalomeApp_IntSpinBox* sb,
+ const int bottom,
+ const int top,
+ const int step )
+ {
+ sb->setAcceptNames( false );
+ sb->setRange( bottom, top );
+ sb->setSingleStep( step );
+ }
+
+ //------------------------------------------------------------
+ void initSpinBox( SalomeApp_DoubleSpinBox* sb,
+ const double& bottom,
+ const double& top,
+ const double& step,
+ const char* quantity )
+ {
+ // Obtain precision from preferences
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ int precision = resMgr->integerValue( "VISU", quantity, 3 );
+
+ sb->setPrecision ( precision );
+ sb->setDecimals ( qAbs(precision) );
+ sb->setRange ( bottom, top );
+ sb->setSingleStep ( step );
+ sb->setDefaultValue( bottom );
+ sb->setAcceptNames ( false );
+
+ // Add a hint for the user saying how to tune precision
+ QString userPropName = QObject::tr( QString( "VISU_PREF_%1" ).arg( quantity ).toLatin1().constData() );
+ sb->setProperty( "validity_tune_hint",
+ QVariant( QObject::tr( "VISU_PRECISION_HINT" ).arg( userPropName ) ) );
+ }
}
class Plot2d_ViewFrame;
class CAM_Module;
class LightApp_SelectionMgr;
+class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
class SalomeApp_Module;
class SalomeApp_Study;
class VisuGUI;
#define CLIP_PLANES_FOLDER "Clipping Planes"
bool getClippingPlanesFolder(_PTR(Study) theStudy, _PTR(SObject)& theSObject);
+
+ void initSpinBox( SalomeApp_IntSpinBox*, const int, const int, const int );
+ void initSpinBox( SalomeApp_DoubleSpinBox*, const double&, const double&, const double&, const char* );
}
#endif
#include "VisuGUI_Tools.h"
#include "VisuGUI_InputPane.h"
-#include <VisuGUI_GUITools.h>
-
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_Vectors_i.hh"
#include "LightApp_Application.h"
VISU_Deformation_i.hh \
VISU_OptionalDeformation_i.hh \
SALOME_GenericObjPointer.hh \
- VISU_ClippingPlaneMgr.hxx
-
+ VISU_ClippingPlaneMgr.hxx \
+ VISU_TableDlg.h
libVISUEngineImpl_la_SOURCES = \
VISUConfig.cc \
VISU_Deformation_i.cc \
VISU_OptionalDeformation_i.cc \
SALOME_GenericObjPointer.cc \
- VISU_ClippingPlaneMgr.cxx
+ VISU_ClippingPlaneMgr.cxx \
+ VISU_TableDlg.cxx
+
+MOC_FILES = \
+ VISU_TimeAnimation_moc.cxx \
+ VISU_TableDlg_moc.cxx
-MOC_FILES = VISU_TimeAnimation_moc.cxx
nodist_libVISUEngineImpl_la_SOURCES= $(MOC_FILES)
# additionnal information to compil and link file
-I$(srcdir)/../CONVERTOR \
-I$(srcdir)/../PIPELINE \
-I$(srcdir)/../OBJECT \
- -I$(srcdir)/../GUITOOLS \
-I$(top_builddir)/idl
libVISUEngineImpl_la_LDFLAGS= \
../CONVERTOR/libVisuConvertor.la \
../PIPELINE/libVisuPipeLine.la \
../OBJECT/libVisuObject.la \
- ../GUITOOLS/libVISUGUITOOLS.la \
-lSalomeIDLKernel \
-lSalomeHDFPersist \
-lSalomeGenericObj \
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library 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 2.1 of the License.
+//
+// This library 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 this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : VISU_TableDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+
+#include "VISU_TableDlg.h"
+
+#include <VISU_Table_i.hh>
+
+#include "SUIT_Tools.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
+#include "LightApp_Application.h"
+
+#include "CAM_Module.h"
+
+#include "SALOMEDSClient_Study.hxx"
+#include "SALOMEDSClient_GenericAttribute.hxx"
+#include "SALOMEDSClient_AttributeTableOfInteger.hxx"
+#include "SALOMEDSClient_AttributeTableOfReal.hxx"
+#include "SALOMEDSClient_StudyBuilder.hxx"
+
+#include <QLayout>
+#include <QTableWidget>
+#include <QTabWidget>
+#include <QList>
+#include <QInputDialog>
+#include <QLabel>
+#include <QIntValidator>
+#include <QDoubleValidator>
+#include <QKeyEvent>
+#include <QHeaderView>
+#include <QPushButton>
+#include <QLineEdit>
+#include <QCheckBox>
+
+#include "utilities.h"
+
+const int MARGIN_SIZE = 11;
+const int SPACING_SIZE = 6;
+const int MIN_TABLE_WIDTH = 200;
+const int MIN_TABLE_HEIGHT = 200;
+
+NumDelegateItem::NumDelegateItem( QObject* parent, NumValidator mode )
+ : QItemDelegate( parent ),
+ myMode( mode )
+{
+}
+
+NumDelegateItem::~NumDelegateItem()
+{
+}
+
+QWidget* NumDelegateItem::createEditor( QWidget* parent,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
+{
+ QLineEdit* editor = new QLineEdit( parent );
+ switch ( myMode )
+ {
+ case NV_Int:
+ editor->setValidator( new QIntValidator( editor ) );
+ break;
+ case NV_Real:
+ editor->setValidator( new QDoubleValidator( editor ) );
+ break;
+ default:
+ break;
+ }
+ return editor;
+}
+
+void NumDelegateItem::setEditorData( QWidget* editor,
+ const QModelIndex& index ) const
+{
+ QLineEdit* aLE = qobject_cast<QLineEdit*>( editor );
+ if ( !aLE )
+ return;
+
+ switch ( myMode )
+ {
+ case NV_Int:
+ {
+ int value = index.model()->data( index, Qt::DisplayRole ).toInt();
+ aLE->setText( QString("%1").arg( value ) );
+ break;
+ }
+ case NV_Real:
+ {
+ double value = index.model()->data(index, Qt::DisplayRole).toDouble();
+ aLE->setText( QString("%1").arg( value ) );
+ break;
+ }
+ default:
+ aLE->setText( index.model()->data( index, Qt::DisplayRole ).toString() );
+ break;
+ }
+}
+
+class VISU_TableDlg::WidgetCointainer : public QWidget
+{
+public:
+ WidgetCointainer( QWidget* parent, Qt::Orientation o, int lm, int tm, int rm, int bm, int s )
+ : QWidget( parent )
+ {
+ QLayout* l = o == Qt::Horizontal ? (QLayout*)( new QHBoxLayout( this ) ) : ( QLayout* )( new QVBoxLayout( this ) );
+ l->setContentsMargins( lm, tm, rm, bm );
+ l->setSpacing( s );
+ setLayout( l );
+ }
+ void addWidget( QWidget* w )
+ {
+ if ( w ) {
+ QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
+ QVBoxLayout* wl = qobject_cast<QVBoxLayout*>( layout() );
+ if ( hl ) hl->addWidget( w );
+ else if ( wl ) wl->addWidget( w );
+ }
+ }
+ void addSpacing( int s )
+ {
+ if ( s > 0 ) {
+ QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
+ QVBoxLayout* wl = qobject_cast<QVBoxLayout*>( layout() );
+ if ( hl ) hl->addSpacing( s );
+ else if ( wl ) wl->addSpacing( s );
+ }
+ }
+ void addStretch( int s )
+ {
+ if ( s >= 0 ) {
+ QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
+ QVBoxLayout* wl = qobject_cast<QVBoxLayout*>( layout() );
+ if ( hl ) hl->addStretch( s );
+ else if ( wl ) wl->addStretch( s );
+ }
+ }
+};
+
+/*class VISU_Table : public QTableWidget {
+public:
+ VISU_Table( Orientation orient, QWidget* parent = 0 )
+ : QTableWidget( parent ), myValidator( 0 ), myOrientation( orient ) {}
+ VISU_Table( Orientation orient, int numRows, int numCols, QWidget* parent = 0 )
+ : QTableWidget( numRows, numCols, parent ), myValidator( 0 ), myOrientation( orient ) {}
+
+ void setValidator( QValidator* v = 0 ) { myValidator = v; }
+ bool isEditing() const { return QTable::isEditing(); }
+
+protected:
+ QWidget* createEditor ( int row, int col, bool initFromCell ) const
+ {
+ bool testUnits = ( myOrientation == Qt::Horizontal && col == 0 ) || ( myOrientation == Qt::Vertical && row == 0 );
+ QWidget* wg = QTable::createEditor( row, col, initFromCell );
+ if ( wg && wg->inherits("QLineEdit") && myValidator && !testUnits )
+ (( QLineEdit*)wg)->setValidator( myValidator );
+ return wg;
+ }
+
+protected:
+ QValidator* myValidator;
+ Orientation myOrientation;
+ };*/
+
+QString VISU_TableDlg::tableTitle( int type )
+{
+ QString tlt;
+ switch ( type ) {
+ case ttInt: tlt = tr( "TABLE_OF_INTEGER_TLT" ); break;
+ case ttReal: tlt = tr( "TABLE_OF_REAL_TLT" ); break;
+ default: tlt = tr( "TABLE_UNKNOWN_TLT" ); break;
+ }
+ return tlt;
+}
+/*!
+ Constructor
+*/
+VISU_TableDlg::VISU_TableDlg( QWidget* parent,
+ _PTR(Study) study,
+ VISU::Table_i* table,
+ bool allowEdition,
+ int which,
+ Qt::Orientation orient,
+ bool showColumnTitles )
+ : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ myStudy( study ), myTable( table ), myEditCheck( 0 ), myUpdateCheck( 0 )
+{
+ allowEdition = true; //////////////////////////////////
+ setWindowTitle( tr( "VIEW_TABLE_TLT" ) );
+ setSizeGripEnabled( true );
+
+ bool bHasIntTable = false;
+ bool bHasRealTable = false;
+ if ( myStudy && myTable ) {
+ _PTR(SObject) aSObject = myStudy->FindObjectID( myTable->GetObjectEntry() );
+ if ( aSObject ) {
+ _PTR(GenericAttribute) anAttr;
+ bHasIntTable = aSObject->FindAttribute( anAttr, "AttributeTableOfInteger" );
+ bHasRealTable = aSObject->FindAttribute( anAttr, "AttributeTableOfReal" );
+ }
+ }
+
+ if ( allowEdition ) {
+ myEditCheck = new QCheckBox( tr( "ALLOW_EDIT_CHECK" ), this );
+ myUpdateCheck = new QCheckBox( tr( "DO_UPDATE_CHECK" ), this );
+ connect( myEditCheck, SIGNAL( toggled( bool ) ), myUpdateCheck, SLOT( setEnabled( bool ) ) );
+ myUpdateCheck->setEnabled( false );
+ myUpdateCheck->hide(); // the feature has been temporarily disabled
+ }
+
+ QWidget* top = 0;
+
+ if ( which == ttInt || which == ttAll || which == ttAuto && bHasIntTable ) {
+ myTableMap[ ttInt ] = new TableWidget( this, orient );
+ myTableMap[ ttInt ]->initialize( myStudy, myTable, ttInt );
+ myTableMap[ ttInt ]->setEditEnabled( false );
+ myTableMap[ ttInt ]->showColumnTitles( showColumnTitles );
+ if ( myEditCheck )
+ connect( myEditCheck, SIGNAL( toggled( bool ) ), myTableMap[ ttInt ], SLOT( setEditEnabled( bool ) ) );
+ }
+ if ( which == ttReal || which == ttAll || which == ttAuto && bHasRealTable ) {
+ myTableMap[ ttReal ] = new TableWidget( this, orient );
+ myTableMap[ ttReal ]->initialize( myStudy, myTable, ttReal );
+ myTableMap[ ttReal ]->setEditEnabled( false );
+ myTableMap[ ttReal ]->showColumnTitles( showColumnTitles );
+ if ( myEditCheck )
+ connect( myEditCheck, SIGNAL( toggled( bool ) ), myTableMap[ ttReal ], SLOT( setEditEnabled( bool ) ) );
+ }
+
+ if ( myTableMap.count() > 1 ) {
+ QTabWidget* tw = new QTabWidget( this );
+ for ( int i = ttInt; i < ttAll; i++ ) {
+ if ( myTableMap.contains( i ) ) {
+ tw->addTab( myTableMap[ i ], tableTitle( i ) );
+ myTableMap[ i ]->layout()->setMargin( MARGIN_SIZE );
+ }
+ }
+ top = tw;
+ }
+ else if ( myTableMap.count() == 1 ) {
+ top = myTableMap[myTableMap.keys().first()];
+ }
+ else {
+ QLabel* dumbLabel = new QLabel( tr( "ERR_TABLE_NOT_AVAILABLE" ), this );
+ dumbLabel->setAlignment( Qt::AlignCenter );
+ top = dumbLabel;
+ }
+
+ myOKBtn = new QPushButton( tr( "BUT_OK" ), this );
+ myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
+
+ QHBoxLayout* btnLayout = new QHBoxLayout;
+ btnLayout->setMargin( 0 );
+ btnLayout->setSpacing( SPACING_SIZE );
+
+ btnLayout->addWidget( myOKBtn );
+ btnLayout->addStretch( 20 );
+ btnLayout->addWidget( myHelpBtn );
+ connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( close() ) );
+ connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( help() ) );
+
+ QVBoxLayout* mainLayout = new QVBoxLayout( this );
+ mainLayout->setMargin( MARGIN_SIZE );
+ mainLayout->setSpacing( SPACING_SIZE );
+
+ if ( myEditCheck ) {
+ QHBoxLayout* checkLayout = new QHBoxLayout;
+ checkLayout->setMargin( 0 );
+ checkLayout->setSpacing( SPACING_SIZE );
+ checkLayout->addWidget( myEditCheck );
+ checkLayout->addWidget( myUpdateCheck );
+ mainLayout->addLayout( checkLayout );
+ }
+ mainLayout->addWidget( top );
+ mainLayout->addLayout( btnLayout );
+
+ resize( 500, 400 );
+ SUIT_Tools::centerWidget( this, parent );
+}
+
+/*!
+ Destructor
+*/
+VISU_TableDlg::~VISU_TableDlg()
+{
+}
+
+/*!
+ <OK> button slot, saves table(s)
+ Called only in create/edit mode ( <edit> parameter for constructor is true )
+*/
+/*
+void VISU_TableDlg::onOK()
+{
+ myOKBtn->setFocus(); // accept possible changes
+ bool done = true;
+
+ if ( myObject ) {
+ _PTR(Study) study = myObject->GetStudy();
+ _PTR(AttributeTableOfInteger) tblIntAttr;
+ _PTR(AttributeTableOfReal) tblRealAttr;
+
+ if ( study ) {
+ _PTR(StudyBuilder) builder = study->NewBuilder();
+ builder->NewCommand(); // start transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ try {
+ if ( myTableMap.contains( ttInt ) ) {
+ builder->RemoveAttribute( myObject, "AttributeTableOfInteger" );
+ tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" );
+
+ int i;
+ int nbRows = myTableMap[ ttInt ]->getNumRows();
+ int nbCols = myTableMap[ ttInt ]->getNumCols();
+ QString tlt = myTableMap[ ttInt ]->getTableTitle();
+ QStringList rowTitles, colTitles, units;
+ myTableMap[ ttInt ]->getRowTitles( rowTitles );
+ myTableMap[ ttInt ]->getColTitles( colTitles );
+ myTableMap[ ttInt ]->getUnits( units );
+
+ if ( nbRows > 0) {
+ // data
+ int nRow = 0;
+ tblIntAttr->SetNbColumns( nbCols );
+ for ( i = 0; i < nbRows; i++ ) {
+ QStringList data;
+ myTableMap[ ttInt ]->getRowData( i, data );
+ bool bEmptyRow = true;
+ for ( int j = 0; j < data.count(); j++ ) {
+ if ( !data[ j ].isNull() ) {
+ tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 );
+ bEmptyRow = false;
+ }
+ }
+ if ( !bEmptyRow ) { // Skip rows with no data !!!
+ // set row title
+ tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
+ // set row unit
+ tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
+ nRow++;
+ }
+ }
+ if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
+ // column titles
+ for ( i = 0; i < colTitles.count(); i++ )
+ tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
+ }
+ }
+ // title
+ tblIntAttr->SetTitle( (const char*)myTableMap[ ttInt ]->getTableTitle().toLatin1() );
+ }
+ if ( myTableMap.contains( ttReal ) ) {
+ builder->RemoveAttribute( myObject, "AttributeTableOfReal" );
+ tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" );
+
+ int i;
+ int nbRows = myTableMap[ ttReal ]->getNumRows();
+ int nbCols = myTableMap[ ttReal ]->getNumCols();
+ QString tlt = myTableMap[ ttReal ]->getTableTitle();
+ QStringList rowTitles, colTitles, units;
+ myTableMap[ ttReal ]->getRowTitles( rowTitles );
+ myTableMap[ ttReal ]->getColTitles( colTitles );
+ myTableMap[ ttReal ]->getUnits( units );
+
+ if ( nbRows > 0) {
+ // data
+ int nRow = 0;
+ tblRealAttr->SetNbColumns( nbCols );
+ for ( i = 0; i < nbRows; i++ ) {
+ QStringList data;
+ myTableMap[ ttReal ]->getRowData( i, data );
+ bool bEmptyRow = true;
+ for ( int j = 0; j < data.count(); j++ ) {
+ if ( !data[ j ].isNull() ) {
+ tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 );
+ bEmptyRow = false;
+ }
+ }
+ if ( !bEmptyRow ) { // Skip rows with no data !!!
+ // set row title
+ tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
+ // set row unit
+ tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
+ nRow++;
+ }
+ }
+ if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
+ // column titles
+ for ( i = 0; i < colTitles.count(); i++ )
+ tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
+ }
+ }
+ // title
+ tblRealAttr->SetTitle( (const char*)myTableMap[ ttReal ]->getTableTitle().toLatin1() );
+ }
+ if ( myTableMap.contains( ttInt ) || myTableMap.contains( ttReal ) )
+ builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ else
+ builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ }
+ catch( ... ) {
+ MESSAGE("VISU_TableDlg::onOK : Exception has been caught !!!");
+ builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ done = false;
+ SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") );
+ }
+ }
+ }
+ if ( done )
+ accept();
+}
+*/
+
+/*!
+ <Help> button slot, shows corresponding help page
+*/
+void VISU_TableDlg::help()
+{
+ QString aHelpFileName = "table_presentations_page.html";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ else {
+ QString platform;
+#ifdef WIN32
+ platform = "winapplication";
+#else
+ platform = "application";
+#endif
+ SUIT_MessageBox::warning( this,
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+ }
+}
+
+/*!
+ Provides help on F1 button click
+*/
+void VISU_TableDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ help();
+ }
+}
+
+/*!
+ Constructor
+*/
+VISU_TableDlg::TableWidget::TableWidget( QWidget* parent,
+ Qt::Orientation orientation )
+ : QWidget( parent ), myOrientation( orientation )
+{
+ myTitleEdit = new QLineEdit( this );
+
+ myTable = new QTableWidget( 5, 5, this );
+ myTable->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+ myTable->setMinimumSize( MIN_TABLE_WIDTH, MIN_TABLE_HEIGHT );
+ myTable->setSelectionMode( QAbstractItemView::SingleSelection );
+ myTable->setShowGrid( true );
+ myTable->horizontalHeader()->setMovable( false );
+ myTable->verticalHeader()->setMovable( false );
+ myTable->setDragEnabled( false );
+
+ myAdjustBtn = new QPushButton( VISU_TableDlg::tr( "ADJUST_CELLS_BTN" ), this );
+ myAddRowBtn = new QPushButton( VISU_TableDlg::tr( "ADD_ROW_BTN" ), this );
+ myDelRowBtn = new QPushButton( VISU_TableDlg::tr( "REMOVE_ROW_BTN" ), this );
+ myAddColBtn = new QPushButton( VISU_TableDlg::tr( "ADD_COLUMN_BTN" ), this );
+ myDelColBtn = new QPushButton( VISU_TableDlg::tr( "REMOVE_COLUMN_BTN" ), this );
+ mySelectAllBtn = new QPushButton( VISU_TableDlg::tr( "SELECT_ALL_BTN" ), this );
+ myClearBtn = new QPushButton( VISU_TableDlg::tr( "CLEAR_BTN"), this );
+
+ // the features has been temporarily disabled
+ myAddRowBtn->hide();
+ myDelRowBtn->hide();
+ myAddColBtn->hide();
+ myDelColBtn->hide();
+ mySelectAllBtn->hide();
+ myClearBtn->hide();
+
+ QVBoxLayout* btnLayout = new QVBoxLayout;
+ btnLayout->setMargin( 0 );
+ btnLayout->setSpacing( SPACING_SIZE );
+ btnLayout->addWidget( myAdjustBtn );
+ btnLayout->addStretch( 20 );
+ btnLayout->addWidget( myAddRowBtn );
+ btnLayout->addWidget( myDelRowBtn );
+ btnLayout->addWidget( myAddColBtn );
+ btnLayout->addWidget( myDelColBtn );
+ btnLayout->addStretch( 20 );
+ btnLayout->addWidget( mySelectAllBtn );
+ btnLayout->addWidget( myClearBtn );
+
+ QGridLayout* mainLayout = new QGridLayout( this );
+ mainLayout->setMargin( 0 );
+ mainLayout->setSpacing( SPACING_SIZE );
+ mainLayout->addWidget( myTitleEdit, 0, 0, 1, 2 );
+ mainLayout->addWidget( myTable, 1, 0 );
+ mainLayout->addLayout( btnLayout, 1, 1 );
+
+ connect( myTable, SIGNAL( itemSelectionChanged() ),
+ this, SLOT( updateButtonsState() ) );
+ connect( myTable, SIGNAL( currentItemChanged( QTableWidgetItem*, QTableWidgetItem* ) ),
+ this, SLOT( updateButtonsState() ) );
+ connect( myAddRowBtn, SIGNAL( clicked() ), this, SLOT( addRow() ) );
+ connect( myAddColBtn, SIGNAL( clicked() ), this, SLOT( addCol() ) );
+ connect( myDelRowBtn, SIGNAL( clicked() ), this, SLOT( delRow() ) );
+ connect( myDelColBtn, SIGNAL( clicked() ), this, SLOT( delCol() ) );
+ connect( myAdjustBtn, SIGNAL( clicked() ), this, SLOT( adjustTable() ) );
+ connect( mySelectAllBtn, SIGNAL( clicked() ), this, SLOT( selectAll() ) );
+ connect( myClearBtn, SIGNAL( clicked() ), this, SLOT( clearTable() ) );
+ myTable->horizontalHeader()->installEventFilter( this );
+ myTable->verticalHeader()->installEventFilter( this );
+ myTable->installEventFilter( this );
+
+ updateButtonsState();
+}
+
+/*!
+ Destructor
+*/
+VISU_TableDlg::TableWidget::~TableWidget()
+{
+}
+
+/*!
+ Initialize widget
+*/
+void VISU_TableDlg::TableWidget::initialize( _PTR(Study) study, VISU::Table_i* table, int type )
+{
+ myStudy = study;
+ myTableObj = table;
+ myType = type;
+
+ setUnitsTitle( VISU_TableDlg::tr( "UNITS_TLT" ) );
+ setEditEnabled( false );
+ showColumnTitles( false );
+
+ _PTR(SObject) aSObject = myStudy->FindObjectID( myTableObj->GetObjectEntry() );
+ if ( aSObject ) {
+ int i, j;
+ switch ( myType ) {
+ case ttInt:
+ myTable->setItemDelegate( new NumDelegateItem( this, NumDelegateItem::NV_Int ) );
+ if ( aSObject->FindAttribute( myAttr, "AttributeTableOfInteger" ) ) {
+ _PTR(AttributeTableOfInteger) intAttr = myAttr;
+ try {
+ // title
+ setTableTitle( intAttr->GetTitle().c_str() );
+ // nb of rows & cols
+ int nbRows = intAttr->GetNbRows() ;
+ int nbCols = intAttr->GetNbColumns();
+ setNumRows( nbRows );
+ setNumCols( nbCols );
+ // rows titles
+ QStringList strlist;
+ std::vector<std::string> titles = intAttr->GetRowTitles();
+ for ( i = 0; i < nbRows; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setRowTitles( strlist );
+ // columns titles
+ strlist.clear();
+ titles = intAttr->GetColumnTitles();
+ for ( i = 0; i < nbCols; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setColTitles( strlist );
+ // units
+ strlist.clear();
+ titles = intAttr->GetRowUnits();
+ if ( titles.size() > 0 ) {
+ for ( i = 0; i < nbRows; i++ )
+ strlist.append( titles[i].c_str() );
+ setUnits( strlist );
+ }
+ // data
+ for ( i = 1; i <= nbRows; i++ ) {
+ strlist.clear();
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( intAttr->HasValue( i, j ) )
+ strlist.append( QString::number( intAttr->GetValue( i, j ) ) );
+ else
+ strlist.append( QString::null );
+ }
+ setRowData( i-1, strlist );
+ }
+ adjustTable();
+ }
+ catch( ... ) {
+ MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!");
+ }
+ }
+ break;
+ case ttReal:
+ myTable->setItemDelegate( new NumDelegateItem( this, NumDelegateItem::NV_Real ) );
+ if ( aSObject->FindAttribute( myAttr, "AttributeTableOfReal" ) ) {
+ _PTR(AttributeTableOfReal) realAttr = myAttr;
+ try {
+ // title
+ setTableTitle( realAttr->GetTitle().c_str() );
+ // nb of rows & cols
+ int nbRows = realAttr->GetNbRows() ;
+ int nbCols = realAttr->GetNbColumns();
+ setNumRows( nbRows );
+ setNumCols( nbCols );
+ // rows titles
+ QStringList strlist;
+ std::vector<std::string> titles = realAttr->GetRowTitles();
+ for ( i = 0; i < nbRows; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setRowTitles( strlist );
+ // columns titles
+ strlist.clear();
+ titles = realAttr->GetColumnTitles();
+ for ( i = 0; i < nbCols; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setColTitles( strlist );
+ // units
+ strlist.clear();
+ titles = realAttr->GetRowUnits();
+ if ( titles.size() > 0 ) {
+ for ( i = 0; i < nbRows; i++ )
+ strlist.append( titles[i].c_str() );
+ setUnits( strlist );
+ }
+ // data
+ for ( i = 1; i <= nbRows; i++ ) {
+ strlist.clear();
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( realAttr->HasValue( i, j ) )
+ strlist.append( QString::number( realAttr->GetValue( i, j ) ) );
+ else
+ strlist.append( QString::null );
+ }
+ setRowData( i-1, strlist );
+ }
+ adjustTable();
+ }
+ catch( ... ) {
+ MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!");
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ updateButtonsState();
+}
+
+/*!
+ Enable / disable editing
+*/
+void VISU_TableDlg::TableWidget::setEditEnabled( bool enable )
+{
+ // the feature has been temporarily disabled
+ enable = false;
+
+ myTitleEdit->setReadOnly( !enable );
+ myTable->setEditTriggers( enable ?
+ QAbstractItemView::DoubleClicked |
+ QAbstractItemView::SelectedClicked |
+ QAbstractItemView::EditKeyPressed :
+ QAbstractItemView::NoEditTriggers );
+ myAddRowBtn->setVisible( enable );
+ myDelRowBtn->setVisible( enable );
+ myAddColBtn->setVisible( enable );
+ myDelColBtn->setVisible( enable );
+ mySelectAllBtn->setVisible( enable );
+ myClearBtn->setVisible( enable );
+}
+
+/*!
+ Show / hide column titles
+*/
+void VISU_TableDlg::TableWidget::showColumnTitles( bool showTitles )
+{
+ if ( myOrientation == Qt::Horizontal )
+ myTable->horizontalHeader()->setVisible( showTitles );
+ else
+ myTable->verticalHeader()->setVisible( showTitles );
+}
+
+/*!
+ Sets table title
+*/
+void VISU_TableDlg::TableWidget::setTableTitle( const QString& title )
+{
+ myTitleEdit->setText( title );
+}
+
+/*!
+ Gets table title
+*/
+QString VISU_TableDlg::TableWidget::getTableTitle()
+{
+ return myTitleEdit->text();
+}
+
+/*!
+ Sets total number of rows
+*/
+void VISU_TableDlg::TableWidget::setNumRows( const int num )
+{
+ myOrientation == Qt::Horizontal ? myTable->setRowCount( num ) : myTable->setColumnCount( num );
+}
+
+/*!
+ Gets total number of rows
+*/
+int VISU_TableDlg::TableWidget::getNumRows()
+{
+ return myOrientation == Qt::Horizontal ? myTable->rowCount() : myTable->columnCount();
+}
+
+/*!
+ Sets total number of columns
+*/
+void VISU_TableDlg::TableWidget::setNumCols( const int num )
+{
+ // !!! first column contains units !!!
+ myOrientation == Qt::Horizontal ? myTable->setColumnCount( num+1 ) : myTable->setRowCount( num+1 );
+// myOrientation == Qt::Horizontal ? myTable->setColumnReadOnly( 0, true ) : myTable->setRowReadOnly( 0, true );
+}
+
+/*!
+ Gets total number of columns
+*/
+int VISU_TableDlg::TableWidget::getNumCols()
+{
+ // !!! first column contains units !!!
+ return myOrientation == Qt::Horizontal ? myTable->columnCount()-1 : myTable->rowCount()-1;
+}
+/*!
+ Sets rows titles
+*/
+void VISU_TableDlg::TableWidget::setRowTitles( QStringList& tlts )
+{
+ QStringList aLabels;
+ for ( int i = 0; i < tlts.count(); i++ )
+ tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] );
+
+ myOrientation == Qt::Horizontal ?
+ myTable->setVerticalHeaderLabels( aLabels ) :
+ myTable->setHorizontalHeaderLabels( aLabels );
+
+ // myTable->verticalHeader()->setLabel( i, tlts[i] ) :
+ //myTable->horizontalHeader()->setLabel( i, tlts[i] );
+ //}
+}
+/*!
+ Gets rows titles
+*/
+void VISU_TableDlg::TableWidget::getRowTitles( QStringList& tlts )
+{
+ tlts.clear();
+ if ( myOrientation == Qt::Horizontal ) {
+ for ( int i = 0; i < myTable->rowCount(); i++ ) {
+ tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" );
+ }
+ }
+ else {
+ for ( int i = 0; i < myTable->columnCount(); i++ ) {
+ tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" );
+ }
+ }
+}
+/*!
+ Sets columns titles
+*/
+void VISU_TableDlg::TableWidget::setColTitles( QStringList& tlts )
+{
+ QStringList aLabels;
+
+ // !!! first column contains units !!!
+ aLabels.append(""); // it'll be initialized below - in setUnitsTitle() method
+
+ for ( int i = 0; i < tlts.count(); i++ )
+ tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] );
+
+ myOrientation == Qt::Horizontal ?
+ myTable->setHorizontalHeaderLabels( aLabels ) :
+ myTable->setVerticalHeaderLabels( aLabels );
+
+ setUnitsTitle( VISU_TableDlg::tr( "UNITS_TLT" ) );
+}
+/*!
+ Sets columns titles
+*/
+void VISU_TableDlg::TableWidget::getColTitles( QStringList& tlts )
+{
+ // !!! first column contains units !!!
+ tlts.clear();
+ if ( myOrientation == Qt::Horizontal ) {
+ for ( int i = 1; i < myTable->columnCount(); i++ ) {
+ tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" );
+ }
+ }
+ else {
+ for ( int i = 1; i < myTable->rowCount(); i++ ) {
+ tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" );
+ }
+ }
+}
+/*!
+ Sets units title
+*/
+void VISU_TableDlg::TableWidget::setUnitsTitle( const QString& tlt ) {
+ // !!! first column contains units !!!
+ myTable->model()->setHeaderData( 0, myOrientation, QVariant(tlt.isNull() ? "" : tlt), Qt::DisplayRole );
+}
+/*!
+ Sets units
+*/
+void VISU_TableDlg::TableWidget::setUnits( QStringList& units )
+{
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ QModelIndex anIndex;
+ for ( int i = 0; i < units.count(); i++ )
+ {
+ myOrientation == Qt::Horizontal ?
+ anIndex = aModel->index( i, 0 ) :
+ anIndex = aModel->index( 0, i );
+
+ aModel->setData( anIndex, QVariant( units[i].isNull() ? "" : units[i] ) );
+ }
+ }
+}
+/*!
+ Gets units
+*/
+void VISU_TableDlg::TableWidget::getUnits( QStringList& units )
+{
+ units.clear();
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ if ( myOrientation == Qt::Horizontal )
+ {
+ for ( int i = 0; i < myTable->rowCount(); i++ )
+ units.append( aModel->index( i, 0 ).data().toString() );
+ }
+ else {
+ for ( int i = 0; i < myTable->columnCount(); i++ )
+ units.append( aModel->index( 0, i ).data().toString() );
+ }
+ }
+}
+/*!
+ Sets row data
+*/
+void VISU_TableDlg::TableWidget::setRowData( int row, QStringList& data )
+{
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ QModelIndex anIndex;
+ if ( row >= 0 && row < getNumRows() ) {
+ for ( int i = 0; i < data.count(); i++ )
+ {
+ myOrientation == Qt::Horizontal ? anIndex = aModel->index( row, i+1 ) :
+ anIndex = aModel->index( i+1, row );
+ aModel->setData( anIndex, QVariant( data[i] ) );
+
+ }
+ }
+ }
+}
+/*!
+ Gets row data
+*/
+void VISU_TableDlg::TableWidget::getRowData( int row, QStringList& data )
+{
+ data.clear();
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ if ( row >= 0 && row < getNumRows() )
+ {
+ if ( myOrientation == Qt::Horizontal )
+ {
+ for ( int i = 1; i < myTable->columnCount(); i++ )
+ data.append( aModel->index( row, i ).data().toString() );
+ }
+ else {
+ for ( int i = 1; i < myTable->rowCount(); i++ )
+ data.append( aModel->index( i, row ).data().toString() );
+ }
+ }
+ }
+}
+/*!
+ Adjusts table cell to see contents, <Adjust Cells> button slot
+*/
+void VISU_TableDlg::TableWidget::adjustTable()
+{
+ myTable->resizeRowsToContents();
+ myTable->resizeColumnsToContents();
+}
+/*!
+ Called when selection changed in table
+*/
+void VISU_TableDlg::TableWidget::updateButtonsState()
+{
+ if ( myTable->editTriggers() == QAbstractItemView::NoEditTriggers )
+ return;
+ bool bDR = false; // <Delete Row(s)>
+ bool bDC = false; // <Delete Column(s)>
+ bool bSA = false; // <Select All>
+ bool bCT = false; // <Clear>
+ int i;
+ //TO DO column/row selection check
+ /*int c = myOrientation == Qt::Horizontal ? 0 : 1;
+ for ( i = c; i < myTable->rowCount(); i++ ) {
+
+ if ( myTable->isRowSelected( i, true ) )
+ bDR = true;
+ else
+ bSA = true;
+ }
+ c = myOrientation == Qt::Horizontal ? 1 : 0;
+ for ( i = c; i < myTable->columnCount(); i++ ) {
+ if ( myTable->isColumnSelected( i, true ) )
+ bDC = true;
+ else
+ bSA = true;
+ }*/
+ /*int nbSel = myTable->numSelections();
+ for ( i = 0; i < nbSel; i++ ) {
+ QTableSelection ts = myTable->selection( i );
+ for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
+ for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
+ if ( myTable->item( j, k ) )
+ bCT = true;
+ }
+ }
+ }*/
+ QList<QTableWidgetItem*> aSelection = myTable->selectedItems();
+ QList<QTableWidgetItem*>::ConstIterator anIt = aSelection.constBegin(),
+ anEndIt = aSelection.constEnd();
+ for ( ; anIt != anEndIt; anIt++ )
+ {
+ if( *anIt )
+ {
+ bCT = true;
+ break;
+ }
+ }
+
+ if ( myTable->item( myTable->currentRow(), myTable->currentColumn() ) )
+ bCT = true;
+ myDelRowBtn->setEnabled( bDR );
+ myDelColBtn->setEnabled( bDC );
+ mySelectAllBtn->setEnabled( bSA );
+ myClearBtn->setEnabled( bCT );
+}
+/*!
+ <Add row> button slot
+*/
+void VISU_TableDlg::TableWidget::addRow()
+{
+ myTable->insertRow( myTable->rowCount() );
+ updateButtonsState();
+}
+/*!
+ <Add column> button slot
+*/
+void VISU_TableDlg::TableWidget::addCol()
+{
+ myTable->insertColumn( myTable->columnCount() );
+ updateButtonsState();
+}
+/*!
+ <Delete row(s)> button slot
+*/
+void VISU_TableDlg::TableWidget::delRow()
+{
+ //TODO
+ /*int c = myOrientation == Qt::Horizontal ? 0 : 1;
+ QList<int> il;
+ int i;
+ for ( i = c; i < myTable->rowCount(); i++ )
+ if ( myTable->isRowSelected( i, true ) )
+ il.append( i );
+ if ( il.count() > 0 ) {
+ QMemArray<int> ildel( il.count() );
+ for ( i = 0; i < il.count(); i++ )
+ ildel[ i ] = il[ i ];
+ myTable->removeRows( ildel );
+ }*/
+
+ updateButtonsState();
+}
+/*!
+ <Delete column(s)> button slot
+*/
+void VISU_TableDlg::TableWidget::delCol()
+{
+ //TODO
+ /*int c = myOrientation == Qt::Horizontal ? 1 : 0;
+ QValueList<int> il;
+ int i;
+ for ( i = c; i < myTable->numCols(); i++ )
+ if ( myTable->isColumnSelected( i, true ) )
+ il.append( i );
+ if ( il.count() > 0 ) {
+ QMemArray<int> ildel( il.count() );
+ for ( i = 0; i < il.count(); i++ )
+ ildel[ i ] = il[ i ];
+ myTable->removeColumns( ildel );
+ }*/
+ updateButtonsState();
+}
+/*!
+ <Select All> button slot
+*/
+void VISU_TableDlg::TableWidget::selectAll()
+{
+ /*myTable->clearSelection();
+ QTableSelection ts;
+ ts.init( 0, 0 ); ts.expandTo( myTable->numRows()-1, myTable->numCols()-1 );
+ myTable->addSelection( ts );*/
+ myTable->selectAll();
+ updateButtonsState();
+}
+/*!
+ <Clear> button slot
+*/
+void VISU_TableDlg::TableWidget::clearTable()
+{
+ /*int nbSel = myTable->numSelections();
+ for ( int i = 0; i < nbSel; i++ ) {
+ QTableSelection ts = myTable->selection( i );
+ for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
+ if ( myOrientation == Qt::Vertical && j == 0 ) {
+// continue; // UNITS
+ }
+ for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
+ if ( myOrientation == Qt::Horizontal && k == 0 ) {
+// continue; // UNITS
+ }
+ myTable->clearCell( j, k );
+ }
+ }
+ }
+ if ( nbSel == 0 )
+ myTable->clearCell( myTable->currentRow(), myTable->currentColumn() );
+ myTable->clearSelection();*/
+ myTable->clearContents();
+ updateButtonsState();
+}
+/*!
+ Event filter - handles titles editing
+*/
+bool VISU_TableDlg::TableWidget::eventFilter( QObject* o, QEvent* e )
+{
+ if ( e->type() == QEvent::MouseButtonDblClick) {
+ //TODO
+ /*QMouseEvent* me = ( QMouseEvent* )e;
+ if ( me->button() == Qt::LeftButton && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers ) ) {
+ if ( o == myTable->horizontalHeader() ) {
+ for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) {
+ QRect rect = myTable->horizontalHeader()->sectionRect( i );
+ rect.addCoords( 1, 1, -1, -1 );
+ if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
+ if ( myOrientation == Qt::Vertical || i != 0 ) {
+ bool bOk;
+ QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
+ tr( "TITLE_LBL" ),
+ QLineEdit::Normal,
+ myTable->horizontalHeader()->label( i ),
+ &bOk,
+ this );
+ if ( bOk && !tlt.isNull() )
+ myTable->horizontalHeader()->setLabel( i, tlt );
+ break;
+ }
+ }
+ }
+ }
+ if ( o == myTable->verticalHeader() ) {
+ for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) {
+ QRect rect = myTable->verticalHeader()->sectionRect( i );
+ rect.addCoords( 1, 1, -1, -1 );
+ if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
+ if ( myOrientation == Qt::Horizontal || i != 0 ) {
+ bool bOk;
+ QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
+ tr( "TITLE_LBL" ),
+ QLineEdit::Normal,
+ myTable->verticalHeader()->label( i ),
+ &bOk,
+ this );
+ if ( bOk && !tlt.isNull() )
+ myTable->verticalHeader()->setLabel( i, tlt );
+ break;
+ }
+ }
+ }
+ }
+ }*/
+ }
+ else if ( e->type() == QEvent::KeyRelease && o == myTable ) {
+ QKeyEvent* ke = (QKeyEvent*)e;
+ if ( ke->key() == Qt::Key_Delete && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) {
+ clearTable();
+ }
+ else if ( ke->key() == Qt::Key_Backspace && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) {
+ clearTable();
+ int i = myTable->currentRow();
+ int j = myTable->currentColumn() - 1;
+ if ( j < 0 ) { j = myTable->columnCount()-1; i--; }
+ if ( i >= 0 && j >= 0 )
+ myTable->setCurrentCell( i, j );
+ }
+ }
+ return QWidget::eventFilter( o, e );
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library 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 2.1 of the License.
+//
+// This library 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 this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : VISU_TableDlg.h
+// Author : Vadim SANDLER
+// Module : VISU
+//
+#ifndef VISU_TABLEDLG_H
+#define VISU_TABLEDLG_H
+
+#include "VISU_I.hxx"
+
+#include <SALOMEDSClient_Study.hxx>
+
+#include <QDialog>
+#include <QItemDelegate>
+#include <QMap>
+
+class QLineEdit;
+class QPushButton;
+class QCheckBox;
+class QTableWidget;
+
+namespace VISU
+{
+ class Table_i;
+}
+
+class VISU_I_EXPORT VISU_TableDlg : public QDialog
+{
+ Q_OBJECT
+
+ class TableWidget;
+ class WidgetCointainer;
+
+ enum { tcTitle, tcTable, tcControls, tcButtons };
+
+public:
+
+ enum { ttNone, ttInt, ttReal, ttAll, ttAuto };
+ enum { teNone = 0x00,
+ teAddRemove = 0x01,
+ teEditData = 0x02,
+ teRowColumn = 0x04,
+ teAll = teAddRemove | teEditData | teRowColumn
+ };
+
+ VISU_TableDlg( QWidget* parent,
+ _PTR(Study) study,
+ VISU::Table_i* table,
+ bool allowEdition = false,
+ int which = ttAuto,
+ Qt::Orientation orient = Qt::Horizontal,
+ bool showColumnTitles = true );
+ ~VISU_TableDlg();
+
+protected:
+ void keyPressEvent( QKeyEvent* e );
+
+private slots:
+ void help();
+
+private:
+ QString tableTitle( int type );
+
+private:
+ typedef QMap<int, TableWidget*> TableMap;
+ typedef QMap<int, WidgetCointainer*> ContMap;
+
+ TableMap myTableMap;
+ ContMap myContMap;
+ QCheckBox* myEditCheck;
+ QCheckBox* myUpdateCheck;
+ QPushButton* myOKBtn;
+ QPushButton* myHelpBtn;
+
+ _PTR(Study) myStudy;
+ VISU::Table_i* myTable;
+};
+
+class VISU_I_EXPORT VISU_TableDlg::TableWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ TableWidget( QWidget* parent = 0, Qt::Orientation orientation = Qt::Horizontal );
+ ~TableWidget();
+
+ void initialize( _PTR(Study) study, VISU::Table_i* table, int type );
+
+ void setTableTitle( const QString& title );
+ QString getTableTitle();
+ void setNumRows( const int num );
+ int getNumRows();
+ void setNumCols( const int num );
+ int getNumCols();
+ void setRowTitles( QStringList& tlts );
+ void getRowTitles( QStringList& tlts );
+ void setColTitles( QStringList& tlts );
+ void getColTitles( QStringList& tlts );
+ void setUnitsTitle( const QString& tlt );
+ void setUnits( QStringList& units );
+ void getUnits( QStringList& units );
+ void setRowData( int row, QStringList& data );
+ void getRowData( int row, QStringList& data );
+
+ bool eventFilter( QObject* o, QEvent* e);
+
+public slots:
+ void setEditEnabled( bool enable );
+ void showColumnTitles( bool showTitles );
+
+ void updateButtonsState();
+ void addRow();
+ void addCol();
+ void delRow();
+ void delCol();
+ void adjustTable();
+ void selectAll();
+ void clearTable();
+
+private:
+ _PTR(Study) myStudy;
+ VISU::Table_i* myTableObj;
+ _PTR(GenericAttribute) myAttr;
+ int myType;
+
+ QLineEdit* myTitleEdit;
+ QTableWidget* myTable;
+ QPushButton* myAddRowBtn;
+ QPushButton* myAddColBtn;
+ QPushButton* myDelRowBtn;
+ QPushButton* myDelColBtn;
+ QPushButton* myAdjustBtn;
+ QPushButton* mySelectAllBtn;
+ QPushButton* myClearBtn;
+ Qt::Orientation myOrientation;
+};
+
+class VISU_I_EXPORT NumDelegateItem: public QItemDelegate
+{
+public:
+ enum NumValidator{ NV_Int, NV_Real };
+
+ NumDelegateItem( QObject* parent, NumValidator mode = NV_Int );
+ virtual ~NumDelegateItem();
+
+ virtual QWidget* createEditor( QWidget* parent,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const;
+ virtual void setEditorData( QWidget* editor,
+ const QModelIndex& index ) const;
+private:
+ int myMode;
+};
+
+#endif // VISU_TABLEDLG_H
+
#include "VISU_PointMap3d_i.hh"
#include "VISU_ScalarMap_i.hh"
#include "VISU_ViewManager_i.hh"
-
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
SalomeApp_Application* myApplication;
VISU::Table_i* myTable;
- typedef VisuGUI_TableDlg* TResult;
+ typedef VISU_TableDlg* TResult;
TResult myResult;
TCreateTableViewEvent (SalomeApp_Application* theApplication,
if (SUIT_Study* aSStudy = myApplication->activeStudy()) {
if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
- _PTR(SObject) aSObject = aCStudy->FindObjectID(myTable->GetObjectEntry());
- if (aSObject) {
- myResult = new VisuGUI_TableDlg (myApplication->desktop(),
- aSObject,
- false,
- VisuGUI_TableDlg::ttAuto,
- Qt::Vertical);
- myResult->show();
- }
+ myResult = new VISU_TableDlg (myApplication->desktop(),
+ aCStudy,
+ myTable,
+ false,
+ VISU_TableDlg::ttAuto,
+ Qt::Vertical);
+ myResult->show();
}
}
}
void TableView_i::SetTitle (const char* theTitle)
{
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VisuGUI_TableDlg,const QString&,QString>
- (myView, &VisuGUI_TableDlg::setWindowTitle, QString(theTitle)));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TableDlg,const QString&,QString>
+ (myView, &VISU_TableDlg::setWindowTitle, QString(theTitle)));
}
char* TableView_i::GetTitle()
class QWidget;
-class VisuGUI_TableDlg;
+class VISU_TableDlg;
class SalomeApp_Application;
virtual void Close();
protected:
- VisuGUI_TableDlg* myView;
+ VISU_TableDlg* myView;
public:
virtual Storable* Create (VISU::Table_ptr theTable);
};