Common/vtkObject.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00067 #ifndef __vtkObject_h
00068 #define __vtkObject_h
00069
00070 #include "vtkObjectBase.h"
00071 #include "vtkSetGet.h"
00072 #include "vtkTimeStamp.h"
00073
00074 class vtkSubjectHelper;
00075 class vtkCommand;
00076
00077 class VTK_COMMON_EXPORT vtkObject : public vtkObjectBase
00078 {
00079 public:
00080 vtkTypeRevisionMacro(vtkObject,vtkObjectBase);
00081
00084 static vtkObject *New();
00085
00086 #ifdef _WIN32
00087
00088 void* operator new( size_t tSize );
00089 void operator delete( void* p );
00090 #endif
00091
00093 virtual void DebugOn();
00094
00096 virtual void DebugOff();
00097
00099 unsigned char GetDebug();
00100
00102 void SetDebug(unsigned char debugFlag);
00103
00106 static void BreakOnError();
00107
00112 virtual void Modified();
00113
00115 virtual unsigned long GetMTime();
00116
00121 virtual void PrintSelf(ostream& os, vtkIndent indent);
00122
00124
00126 static void SetGlobalWarningDisplay(int val);
00127 static void GlobalWarningDisplayOn(){vtkObject::SetGlobalWarningDisplay(1);};
00128 static void GlobalWarningDisplayOff()
00129 {vtkObject::SetGlobalWarningDisplay(0);};
00130 static int GetGlobalWarningDisplay();
00132
00134 virtual void Register(vtkObjectBase* o);
00135
00139 virtual void UnRegister(vtkObjectBase* o);
00140
00142
00151 unsigned long AddObserver(unsigned long event, vtkCommand *,
00152 float priority=0.0);
00153 unsigned long AddObserver(const char *event, vtkCommand *,
00154 float priority=0.0);
00155 vtkCommand *GetCommand(unsigned long tag);
00156 void RemoveObserver(vtkCommand*);
00157
00158 void RemoveObserver(unsigned long tag);
00159 void RemoveObservers(unsigned long event);
00160 void RemoveObservers(const char *event);
00161 int HasObserver(unsigned long event);
00162 int HasObserver(const char *event);
00164
00175
00176
00177
00178
00179 int InvokeEvent(unsigned long event, void *callData);
00180 int InvokeEvent(const char *event, void *callData);
00181
00182 int InvokeEvent(unsigned long event) { return this->InvokeEvent(event, NULL); };
00183 int InvokeEvent(const char *event) { return this->InvokeEvent(event, NULL); };
00184
00185 protected:
00186 vtkObject();
00187 virtual ~vtkObject();
00188
00189 unsigned char Debug;
00190 vtkTimeStamp MTime;
00191 vtkSubjectHelper *SubjectHelper;
00192
00193 private:
00194 vtkObject(const vtkObject&);
00195 void operator=(const vtkObject&);
00196 };
00197
00198 #endif
00199