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

volume.h

Go to the documentation of this file.
00001 /*      Modified April 2002
00002         Modified by Christopher Steinbach
00003 
00004         Modified to add functions to enable/disable rerendering
00005         so that animations will play back correctly.
00006 */
00007 
00008 #ifndef _VUVOLUME_H_
00009 #define _VUVOLUME_H_
00010 
00011 #include "vuSimpleTypes.h"
00012 #include "vuString.h"
00013 #include "vuVector.h"
00014 #include "vuCamera.h"
00015 #include "vuTFunc/vuTFIntensity.h" //for transfer functions 
00016 #include "vuTFunc/vuTFDesign.h"
00017 
00018 //Needed for the FILE* declaration.
00019 #include <stdio.h>
00020 
00021 
00022 class vu1;
00023 typedef vu1 vuVolume;
00024 
00026 
00041 class vu1
00042 {
00043 public:
00045 
00047     vu1();
00049 
00052     vu1(const vu1 &inst);
00054     virtual ~vu1();
00055 
00057 
00060     vu1& operator=(const vu1 &rhs);
00061     
00063 
00068     void setFileName(const char* val);
00070 
00071     const char *getFileName(void) const;
00072 
00074 
00088     virtual bool read(void) = 0;
00090 
00092     virtual bool write(void) = 0;
00093 
00095 
00101     const char *getHeader(void) const;
00102 
00104     virtual bool IsReRendering ();
00105 
00107     virtual void setIsReRendering(bool isit=true);
00108 
00109 public:
00110 
00112 
00114     dword getDataSize();
00115 
00116     // Every subclass of volume (i.e. every algorithm) has a transfer function.
00117     // See comments for volume::m_TFunc.
00118     //void setTransferFunc(const vuTFDesign& tf);
00119 
00121 
00122     void setRenderState(dword val);
00124 
00125     dword getRenderState(void) const;
00126 
00128 
00132     virtual void setViewVectors(const vuVector& view,const vuVector& up,const vuVector& right)=0;
00133 
00135 
00141     virtual void render(void) = 0;
00142 
00144 
00147     bool errorOccurred(void) const;
00149 
00153     byte getErrorLevel(void) const;
00155 
00158     const char *getErrorMessage(void) const;
00159 
00160 protected:
00162 
00168     void close(void);
00169 
00171 
00175     virtual bool read(FILE *file);
00177 
00179     virtual bool write(FILE *file);
00180 
00182 
00187     bool setError(const char *Message,byte ErrorLevel = 1);
00189     bool setInvalidFormatError();
00191     bool setWriteError();
00192 
00193 protected:
00195     byte* m_Data;
00197     dword m_DataSize;
00198 
00200     dword m_RenderState;
00201 
00203     vuString m_FileName;
00205     vuString m_Header;
00207     bool m_Binary;
00208 
00210     bool m_Error;
00212     vuString m_ErrorMessage;
00214     byte m_ErrorLevel;
00215 
00216     bool m_rerendering;
00218     vuCamera *m_Camera;
00219 
00220     //The transfer function.
00221     /*
00222       The vast majority of subclasses of volume should have a transfer
00223       function, just like the vast majority of subclasses will need a 
00224       camera set up. Why declare m_TFunc in every algorithm class and
00225       reimplement its behavior in every utility window when it can be
00226       done in one place? To disable volume's transfer function dialog,
00227       simply overwrite onLeftDoubleClick() in vuBasicUtility.
00228 
00229       This attribute, however, is not yet used, because conceivably,
00230       each algorithm could demand a variation of the transfer function
00231       (subclasses), and because current algorithms already follows that
00232       architecture (though as far as I can see every transfer function is 
00233       of the same type). This might be something to consider in the next
00234       architectural revision of vuVolume.
00235     */
00236     //vuTFDesign m_TFunc;
00237 
00238 public:
00240     virtual void preview(int hint=0);
00242     void setCamera(vuCamera *mycamera);
00244     vuCamera& getCamera();
00246     vuCamera *getCameraPtr();
00248     virtual vuVector getCenter() const;
00249 
00250 
00251     virtual void glInit();
00252     virtual void glResize(dword width, dword height);
00253 };
00254 
00255 #endif

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