Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkSceneBase.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
00007 
00008 =========================================================================*/
00009 
00010 #ifndef __mitkSceneBase_h
00011 #define __mitkSceneBase_h
00012 
00013 #include "mitkSceneContainer.h"
00014 
00022 class MITK_VISUALIZATION_API mitkSceneBase : public mitkObject
00023 {
00024 public:
00025     MITK_TYPE(mitkSceneBase,mitkObject)
00026     mitkSceneBase();
00027     mitkSceneBase(mitkSceneContainer* container);
00028     void SetContainer(mitkSceneContainer* container) { m_Container=container;}
00029     mitkSceneContainer* GetContainer() { return m_Container; }
00030 protected:
00031     virtual ~mitkSceneBase();
00032 public:
00036     void* GetWindowId() {if (m_Container) return m_Container->GetWindowId(); else return NULL;}
00040     const int* GetSize() {if (m_Container) return m_Container->GetSize(); else return NULL;}
00044     int GetWidth() {if (m_Container) return m_Container->GetWidth(); else return -1;}
00048     int GetHeight() {if (m_Container) return m_Container->GetHeight(); else return -1;}
00052     void Update() {if (m_Container) m_Container->Update();}
00056     void MakeCurrent() { if (m_Container) m_Container->MakeCurrent();}
00060     void SwapBuffers() {if (m_Container) m_Container->SwapBuffers();}
00065     bool HasUnprocessedMouseMessage() {if (m_Container) return m_Container->HasUnprocessedMouseMessage(); else return false;}
00066 // Scene Functions
00070     virtual void InitGL(){};
00074     virtual void DestroyGL(){};
00078     virtual void ResizeGL(int newX, int newY){};
00082     virtual void RenderGL(){};
00086     virtual void OnMouseDown(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos){};
00090     virtual void OnMouseUp(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos){};
00094     virtual void OnMouseMove(bool ctrlDown, bool shiftDown, int xPos, int yPos){};
00098     virtual void OnMouseWheel(bool ctrlDown, bool shiftDown, int xPos, int yPos, int delta){};
00099 
00100 protected:
00101     mitkSceneContainer* m_Container;
00102 
00103 private:
00104     mitkSceneBase(const mitkSceneBase&);
00105     void operator = (const mitkSceneBase&);
00106 };
00107 
00108 
00109 #endif

Generated on Tue Feb 25 15:00:37 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3