ParaView
vtkPythonAnnotationFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPythonAnnotationFilter.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 =========================================================================*/
37 #ifndef vtkPythonAnnotationFilter_h
38 #define vtkPythonAnnotationFilter_h
39 
40 #include "vtkPVClientServerCoreCoreModule.h" //needed for exports
41 #include "vtkTableAlgorithm.h"
42 
43 class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPythonAnnotationFilter : public vtkTableAlgorithm
44 {
45 public:
46  static vtkPythonAnnotationFilter* New();
47  vtkTypeMacro(vtkPythonAnnotationFilter, vtkTableAlgorithm);
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
56  vtkSetStringMacro(Expression);
57  vtkGetStringMacro(Expression);
59 
61 
67  vtkSetMacro(ArrayAssociation, int);
68  vtkGetMacro(ArrayAssociation, int);
70 
72 
75  vtkGetStringMacro(ComputedAnnotationValue);
77 
78  //------------------------------------------------------------------------------
80 
84  vtkGetMacro(DataTimeValid, bool);
85  vtkGetMacro(DataTime, double);
87 
88  vtkGetMacro(NumberOfTimeSteps, int);
89  double GetTimeStep(int index)
90  {
91  return (index < this->NumberOfTimeSteps ? this->TimeSteps[index] : 0.0);
92  }
93 
94  vtkGetMacro(TimeRangeValid, bool);
95  vtkGetVector2Macro(TimeRange, double);
96  vtkGetObjectMacro(CurrentInputDataObject, vtkDataObject);
97  void SetComputedAnnotationValue(const char* value);
98 
99 protected:
102 
103  virtual int FillInputPortInformation(int port, vtkInformation* info);
104  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
105  vtkInformationVector* outputVector);
106 
107  virtual void EvaluateExpression();
108 
109  char* Expression;
112 
113 private:
114  vtkPythonAnnotationFilter(const vtkPythonAnnotationFilter&) VTK_DELETE_FUNCTION;
115  void operator=(const vtkPythonAnnotationFilter&) VTK_DELETE_FUNCTION;
116 
117  bool DataTimeValid;
118  double DataTime;
119  int NumberOfTimeSteps;
120  double* TimeSteps;
121  bool TimeRangeValid;
122  double TimeRange[2];
123  vtkDataObject* CurrentInputDataObject;
124 };
125 
126 #endif
filter used to generate text annotation from Python expressions.