ParaView
Public Member Functions | Protected Member Functions | List of all members
vtkSMPropertyHelper Class Reference

helper class to get/set property values. More...

#include <vtkSMPropertyHelper.h>

Inheritance diagram for vtkSMPropertyHelper:
Inheritance graph
[legend]
Collaboration diagram for vtkSMPropertyHelper:
Collaboration graph
[legend]

Public Member Functions

void UpdateValueFromServer ()
 Updates the property value by fetching the value from the server. More...
 
void SetNumberOfElements (unsigned int elems)
 Set the number of elements in the property. More...
 
unsigned int GetNumberOfElements () const
 Get the number of elements in the property. More...
 
void RemoveAllValues ()
 Equivalent to SetNumberOfElements(0). More...
 
vtkVariant GetAsVariant (unsigned int index)
 Get value as a variant. More...
 
template<class T >
std::vector< T > GetArray ()
 Templated method to call GetIntArray(), GetDoubleArray(), GetIdTypeArray(). More...
 
template<class T >
GetAs (unsigned int index=0)
 Templated method to call GetAsInt(), GetAsDouble(), GetAsIdType() Note, we only provide implementations for T==double, int, vtkIdType. More...
 
vtkIdType GetAsIdType (unsigned int index=0)
 
std::vector< vtkIdType > GetIdTypeArray ()
 
void SetUseUnchecked (bool val)
 Get/Set whether to use unchecked properties. More...
 
bool GetUseUnchecked ()
 
bool Copy (vtkSMPropertyHelper &source)
 Copy property values from another vtkSMPropertyHelper. More...
 
template<>
std::vector< int > GetArray ()
 
template<>
std::vector< double > GetArray ()
 
template<>
int GetAs (unsigned int index)
 
template<>
double GetAs (unsigned int index)
 
 vtkSMPropertyHelper (vtkSMProxy *proxy, const char *name, bool quiet=false)
 If quiet is true, then no errors or warning are raised if the property is missing or of incorrect type. More...
 
 vtkSMPropertyHelper (vtkSMProperty *property, bool quiet=false)
 If quiet is true, then no errors or warning are raised if the property is missing or of incorrect type. More...
 
 ~vtkSMPropertyHelper ()
 If quiet is true, then no errors or warning are raised if the property is missing or of incorrect type. More...
 
void Set (int value)
 Set/Get methods with int API. More...
 
void Set (unsigned int index, int value)
 Set/Get methods with int API. More...
 
void Set (const int *values, unsigned int count)
 Set/Get methods with int API. More...
 
int GetAsInt (unsigned int index=0)
 Set/Get methods with int API. More...
 
unsigned int Get (int *values, unsigned int count=1)
 Set/Get methods with int API. More...
 
std::vector< int > GetIntArray ()
 Set/Get methods with int API. More...
 
void Set (double value)
 Set/Get methods with double API. More...
 
void Set (unsigned int index, double value)
 Set/Get methods with double API. More...
 
void Set (const double *values, unsigned int count)
 Set/Get methods with double API. More...
 
double GetAsDouble (unsigned int index=0)
 Set/Get methods with double API. More...
 
unsigned int Get (double *values, unsigned int count=1)
 Set/Get methods with double API. More...
 
std::vector< double > GetDoubleArray ()
 Set/Get methods with double API. More...
 
void Set (const char *value)
 Set/Get methods for vtkSMStringVectorProperty. More...
 
void Set (unsigned int index, const char *value)
 Set/Get methods for vtkSMStringVectorProperty. More...
 
const char * GetAsString (unsigned int index=0)
 Set/Get methods for vtkSMStringVectorProperty. More...
 
void Set (vtkSMProxy *value, unsigned int outputport=0)
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
void Set (unsigned int index, vtkSMProxy *value, unsigned int outputport=0)
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
void Set (vtkSMProxy **value, unsigned int count, unsigned int *outputports=NULL)
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
void Add (vtkSMProxy *value, unsigned int outputport=0)
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
void Remove (vtkSMProxy *value)
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
vtkSMProxyGetAsProxy (unsigned int index=0)
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
unsigned int GetOutputPort (unsigned int index=0)
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
void SetStatus (const char *key, int value)
 This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status. More...
 
int GetStatus (const char *key, int default_value=0)
 This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status. More...
 
void SetStatus (const char *key, double *values, int num_values)
 This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status. More...
 
bool GetStatus (const char *key, double *values, int num_values)
 This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status. More...
 
void SetStatus (const char *key, const char *value)
 This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status (as a string) More...
 
const char * GetStatus (const char *key, const char *default_value)
 This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status (as a string) More...
 
void SetInputArrayToProcess (int fieldAssociation, const char *arrayName)
 For vtkSMStringVectorProperty that is used to setting input array to process on algorithms, this provides a convenient API to get/set the values. More...
 
int GetInputArrayAssociation ()
 For vtkSMStringVectorProperty that is used to setting input array to process on algorithms, this provides a convenient API to get/set the values. More...
 
const char * GetInputArrayNameToProcess ()
 For vtkSMStringVectorProperty that is used to setting input array to process on algorithms, this provides a convenient API to get/set the values. More...
 

Protected Member Functions

void setUseUnchecked (bool useUnchecked)
 

Detailed Description

helper class to get/set property values.

vtkSMPropertyHelper is a helper class to get/set property values in a type independent fashion. eg.

vtkSMPropertyHelper(proxy, "Visibility").Set(0);
vtkSMPropertyHelper(proxy, "Input").Set(inputProxy, 0);
double center[3] = {...};
vtkSMPropertyHelper(proxy, "Center").Set(center, 3);
Caveat:
This class is not wrapped, hence not available in any of the wrapped languagues such as python.

Definition at line 89 of file vtkSMPropertyHelper.h.

Constructor & Destructor Documentation

§ vtkSMPropertyHelper() [1/2]

vtkSMPropertyHelper::vtkSMPropertyHelper ( vtkSMProxy proxy,
const char *  name,
bool  quiet = false 
)

If quiet is true, then no errors or warning are raised if the property is missing or of incorrect type.

§ vtkSMPropertyHelper() [2/2]

vtkSMPropertyHelper::vtkSMPropertyHelper ( vtkSMProperty property,
bool  quiet = false 
)

If quiet is true, then no errors or warning are raised if the property is missing or of incorrect type.

§ ~vtkSMPropertyHelper()

vtkSMPropertyHelper::~vtkSMPropertyHelper ( )

If quiet is true, then no errors or warning are raised if the property is missing or of incorrect type.

Member Function Documentation

§ UpdateValueFromServer()

void vtkSMPropertyHelper::UpdateValueFromServer ( )

Updates the property value by fetching the value from the server.

This only works for properties with InformationOnly attribute set to 1. For all other properties, this has no effect.

§ SetNumberOfElements()

void vtkSMPropertyHelper::SetNumberOfElements ( unsigned int  elems)

Set the number of elements in the property.

For vtkSMProxyProperty, this is equivalent to SetNumberOfProxies().

§ GetNumberOfElements()

unsigned int vtkSMPropertyHelper::GetNumberOfElements ( ) const

Get the number of elements in the property.

For vtkSMProxyProperty, this is equivalent to GetNumberOfProxies().

§ RemoveAllValues()

void vtkSMPropertyHelper::RemoveAllValues ( )
inline

Equivalent to SetNumberOfElements(0).

Definition at line 124 of file vtkSMPropertyHelper.h.

§ GetAsVariant()

vtkVariant vtkSMPropertyHelper::GetAsVariant ( unsigned int  index)

Get value as a variant.

§ GetArray() [1/3]

template<class T >
std::vector<T> vtkSMPropertyHelper::GetArray ( )

Templated method to call GetIntArray(), GetDoubleArray(), GetIdTypeArray().

Note, we only provide implementations for T==double, int, vtkIdType.

§ GetAs() [1/3]

template<class T >
T vtkSMPropertyHelper::GetAs ( unsigned int  index = 0)

Templated method to call GetAsInt(), GetAsDouble(), GetAsIdType() Note, we only provide implementations for T==double, int, vtkIdType.

§ Set() [1/11]

void vtkSMPropertyHelper::Set ( int  value)
inline

Set/Get methods with int API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

Definition at line 150 of file vtkSMPropertyHelper.h.

§ Set() [2/11]

void vtkSMPropertyHelper::Set ( unsigned int  index,
int  value 
)

Set/Get methods with int API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ Set() [3/11]

void vtkSMPropertyHelper::Set ( const int *  values,
unsigned int  count 
)

Set/Get methods with int API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ GetAsInt()

int vtkSMPropertyHelper::GetAsInt ( unsigned int  index = 0)

Set/Get methods with int API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ Get() [1/2]

unsigned int vtkSMPropertyHelper::Get ( int *  values,
unsigned int  count = 1 
)

Set/Get methods with int API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ GetIntArray()

std::vector<int> vtkSMPropertyHelper::GetIntArray ( )

Set/Get methods with int API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ Set() [4/11]

void vtkSMPropertyHelper::Set ( double  value)
inline

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

Definition at line 163 of file vtkSMPropertyHelper.h.

§ Set() [5/11]

void vtkSMPropertyHelper::Set ( unsigned int  index,
double  value 
)

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ Set() [6/11]

void vtkSMPropertyHelper::Set ( const double *  values,
unsigned int  count 
)

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ GetAsDouble()

double vtkSMPropertyHelper::GetAsDouble ( unsigned int  index = 0)

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ Get() [2/2]

unsigned int vtkSMPropertyHelper::Get ( double *  values,
unsigned int  count = 1 
)

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ GetDoubleArray()

std::vector<double> vtkSMPropertyHelper::GetDoubleArray ( )

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

§ GetAsIdType()

vtkIdType vtkSMPropertyHelper::GetAsIdType ( unsigned int  index = 0)

§ GetIdTypeArray()

std::vector<vtkIdType> vtkSMPropertyHelper::GetIdTypeArray ( )

§ Set() [7/11]

void vtkSMPropertyHelper::Set ( const char *  value)
inline

Set/Get methods for vtkSMStringVectorProperty.

Calling these methods on any other type of property will raise errors. These overloads can be used for vtkSMIntVectorProperty with an enumeration domain as well, in which case the string-to-int (and vice-versa) translations are done internally.

Definition at line 194 of file vtkSMPropertyHelper.h.

§ Set() [8/11]

void vtkSMPropertyHelper::Set ( unsigned int  index,
const char *  value 
)

Set/Get methods for vtkSMStringVectorProperty.

Calling these methods on any other type of property will raise errors. These overloads can be used for vtkSMIntVectorProperty with an enumeration domain as well, in which case the string-to-int (and vice-versa) translations are done internally.

§ GetAsString()

const char* vtkSMPropertyHelper::GetAsString ( unsigned int  index = 0)

Set/Get methods for vtkSMStringVectorProperty.

Calling these methods on any other type of property will raise errors. These overloads can be used for vtkSMIntVectorProperty with an enumeration domain as well, in which case the string-to-int (and vice-versa) translations are done internally.

§ Set() [9/11]

void vtkSMPropertyHelper::Set ( vtkSMProxy value,
unsigned int  outputport = 0 
)
inline

Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty.

Calling these methods on any other type of property will raise errors. The option outputport(s) argument is used only for vtkSMInputProperty.

Definition at line 205 of file vtkSMPropertyHelper.h.

§ Set() [10/11]

void vtkSMPropertyHelper::Set ( unsigned int  index,
vtkSMProxy value,
unsigned int  outputport = 0 
)

Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty.

Calling these methods on any other type of property will raise errors. The option outputport(s) argument is used only for vtkSMInputProperty.

§ Set() [11/11]

void vtkSMPropertyHelper::Set ( vtkSMProxy **  value,
unsigned int  count,
unsigned int *  outputports = NULL 
)

Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty.

Calling these methods on any other type of property will raise errors. The option outputport(s) argument is used only for vtkSMInputProperty.

§ Add()

void vtkSMPropertyHelper::Add ( vtkSMProxy value,
unsigned int  outputport = 0 
)

Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty.

Calling these methods on any other type of property will raise errors. The option outputport(s) argument is used only for vtkSMInputProperty.

§ Remove()

void vtkSMPropertyHelper::Remove ( vtkSMProxy value)

Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty.

Calling these methods on any other type of property will raise errors. The option outputport(s) argument is used only for vtkSMInputProperty.

§ GetAsProxy()

vtkSMProxy* vtkSMPropertyHelper::GetAsProxy ( unsigned int  index = 0)

Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty.

Calling these methods on any other type of property will raise errors. The option outputport(s) argument is used only for vtkSMInputProperty.

§ GetOutputPort()

unsigned int vtkSMPropertyHelper::GetOutputPort ( unsigned int  index = 0)

Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty.

Calling these methods on any other type of property will raise errors. The option outputport(s) argument is used only for vtkSMInputProperty.

§ SetStatus() [1/3]

void vtkSMPropertyHelper::SetStatus ( const char *  key,
int  value 
)

This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status.

§ GetStatus() [1/3]

int vtkSMPropertyHelper::GetStatus ( const char *  key,
int  default_value = 0 
)

This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status.

§ SetStatus() [2/3]

void vtkSMPropertyHelper::SetStatus ( const char *  key,
double *  values,
int  num_values 
)

This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status.

§ GetStatus() [2/3]

bool vtkSMPropertyHelper::GetStatus ( const char *  key,
double *  values,
int  num_values 
)

This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status.

§ SetStatus() [3/3]

void vtkSMPropertyHelper::SetStatus ( const char *  key,
const char *  value 
)

This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status (as a string)

§ GetStatus() [3/3]

const char* vtkSMPropertyHelper::GetStatus ( const char *  key,
const char *  default_value 
)

This API is useful for setting values on vtkSMStringVectorProperty that is used for status where the first value is the name of the array (for example) and the second value is it's status (as a string)

§ SetInputArrayToProcess()

void vtkSMPropertyHelper::SetInputArrayToProcess ( int  fieldAssociation,
const char *  arrayName 
)

For vtkSMStringVectorProperty that is used to setting input array to process on algorithms, this provides a convenient API to get/set the values.

§ GetInputArrayAssociation()

int vtkSMPropertyHelper::GetInputArrayAssociation ( )

For vtkSMStringVectorProperty that is used to setting input array to process on algorithms, this provides a convenient API to get/set the values.

§ GetInputArrayNameToProcess()

const char* vtkSMPropertyHelper::GetInputArrayNameToProcess ( )

For vtkSMStringVectorProperty that is used to setting input array to process on algorithms, this provides a convenient API to get/set the values.

§ SetUseUnchecked()

void vtkSMPropertyHelper::SetUseUnchecked ( bool  val)
inline

Get/Set whether to use unchecked properties.

Definition at line 258 of file vtkSMPropertyHelper.h.

§ GetUseUnchecked()

bool vtkSMPropertyHelper::GetUseUnchecked ( )
inline

Definition at line 259 of file vtkSMPropertyHelper.h.

§ Copy()

bool vtkSMPropertyHelper::Copy ( vtkSMPropertyHelper source)

Copy property values from another vtkSMPropertyHelper.

This only works for compatible properties and currently only supported for numeric vtkSMVectorProperty subclasses.

§ setUseUnchecked()

void vtkSMPropertyHelper::setUseUnchecked ( bool  useUnchecked)
inlineprotected

Definition at line 269 of file vtkSMPropertyHelper.h.

§ GetArray() [2/3]

template<>
std::vector<int> vtkSMPropertyHelper::GetArray ( )
inline

Definition at line 319 of file vtkSMPropertyHelper.h.

§ GetArray() [3/3]

template<>
std::vector<double> vtkSMPropertyHelper::GetArray ( )
inline

Definition at line 325 of file vtkSMPropertyHelper.h.

§ GetAs() [2/3]

template<>
int vtkSMPropertyHelper::GetAs ( unsigned int  index)
inline

Definition at line 339 of file vtkSMPropertyHelper.h.

§ GetAs() [3/3]

template<>
double vtkSMPropertyHelper::GetAs ( unsigned int  index)
inline

Definition at line 345 of file vtkSMPropertyHelper.h.

Member Data Documentation

§ Property

vtkSMProperty* vtkSMPropertyHelper::Property

Definition at line 307 of file vtkSMPropertyHelper.h.

§ VectorProperty

vtkSMVectorProperty* vtkSMPropertyHelper::VectorProperty

Definition at line 308 of file vtkSMPropertyHelper.h.

§ IntVectorProperty

vtkSMIntVectorProperty* vtkSMPropertyHelper::IntVectorProperty

Definition at line 309 of file vtkSMPropertyHelper.h.

§ DoubleVectorProperty

vtkSMDoubleVectorProperty* vtkSMPropertyHelper::DoubleVectorProperty

Definition at line 310 of file vtkSMPropertyHelper.h.

§ IdTypeVectorProperty

vtkSMIdTypeVectorProperty* vtkSMPropertyHelper::IdTypeVectorProperty

Definition at line 311 of file vtkSMPropertyHelper.h.

§ StringVectorProperty

vtkSMStringVectorProperty* vtkSMPropertyHelper::StringVectorProperty

Definition at line 312 of file vtkSMPropertyHelper.h.

§ ProxyProperty

vtkSMProxyProperty* vtkSMPropertyHelper::ProxyProperty

Definition at line 313 of file vtkSMPropertyHelper.h.

§ InputProperty

vtkSMInputProperty* vtkSMPropertyHelper::InputProperty

Definition at line 314 of file vtkSMPropertyHelper.h.


The documentation for this class was generated from the following file: