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