00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkDataRepresentation.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 -------------------------------------------------------------------------*/ 00055 #ifndef __vtkDataRepresentation_h 00056 #define __vtkDataRepresentation_h 00057 00058 #include "vtkObject.h" 00059 00060 class vtkAlgorithmOutput; 00061 class vtkConvertSelectionDomain; 00062 class vtkDataObject; 00063 class vtkSelection; 00064 class vtkSelectionLink; 00065 class vtkTable; 00066 class vtkView; 00067 00068 class VTK_VIEWS_EXPORT vtkDataRepresentation : public vtkObject 00069 { 00070 public: 00071 static vtkDataRepresentation *New(); 00072 vtkTypeRevisionMacro(vtkDataRepresentation, vtkObject); 00073 void PrintSelf(ostream& os, vtkIndent indent); 00074 00077 void SetInput(vtkDataObject* input); 00078 00080 00083 virtual void SetInputConnection(vtkAlgorithmOutput* conn); 00084 virtual vtkAlgorithmOutput* GetInputConnection() 00085 { return this->GetInputConnectionInternal(); } 00087 00093 void Select(vtkView* view, vtkSelection* selection); 00094 00096 00098 vtkSetMacro(Selectable, bool); 00099 vtkGetMacro(Selectable, bool); 00100 vtkBooleanMacro(Selectable, bool); 00102 00105 void UpdateSelection(vtkSelection* selection); 00106 00108 00112 virtual vtkSelectionLink* GetSelectionLink() 00113 { return this->GetSelectionLinkInternal(); } 00114 virtual void SetSelectionLink(vtkSelectionLink* link); 00116 00120 vtkAlgorithmOutput* GetSelectionConnection(); 00121 00122 protected: 00123 vtkDataRepresentation(); 00124 ~vtkDataRepresentation(); 00125 00129 virtual bool AddToView(vtkView* vtkNotUsed(view)) { return true; } 00130 00134 virtual bool RemoveFromView(vtkView* vtkNotUsed(view)) { return true; } 00135 00142 virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection); 00143 00144 // The input connection. 00145 vtkGetObjectMacro(InputConnectionInternal, vtkAlgorithmOutput); 00146 void SetInputConnectionInternal(vtkAlgorithmOutput* conn); 00147 vtkAlgorithmOutput* InputConnectionInternal; 00148 00149 // The linked selection. 00150 vtkGetObjectMacro(SelectionLinkInternal, vtkSelectionLink); 00151 void SetSelectionLinkInternal(vtkSelectionLink* link); 00152 vtkSelectionLink* SelectionLinkInternal; 00153 00154 // The filter used to map the selection to the appropriate domain. 00155 vtkConvertSelectionDomain* ConvertDomain; 00156 00157 // Whether is represenation can handle a selection. 00158 bool Selectable; 00159 00160 //BTX 00161 friend class vtkView; 00162 //ETX 00163 00164 private: 00165 vtkDataRepresentation(const vtkDataRepresentation&); // Not implemented. 00166 void operator=(const vtkDataRepresentation&); // Not implemented. 00167 }; 00168 00169 #endif