- Q_OBJECT ;
- friend class SVTK_ViewWindow;
-public:
-
- static SVTK_RenderWindowInteractor *New() ;
-
- vtkTypeMacro(SVTK_RenderWindowInteractor,vtkRenderWindowInteractor);
-
- // Description:
- // Initializes the event handlers without an XtAppContext. This is
- // good for when you don`t have a user interface, but you still
- // want to have mouse interaction.
- virtual void Initialize();
-
- virtual void SetInteractorStyle(vtkInteractorObserver *);
- SVTK_InteractorStyle* GetSInteractorStyle(){ return myInteractorStyle;}
-
- // Description:
- // This will start up the X event loop and never return. If you
- // call this method it will loop processing X events until the
- // application is exited.
- virtual void Start();
-
- // Description:
- // Event loop notification member for Window size change
- virtual void UpdateSize(int x,int y);
-
- // Description:
- // Timer methods must be overridden by platform dependent subclasses.
- // flag is passed to indicate if this is first timer set or an update
- // as Win32 uses repeating timers, whereas X uses One shot more timer
- // if flag==VTKXI_TIMER_FIRST Win32 and X should createtimer
- // otherwise Win32 should exit and X should perform AddTimeOut()
- virtual int CreateTimer(int ) ;
- virtual int DestroyTimer() ;
-
- /* Selection Management */
- bool highlightCell(const TColStd_IndexedMapOfInteger& MapIndex,
- SALOME_Actor* theMapActor,
- bool hilight,
- bool update = true );
- bool highlightEdge(const TColStd_IndexedMapOfInteger& MapIndex,
- SALOME_Actor* theMapActor,
- bool hilight,
- bool update = true );
- bool highlightPoint(const TColStd_IndexedMapOfInteger& MapIndex,
- SALOME_Actor* theMapActor,
- bool hilight,
- bool update = true );
- bool highlight(const Handle(SALOME_InteractiveObject)& IObject,
- bool hiligth,
- bool immediatly = true );
- void unHighlightSubSelection();
- bool unHighlightAll();
-
- bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject);
- bool isVisible( const Handle(SALOME_InteractiveObject)& IObject);
- void rename(const Handle(SALOME_InteractiveObject)& IObject, QString newName);
-
- void SetSelectionMode(Selection_Mode mode);
- void SetSelectionProp(const double& theRed = 1,
- const double& theGreen = 1,
- const double& theBlue = 0,
- const int& theWidth = 5);
- void SetSelectionTolerance(const double& theTolNodes = 0.025,
- const double& theTolCell = 0.001);
-
- // Displaymode management
- int GetDisplayMode();
- void SetDisplayMode(int);
-
- // Switch representation wireframe/shading
- void SetDisplayMode(const Handle(SALOME_InteractiveObject)& IObject, int theMode);
-
- // Change all actors to wireframe or surface
- void ChangeRepresentationToWireframe();
- void ChangeRepresentationToSurface();
-
- // Change to wireframe or surface a list of vtkactor
- void ChangeRepresentationToWireframe(vtkActorCollection* ListofActors);
- void ChangeRepresentationToSurface(vtkActorCollection* ListofActors);
-
- // Erase Display functions
- void EraseAll();
- void DisplayAll();
- void RemoveAll( const bool immediatly );
- void Erase(const Handle(SALOME_InteractiveObject)& IObject,
- bool immediatly=true);
- void Remove(const Handle(SALOME_InteractiveObject)& IObject,
- bool immediatly=true);
- void Display(const Handle(SALOME_InteractiveObject)& IObject,
- bool immediatly=true);
-
- void Display( SALOME_Actor* SActor,
- bool immediatly = true );
- void Erase( SALOME_Actor* SActor,
- bool immediatly = true );
- void Remove( SALOME_Actor* SActor,
- bool updateViewer = true );
-
- // Transparency
- void SetTransparency(const Handle(SALOME_InteractiveObject)& IObject,
- float trans);
- float GetTransparency(const Handle(SALOME_InteractiveObject)& IObject);
-
- // Color
- void SetColor(const Handle(SALOME_InteractiveObject)& IObject,
- QColor thecolor);
- QColor GetColor(const Handle(SALOME_InteractiveObject)& IObject);
-
- void Update();
-
- vtkRenderer* GetRenderer();
-
- void setGUIWindow(QWidget* theWindow);
-
- void setViewWindow(SVTK_ViewWindow* theViewWindow);
-
- void setCellData(const int& theIndex,
- SALOME_Actor* theMapActor,
- SVTK_Actor* theActor);
- void setEdgeData(const int& theCellIndex,
- SALOME_Actor* theMapActor,
- const int& theEdgeIndex,
- SVTK_Actor* theActor ); //NB
- void setPointData(const int& theIndex,
- SALOME_Actor* theMapActor,
- SVTK_Actor* theActor);
-
- typedef void (*TUpdateActor)(const TColStd_IndexedMapOfInteger& theMapIndex,
- SALOME_Actor* theMapActor,
- SVTK_Actor* theActor);
- protected: