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

vtkOutputWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkOutputWindow.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00040 #ifndef __vtkOutputWindow_h
00041 #define __vtkOutputWindow_h
00042 
00043 #include "vtkObject.h"
00044 
00045 //BTX
00046 
00047 class VTK_COMMON_EXPORT vtkOutputWindow;
00048 
00049 class VTK_COMMON_EXPORT vtkOutputWindowCleanup
00050 {
00051 public:
00052   vtkOutputWindowCleanup();
00053   ~vtkOutputWindowCleanup();
00054 };
00055 //ETX
00056 
00057 class VTK_COMMON_EXPORT vtkOutputWindow : public vtkObject
00058 {
00059 public:
00060 // Methods from vtkObject
00061   vtkTypeRevisionMacro(vtkOutputWindow,vtkObject);
00063   virtual void PrintSelf(ostream& os, vtkIndent indent);
00064 
00066 
00070   static vtkOutputWindow* New();
00071   // Description:
00072   // Return the singleton instance with no reference counting.
00073   static vtkOutputWindow* GetInstance();
00074   // Description:
00075   // Supply a user defined output window. Call ->Delete() on the supplied
00076   // instance after setting it.
00077   static void SetInstance(vtkOutputWindow *instance);
00078   // Description:
00079   // Display the text. Four virtual methods exist, depending on the type of
00080   // message to display. This allows redirection or reformatting of the
00081   // messages. The default implementation uses DisplayText for all.
00082   virtual void DisplayText(const char*);
00083   virtual void DisplayErrorText(const char*);
00084   virtual void DisplayWarningText(const char*);
00085   virtual void DisplayGenericWarningText(const char*);
00087 
00088   virtual void DisplayDebugText(const char*);
00090 
00092   vtkBooleanMacro(PromptUser,int);
00093   vtkSetMacro(PromptUser, int);
00095 //BTX
00096   // use this as a way of memory management when the
00097   // program exits the SmartPointer will be deleted which
00098   // will delete the Instance singleton
00099   static vtkOutputWindowCleanup Cleanup;
00100 //ETX
00101 protected:
00102   vtkOutputWindow();
00103   virtual ~vtkOutputWindow();
00104   int PromptUser;
00105 private:
00106   static vtkOutputWindow* Instance;
00107 private:
00108   vtkOutputWindow(const vtkOutputWindow&);  // Not implemented.
00109   void operator=(const vtkOutputWindow&);  // Not implemented.
00110 };
00111 
00112 #endif