00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkView_h
00012 #define __mitkView_h
00013
00014 #include "mitkGLWindow.h"
00015 #include "mitkScene.h"
00016
00041 class MITK_VISUALIZATION_API mitkView : public mitkObject
00042 {
00043 public:
00044 MITK_TYPE(mitkView, mitkObject)
00045
00046 virtual void PrintSelf(ostream& os);
00047
00048 mitkView();
00049
00054 void* GetWindowId() { return m_Window->GetWindowId();}
00055
00060 void* GetParent() {return m_Window->GetParent();}
00061
00066 void* GetApplicationId() {return m_Window->GetApplicationId();}
00067
00072 void* GetDeviceContext() {return m_Window->GetDeviceContext();}
00073
00078 void* GetRenderContext() {return m_Window->GetRenderContext();}
00079
00087 void SetParent(void *parentId) { m_Window->SetParent(parentId);}
00088
00094 const int *GetPosition() {return m_Window->GetPosition();}
00095
00100 int GetLeft() {return m_Window->GetLeft();}
00101
00106 int GetTop() {return m_Window->GetTop();}
00107
00113 void SetPosition(int leftPos,int topPos) { m_Window->SetPosition(leftPos,topPos);}
00114
00120 void SetPosition(int a[2]) { m_Window->SetPosition(a);}
00121
00126 void SetLeft(int leftPos) { m_Window->SetLeft(leftPos); }
00127
00132 void SetTop(int topPos) { m_Window->SetTop(topPos); }
00133
00137 int GetTitleBar() { return m_Window->GetTitleBar(); }
00138
00142 void SetTitleBar(int titleBar) { m_Window->SetTitleBar(titleBar);}
00143
00147 void SetTitleBarOn() { m_Window->SetTitleBarOn();}
00148
00152 void SetTitleBarOff() { m_Window->SetTitleBarOff();}
00153
00159 const int *GetSize() { return m_Window->GetSize();}
00160
00165 int GetWidth() { return m_Window->GetWidth();}
00166
00171 int GetHeight() { return m_Window->GetHeight();}
00172
00178 void SetSize(int widthSize, int heightSize) { m_Window->SetSize(widthSize,heightSize); }
00179
00185 void SetSize(int a[2]) { m_Window->SetSize(a); }
00186
00191 void SetWidth(int widthSize) { m_Window->SetWidth(widthSize); }
00192
00197 void SetHeight(int heightSize) { m_Window->SetHeight(heightSize); }
00198
00208 const int * GetViewPort() { return m_Scene->GetViewPort(); }
00209
00220 void GetViewPort(int vp[4]) { m_Scene->GetViewPort(vp);}
00221
00225 const char *GetWindowName() { return m_Window->GetWindowName(); }
00226
00230 void SetWindowName(const char * winName) {m_Window->SetWindowName(winName); }
00231
00236 void Show() { m_Window->Show(); }
00237
00241 void Hide() { m_Window->Show(); }
00242
00246 void Update() { m_Window->Update(); }
00247
00251 void MakeCurrent() { m_Window->MakeCurrent(); }
00252
00256 void SwapBuffers() { m_Window->SwapBuffers(); }
00257
00267 void SetBackColor(unsigned char rColor, unsigned char gColor, unsigned char bColor)
00268 {
00269 m_Scene->SetBackColor(rColor,gColor,bColor);
00270 }
00280 void SetBackColor(float rColor, float gColor, float bColor)
00281 {
00282 m_Scene->SetBackColor(rColor,gColor,bColor);
00283 }
00293 void SetBackColor(int rColor, int gColor, int bColor)
00294 {
00295 m_Scene->SetBackColor(rColor,gColor,bColor);
00296 }
00306 void GetBackColor(float &rColor, float &gColor, float &bColor)
00307 {
00308 m_Scene->GetBackColor(rColor,gColor,bColor);
00309 }
00319 void GetBackColor(unsigned char &rColor, unsigned char &gColor, unsigned char &bColor)
00320 {
00321 m_Scene->GetBackColor(rColor,gColor,bColor);
00322 }
00332 void GetBackColor(int &rColor, int &gColor, int &bColor)
00333 {
00334 m_Scene->GetBackColor(rColor,gColor,bColor);
00335 }
00339 void ResetScene()
00340 {
00341 m_Scene->ResetScene();
00342 }
00349 void Translate(float deltX, float deltY, float deltZ)
00350 {
00351 m_Scene->Translate(deltX,deltY,deltZ);
00352 }
00360 void Rotate(float deltX, float deltY, float deltZ)
00361 {
00362 m_Scene->Rotate(deltX,deltY,deltZ);
00363 }
00372 void Rotate(float ax, float ay, float az, float angle)
00373 {
00374 m_Scene->Rotate(ax,ay,az,angle);
00375 }
00381 void Rotate(const mitkQuaternion &q)
00382 {
00383 m_Scene->Rotate(q);
00384 }
00391 void SetRotation(float x, float y, float z)
00392 {
00393 m_Scene->SetRotation(x,y,z);
00394 }
00395
00403 void SetRotation(float ax, float ay, float az, float angle)
00404 {
00405 m_Scene->SetRotation(ax,ay,az,angle);
00406 }
00411 void SetRotation(const mitkQuaternion &q)
00412 {
00413 m_Scene->SetRotation(q);
00414 }
00420 void Scale(float delt)
00421 {
00422 m_Scene->Scale(delt);
00423 }
00424
00429 mitkManipulator* CreateManipulator();
00430
00437 void SetManipulator(mitkManipulator *mani);
00438
00451 void AddModel(mitkModel *model) { m_Scene->AddModel(model);}
00452
00459 void RemoveModel(mitkModel *model) {m_Scene->RemoveModel(model);}
00460
00465 void RemoveModel(int i) { m_Scene->RemoveModel(i);}
00466
00470 void RemoveAllModels() { m_Scene->RemoveAllModels();}
00471
00475 void RemoveAllModel() { this->RemoveAllModels(); }
00476
00482 mitkModel* GetModel(int i) { return m_Scene->GetModel(i);}
00483
00489 mitkList* GetModels() { return m_Scene->GetModels();}
00490
00495 int GetModelCount() { return m_Scene->GetModelCount();}
00496
00500 int GetNumberOfPropsRendered() { return m_Scene->GetNumberOfPropsRendered();}
00501
00506 void SetCamera(mitkCamera *cam) { m_Scene->SetCamera(cam);}
00507
00512 mitkCamera* GetCamera() { return m_Scene->GetCamera();}
00513
00520 void SetDefaultLight(mitkLight *lit) { m_Scene->SetDefaultLight(lit);}
00521
00528 mitkLight* GetDefaultLight() { return m_Scene->GetDefaultLight();}
00529
00533 mitkLight* GetLight() { return this->GetDefaultLight(); }
00534
00540 void AddAdditionalLight(mitkLight *lit) { m_Scene->AddAdditionalLight(lit);}
00541
00546 void RemoveAdditionalLight(int idx) { m_Scene->RemoveAdditionalLight(idx);}
00547
00554 void RemoveAdditionalLight(mitkLight *lit) { m_Scene->RemoveAdditionalLight(lit);}
00555
00559 void RemoveAllAdditionalLights() { m_Scene->RemoveAllAdditionalLights();}
00560
00565 int GetAdditionalLightCount() { return m_Scene->GetAdditionalLightCount();}
00566
00571 mitkLight* GetAdditionalLight(int idx) { return m_Scene->GetAdditionalLight(idx);}
00572
00576 void AlignScene() { m_Scene->AlignScene();}
00577
00588 float* GetZbufferData(int x1, int y1, int x2, int y2)
00589 {
00590 return m_Scene->GetZbufferData(x1,y1,x2,y2);
00591 }
00592
00607 void GetZbufferData(int x1, int y1, int x2, int y2, float *buffer)
00608 {
00609 m_Scene->GetZbufferData(x1,y1,x2,y2,buffer);
00610 }
00611
00623 unsigned char* GetPixelData(int xOffset, int yOffset, int width, int height)
00624 {
00625 return m_Scene->GetPixelData(xOffset,yOffset,width,height);
00626 }
00627
00649 void GetPixelData(int xOffset, int yOffset, int width, int height, unsigned char *buffer, int packAlignment = 4, bool swapRGB = false)
00650 { this->GetPixelData24(xOffset, yOffset, width, height, buffer, packAlignment, swapRGB); }
00651
00671 void GetPixelData24(int xOffset, int yOffset, int width, int height, unsigned char *buffer, int packAlignment = 4, bool swapRGB = false)
00672 {
00673 m_Scene->GetPixelData24(xOffset,yOffset,width,height,buffer,packAlignment,swapRGB);
00674 }
00675
00690 void GetPixelData32(int xOffset, int yOffset, int width, int height, unsigned char *buffer, bool swapRGB = false)
00691 {
00692 m_Scene->GetPixelData32(xOffset,yOffset,width,height,buffer,swapRGB);
00693 }
00694
00701 void SetSelected(bool isSelected)
00702 {
00703 m_Scene->SetSelected(isSelected);
00704 }
00705
00712 bool GetSelected() { return m_Scene->GetSelected();}
00713
00717 float GetTranslateSpeed() { return m_Scene->GetTranslateSpeed();}
00718
00724 float GetTranslationX() { return m_Scene->GetTranslationX();}
00725
00731 float GetTranslationY() { return m_Scene->GetTranslationY(); }
00732
00738 float GetTranslationZ() { return m_Scene->GetTranslationZ(); }
00739
00747 void GetTranslation(float trans[3])
00748 {
00749 m_Scene->GetTranslation(trans);
00750 }
00751
00756 const mitkQuaternion& GetRotation() { return m_Scene->GetRotation(); }
00757
00762 float GetScale() { return m_Scene->GetScale(); }
00763
00771 bool HasUnprocessedMouseMessage() { return m_Window->HasUnprocessedMouseMessage(); }
00772
00778 void EnableLoD() { m_Scene->EnableLoD();}
00779
00785 void DisableLoD() { m_Scene->DisableLoD();}
00786
00791 bool IsLoDEnabled() { return m_Scene->IsLoDEnabled();}
00792
00797 double GetFrameSpeed() { return m_Window->GetFrameSpeed(); }
00798
00803 double GetRenderTime() { return m_Window->GetRenderTime(); }
00804
00810 void EnableCalculateFrameSpeed() { m_Window->EnableCalculateFrameSpeed(); }
00811
00817 void DisableCalculateFrameSpeed() { m_Window->DisableCalculateFrameSpeed(); }
00818
00823 bool IsModelsModified()
00824 {
00825 return m_Scene->IsModelsModified();
00826 }
00827
00832 bool IsCameraModified()
00833 {
00834 return m_Scene->IsCameraModified();
00835 }
00836
00841 bool IsAdditionalLightModified()
00842 {
00843 return m_Scene->IsAdditionalLightModified();
00844 }
00845
00850 mitkScene* GetScene() {return m_Scene;}
00851
00852 protected:
00853 virtual ~mitkView();
00854
00855 mitkRCPtr<mitkGLWindow> m_Window;
00856 mitkScene* m_Scene;
00857
00858 private:
00859 mitkView(const mitkView&);
00860 void operator=(const mitkView&);
00861 };
00862
00863
00864
00865
00866
00867
00868 #endif
00869
00870