vtkChartRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkChartRepresentation.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkChartRepresentation_h
29 #define vtkChartRepresentation_h
30 
32 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
33 #include "vtkStdString.h" // needed for vtkStdString.
34 #include "vtkWeakPointer.h" // needed for vtkWeakPointer
35 
36 #include <map> // needed for map
37 #include <set> //needed for ivars
38 
40 class vtkCSVExporter;
42 class vtkPVContextView;
44 class vtkTable;
45 
46 class VTKREMOTINGVIEWS_EXPORT vtkChartRepresentation : public vtkPVDataRepresentation
47 {
48 public:
49  static vtkChartRepresentation* New();
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
57  void SetSelectionRepresentation(vtkChartSelectionRepresentation*);
58 
62  void SetVisibility(bool visible) override;
63 
70  void MarkModified() override;
71 
72  // *************************************************************************
73 
75 
79  void SetFieldAssociation(int);
80  vtkGetMacro(FieldAssociation, int);
82 
83  // methods to control block selection.
84  // When changed, this will call MarkModified().
85  void SetCompositeDataSetIndex(unsigned int); // only used for single block selection
86  void AddCompositeDataSetIndex(unsigned int);
87  void ResetCompositeDataSetIndices();
88 
93  unsigned int Initialize(unsigned int minIdAvailable, unsigned int maxIdAvailable) override;
94 
103  vtkInformation* outInfo) override;
104 
112  virtual vtkStdString GetDefaultSeriesLabel(
113  const vtkStdString& tableName, const vtkStdString& columnName);
114 
116 
120  vtkSetMacro(FlattenTable, int);
121  vtkGetMacro(FlattenTable, int);
123 
137  virtual bool MapSelectionToInput(vtkSelection* sel);
138 
149  virtual bool MapSelectionToView(vtkSelection* sel);
150 
156  virtual bool Export(vtkCSVExporter* vtkNotUsed(exporter)) { return false; }
157 
158 protected:
160  ~vtkChartRepresentation() override;
161 
165  int FillInputPortInformation(int port, vtkInformation* info) override;
166 
177  virtual void PrepareForRendering() {}
178 
190 
196  bool AddToView(vtkView* view) override;
197 
203  bool RemoveFromView(vtkView* view) override;
204 
211  vtkTable* GetLocalOutput(bool pre_delivery = false);
212 
217  virtual vtkSmartPointer<vtkDataObject> TransformInputData(vtkDataObject* data);
218 
226  virtual vtkSmartPointer<vtkDataObject> ReduceDataToRoot(vtkDataObject* data);
227 
235 
236  typedef std::map<std::string, vtkSmartPointer<vtkTable> > MapOfTables;
241  bool GetLocalOutput(MapOfTables& tables);
242 
246 
248  std::set<unsigned int> CompositeIndices; // the selected blocks
249 
251 
252 private:
254  void operator=(const vtkChartRepresentation&) = delete;
255 
256  vtkTimeStamp PrepareForRenderingTime;
257  vtkMTimeType LastLocalOutputMTime;
259  vtkSmartPointer<vtkMultiBlockDataSet> LocalOutputRequestData;
260 };
261 
262 #endif
virtual void PrepareForRendering()
This method is called before actual render if this->MTime was modified since the last time this metho...
vtkPVDataRepresentation adds some ParaView specific API to data representations.
vtkSmartPointer< vtkMultiBlockDataSet > LocalOutput
vtkWeakPointer< vtkPVContextView > ContextView
vtkWeakPointer< vtkChartSelectionRepresentation > SelectionRepresentation
bool AddToView(vtkView *view) override
Making these methods public.
virtual bool Export(vtkCSVExporter *vtkNotUsed(exporter))
Called by vtkPVContextView::Export() to export the representation's data to a CSV file.
std::map< std::string, vtkSmartPointer< vtkTable > > MapOfTables
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
vtkTypeUInt64 vtkMTimeType
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
virtual unsigned int Initialize(unsigned int minIdAvailable, unsigned int maxIdAvailable)
Initialize the representation with an identifier range so each internal representation can own a uniq...
virtual int FillInputPortInformation(int port, vtkInformation *info)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
bool RemoveFromView(vtkView *view) override
Making these methods public.
virtual void MarkModified()
This is one of the most important functions.
static vtkDataRepresentation * New()
vtkPVContextView adopts vtkContextView so that it can be used in ParaView configurations.
vtkChartRepresentation is the base representation for charting representations.
exporter used by certain views to export data as a CSV file.
void PrintSelf(ostream &os, vtkIndent indent) override
std::set< unsigned int > CompositeIndices
vtkSelectionDeliveryFilter is a filter that can deliver vtkSelection from data-server nodes to the cl...
representation for showing selections in chart views.