00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00049 #ifndef __vtkObject_h
00050 #define __vtkObject_h
00051
00052 #include "vtkObjectBase.h"
00053 #include "vtkSetGet.h"
00054 #include "vtkTimeStamp.h"
00055
00056 class vtkSubjectHelper;
00057 class vtkCommand;
00058
00059 class VTK_COMMON_EXPORT vtkObject : public vtkObjectBase
00060 {
00061 public:
00062 vtkTypeRevisionMacro(vtkObject,vtkObjectBase);
00063
00066 static vtkObject *New();
00067
00068 #ifdef _WIN32
00069
00070 void* operator new( size_t tSize );
00071 void operator delete( void* p );
00072 #endif
00073
00075 virtual void DebugOn();
00076
00078 virtual void DebugOff();
00079
00081 unsigned char GetDebug();
00082
00084 void SetDebug(unsigned char debugFlag);
00085
00088 static void BreakOnError();
00089
00094 virtual void Modified();
00095
00097 virtual unsigned long GetMTime();
00098
00103 virtual void PrintSelf(ostream& os, vtkIndent indent);
00104
00106
00108 static void SetGlobalWarningDisplay(int val);
00109 static void GlobalWarningDisplayOn(){vtkObject::SetGlobalWarningDisplay(1);};
00110 static void GlobalWarningDisplayOff()
00111 {vtkObject::SetGlobalWarningDisplay(0);};
00112 static int GetGlobalWarningDisplay();
00114
00116
00125 unsigned long AddObserver(unsigned long event, vtkCommand *,
00126 float priority=0.0);
00127 unsigned long AddObserver(const char *event, vtkCommand *,
00128 float priority=0.0);
00129 vtkCommand *GetCommand(unsigned long tag);
00130 void RemoveObserver(vtkCommand*);
00131 void RemoveObservers(unsigned long event, vtkCommand *);
00132 void RemoveObservers(const char *event, vtkCommand *);
00133 int HasObserver(unsigned long event, vtkCommand *);
00134 int HasObserver(const char *event, vtkCommand *);
00135
00136 void RemoveObserver(unsigned long tag);
00137 void RemoveObservers(unsigned long event);
00138 void RemoveObservers(const char *event);
00139 void RemoveAllObservers();
00140 int HasObserver(unsigned long event);
00141 int HasObserver(const char *event);
00143
00154
00155
00156
00157
00158 int InvokeEvent(unsigned long event, void *callData);
00159 int InvokeEvent(const char *event, void *callData);
00160
00161 int InvokeEvent(unsigned long event) { return this->InvokeEvent(event, NULL); };
00162 int InvokeEvent(const char *event) { return this->InvokeEvent(event, NULL); };
00163
00164 protected:
00165 vtkObject();
00166 virtual ~vtkObject();
00167
00168
00169 virtual void RegisterInternal(vtkObjectBase*, int check);
00170 virtual void UnRegisterInternal(vtkObjectBase*, int check);
00171
00172 unsigned char Debug;
00173 vtkTimeStamp MTime;
00174 vtkSubjectHelper *SubjectHelper;
00175
00177
00184 void InternalGrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL);
00185 void InternalReleaseFocus();
00186
00188
00189 private:
00190 vtkObject(const vtkObject&);
00191 void operator=(const vtkObject&);
00192 };
00193
00194 #endif
00195