Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkSMDomain Class Reference

represents the possible values a property can have More...

#include <vtkSMDomain.h>

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

Classes

class  DeferDomainModifiedEvents
 helper to defer firing of vtkCommand::DomainModifiedEvent. More...
 

Public Types

enum  IsInDomainReturnCodes { NOT_APPLICABLE = -1, NOT_IN_DOMAIN = 0, IN_DOMAIN = 1 }
 Return values for IsInDomain calls. More...
 
typedef vtkSMSessionObject Superclass
 
- Public Types inherited from vtkSMSessionObject
typedef vtkSMObject Superclass
 
- Public Types inherited from vtkSMObject
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual int IsInDomain (vtkSMProperty *vtkNotUsed(property))
 Is the (unchecked) value of the property in the domain? Overwritten by sub-classes. More...
 
virtual void Update (vtkSMProperty *requestingProperty)
 Update self based on the "unchecked" values of all required properties. More...
 
virtual void SetAnimationValue (vtkSMProperty *, int vtkNotUsed(index), double vtkNotUsed(value))
 Set the value of an element of a property from the animation editor. More...
 
virtual int SetDefaultValues (vtkSMProperty *, bool vtkNotUsed(use_unchecked_values))
 A vtkSMProperty is often defined with a default value in the XML itself. More...
 
vtkSMPropertyGetProperty ()
 Provides access to the vtkSMProperty on which this domain is hooked up. More...
 
virtual unsigned int GetNumberOfInputConnections (const char *function)
 Helper method to get the number of input connections hence the number of available vtkPVDataInformation from input proxy connected to the required property with the given function. More...
 
vtkSMPropertyGetRequiredProperty (const char *function)
 Returns a given required property of the given function. More...
 
virtual char * GetXMLName ()
 Assigned by the XML parser. More...
 
virtual bool GetIsOptional ()
 When the IsOptional flag is set, IsInDomain() always returns true. More...
 
virtual vtkPVDataInformationGetInputDataInformation (const char *function, unsigned int index=0)
 Helper methods to get vtkPVDataInformation from input proxy connected to the required property with the given function and provided input index. More...
 
virtual vtkPVDataInformationGetInputSubsetDataInformation (unsigned int compositeIndex, const char *function, unsigned int index=0)
 Helper methods to get vtkPVDataInformation from input proxy connected to the required property with the given function and provided input index. More...
 
- Public Member Functions inherited from vtkSMSessionObject
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual vtkSMSessionProxyManagerGetSessionProxyManager ()
 Return the corresponding ProxyManager if any. More...
 
virtual void SetSession (vtkSMSession *)
 Get/Set the session on wihch this object exists. More...
 
virtual vtkSMSessionGetSession ()
 Get/Set the session on wihch this object exists. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkSMDomainNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMDomainSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMSessionObject
static vtkSMSessionObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMSessionObjectSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMObject
static vtkSMObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMObjectSafeDownCast (vtkObject *o)
 
static std::string CreatePrettyLabel (const std::string &name)
 Return a well-formated label using provided name by adding spaces between lower cases and upper cases: More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkSMDomain ()
 
 ~vtkSMDomain () override
 
virtual int LoadState (vtkPVXMLElement *vtkNotUsed(domainElement), vtkSMProxyLocator *vtkNotUsed(loader))
 Load the state of the domain from the XML. More...
 
virtual int ReadXMLAttributes (vtkSMProperty *prop, vtkPVXMLElement *elem)
 Set the appropriate ivars from the xml element. More...
 
void RemoveRequiredProperty (vtkSMProperty *prop)
 Remove the given property from the required properties list. More...
 
void AddRequiredProperty (vtkSMProperty *prop, const char *function)
 Add a new required property to this domain. More...
 
void DomainModified ()
 Invokes DomainModifiedEvent. More...
 
void InvokeModified ()
 
unsigned int GetNumberOfRequiredProperties ()
 Gets the number of required properties added. More...
 
void SetProperty (vtkSMProperty *)
 Set the domain's property. More...
 
void SaveState (vtkPVXMLElement *parent, const char *uid)
 Add the header and creates a new vtkPVXMLElement for the domain, fills it up with the common attributes. More...
 
virtual void ChildSaveState (vtkPVXMLElement *domainElement)
 Add the header and creates a new vtkPVXMLElement for the domain, fills it up with the common attributes. More...
 
virtual void SetIsOptional (bool)
 When the IsOptional flag is set, IsInDomain() always returns true. More...
 
virtual void SetXMLName (const char *)
 Assigned by the XML parser. More...
 
- Protected Member Functions inherited from vtkSMSessionObject
 vtkSMSessionObject ()
 
 ~vtkSMSessionObject () override
 
- Protected Member Functions inherited from vtkSMObject
 vtkSMObject ()
 
 ~vtkSMObject () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

char * XMLName
 
bool IsOptional
 
vtkSMDomainInternals * Internals
 
- Protected Attributes inherited from vtkSMSessionObject
vtkWeakPointer< vtkSMSessionSession
 Identifies the session id to which this object is related. More...
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Friends

class vtkSMProperty
 
class DeferDomainModifiedEvents
 

Detailed Description

represents the possible values a property can have

vtkSMDomain is an abstract class that describes the "domain" of a a widget. A domain is a collection of possible values a property can have.

Each domain can depend on one or more properties to compute it's values. This are called "required" properties and can be set in the XML configuration file.

Every time a domain changes it must fire a vtkCommand::DomainModifiedEvent. Applications may decide to update the UI every-time the domain changes. As a result, domains ideally should only fire that event when their values change for real not just potentially changed.

See also
vtkSMDomain::DeferDomainModifiedEvents.

Definition at line 37 of file vtkSMDomain.h.

Member Typedef Documentation

◆ Superclass

Definition at line 41 of file vtkSMDomain.h.

Member Enumeration Documentation

◆ IsInDomainReturnCodes

Return values for IsInDomain calls.

Enumerator
NOT_APPLICABLE 
NOT_IN_DOMAIN 
IN_DOMAIN 

Definition at line 47 of file vtkSMDomain.h.

Constructor & Destructor Documentation

◆ vtkSMDomain()

vtkSMDomain::vtkSMDomain ( )
protected

◆ ~vtkSMDomain()

vtkSMDomain::~vtkSMDomain ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkSMDomain* vtkSMDomain::New ( )
static

◆ GetClassName()

virtual const char* vtkSMDomain::GetClassName ( )
virtual

◆ IsTypeOf()

static int vtkSMDomain::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkSMDomain::IsA ( const char *  type)
virtual

◆ SafeDownCast()

static vtkSMDomain* vtkSMDomain::SafeDownCast ( vtkObject o)
static

◆ PrintSelf()

void vtkSMDomain::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

◆ IsInDomain()

virtual int vtkSMDomain::IsInDomain ( vtkSMProperty vtkNotUsedproperty)
inlinevirtual

Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.

Returned values as defined in IsInDomainReturnCodes. NOT_APPLICABLE is returned if the domain is not applicable for the property values. NOT_IN_DOMAIN implies that the value is not in domain while IN_DOMAIN implies that the value is acceptable.

Reimplemented in vtkSMCompositeTreeDomain.

Definition at line 64 of file vtkSMDomain.h.

◆ Update()

virtual void vtkSMDomain::Update ( vtkSMProperty requestingProperty)
virtual

◆ SetAnimationValue()

virtual void vtkSMDomain::SetAnimationValue ( vtkSMProperty ,
int   vtkNotUsedindex,
double   vtkNotUsedvalue 
)
inlinevirtual

Set the value of an element of a property from the animation editor.

Definition at line 76 of file vtkSMDomain.h.

◆ SetDefaultValues()

virtual int vtkSMDomain::SetDefaultValues ( vtkSMProperty ,
bool   vtkNotUseduse_unchecked_values 
)
inlinevirtual

A vtkSMProperty is often defined with a default value in the XML itself.

However, many times, the default value must be determined at run time. To facilitate this, domains can override this method to compute and set the default value for the property. Note that unlike the compile-time default values, the application must explicitly call this method to initialize the property. If use_unchecked_values is true, the property's unchecked values will be changed by this method. Returns 1 if the domain updated the property. Default implementation does nothing.

Definition at line 91 of file vtkSMDomain.h.

◆ GetXMLName()

virtual char* vtkSMDomain::GetXMLName ( )
virtual

Assigned by the XML parser.

The name assigned in the XML configuration. Can be used to figure out the origin of the domain.

◆ GetIsOptional()

virtual bool vtkSMDomain::GetIsOptional ( )
virtual

When the IsOptional flag is set, IsInDomain() always returns true.

This is used by properties that use domains to provide information (a suggestion to the gui for example) as opposed to restrict their values.

◆ GetProperty()

vtkSMProperty* vtkSMDomain::GetProperty ( )

Provides access to the vtkSMProperty on which this domain is hooked up.

◆ GetInputDataInformation()

virtual vtkPVDataInformation* vtkSMDomain::GetInputDataInformation ( const char *  function,
unsigned int  index = 0 
)
virtual

Helper methods to get vtkPVDataInformation from input proxy connected to the required property with the given function and provided input index.

◆ GetInputSubsetDataInformation()

virtual vtkPVDataInformation* vtkSMDomain::GetInputSubsetDataInformation ( unsigned int  compositeIndex,
const char *  function,
unsigned int  index = 0 
)
virtual

Helper methods to get vtkPVDataInformation from input proxy connected to the required property with the given function and provided input index.

◆ GetNumberOfInputConnections()

virtual unsigned int vtkSMDomain::GetNumberOfInputConnections ( const char *  function)
virtual

Helper method to get the number of input connections hence the number of available vtkPVDataInformation from input proxy connected to the required property with the given function.

◆ GetRequiredProperty()

vtkSMProperty* vtkSMDomain::GetRequiredProperty ( const char *  function)

Returns a given required property of the given function.

Function is a string associated with the require property in the XML file.

◆ SaveState()

void vtkSMDomain::SaveState ( vtkPVXMLElement parent,
const char *  uid 
)
protected

Add the header and creates a new vtkPVXMLElement for the domain, fills it up with the common attributes.

The newly created element will also be added to the parent element as a child node. Subclasses can override ChildSaveState() method to fill it up with subclass specific values.

◆ ChildSaveState()

virtual void vtkSMDomain::ChildSaveState ( vtkPVXMLElement domainElement)
protectedvirtual

Add the header and creates a new vtkPVXMLElement for the domain, fills it up with the common attributes.

The newly created element will also be added to the parent element as a child node. Subclasses can override ChildSaveState() method to fill it up with subclass specific values.

Reimplemented in vtkSMProxyListDomain, vtkSMEnumerationDomain, and vtkSMStringListDomain.

◆ LoadState()

virtual int vtkSMDomain::LoadState ( vtkPVXMLElement vtkNotUseddomainElement,
vtkSMProxyLocator vtkNotUsedloader 
)
inlineprotectedvirtual

Load the state of the domain from the XML.

Subclasses generally have no need to load XML state. In fact, serialization of state for domains, in general, is unnecessary for two reasons:

  1. domains whose values are defined in XML will be populated from the configuration xml anyways.
  2. domains whose values depend on data (at runtime) will be repopulated with data values when the XML state is loaded. The only exception to this rule is vtkSMProxyListDomain (presently). vtkSMProxyListDomain needs to try to restore proxies (with proper ids) for the domain.

Definition at line 170 of file vtkSMDomain.h.

◆ ReadXMLAttributes()

virtual int vtkSMDomain::ReadXMLAttributes ( vtkSMProperty prop,
vtkPVXMLElement elem 
)
protectedvirtual

◆ RemoveRequiredProperty()

void vtkSMDomain::RemoveRequiredProperty ( vtkSMProperty prop)
protected

Remove the given property from the required properties list.

◆ AddRequiredProperty()

void vtkSMDomain::AddRequiredProperty ( vtkSMProperty prop,
const char *  function 
)
protected

Add a new required property to this domain.

Whenever the prop fires vtkCommand::UncheckedPropertyModifiedEvent, vtkSMDomain::Update(prop) is called. Also whenever a vtkSMInputProperty is added as a required property, vtkSMDomain::Update(prop) will also be called the vtkCommand::UpdateDataEvent is fired by the proxies contained in that required property.

◆ SetIsOptional()

virtual void vtkSMDomain::SetIsOptional ( bool  )
protectedvirtual

When the IsOptional flag is set, IsInDomain() always returns true.

This is used by properties that use domains to provide information (a suggestion to the gui for example) as opposed to restrict their values.

◆ SetXMLName()

virtual void vtkSMDomain::SetXMLName ( const char *  )
protectedvirtual

Assigned by the XML parser.

The name assigned in the XML configuration. Can be used to figure out the origin of the domain.

◆ DomainModified()

void vtkSMDomain::DomainModified ( )
protected

Invokes DomainModifiedEvent.

Note that this event must be fired after the domain has changed (ideally, if and only if the domain has changed).

◆ InvokeModified()

void vtkSMDomain::InvokeModified ( )
inlineprotected

Definition at line 223 of file vtkSMDomain.h.

◆ GetNumberOfRequiredProperties()

unsigned int vtkSMDomain::GetNumberOfRequiredProperties ( )
protected

Gets the number of required properties added.

◆ SetProperty()

void vtkSMDomain::SetProperty ( vtkSMProperty )
protected

Set the domain's property.

This is called by vtkSMProperty when the domain is created.

Friends And Related Function Documentation

◆ vtkSMProperty

friend class vtkSMProperty
friend

Definition at line 182 of file vtkSMDomain.h.

◆ DeferDomainModifiedEvents

friend class DeferDomainModifiedEvents
friend

Definition at line 279 of file vtkSMDomain.h.

Member Data Documentation

◆ XMLName

char* vtkSMDomain::XMLName
protected

Definition at line 271 of file vtkSMDomain.h.

◆ IsOptional

bool vtkSMDomain::IsOptional
protected

Definition at line 272 of file vtkSMDomain.h.

◆ Internals

vtkSMDomainInternals* vtkSMDomain::Internals
protected

Definition at line 273 of file vtkSMDomain.h.


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