Commit dcbc481e authored by Schuyler Kylstra's avatar Schuyler Kylstra

14900 Added an option to annotate a suffix to global data

parent 27ec7553
......@@ -41,6 +41,7 @@ vtkStandardNewMacro(vtkAnnotateGlobalDataFilter);
vtkAnnotateGlobalDataFilter::vtkAnnotateGlobalDataFilter()
{
this->Prefix = 0;
this->Postfix = 0;
this->FieldArrayName = 0;
this->SetArrayAssociation(vtkDataObject::FIELD);
}
......@@ -49,6 +50,7 @@ vtkAnnotateGlobalDataFilter::vtkAnnotateGlobalDataFilter()
vtkAnnotateGlobalDataFilter::~vtkAnnotateGlobalDataFilter()
{
this->SetPrefix(0);
this->SetPostfix(0);
this->SetFieldArrayName(0);
}
......@@ -78,4 +80,5 @@ void vtkAnnotateGlobalDataFilter::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "FieldArrayName: " << (this->FieldArrayName?
this->FieldArrayName : "(none)") << endl;
os << indent << "Prefix: " << (this->Prefix? this->Prefix : "(none)") << endl;
os << indent << "Postfix: " << (this->Postfix? this->Postfix : "(none)") << endl;
}
......@@ -47,6 +47,11 @@ public:
vtkSetStringMacro(Prefix);
vtkGetStringMacro(Prefix);
// Description:
// Set the text prefix to display in front of the Field value
vtkSetStringMacro(Postfix);
vtkGetStringMacro(Postfix);
protected:
vtkAnnotateGlobalDataFilter();
~vtkAnnotateGlobalDataFilter();
......@@ -54,6 +59,7 @@ protected:
virtual void EvaluateExpression();
char* Prefix;
char* Postfix;
char* FieldArrayName;
private:
vtkAnnotateGlobalDataFilter(const vtkAnnotateGlobalDataFilter&); // Not implemented
......
......@@ -116,6 +116,13 @@ timestep.
<Documentation>Text that is used as a prefix to the field
value</Documentation>
</StringVectorProperty>
<StringVectorProperty command="SetPostfix"
default_values=""
name="Suffix"
number_of_elements="1">
<Documentation>Text that is used as a suffix to the field
value</Documentation>
</StringVectorProperty>
<Hints>
<Visibility replace_input="0" />
<OutputPort index="0"
......
......@@ -137,6 +137,7 @@ def execute_on_global_data(self):
except: pass
expression = self.GetPrefix() if self.GetPrefix() else ""
expression += str(chosen_element)
expression += self.GetPostfix() if self.GetPostfix() else ""
self.SetComputedAnnotationValue(expression)
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment