VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkView.h,v $ 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 -------------------------------------------------------------------------*/ 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 vtkSelectionLink; 00057 class vtkStringArray; 00058 class vtkViewTheme; 00059 00060 class VTK_VIEWS_EXPORT vtkView : public vtkObject 00061 { 00062 public: 00063 static vtkView *New(); 00064 vtkTypeRevisionMacro(vtkView, vtkObject); 00065 void PrintSelf(ostream& os, vtkIndent indent); 00066 00068 void AddRepresentation(vtkDataRepresentation* rep); 00069 00071 void AddRepresentation(int port, vtkDataRepresentation* rep); 00072 00074 void SetRepresentation(vtkDataRepresentation* rep); 00075 00078 void SetRepresentation(int port, vtkDataRepresentation* rep); 00079 00083 void SetRepresentation(int port, int index, vtkDataRepresentation* rep); 00084 00091 vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn); 00092 00100 vtkDataRepresentation* AddRepresentationFromInputConnection(int port, vtkAlgorithmOutput* conn); 00101 00108 vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn); 00109 00116 vtkDataRepresentation* SetRepresentationFromInputConnection(int port, vtkAlgorithmOutput* conn); 00117 00123 vtkDataRepresentation* SetRepresentationFromInputConnection(int port, int index, vtkAlgorithmOutput* conn); 00124 00130 vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input); 00131 00138 vtkDataRepresentation* AddRepresentationFromInput(int port, vtkDataObject* input); 00139 00146 vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input); 00147 00154 vtkDataRepresentation* SetRepresentationFromInput(int port, vtkDataObject* input); 00155 00161 vtkDataRepresentation* SetRepresentationFromInput(int port, int index, vtkDataObject* input); 00162 00164 void RemoveRepresentation(vtkDataRepresentation* rep); 00165 00167 void RemoveRepresentation(vtkAlgorithmOutput* rep); 00168 00170 void RemoveAllRepresentations(); 00171 00173 void RemoveAllRepresentations(int port); 00174 00177 int GetNumberOfRepresentations(); 00178 00180 int GetNumberOfRepresentations(int port); 00181 00183 vtkDataRepresentation* GetRepresentation(int index = 0); 00184 00186 vtkDataRepresentation* GetRepresentation(int port, int index); 00187 00189 bool IsItemPresent(vtkDataRepresentation* rep); 00190 00192 bool IsItemPresent(int port, vtkDataRepresentation* rep); 00193 00195 void RemoveItem(vtkDataRepresentation* rep); 00196 00198 virtual void Update() { } 00199 00201 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { } 00202 00204 00208 vtkSetMacro(SelectionType, int); 00209 vtkGetMacro(SelectionType, int); 00211 00213 00214 virtual void SetSelectionArrayNames(vtkStringArray* names); 00215 vtkGetObjectMacro(SelectionArrayNames, vtkStringArray); 00217 00219 00220 virtual void SetSelectionArrayName(const char* name); 00221 virtual const char* GetSelectionArrayName(); 00223 00224 //BTX 00228 vtkCommand* GetObserver(); 00229 00231 00233 class ViewProgressEventCallData 00234 { 00235 const char* Message; 00236 double Progress; 00238 00239 public: 00240 ViewProgressEventCallData(const char* msg, double progress) 00241 { 00242 this->Message = msg; 00243 this->Progress = progress; 00244 } 00245 ~ViewProgressEventCallData() 00246 { 00247 this->Message = 0; 00248 } 00249 00251 00252 const char* GetProgressMessage() const 00253 { return this->Message; } 00255 00257 00258 double GetProgress() const 00259 { return this->Progress; } 00260 }; 00261 //ETX 00263 00271 void RegisterProgress(vtkObject* algorithm, const char* message=NULL); 00272 00274 void UnRegisterProgress(vtkObject* algorithm); 00275 00276 //BTX 00277 protected: 00278 vtkView(); 00279 ~vtkView(); 00280 00282 00285 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, 00286 void* callData); 00288 00290 00293 virtual void AddInputConnection( int vtkNotUsed(port), int vtkNotUsed(item), 00294 vtkAlgorithmOutput* vtkNotUsed(conn), 00295 vtkAlgorithmOutput* vtkNotUsed(selectionConn)) { } 00297 00299 00302 virtual void RemoveInputConnection( 00303 int vtkNotUsed(port), int vtkNotUsed(item), 00304 vtkAlgorithmOutput* vtkNotUsed(conn), 00305 vtkAlgorithmOutput* vtkNotUsed(selectionConn)) { } 00307 00309 int SelectionType; 00310 00312 vtkStringArray* SelectionArrayNames; 00313 00316 void SizePort(int i, int j); 00317 00319 bool CheckPort(int i, int j); 00320 00326 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn); 00327 00329 00332 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00333 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {} 00335 00336 private: 00337 vtkView(const vtkView&); // Not implemented. 00338 void operator=(const vtkView&); // Not implemented. 00339 00340 class vtkImplementation; 00341 vtkImplementation* Implementation; 00342 00343 class Command; 00344 friend class Command; 00345 Command* Observer; 00346 00347 class vtkInternal; 00348 vtkInternal* Internal; 00349 //ETX 00350 }; 00351 00352 #endif