00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _SOQTVIEWER_H_
00014 #define _SOQTVIEWER_H_
00015
00016 #include <SoViewer/Qt/SoQtRenderArea.h>
00017
00018 #include <Inventor/actions/SoGetBoundingBoxAction.h>
00019
00020 class SoCamera;
00021 class SoNode;
00022 class SoSeparator;
00023 class SoDirectionalLight;
00024
00025 class SOVIEWER_API SoQtViewer : public SoQtRenderArea
00026 {
00027 Q_OBJECT
00028 public:
00029 SoQtViewer(QWidget *parent=0);
00030
00031 virtual ~SoQtViewer();
00032
00035 virtual void setCamera(SoCamera *camera);
00036
00038 SoCamera * getCamera();
00039
00041 virtual void setSceneGraph(SoNode * a_new_scene);
00042
00046 virtual void setCameraType(SoType type);
00047
00049 virtual SoNode * getSceneGraph();
00050
00052 virtual void viewAll();
00053
00058 virtual void setViewing(bool state);
00059
00062 bool isViewing() const{ return m_viewing; }
00063
00064 SbVec3f projectPoint(const SbVec2f & pt) const;
00065 void rotateCamera(const SbRotation &rot);
00066 void adjustCameraClippingPlanes();
00067 protected:
00068 virtual void soPaintEvent();
00069 virtual void soKeyPressEvent( SoKeyboardEvent * e);
00070 virtual void soMousePressEvent( SoMouseButtonEvent * e );
00071 virtual void soMouseMoveEvent( SoLocation2Event * e );
00072 virtual void soMouseReleaseEvent( SoMouseButtonEvent * e );
00073 virtual void soWheelEvent( SoWheelEvent * e );
00074 private:
00075 SoType m_cameraType;
00076 SoCamera * m_p_camera;
00077 SoSeparator * m_p_rootGraph;
00078 SoNode * m_p_sceneGraph;
00079 SoDirectionalLight * m_p_directionalLight;
00080
00081 SbVec2f m_startDrag;
00082 bool m_viewing;
00083
00084 SoMouseButtonEvent::Button m_mouseButton;
00085 };
00086
00087 #endif