VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkView.h 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 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00049 #ifndef __vtkView_h 00050 #define __vtkView_h 00051 00052 #include "vtkObject.h" 00053 00054 class vtkAlgorithmOutput; 00055 class vtkCommand; 00056 class vtkDataObject; 00057 class vtkDataRepresentation; 00058 class vtkSelection; 00059 class vtkViewTheme; 00060 00061 class VTK_VIEWS_EXPORT vtkView : public vtkObject 00062 { 00063 public: 00064 static vtkView *New(); 00065 vtkTypeMacro(vtkView, vtkObject); 00066 void PrintSelf(ostream& os, vtkIndent indent); 00067 00069 void AddRepresentation(vtkDataRepresentation* rep); 00070 00072 void SetRepresentation(vtkDataRepresentation* rep); 00073 00079 vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn); 00080 00086 vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn); 00087 00093 vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input); 00094 00099 vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input); 00100 00102 void RemoveRepresentation(vtkDataRepresentation* rep); 00103 00105 void RemoveRepresentation(vtkAlgorithmOutput* rep); 00106 00108 void RemoveAllRepresentations(); 00109 00112 int GetNumberOfRepresentations(); 00113 00115 vtkDataRepresentation* GetRepresentation(int index = 0); 00116 00118 bool IsRepresentationPresent(vtkDataRepresentation* rep); 00119 00121 virtual void Update(); 00122 00124 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { } 00125 00126 //BTX 00130 vtkCommand* GetObserver(); 00131 00133 00135 class ViewProgressEventCallData 00136 { 00137 const char* Message; 00138 double Progress; 00140 00141 public: 00142 ViewProgressEventCallData(const char* msg, double progress) 00143 { 00144 this->Message = msg; 00145 this->Progress = progress; 00146 } 00147 ~ViewProgressEventCallData() 00148 { 00149 this->Message = 0; 00150 } 00151 00153 00154 const char* GetProgressMessage() const 00155 { return this->Message; } 00157 00159 00160 double GetProgress() const 00161 { return this->Progress; } 00162 }; 00163 //ETX 00165 00173 void RegisterProgress(vtkObject* algorithm, const char* message=NULL); 00174 00176 void UnRegisterProgress(vtkObject* algorithm); 00177 00178 //BTX 00179 protected: 00180 vtkView(); 00181 ~vtkView(); 00182 00184 00187 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, 00188 void* callData); 00190 00192 00195 virtual void AddInputConnection( 00196 vtkAlgorithmOutput* vtkNotUsed(conn), 00197 vtkAlgorithmOutput* vtkNotUsed(selectionConn)) { } 00199 00201 00204 virtual void RemoveInputConnection( 00205 vtkAlgorithmOutput* vtkNotUsed(conn), 00206 vtkAlgorithmOutput* vtkNotUsed(selectionConn)) { } 00208 00214 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn); 00215 00217 00220 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00221 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00223 00225 00227 vtkSetMacro(ReuseSingleRepresentation, bool); 00228 vtkGetMacro(ReuseSingleRepresentation, bool); 00229 vtkBooleanMacro(ReuseSingleRepresentation, bool); 00230 bool ReuseSingleRepresentation; 00232 00233 private: 00234 vtkView(const vtkView&); // Not implemented. 00235 void operator=(const vtkView&); // Not implemented. 00236 00237 class vtkImplementation; 00238 vtkImplementation* Implementation; 00239 00240 class Command; 00241 friend class Command; 00242 Command* Observer; 00243 00244 class vtkInternal; 00245 vtkInternal* Internal; 00246 //ETX 00247 }; 00248 00249 #endif