VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkDataRepresentation.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 -------------------------------------------------------------------------*/ 00058 #ifndef __vtkDataRepresentation_h 00059 #define __vtkDataRepresentation_h 00060 00061 #include "vtkPassInputTypeAlgorithm.h" 00062 00063 class vtkAlgorithmOutput; 00064 class vtkAnnotationLink; 00065 class vtkDataObject; 00066 class vtkSelection; 00067 class vtkStringArray; 00068 class vtkView; 00069 class vtkViewTheme; 00070 00071 class VTK_VIEWS_EXPORT vtkDataRepresentation : public vtkPassInputTypeAlgorithm 00072 { 00073 public: 00074 static vtkDataRepresentation *New(); 00075 vtkTypeMacro(vtkDataRepresentation, vtkPassInputTypeAlgorithm); 00076 void PrintSelf(ostream& os, vtkIndent indent); 00077 00079 00081 vtkAlgorithmOutput* GetInputConnection(int port = 0, int index = 0) 00082 { return this->Superclass::GetInputConnection(port, index); } 00084 00086 00088 vtkAnnotationLink* GetAnnotationLink() 00089 { return this->AnnotationLinkInternal; } 00090 void SetAnnotationLink(vtkAnnotationLink* link); 00092 00095 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { } 00096 00098 00105 void Select(vtkView* view, vtkSelection* selection) 00106 { this->Select(view, selection, false); } 00107 void Select(vtkView* view, vtkSelection* selection, bool extend); 00109 00111 00113 vtkSetMacro(Selectable, bool); 00114 vtkGetMacro(Selectable, bool); 00115 vtkBooleanMacro(Selectable, bool); 00117 00119 00124 void UpdateSelection(vtkSelection* selection) 00125 { this->UpdateSelection(selection, false); } 00126 void UpdateSelection(vtkSelection* selection, bool extend); 00128 00130 00133 virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort() 00134 { return this->GetInternalAnnotationOutputPort(0); } 00135 virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort(int port) 00136 { return this->GetInternalAnnotationOutputPort(port, 0); } 00137 virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort(int port, int conn); 00139 00141 00144 virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort() 00145 { return this->GetInternalSelectionOutputPort(0); } 00146 virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort(int port) 00147 { return this->GetInternalSelectionOutputPort(port, 0); } 00148 virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort(int port, int conn); 00150 00152 00155 virtual vtkAlgorithmOutput* GetInternalOutputPort() 00156 { return this->GetInternalOutputPort(0); } 00157 virtual vtkAlgorithmOutput* GetInternalOutputPort(int port) 00158 { return this->GetInternalOutputPort(port, 0); } 00159 virtual vtkAlgorithmOutput* GetInternalOutputPort(int port, int conn); 00161 00163 00167 vtkSetMacro(SelectionType, int); 00168 vtkGetMacro(SelectionType, int); 00170 00172 00173 virtual void SetSelectionArrayNames(vtkStringArray* names); 00174 vtkGetObjectMacro(SelectionArrayNames, vtkStringArray); 00176 00178 00179 virtual void SetSelectionArrayName(const char* name); 00180 virtual const char* GetSelectionArrayName(); 00182 00183 protected: 00184 vtkDataRepresentation(); 00185 ~vtkDataRepresentation(); 00186 00188 00197 virtual int RequestData( 00198 vtkInformation*, 00199 vtkInformationVector**, 00200 vtkInformationVector*) 00201 { return 1; } 00203 00206 virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData); 00207 00209 00210 virtual void SetAnnotationLinkInternal(vtkAnnotationLink* link); 00211 vtkAnnotationLink* AnnotationLinkInternal; 00213 00214 // Whether is represenation can handle a selection. 00215 bool Selectable; 00216 00218 int SelectionType; 00219 00221 vtkStringArray* SelectionArrayNames; 00222 00223 //BTX 00224 friend class vtkView; 00225 friend class vtkRenderView; 00226 class Command; 00227 friend class Command; 00228 Command* Observer; 00229 //ETX 00230 00231 // ------------------------------------------------------------------------ 00232 // Methods to override in subclasses 00233 // ------------------------------------------------------------------------ 00234 00238 virtual bool AddToView(vtkView* vtkNotUsed(view)) { return true; } 00239 00243 virtual bool RemoveFromView(vtkView* vtkNotUsed(view)) { return true; } 00244 00251 virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection); 00252 00253 private: 00254 vtkDataRepresentation(const vtkDataRepresentation&); // Not implemented. 00255 void operator=(const vtkDataRepresentation&); // Not implemented. 00256 00257 //BTX 00258 class Internals; 00259 Internals* Implementation; 00260 //ETX 00261 }; 00262 00263 #endif