00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00046 #ifndef __vtkView_h
00047 #define __vtkView_h
00048
00049 #include "vtkObject.h"
00050
00051 class vtkAlgorithmOutput;
00052 class vtkCommand;
00053 class vtkDataObject;
00054 class vtkDataRepresentation;
00055 class vtkSelection;
00056 class vtkViewTheme;
00057
00058 class VTK_VIEWS_EXPORT vtkView : public vtkObject
00059 {
00060 public:
00061 static vtkView *New();
00062 vtkTypeRevisionMacro(vtkView, vtkObject);
00063 void PrintSelf(ostream& os, vtkIndent indent);
00064
00066 void AddRepresentation(vtkDataRepresentation* rep);
00067
00069 void SetRepresentation(vtkDataRepresentation* rep);
00070
00076 vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
00077
00083 vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
00084
00090 vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input);
00091
00096 vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input);
00097
00099 void RemoveRepresentation(vtkDataRepresentation* rep);
00100
00102 void RemoveRepresentation(vtkAlgorithmOutput* rep);
00103
00105 void RemoveAllRepresentations();
00106
00109 int GetNumberOfRepresentations();
00110
00112 vtkDataRepresentation* GetRepresentation(int index = 0);
00113
00115 bool IsRepresentationPresent(vtkDataRepresentation* rep);
00116
00118 virtual void Update();
00119
00121 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
00122
00123
00127 vtkCommand* GetObserver();
00128
00130
00132 class ViewProgressEventCallData
00133 {
00134 const char* Message;
00135 double Progress;
00137
00138 public:
00139 ViewProgressEventCallData(const char* msg, double progress)
00140 {
00141 this->Message = msg;
00142 this->Progress = progress;
00143 }
00144 ~ViewProgressEventCallData()
00145 {
00146 this->Message = 0;
00147 }
00148
00150
00151 const char* GetProgressMessage() const
00152 { return this->Message; }
00154
00156
00157 double GetProgress() const
00158 { return this->Progress; }
00159 };
00160
00162
00170 void RegisterProgress(vtkObject* algorithm, const char* message=NULL);
00171
00173 void UnRegisterProgress(vtkObject* algorithm);
00174
00175
00176 protected:
00177 vtkView();
00178 ~vtkView();
00179
00181
00184 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
00185 void* callData);
00187
00189
00192 virtual void AddInputConnection(
00193 vtkAlgorithmOutput* vtkNotUsed(conn),
00194 vtkAlgorithmOutput* vtkNotUsed(selectionConn)) { }
00196
00198
00201 virtual void RemoveInputConnection(
00202 vtkAlgorithmOutput* vtkNotUsed(conn),
00203 vtkAlgorithmOutput* vtkNotUsed(selectionConn)) { }
00205
00211 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
00212
00214
00217 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
00218 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
00220
00222
00224 vtkSetMacro(ReuseSingleRepresentation, bool);
00225 vtkGetMacro(ReuseSingleRepresentation, bool);
00226 vtkBooleanMacro(ReuseSingleRepresentation, bool);
00227 bool ReuseSingleRepresentation;
00229
00230 private:
00231 vtkView(const vtkView&);
00232 void operator=(const vtkView&);
00233
00234 class vtkImplementation;
00235 vtkImplementation* Implementation;
00236
00237 class Command;
00238 friend class Command;
00239 Command* Observer;
00240
00241 class vtkInternal;
00242 vtkInternal* Internal;
00243
00244 };
00245
00246 #endif