myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() );
myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() );
#endif
+#ifndef DISABLE_PLOT2DKVIEWER
+ myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::PanDown, CTRL+Key_Down, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::ZoomIn, CTRL+Key_Plus, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::ZoomOut, CTRL+Key_Minus, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::ZoomFit, CTRL+Key_Asterisk, Plot2d_Viewer::Type() );
+#endif
connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
SPlot2d.h \
SPlot2d_Curve.h \
SPlot2d_Prs.h \
- SPlot2d_ViewModel.h
+ SPlot2d_ViewModel.h \
+ SPlot2d_ViewWindow.h
# .po files to transform in .qm
PO_FILES = SPlot2d_msg_en.po
LIB_SRC = \
SPlot2d_Curve.cxx \
SPlot2d_Prs.cxx \
- SPlot2d_ViewModel.cxx
+ SPlot2d_ViewModel.cxx \
+ SPlot2d_ViewWindow.cxx
LIB_MOC = \
- SPlot2d_ViewModel.h
+ SPlot2d_ViewModel.h \
+ SPlot2d_ViewWindow.h
CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(QWT_INCLUDES) $(BOOST_CPPFLAGS)
LDFLAGS+=$(QT_MT_LIBS) $(QWT_LIBS) -lsuit -lPlot2d -lSalomePrs
#include "SPlot2d_ViewModel.h"
+#include "SPlot2d_ViewWindow.h"
+
#include "SPlot2d_Prs.h"
#include "SUIT_Session.h"
#include "SUIT_Application.h"
newVF->displayCurve( *anIt, false );
newVF->Repaint();
}
+
+/*!
+ create SPlot2d_ViewWindow
+*/
+SUIT_ViewWindow* SPlot2d_Viewer::createView( SUIT_Desktop* theDesktop )
+{
+ SPlot2d_ViewWindow* aPlot2dView = new SPlot2d_ViewWindow(theDesktop, this);
+ if (getPrs())
+ aPlot2dView->getViewFrame()->Display(getPrs());
+ return aPlot2dView;
+}
void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
+
+ virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
/* display */
void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// 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
+//
+#include "SPlot2d_ViewWindow.h"
+
+#include "Plot2d_ViewFrame.h"
+
+#include "SUIT_Accel.h"
+
+/*!
+ Constructor
+*/
+SPlot2d_ViewWindow
+::SPlot2d_ViewWindow( SUIT_Desktop* theDesktop,
+ Plot2d_Viewer* theModel)
+ : Plot2d_ViewWindow( theDesktop, theModel )
+{
+}
+
+/*!
+ Destructor
+*/
+SPlot2d_ViewWindow
+::~SPlot2d_ViewWindow()
+{
+}
+
+/*!
+ Performs action
+ \param theAction - type of action
+*/
+bool
+SPlot2d_ViewWindow
+::action( const int theAction )
+{
+ switch ( theAction ) {
+ case SUIT_Accel::PanLeft:
+ getViewFrame()->onPanLeft();
+ break;
+ case SUIT_Accel::PanRight:
+ getViewFrame()->onPanRight();
+ break;
+ case SUIT_Accel::PanUp:
+ getViewFrame()->onPanUp();
+ break;
+ case SUIT_Accel::PanDown:
+ getViewFrame()->onPanDown();
+ break;
+ case SUIT_Accel::ZoomIn:
+ getViewFrame()->onZoomIn();
+ break;
+ case SUIT_Accel::ZoomOut:
+ getViewFrame()->onZoomOut();
+ break;
+ case SUIT_Accel::ZoomFit:
+ getViewFrame()->fitAll();
+ break;
+ }
+ return true;
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// 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
+//
+#ifndef SPLOT2D_VIEWWINDOW_H
+#define SPLOT2D_VIEWWINDOW_H
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+#include "SPlot2d.h"
+#include "Plot2d_ViewWindow.h"
+
+class SPLOT2D_EXPORT SPlot2d_ViewWindow : public Plot2d_ViewWindow
+{
+ Q_OBJECT;
+
+public:
+ SPlot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* );
+ virtual ~SPlot2d_ViewWindow();
+
+protected:
+ virtual bool action( const int );
+
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif