SoWxViewer.h

Go to the documentation of this file.
00001 /*
00002 _______________________________________________________________________
00003 __________________________ G E O M E T R Y ____________________________
00004 |
00005 | THIS FILE IS PART OF THE SOVIEWER LIBRARY.
00006 | USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     
00007 | GOVERNED BY A BSD-STYLE SOURCE LICENSE.
00008 | PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       
00009 _______________________________________________________________________
00010 _______________________________________________________________________
00011 */
00012 
00013 #ifndef _SOWXVIEWER_H_
00014 #define _SOWXVIEWER_H_
00015 
00016 #include "SoWxRenderArea.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 SoWxViewer : public SoWxRenderArea
00026 {
00027 public:
00028     SoWxViewer(wxWindow *parent, wxWindowID id = wxID_ANY,
00029         const wxPoint& pos = wxDefaultPosition,
00030         const wxSize& size = wxDefaultSize, long style = 0,
00031         const wxString& name = wxT("SoWxRenderArea"));
00032 
00033     virtual ~SoWxViewer();
00034 
00037     virtual void setCamera(SoCamera *camera);
00038 
00040     SoCamera * getCamera();
00041 
00043     virtual void setSceneGraph(SoNode * a_new_scene);
00044 
00048     virtual void setCameraType(SoType type);
00049 
00051     virtual SoNode * getSceneGraph();
00052 
00054     virtual void viewAll();
00055 
00060     virtual void setViewing(bool state);
00061 
00064     bool isViewing() const{ return m_viewing; }
00065 
00066     SbVec3f projectPoint(const SbVec2f & pt) const;
00067     void rotateCamera(const SbRotation &rot);
00068     void adjustCameraClippingPlanes();
00069 protected:
00070     virtual void soPaintEvent();
00071     virtual void soKeyPressEvent( SoKeyboardEvent * e);
00072     virtual void soMousePressEvent( SoMouseButtonEvent * e );
00073     virtual void soMouseMoveEvent( SoLocation2Event * e );
00074     virtual void soMouseReleaseEvent( SoMouseButtonEvent * e );
00075     virtual void soWheelEvent( SoWheelEvent * e );
00076 private:
00077     SoType               m_cameraType;
00078     SoCamera           * m_p_camera;
00079     SoSeparator        * m_p_rootGraph;
00080     SoNode             * m_p_sceneGraph;
00081     SoDirectionalLight * m_p_directionalLight;
00082 
00083     SbVec2f              m_startDrag;
00084     bool                                 m_viewing;
00085 
00086     SoMouseButtonEvent::Button m_mouseButton;
00087 };
00088 
00089 #endif

Generated on Thu May 8 14:30:09 2008 for OpenInventorViewer by  doxygen 1.5.1