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 
200  vtkGetMacro(ShowBlockName, bool);
201  vtkSetMacro(ShowBlockName, bool);
202  vtkBooleanMacro(ShowBlockName, bool);
204 
206 
217  void SetPlaceHolderDataType(int datatype);
218  vtkGetMacro(PlaceHolderDataType, int);
220 protected:
222  ~vtkChartRepresentation() override;
223 
227  int FillInputPortInformation(int port, vtkInformation* info) override;
228 
239  virtual void PrepareForRendering() {}
240 
252 
258  bool AddToView(vtkView* view) override;
259 
265  bool RemoveFromView(vtkView* view) override;
266 
273  vtkTable* GetLocalOutput(bool pre_delivery = false);
274 
279  virtual vtkSmartPointer<vtkDataObject> TransformInputData(vtkDataObject* data);
280 
288  virtual vtkSmartPointer<vtkDataObject> ReduceDataToRoot(vtkDataObject* data);
289 
297 
298  using MapOfTables = std::map<std::string, std::pair<vtkSmartPointer<vtkTable>, unsigned int>>;
302  bool GetLocalOutput(MapOfTables& tables);
303 
306 
307  std::vector<std::string> BlockSelectors;
308  std::set<unsigned int> CompositeIndices; // the selected blocks
309 
310 private:
311  int FieldAssociation;
312  int FlattenTable;
313  int ArraySelectionMode = MERGED_BLOCKS;
314 
315  // This is used to be able to create the correct placeHolder in RequestData for the client
316  int PlaceHolderDataType = VTK_PARTITIONED_DATA_SET_COLLECTION;
317 
318  char* ActiveAssembly = nullptr;
319 
320  vtkWeakPointer<vtkChartSelectionRepresentation> SelectionRepresentation;
321 
322  bool ShowBlockName = true;
323 
325  void operator=(const vtkChartRepresentation&) = delete;
326 
327  vtkTimeStamp PrepareForRenderingTime;
328  vtkMTimeType LastLocalOutputMTime;
330  vtkSmartPointer<vtkDataObjectTree> LocalOutputRequestData;
331 };
332 
333 #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
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.