1 // File : OCCViewer_Viewer3d.h
2 // Created : Wed Mar 20 11:00:02 2002
3 // Author : Nicolas REJNERI
6 // Copyright : Open CASCADE 2002
10 #ifndef OCCVIEWER_VIEWER3D_H
11 #define OCCVIEWER_VIEWER3D_H
13 #include "OCCViewer_ViewFrame.h"
14 #include "OCCViewer_AISSelector.h"
17 #include "QAD_Popup.h"
18 #include "QAD_ViewFrame.h"
19 #include "SALOME_InteractiveObject.hxx"
21 // Open CASCADE Includes
22 #include <AIS_InteractiveContext.hxx>
23 #include <AIS_Trihedron.hxx>
25 class QAD_EXPORT OCCViewer_Viewer3d : public QObject, public QAD_PopupClientServer
30 OCCViewer_Viewer3d(OCCViewer_ViewFrame* vf);
31 ~OCCViewer_Viewer3d();
34 void vwKeyPress( QKeyEvent* );
35 void vwKeyRelease( QKeyEvent* );
36 void vwDrawExternal( QPainter* );
39 void onKeyPress(QKeyEvent*);
41 void onMouseMove(QMouseEvent*);
42 void onMousePress(QMouseEvent*);
43 void onMouseRelease(QMouseEvent*);
44 void onMouseDoubleClick(QMouseEvent*);
46 void onSelectionDone( bool bAdded );
47 void onSelectionCancel( bool bAdded );
49 void onTransformationStarted( OCCViewer_ViewPort::OperationType );
50 void onTransformationFinished( OCCViewer_ViewPort::OperationType );
53 void vw3dSelectionDone (bool added);
54 void vw3dSelectionCancel();
55 void vw3dSelectionEnabled( bool );
58 void createViewer3d();
59 Handle(V3d_Viewer) getViewer3d() const;
61 void setTrihedronSize(float size);
62 bool isTrihedronDisplayed();
64 /* popup management */
67 void setCursor( const QCursor& cursor);
68 const QCursor& cursor() const;
69 void setIcon( const QPixmap& icon);
70 const QPixmap& icon() const;
71 void setBackgroundColor( const QColor& aColor);
72 const QColor& backgroundColor() const;
74 /* Selection management */
75 bool highlight( const Handle(SALOME_InteractiveObject)& IObject,
76 bool highlight, bool update=true);
77 bool unHighlightAll();
78 bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject,
79 bool onlyInViewer = false );
80 bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
81 void rename( const Handle(SALOME_InteractiveObject)& IObject,
84 bool enabledSelection() const;
85 void enableSelection( bool );
86 void enableMultipleSelection( bool );
88 void SetColor(const Handle(SALOME_InteractiveObject)& IObject,
90 void SwitchRepresentation(const Handle(SALOME_InteractiveObject)& IObject,
92 void SetTransparency(const Handle(SALOME_InteractiveObject)& IObject,
95 /* interactive context */
96 Handle (AIS_InteractiveContext) getAISContext() const;
97 OCCViewer_AISSelector* getAISSelector() const;
100 Handle(AIS_Trihedron) getTrihedron() const;
103 bool eventFilter( QObject *, QEvent * );
106 OCCViewer_ViewFrame* myViewFrame;
108 Handle (AIS_InteractiveContext) myAISContext;
109 OCCViewer_AISSelector* myAISSelector;
110 bool myEnableSelection;
111 Handle(AIS_Trihedron) myTrihedron;
112 Handle(V3d_Viewer) myV3dViewer;
113 Handle(V3d_Viewer) myV3dCollector;
115 /* attributes for all the views */
116 QPixmap myIcon; /* icon */
117 QCursor myCursor; /* current cursor */
118 QColor myBackColor; /* background */