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) const
 Get value as a variant. More...
 
template<class T >
std::vector< T > GetArray () const
 Templated method to call GetIntArray(), GetDoubleArray(), GetIdTypeArray(). More...
 
template<class T >
GetAs (unsigned int index=0) const
 Templated method to call GetAsInt(), GetAsDouble(), GetAsIdType() Note, we only provide implementations for T==double, int, vtkIdType. More...
 
vtkIdType GetAsIdType (unsigned int index=0) const
 
std::vector< vtkIdTypeGetIdTypeArray () const
 
void RemoveStatus (const char *key)
 Removes the status value specified for the given key, if any. More...
 
void SetUseUnchecked (bool val)
 Get/Set whether to use unchecked properties. More...
 
bool GetUseUnchecked () const
 
bool Copy (const vtkSMPropertyHelper &source)
 Copy property values from another vtkSMPropertyHelper. More...
 
vtkSMPropertyHelperModified ()
 Set the proxy to modified if necessary before calling Set() Return reference so method chaining can be used. More...
 
template<>
std::vector< intGetArray () const
 
template<>
std::vector< doubleGetArray () const
 
template<>
int GetAs (unsigned int index) const
 
template<>
double GetAs (unsigned int index) const
 
 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...
 
void Append (const int *values, unsigned int count)
 Set/Get methods with int API. More...
 
int GetAsInt (unsigned int index=0) const
 Set/Get methods with int API. More...
 
unsigned int Get (int *values, unsigned int count=1) const
 Set/Get methods with int API. More...
 
std::vector< intGetIntArray () const
 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...
 
void Append (const double *values, unsigned int count)
 Set/Get methods with double API. More...
 
double GetAsDouble (unsigned int index=0) const
 Set/Get methods with double API. More...
 
unsigned int Get (double *values, unsigned int count=1) const
 Set/Get methods with double API. More...
 
std::vector< doubleGetDoubleArray () const
 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) const
 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=nullptr)
 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) const
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
unsigned int GetOutputPort (unsigned int index=0) const
 Set/Get methods for vtkSMProxyProperty or vtkSMInputProperty. More...
 
vtkSMOutputPortGetAsOutputPort (unsigned int index=0) const
 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 its status. More...
 
int GetStatus (const char *key, int default_value=0) const
 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 its 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), the second value is its status and the third value is number of status. More...
 
bool GetStatus (const char *key, double *values, int num_values) const
 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), the second value is its status and the third value is number of status. More...
 
void SetStatus (int key, int *values, int num_values)
 This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example), the second value is its status and the third value is number of status. More...
 
bool GetStatus (int key, int *values, int num_values) const
 This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example), the second value is its status and the third value is number of 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 its status (as a string) More...
 
const char * GetStatus (const char *key, const char *default_value) const
 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 its status (as a string) More...
 
void SetStatus (int key, int value)
 This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example) and the second value is its status. More...
 
int GetStatus (int key, int default_value=0) const
 This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example) and the second value is its status. 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 () const
 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 () const
 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 52 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 87 of file vtkSMPropertyHelper.h.

◆ GetAsVariant()

vtkVariant vtkSMPropertyHelper::GetAsVariant ( unsigned int  index) const

Get value as a variant.

◆ GetArray() [1/3]

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

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) const

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 113 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.

◆ Append() [1/2]

void vtkSMPropertyHelper::Append ( 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) const

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 
) const

Set/Get methods with int API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

◆ GetIntArray()

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

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 127 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.

◆ Append() [2/2]

void vtkSMPropertyHelper::Append ( 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) const

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 
) const

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

◆ GetDoubleArray()

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

Set/Get methods with double API.

Calling these method on vtkSMStringVectorProperty or vtkSMProxyProperty will raise errors.

◆ GetAsIdType()

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

◆ GetIdTypeArray()

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

◆ 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 160 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) const

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 171 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 = nullptr 
)

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) const

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) const

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.

◆ GetAsOutputPort()

vtkSMOutputPort* vtkSMPropertyHelper::GetAsOutputPort ( unsigned int  index = 0) const

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/5]

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 its status.

◆ GetStatus() [1/5]

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

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 its status.

◆ SetStatus() [2/5]

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), the second value is its status and the third value is number of status.

◆ GetStatus() [2/5]

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

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), the second value is its status and the third value is number of status.

◆ SetStatus() [3/5]

void vtkSMPropertyHelper::SetStatus ( int  key,
int values,
int  num_values 
)

This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example), the second value is its status and the third value is number of status.

◆ GetStatus() [3/5]

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

This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example), the second value is its status and the third value is number of status.

◆ SetStatus() [4/5]

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 its status (as a string)

◆ GetStatus() [4/5]

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

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 its status (as a string)

◆ RemoveStatus()

void vtkSMPropertyHelper::RemoveStatus ( const char *  key)

Removes the status value specified for the given key, if any.

Applicable only to vtkSMStringVectorProperty objects, and this function assumes that the presence of a key in the property indicates that it is enabled.

◆ SetStatus() [5/5]

void vtkSMPropertyHelper::SetStatus ( int  key,
int  value 
)

This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example) and the second value is its status.

◆ GetStatus() [5/5]

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

This API is useful for setting values on vtkSMIntVectorProperty that is used for status where the first value is the id of the element (for example) and the second value is its status.

◆ 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 ( ) const

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 ( ) const

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 252 of file vtkSMPropertyHelper.h.

◆ GetUseUnchecked()

bool vtkSMPropertyHelper::GetUseUnchecked ( ) const
inline

Definition at line 253 of file vtkSMPropertyHelper.h.

◆ Copy()

bool vtkSMPropertyHelper::Copy ( const vtkSMPropertyHelper source)

Copy property values from another vtkSMPropertyHelper.

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

◆ Modified()

vtkSMPropertyHelper& vtkSMPropertyHelper::Modified ( )

Set the proxy to modified if necessary before calling Set() Return reference so method chaining can be used.

◆ setUseUnchecked()

void vtkSMPropertyHelper::setUseUnchecked ( bool  useUnchecked)
inlineprotected

Definition at line 269 of file vtkSMPropertyHelper.h.

◆ GetArray() [2/3]

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

Definition at line 321 of file vtkSMPropertyHelper.h.

◆ GetArray() [3/3]

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

Definition at line 327 of file vtkSMPropertyHelper.h.

◆ GetAs() [2/3]

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

Definition at line 341 of file vtkSMPropertyHelper.h.

◆ GetAs() [3/3]

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

Definition at line 347 of file vtkSMPropertyHelper.h.

Member Data Documentation

◆ Property

vtkSMProperty* vtkSMPropertyHelper::Property

Definition at line 309 of file vtkSMPropertyHelper.h.

◆ VectorProperty

vtkSMVectorProperty* vtkSMPropertyHelper::VectorProperty

Definition at line 310 of file vtkSMPropertyHelper.h.

◆ IntVectorProperty

vtkSMIntVectorProperty* vtkSMPropertyHelper::IntVectorProperty

Definition at line 311 of file vtkSMPropertyHelper.h.

◆ DoubleVectorProperty

vtkSMDoubleVectorProperty* vtkSMPropertyHelper::DoubleVectorProperty

Definition at line 312 of file vtkSMPropertyHelper.h.

◆ IdTypeVectorProperty

vtkSMIdTypeVectorProperty* vtkSMPropertyHelper::IdTypeVectorProperty

Definition at line 313 of file vtkSMPropertyHelper.h.

◆ StringVectorProperty

vtkSMStringVectorProperty* vtkSMPropertyHelper::StringVectorProperty

Definition at line 314 of file vtkSMPropertyHelper.h.

◆ ProxyProperty

vtkSMProxyProperty* vtkSMPropertyHelper::ProxyProperty

Definition at line 315 of file vtkSMPropertyHelper.h.

◆ InputProperty

vtkSMInputProperty* vtkSMPropertyHelper::InputProperty

Definition at line 316 of file vtkSMPropertyHelper.h.


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