X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNewGeom%2FNewGeom_SalomeViewer.h;h=8012c4a015c25ad59a452ee9fe598ba28bc30ca3;hb=a63f4aea8cf064bae8339c926584316f218d98d5;hp=0377ce7e06d17ed86a351dc1cd22a6b271d40b8e;hpb=72cb66f9c09b0f8fa224f6f8ab43548658015b49;p=modules%2Fshaper.git diff --git a/src/NewGeom/NewGeom_SalomeViewer.h b/src/NewGeom/NewGeom_SalomeViewer.h index 0377ce7e0..8012c4a01 100644 --- a/src/NewGeom/NewGeom_SalomeViewer.h +++ b/src/NewGeom/NewGeom_SalomeViewer.h @@ -9,6 +9,8 @@ #include #include +#include + #include class SUIT_ViewWindow; @@ -20,6 +22,7 @@ class OCCViewer_Viewer; class SUIT_ViewManager; /** +* \ingroup Salome * A class for providing access of NewGeom functionality to * SALOME view window functionality */ @@ -28,20 +31,32 @@ class NewGeom_SalomeView: public ModuleBase_IViewWindow public: /// Constructor /// \param theViewer a reference to a viewer - NewGeom_SalomeView(OCCViewer_Viewer* theViewer) { myViewer = theViewer; } + NewGeom_SalomeView(OCCViewer_Viewer* theViewer); virtual Handle(V3d_View) v3dView() const; + /// Returns the view window view port + virtual QWidget* viewPort() const; + + /// Set the current viewer + /// \param theViewer a viewer instance void setViewer(OCCViewer_Viewer* theViewer) { myViewer = theViewer; } + + /// Returns current viewer OCCViewer_Viewer* viewer() const { return myViewer; } + /// Sets the current view + void setCurrentView(SUIT_ViewWindow* theView) { myCurrentView = theView; } + private: /// A reference to a viewer OCCViewer_Viewer* myViewer; + SUIT_ViewWindow* myCurrentView; }; /** +* \ingroup Salome * A class for providing access of NewGeom functionality to * SALOME viewer functionality */ @@ -85,6 +100,8 @@ Q_OBJECT /// \param theZ the Z projection value virtual void setViewProjection(double theX, double theY, double theZ); + /// Set selector + /// \param theSel a selector instance void setSelector(NewGeom_OCCSelector* theSel); /// Add selection filter to the viewer @@ -96,6 +113,7 @@ Q_OBJECT /// Remove all selection filters from the viewer virtual void clearSelectionFilters(); + /// Returns current selector NewGeom_OCCSelector* selector() const { return mySelector; @@ -104,6 +122,16 @@ Q_OBJECT /// Update current viewer virtual void update(); + /// Method returns True if the viewer can process editing objects + /// by mouse drugging. If this is impossible thet it has to return False. + virtual bool canDragByMouse() const; + + /// Activate or deactivate viewer + /// \param toActivate - activation flag + void activateViewer(bool toActivate); + + // Fit all along Z (perpendicular to display) + virtual void Zfitall(); private slots: void onMousePress(SUIT_ViewWindow*, QMouseEvent*); @@ -119,6 +147,7 @@ Q_OBJECT void onActivated(SUIT_ViewWindow*); void onSelectionChanged(); + void onViewTransformed(OCCViewer_ViewWindow::OperationType); private: NewGeom_OCCSelector* mySelector;