X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_ViewPort.h;h=8ce7a246979b9540b8a1dd568ee4e65fe114ed66;hb=26ac7ca874ce9a796ff7ad43685f42afca635df9;hp=5c60ad502c5a9a2e6ccc1a041eb53f4d09e1c9af;hpb=232b55569765049c7d1cceb5096a45f8584c9369;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_ViewPort.h b/src/OCCViewer/OCCViewer_ViewPort.h index 5c60ad502..8ce7a2469 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.h +++ b/src/OCCViewer/OCCViewer_ViewPort.h @@ -1,21 +1,25 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2007-2016 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// 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 +// 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/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef OCCVIEWER_VIEWPORT_H #define OCCVIEWER_VIEWPORT_H @@ -23,88 +27,100 @@ #include "QtxAction.h" -#include -#include -#include +#include +#include #include +class QColor; class QRect; -class QCursor; class QPainter; class OCCViewer_ViewSketcher; -class OCCViewer_ViewTransformer; +#ifdef WIN32 +#pragma warning ( disable:4251 ) +#endif + +/*! + \class OCCViewer_ViewPort + Visualisation canvas of SUIT-based application +*/ class OCCVIEWER_EXPORT OCCViewer_ViewPort : public QWidget { - Q_OBJECT + Q_OBJECT friend class OCCViewer_ViewSketcher; public: OCCViewer_ViewPort( QWidget* parent ); - virtual ~OCCViewer_ViewPort(); + virtual ~OCCViewer_ViewPort(); public: - void setSketchingEnabled( bool ); + void setSketchingEnabled( bool ); bool isSketchingEnabled() const; - void setTransformEnabled( bool ); + void setTransformEnabled( bool ); bool isTransformEnabled() const; - virtual QColor backgroundColor() const; - virtual void setBackgroundColor( const QColor& ); + virtual QColor backgroundColor() const; + virtual void setBackgroundColor( const QColor& ); + + void redrawPainters(); - void redrawPainters(); + virtual void onUpdate(); - virtual void onUpdate(); + virtual QPaintEngine* paintEngine() const; protected: -// enum ViewType { Type2D, Type3D }; - void selectVisualId(); +// enum ViewType { Type2D, Type3D }; + void selectVisualId(); // EVENTS - virtual void paintEvent( QPaintEvent *); - virtual void mouseMoveEvent( QMouseEvent *); - virtual void mouseReleaseEvent( QMouseEvent *); - virtual void mousePressEvent( QMouseEvent *); - virtual void mouseDoubleClickEvent( QMouseEvent *); - virtual void keyPressEvent( QKeyEvent *); - virtual void keyReleaseEvent( QKeyEvent *); + virtual void paintEvent( QPaintEvent *); + virtual void mouseMoveEvent( QMouseEvent *); + virtual void mouseReleaseEvent( QMouseEvent *); + virtual void mousePressEvent( QMouseEvent *); + virtual void mouseDoubleClickEvent( QMouseEvent *); + virtual void keyPressEvent( QKeyEvent *); + virtual void keyReleaseEvent( QKeyEvent *); // TO BE REDEFINED - virtual void reset() = 0; - virtual void pan( int, int ) = 0; - virtual void setCenter( int, int ) = 0; - virtual void fitRect( const QRect& ) = 0; - virtual void zoom( int, int, int, int ) = 0; - virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0; + virtual void reset() = 0; + virtual void pan( int, int ) = 0; + virtual void setCenter( int, int ) = 0; + virtual void fitRect( const QRect& ) = 0; + virtual void zoom( int, int, int, int ) = 0; + virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0; -// POPUP -// void onCreatePopup( QPopupMenu* ); -// void onDestroyPopup( QPopupMenu* ); +public slots: + virtual bool synchronize( OCCViewer_ViewPort* ); protected slots: - virtual void onChangeBgColor(); + virtual void onChangeBackground(); signals: - void vpKeyEvent( QKeyEvent* ); - void vpMouseEvent( QMouseEvent* ); - void vpDrawExternal( QPainter* ); + void vpKeyEvent( QKeyEvent* ); + void vpMouseEvent( QMouseEvent* ); + void vpDrawExternal( QPainter* ); void vpChangeBGColor( QColor ); + void vpTransformed( OCCViewer_ViewPort* ); private: - void initialize(); - void cleanup(); + void initialize(); + void cleanup(); protected: - Handle(Aspect_Window) myWindow; - bool myEnableSketching; - bool myEnableTransform; - bool myPaintersRedrawing; /* set to draw externally */ - QPtrList myPopupActions; - + Handle(Aspect_Window) myWindow; + bool myEnableSketching; + bool myEnableTransform; + bool myPaintersRedrawing; /* set to draw externally */ + QList myPopupActions; + private: - static int nCounter; /* objects counter */ + static int nCounter; /* objects counter */ }; +#ifdef WIN32 +#pragma warning ( default:4251 ) +#endif + #endif