CarpetViewer.h

Go to the documentation of this file.
00001 /* $Id: CarpetViewer.h,v 1.24 2005/10/26 11:26:55 pfb Exp $ */
00002 
00003 #ifndef _CarpetViewer_h
00004 #define _CarpetViewer_h
00005 
00011 #include "../../../../Common/Observer/Observer.h"
00012 #include "../../../../Common/Observer/Subject.h"
00013 #include <vtkObject.h>
00014 #include <vtkObjectFactory.h>
00015 #include <string>
00016 
00017 class FiletoActor;
00018 class ssFiletoActorContainer;
00019 class vtkRenderer;
00020 class vtkRenderWindow;
00021 class vtkRenderWindowInteractor;
00022 class vtkAxes;
00023 class vtkTubeFilter;
00024 class vtkPolyDataMapper;
00025 class vtkActor;
00026 class vtkCamera;
00027 class vtkMutexLock;
00028 
00038 class CarpetViewer : public Subject, public Observer, public vtkObject
00039   {
00040   //****************************************************************************
00041                              public:
00042 
00048   static CarpetViewer *New();
00049 
00053   vtkTypeMacro(CarpetViewer, vtkObject);
00054 
00060   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00066   void renderWindow(vtkRenderWindow *window);
00067 
00072   vtkRenderWindow *renderWindow() const;
00073 
00079   void initializeInteractor();
00080 
00085   vtkRenderWindowInteractor *renderWindowInteractor() const;
00086 
00091   vtkRenderer *renderer() const;
00092 
00102   void addActor(const std::string filename, float decimate = 0.0);
00103   
00113   void addActor(const char *filename, float decimate = 0.0);
00114 
00119   void removeActor(const std::string key);
00120 
00125   void removeActor(const char *key);
00126 
00132   const char *name(int index) const;
00133 
00138   int numberOfActors() const;
00139 
00144   const ssFiletoActorContainer *actors() const;
00145 
00149   void clear();
00150 
00155   void axesOn();
00156 
00160   void axesOff();
00161 
00165   void wireOn();
00166 
00170   void wireOff();
00171 
00176   void start();
00177 
00183   void notify();
00184 
00188   void DebugOn();
00189 
00193   void DebugOff();
00194 
00195   //****************************************************************************
00196                              protected:
00197 
00201   CarpetViewer();
00202 
00206   ~CarpetViewer();
00207 
00208   //****************************************************************************
00209                              private:
00210 
00214   CarpetViewer(const CarpetViewer& rhs);
00215   CarpetViewer& operator=(const CarpetViewer& rhs);
00216 
00217   ssFiletoActorContainer    *actorList;
00218   vtkRenderWindow           *window;   /* The renderer specified by renderer */
00219   vtkRenderWindowInteractor *interactor;
00220   vtkRenderer               *irenderer;
00221   vtkCamera                 *camera;
00222   vtkMutexLock              *windowLock;    /* The mutex for window */
00223   vtkMutexLock              *dataflowLock;  /* The mutex for dataflow ops */
00224   vtkAxes                   *axes;
00225   vtkTubeFilter             *tubes;
00226   vtkPolyDataMapper         *axesMapper;
00227   vtkActor                  *axesActor;
00228   bool                      wire;
00229   };
00230 
00315 #endif