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 "vtkViewsCoreModule.h" // For export macro 00053 #include "vtkObject.h" 00054 00055 class vtkAlgorithmOutput; 00056 class vtkCommand; 00057 class vtkDataObject; 00058 class vtkDataRepresentation; 00059 class vtkSelection; 00060 class vtkViewTheme; 00061 00062 class VTKVIEWSCORE_EXPORT vtkView : public vtkObject 00063 { 00064 public: 00065 static vtkView *New(); 00066 vtkTypeMacro(vtkView, vtkObject); 00067 void PrintSelf(ostream& os, vtkIndent indent); 00068 00070 void AddRepresentation(vtkDataRepresentation* rep); 00071 00073 void SetRepresentation(vtkDataRepresentation* rep); 00074 00080 vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn); 00081 00087 vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn); 00088 00094 vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input); 00095 00100 vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input); 00101 00103 void RemoveRepresentation(vtkDataRepresentation* rep); 00104 00106 void RemoveRepresentation(vtkAlgorithmOutput* rep); 00107 00109 void RemoveAllRepresentations(); 00110 00113 int GetNumberOfRepresentations(); 00114 00116 vtkDataRepresentation* GetRepresentation(int index = 0); 00117 00119 bool IsRepresentationPresent(vtkDataRepresentation* rep); 00120 00122 virtual void Update(); 00123 00125 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { } 00126 00127 //BTX 00131 vtkCommand* GetObserver(); 00132 00134 00136 class ViewProgressEventCallData 00137 { 00138 const char* Message; 00139 double Progress; 00141 00142 public: 00143 ViewProgressEventCallData(const char* msg, double progress) 00144 { 00145 this->Message = msg; 00146 this->Progress = progress; 00147 } 00148 ~ViewProgressEventCallData() 00149 { 00150 this->Message = 0; 00151 } 00152 00154 00155 const char* GetProgressMessage() const 00156 { return this->Message; } 00158 00160 00161 double GetProgress() const 00162 { return this->Progress; } 00163 }; 00164 //ETX 00166 00174 void RegisterProgress(vtkObject* algorithm, const char* message=NULL); 00175 00177 void UnRegisterProgress(vtkObject* algorithm); 00178 00179 //BTX 00180 protected: 00181 vtkView(); 00182 ~vtkView(); 00183 00185 00188 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, 00189 void* callData); 00191 00197 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn); 00198 00200 00203 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00204 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00206 00208 00210 vtkSetMacro(ReuseSingleRepresentation, bool); 00211 vtkGetMacro(ReuseSingleRepresentation, bool); 00212 vtkBooleanMacro(ReuseSingleRepresentation, bool); 00213 bool ReuseSingleRepresentation; 00215 00216 private: 00217 vtkView(const vtkView&); // Not implemented. 00218 void operator=(const vtkView&); // Not implemented. 00219 00220 class vtkImplementation; 00221 vtkImplementation* Implementation; 00222 00223 class Command; 00224 friend class Command; 00225 Command* Observer; 00226 00227 class vtkInternal; 00228 vtkInternal* Internal; 00229 //ETX 00230 }; 00231 00232 #endif