vtkChartRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkChartRepresentation_h
17 #define vtkChartRepresentation_h
18 
20 #include "vtkParaViewDeprecation.h" // for deprecation
21 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
22 #include "vtkWeakPointer.h" // needed for vtkWeakPointer
23 
24 #include <map> // needed for std::map
25 #include <set> // needed for std::set
26 #include <vector> // needed for std::vector
27 
30 class vtkCSVExporter;
31 class vtkDataObjectTree;
32 class vtkPVContextView;
34 class vtkTable;
35 
37 {
38 public:
39  static vtkChartRepresentation* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
47  void SetSelectionRepresentation(vtkChartSelectionRepresentation*);
48 
52  void SetVisibility(bool visible) override;
53 
60  void MarkModified() override;
61 
62  // *************************************************************************
63 
65 
69  void SetFieldAssociation(int);
70  vtkGetMacro(FieldAssociation, int);
72 
74 
80  vtkSetStringMacro(ActiveAssembly);
81  vtkGetStringMacro(ActiveAssembly);
83 
85 
88  void AddBlockSelector(const char* selector);
89  void RemoveAllBlockSelectors();
91 
93 
97  PARAVIEW_DEPRECATED_IN_6_1_0("Use AddBlockSelector() with SetActiveAssembly instead. "
98  "CompositeDataSetIndex is no longer used.")
99  void SetCompositeDataSetIndex(unsigned int); // only used for single block selection
100  PARAVIEW_DEPRECATED_IN_6_1_0("Use AddBlockSelector() with SetActiveAssembly instead. "
101  "CompositeDataSetIndex is no longer used.")
102  void AddCompositeDataSetIndex(unsigned int);
103  PARAVIEW_DEPRECATED_IN_6_1_0("Use RemoveAllBlockSelectors() with SetActiveAssembly instead. "
104  "CompositeDataSetIndex is no longer used.")
105  void ResetCompositeDataSetIndices();
107 
112  unsigned int Initialize(unsigned int minIdAvailable, unsigned int maxIdAvailable) override;
113 
121  int ProcessViewRequest(vtkInformationRequestKey* request_type, vtkInformation* inInfo,
122  vtkInformation* outInfo) override;
123 
131  virtual std::string GetDefaultSeriesLabel(
132  const std::string& tableName, const std::string& columnName);
133 
135 
139  vtkSetMacro(FlattenTable, int);
140  vtkGetMacro(FlattenTable, int);
142 
156  virtual bool MapSelectionToInput(vtkSelection* sel);
157 
168  virtual bool MapSelectionToView(vtkSelection* sel);
169 
171 
176  virtual bool Export(vtkAbstractChartExporter* vtkNotUsed(exporter)) { return false; }
178 
180  {
181  MERGED_BLOCKS = 0,
182  INDIVIDUAL_BLOCKS = 1,
183  };
184 
186 
191  vtkGetMacro(ArraySelectionMode, int);
192  void SetArraySelectionMode(int mode);
194 
196 
207  void SetPlaceHolderDataType(int datatype);
208  vtkGetMacro(PlaceHolderDataType, int);
210 protected:
212  ~vtkChartRepresentation() override;
213 
217  int FillInputPortInformation(int port, vtkInformation* info) override;
218 
229  virtual void PrepareForRendering() {}
230 
242 
248  bool AddToView(vtkView* view) override;
249 
255  bool RemoveFromView(vtkView* view) override;
256 
263  vtkTable* GetLocalOutput(bool pre_delivery = false);
264 
269  virtual vtkSmartPointer<vtkDataObject> TransformInputData(vtkDataObject* data);
270 
278  virtual vtkSmartPointer<vtkDataObject> ReduceDataToRoot(vtkDataObject* data);
279 
287 
288  using MapOfTables = std::map<std::string, std::pair<vtkSmartPointer<vtkTable>, unsigned int>>;
292  bool GetLocalOutput(MapOfTables& tables);
293 
297  int ArraySelectionMode = MERGED_BLOCKS;
298 
299  // This is used to be able to create the correct placeHolder in RequestData for the client
300  int PlaceHolderDataType = VTK_PARTITIONED_DATA_SET_COLLECTION;
301 
303 
304  char* ActiveAssembly = nullptr;
305  std::vector<std::string> BlockSelectors;
306  std::set<unsigned int> CompositeIndices; // the selected blocks
307 
309 
310 private:
312  void operator=(const vtkChartRepresentation&) = delete;
313 
314  vtkTimeStamp PrepareForRenderingTime;
315  vtkMTimeType LastLocalOutputMTime;
317  vtkSmartPointer<vtkDataObjectTree> LocalOutputRequestData;
318 };
319 
320 #endif
data
virtual void PrepareForRendering()
This method is called before actual render if this->MTime was modified since the last time this metho...
#define VTKREMOTINGVIEWS_EXPORT
std::vector< std::string > BlockSelectors
vtkPVDataRepresentation adds some ParaView specific API to data representations.
vtkWeakPointer< vtkPVContextView > ContextView
vtkWeakPointer< vtkChartSelectionRepresentation > SelectionRepresentation
bool AddToView(vtkView *view) override
Making these methods public.
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
vtkTypeUInt64 vtkMTimeType
virtual int FillInputPortInformation(int port, vtkInformation *info)
std::map< std::string, std::pair< vtkSmartPointer< vtkTable >, unsigned int > > MapOfTables
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
#define PARAVIEW_DEPRECATED_IN_6_1_0(reason)
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 CSV.
vtkSmartPointer< vtkDataObjectTree > LocalOutput
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...
#define const
Definition: zconf.h:238
exporter used by certain views to export data into a file or stream.
representation for showing selections in chart views.