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 "vtkSmartPointer.h" // needed for vtkSmartPointer
21 #include "vtkWeakPointer.h" // needed for vtkWeakPointer
22 
23 #include <map> // needed for std::map
24 #include <set> // needed for std::set
25 #include <vector> // needed for std::vector
26 
29 class vtkCSVExporter;
30 class vtkDataObjectTree;
31 class vtkPVContextView;
33 class vtkTable;
34 
36 {
37 public:
38  static vtkChartRepresentation* New();
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
46  void SetSelectionRepresentation(vtkChartSelectionRepresentation*);
47 
51  void SetVisibility(bool visible) override;
52 
59  void MarkModified() override;
60 
61  // *************************************************************************
62 
64 
68  void SetFieldAssociation(int);
69  vtkGetMacro(FieldAssociation, int);
71 
73 
79  vtkSetStringMacro(ActiveAssembly);
80  vtkGetStringMacro(ActiveAssembly);
82 
84 
87  void AddBlockSelector(const char* selector);
88  void RemoveAllBlockSelectors();
90 
95  unsigned int Initialize(unsigned int minIdAvailable, unsigned int maxIdAvailable) override;
96 
105  vtkInformation* outInfo) override;
106 
114  virtual std::string GetDefaultSeriesLabel(
115  const std::string& tableName, const std::string& columnName);
116 
118 
122  vtkSetMacro(FlattenTable, int);
123  vtkGetMacro(FlattenTable, int);
125 
139  virtual bool MapSelectionToInput(vtkSelection* sel);
140 
151  virtual bool MapSelectionToView(vtkSelection* sel);
152 
154 
159  virtual bool Export(vtkAbstractChartExporter* vtkNotUsed(exporter)) { return false; }
161 
163  {
164  MERGED_BLOCKS = 0,
165  INDIVIDUAL_BLOCKS = 1,
166  };
167 
169 
174  vtkGetMacro(ArraySelectionMode, int);
175  void SetArraySelectionMode(int mode);
177 
179 
183  vtkGetMacro(ShowBlockName, bool);
184  vtkSetMacro(ShowBlockName, bool);
185  vtkBooleanMacro(ShowBlockName, bool);
187 
189 
200  void SetPlaceHolderDataType(int datatype);
201  vtkGetMacro(PlaceHolderDataType, int);
203 protected:
205  ~vtkChartRepresentation() override;
206 
210  int FillInputPortInformation(int port, vtkInformation* info) override;
211 
222  virtual void PrepareForRendering() {}
223 
235 
241  bool AddToView(vtkView* view) override;
242 
248  bool RemoveFromView(vtkView* view) override;
249 
256  vtkTable* GetLocalOutput(bool pre_delivery = false);
257 
262  virtual vtkSmartPointer<vtkDataObject> TransformInputData(vtkDataObject* data);
263 
271  virtual vtkSmartPointer<vtkDataObject> ReduceDataToRoot(vtkDataObject* data);
272 
280 
281  using MapOfTables = std::map<std::string, std::pair<vtkSmartPointer<vtkTable>, unsigned int>>;
285  bool GetLocalOutput(MapOfTables& tables);
286 
289 
290  std::vector<std::string> BlockSelectors;
291  std::set<unsigned int> CompositeIndices; // the selected blocks
292 
293 private:
294  int FieldAssociation;
295  int FlattenTable;
296  int ArraySelectionMode = MERGED_BLOCKS;
297 
298  // This is used to be able to create the correct placeHolder in RequestData for the client
299  int PlaceHolderDataType = VTK_PARTITIONED_DATA_SET_COLLECTION;
300 
301  char* ActiveAssembly = nullptr;
302 
303  vtkWeakPointer<vtkChartSelectionRepresentation> SelectionRepresentation;
304 
305  bool ShowBlockName = true;
306 
308  void operator=(const vtkChartRepresentation&) = delete;
309 
310  vtkTimeStamp PrepareForRenderingTime;
311  vtkMTimeType LastLocalOutputMTime;
313  vtkSmartPointer<vtkDataObjectTree> LocalOutputRequestData;
314 };
315 
316 #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 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)
std::map< std::string, std::pair< vtkSmartPointer< vtkTable >, unsigned int > > MapOfTables
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()
virtual bool Export(vtkAbstractChartExporter *vtkNotUsed(exporter))
Called by vtkPVContextView::Export() to export the representation&#39;s data to a CSV file...
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...
exporter used by certain views to export data into a file or stream.
representation for showing selections in chart views.