Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuBasicSubWindow.cpp

Go to the documentation of this file.
00001 #include "vuBasicSubWindow.h"
00002 #include <math.h>
00003 #include "vuLinAlg/vuMatrix.h"
00004 #include "vuLinAlg/vuSpherical.h"
00005 
00006 //----------------------------------------------------------------------------
00007 //------------------------- vuPrewviewWin implementation ---------------------
00008 //----------------------------------------------------------------------------
00009 
00010 BEGIN_EVENT_TABLE(vuBasicSubWindow, vuGLCanvas)
00011   EVT_MOUSE_EVENTS(vuBasicSubWindow::glOnMouse)
00012 END_EVENT_TABLE()
00013 
00014 vuBasicSubWindow::vuBasicSubWindow(vuBasicUtility *parent,int Xsize,int Ysize)
00015   : vuGLCanvas(parent,-1,wxPoint(0,0),wxSize(Xsize, Ysize)), m_Parent(parent) 
00016 {
00017   m_Volume = NULL;
00018 }
00019 
00020 vuBasicSubWindow::~vuBasicSubWindow()
00021 {
00022 }
00023 
00024 void vuBasicSubWindow::setVolume(vuVolume* vol)
00025 {
00026   m_Volume = vol;
00027 }
00028 
00029 void vuBasicSubWindow::render()
00030 {
00031   if (m_Volume != NULL) {
00032     if (m_Volume->IsReRendering()) {
00033       m_Volume->render();
00034       m_Volume->setIsReRendering(false);
00035     }
00036   }
00037   else { // draw black screen
00038     static byte *background = NULL;
00039 
00040     if (background == NULL) {      
00041       background = new byte[16];
00042       for (dword i=0; i<16; i++) background[i] = 0;
00043     }
00044 
00045     glPixelZoom((float)getWidth()/4, (float)getHeight()/4);
00046     glDrawPixels(4, 4, GL_LUMINANCE, GL_UNSIGNED_BYTE, background);
00047   }
00048 }
00049 
00050 bool vuBasicSubWindow::glInit()
00051 {
00052   if (m_Volume) {
00053     m_Volume->glResize(getWidth(), getHeight());
00054   }
00055   return true;
00056 }
00057 
00058 //----------------------------------------------------------------------------
00059 //------------------------- protected: glOnMouse() ---------------------------
00060 //----------------------------------------------------------------------------
00061 
00062 void vuBasicSubWindow::glOnMouse(wxMouseEvent &ev)
00063 {
00064 }

Generated on Wed Dec 15 21:20:33 2004 for vuVolume by  doxygen 1.3.9.1