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 00196 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn); 00197 00199 00202 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00203 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00205 00207 00209 vtkSetMacro(ReuseSingleRepresentation, bool); 00210 vtkGetMacro(ReuseSingleRepresentation, bool); 00211 vtkBooleanMacro(ReuseSingleRepresentation, bool); 00212 bool ReuseSingleRepresentation; 00214 00215 private: 00216 vtkView(const vtkView&); // Not implemented. 00217 void operator=(const vtkView&); // Not implemented. 00218 00219 class vtkImplementation; 00220 vtkImplementation* Implementation; 00221 00222 class Command; 00223 friend class Command; 00224 Command* Observer; 00225 00226 class vtkInternal; 00227 vtkInternal* Internal; 00228 //ETX 00229 }; 00230 00231 #endif