Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkSMSILModel Class Reference

is a helper for to work with SILs. More...

#include <vtkSMSILModel.h>

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

Public Types

enum  CheckState { UNCHECKED = 0, PARTIAL = 1, CHECKED = 2 }
 
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
 
int GetNumberOfChildren (vtkIdType vertexid)
 Returns the number of children for the given vertex. More...
 
vtkIdType GetChildVertex (vtkIdType parentid, int child_index)
 Returns the vertex id for the n-th child where n=child_index. More...
 
vtkIdType GetParentVertex (vtkIdType parent)
 Returns the parent vertex i.e. More...
 
const char * GetName (vtkIdType vertex)
 Get the name for the vertex. More...
 
int GetCheckStatus (vtkIdType vertex)
 Get the check state for a vertex. More...
 
void UpdatePropertyValue (vtkSMStringVectorProperty *)
 Updates the property using the check states maintained by the model. More...
 
void UpdateStateFromProperty (vtkSMStringVectorProperty *)
 Updates the check states maintained internally by the model using the status from the property. More...
 
vtkIdType FindVertex (const char *name)
 Locate a vertex with the given name. More...
 
void GetLeaves (std::set< vtkIdType > &leaves, vtkIdType root, bool traverse_cross_edges)
 
void Initialize (vtkGraph *sil)
 Initialize the model using a SIL. More...
 
virtual vtkGraphGetSIL ()
 Initialize the model using a SIL. More...
 
void Initialize (vtkSMProxy *, vtkSMStringVectorProperty *)
 Initialize the model using a proxy and its property. More...
 
virtual vtkSMProxyGetProxy ()
 Initialize the model using a proxy and its property. More...
 
virtual vtkSMStringVectorPropertyGetProperty ()
 Initialize the model using a proxy and its property. More...
 
bool SetCheckState (vtkIdType vertex, int status)
 Set the check state for a vertex. More...
 
bool SetCheckState (const char *name, int status)
 Set the check state for a vertex. More...
 
void CheckAll ()
 Convenience methods to check/uncheck all items. More...
 
void UncheckAll ()
 Convenience methods to check/uncheck all items. 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 vtkSMSILModelNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMSILModelSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMObject
static vtkSMObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMObjectSafeDownCast (vtkObject *o)
 
- 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

 vtkSMSILModel ()
 
 ~vtkSMSILModel () override
 
void UpdateProperty ()
 
void OnPropertyModified ()
 
void OnDomainModified ()
 
void Check (vtkIdType vertexid, bool checked, vtkIdType inedgeid=-1)
 Called to check/uncheck an item. More...
 
void UpdateCheck (vtkIdType vertexid)
 Determine vertexid's check state using its immediate children. More...
 
void SetSIL (vtkGraph *)
 
- 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

bool BlockUpdate
 
vtkSMProxyProxy
 
vtkSMStringVectorPropertyProperty
 
vtkGraphSIL
 
vtkCommandPropertyObserver
 
vtkCommandDomainObserver
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

is a helper for to work with SILs.

vtkSMSILModel makes it easier to make checks/unchecks for the SIL while respecting the links/dependencies defined by the SIL.

There are two ways of initializing the model:

Events:
  • vtkCommand::UpdateDataEvent – fired when the check state of any element changes. calldata = vertexid for the element whose check state changed.

Legacy Warning

While not deprecated, this class exists to support readers that use legacy representation for SIL which used a vtkGraph to represent the SIL. It is recommended that newer code uses vtkSubsetInclusionLattice (or subclass) to represent the SIL. In that case, there is no need for such a helper class as similar API is exposed on vtkSubsetInclusionLattice and subclasses.

Definition at line 55 of file vtkSMSILModel.h.

Member Typedef Documentation

◆ Superclass

Definition at line 59 of file vtkSMSILModel.h.

Member Enumeration Documentation

◆ CheckState

Enumerator
UNCHECKED 
PARTIAL 
CHECKED 

Definition at line 62 of file vtkSMSILModel.h.

Constructor & Destructor Documentation

◆ vtkSMSILModel()

vtkSMSILModel::vtkSMSILModel ( )
protected

◆ ~vtkSMSILModel()

vtkSMSILModel::~vtkSMSILModel ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkSMSILModel* vtkSMSILModel::New ( )
static

◆ GetClassName()

virtual const char* vtkSMSILModel::GetClassName ( )
virtual

Reimplemented from vtkSMObject.

◆ IsTypeOf()

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

◆ IsA()

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

Reimplemented from vtkSMObject.

◆ SafeDownCast()

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

◆ PrintSelf()

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

Reimplemented from vtkSMObject.

◆ Initialize() [1/2]

void vtkSMSILModel::Initialize ( vtkGraph sil)

Initialize the model using a SIL.

There are two ways of initializing the model:

  • One way is to initialize it with a SIL (using Initialize(vtkGraph*). Then the model can be used as a simple API to check/uncheck elements.
  • Second way is to initialize with a proxy and property (using Initialize(vtkSMProxy, vtkSMProperty*). In that case, the SIL is obtained from the property's vtkSMSILDomain. Also as the user changes the check states, the property is updated/pushed.

◆ GetSIL()

virtual vtkGraph* vtkSMSILModel::GetSIL ( )
virtual

Initialize the model using a SIL.

There are two ways of initializing the model:

  • One way is to initialize it with a SIL (using Initialize(vtkGraph*). Then the model can be used as a simple API to check/uncheck elements.
  • Second way is to initialize with a proxy and property (using Initialize(vtkSMProxy, vtkSMProperty*). In that case, the SIL is obtained from the property's vtkSMSILDomain. Also as the user changes the check states, the property is updated/pushed.

◆ Initialize() [2/2]

void vtkSMSILModel::Initialize ( vtkSMProxy ,
vtkSMStringVectorProperty  
)

Initialize the model using a proxy and its property.

If a property is set, then the model keeps the property updated when the check states are changed or when the property changes, the model's internal check states are updated. If the property has a SILDomain, then the model attaches itself to the domain so that whenever the domains is updated (i.e. a new SIL is obtained from the server) the model updates the sil as well.

There are two ways of initializing the model:

  • One way is to initialize it with a SIL (using Initialize(vtkGraph*). Then the model can be used as a simple API to check/uncheck elements.
  • Second way is to initialize with a proxy and property (using Initialize(vtkSMProxy, vtkSMProperty*). In that case, the SIL is obtained from the property's vtkSMSILDomain. Also as the user changes the check states, the property is updated/pushed.

◆ GetProxy()

virtual vtkSMProxy* vtkSMSILModel::GetProxy ( )
virtual

Initialize the model using a proxy and its property.

If a property is set, then the model keeps the property updated when the check states are changed or when the property changes, the model's internal check states are updated. If the property has a SILDomain, then the model attaches itself to the domain so that whenever the domains is updated (i.e. a new SIL is obtained from the server) the model updates the sil as well.

There are two ways of initializing the model:

  • One way is to initialize it with a SIL (using Initialize(vtkGraph*). Then the model can be used as a simple API to check/uncheck elements.
  • Second way is to initialize with a proxy and property (using Initialize(vtkSMProxy, vtkSMProperty*). In that case, the SIL is obtained from the property's vtkSMSILDomain. Also as the user changes the check states, the property is updated/pushed.

◆ GetProperty()

virtual vtkSMStringVectorProperty* vtkSMSILModel::GetProperty ( )
virtual

Initialize the model using a proxy and its property.

If a property is set, then the model keeps the property updated when the check states are changed or when the property changes, the model's internal check states are updated. If the property has a SILDomain, then the model attaches itself to the domain so that whenever the domains is updated (i.e. a new SIL is obtained from the server) the model updates the sil as well.

There are two ways of initializing the model:

  • One way is to initialize it with a SIL (using Initialize(vtkGraph*). Then the model can be used as a simple API to check/uncheck elements.
  • Second way is to initialize with a proxy and property (using Initialize(vtkSMProxy, vtkSMProperty*). In that case, the SIL is obtained from the property's vtkSMSILDomain. Also as the user changes the check states, the property is updated/pushed.

◆ GetNumberOfChildren()

int vtkSMSILModel::GetNumberOfChildren ( vtkIdType  vertexid)

Returns the number of children for the given vertex.

A node is a child node if it has no out-going edges or all out-going edges have "CrossEdges" set to 1. If vertex id is invalid, returns -1.

◆ GetChildVertex()

vtkIdType vtkSMSILModel::GetChildVertex ( vtkIdType  parentid,
int  child_index 
)

Returns the vertex id for the n-th child where n=child_index.

Returns 0 if request is invalid.

◆ GetParentVertex()

vtkIdType vtkSMSILModel::GetParentVertex ( vtkIdType  parent)

Returns the parent vertex i.e.

the vertex at the end of an in-edge which is not a cross-edge. It's an error to call this method for the root vertex id i.e. 0.

◆ GetName()

const char* vtkSMSILModel::GetName ( vtkIdType  vertex)

Get the name for the vertex.

◆ GetCheckStatus()

int vtkSMSILModel::GetCheckStatus ( vtkIdType  vertex)

Get the check state for a vertex.

◆ SetCheckState() [1/2]

bool vtkSMSILModel::SetCheckState ( vtkIdType  vertex,
int  status 
)

Set the check state for a vertex.

Returns true if the status was changed, false if unaffected.

◆ SetCheckState() [2/2]

bool vtkSMSILModel::SetCheckState ( const char *  name,
int  status 
)
inline

Set the check state for a vertex.

Returns true if the status was changed, false if unaffected.

Definition at line 142 of file vtkSMSILModel.h.

◆ CheckAll()

void vtkSMSILModel::CheckAll ( )

Convenience methods to check/uncheck all items.

◆ UncheckAll()

void vtkSMSILModel::UncheckAll ( )

Convenience methods to check/uncheck all items.

◆ UpdatePropertyValue()

void vtkSMSILModel::UpdatePropertyValue ( vtkSMStringVectorProperty )

Updates the property using the check states maintained by the model.

◆ UpdateStateFromProperty()

void vtkSMSILModel::UpdateStateFromProperty ( vtkSMStringVectorProperty )

Updates the check states maintained internally by the model using the status from the property.

◆ FindVertex()

vtkIdType vtkSMSILModel::FindVertex ( const char *  name)

Locate a vertex with the given name.

Returns -1 if the vertex is not found.

◆ GetLeaves()

void vtkSMSILModel::GetLeaves ( std::set< vtkIdType > &  leaves,
vtkIdType  root,
bool  traverse_cross_edges 
)

◆ UpdateProperty()

void vtkSMSILModel::UpdateProperty ( )
protected

◆ OnPropertyModified()

void vtkSMSILModel::OnPropertyModified ( )
protected

◆ OnDomainModified()

void vtkSMSILModel::OnDomainModified ( )
protected

◆ Check()

void vtkSMSILModel::Check ( vtkIdType  vertexid,
bool  checked,
vtkIdType  inedgeid = -1 
)
protected

Called to check/uncheck an item.

◆ UpdateCheck()

void vtkSMSILModel::UpdateCheck ( vtkIdType  vertexid)
protected

Determine vertexid's check state using its immediate children.

If the check-state for the vertex has changed, then it propagates the call to the parent node.

◆ SetSIL()

void vtkSMSILModel::SetSIL ( vtkGraph )
protected

Member Data Documentation

◆ BlockUpdate

bool vtkSMSILModel::BlockUpdate
protected

Definition at line 196 of file vtkSMSILModel.h.

◆ Proxy

vtkSMProxy* vtkSMSILModel::Proxy
protected

Definition at line 200 of file vtkSMSILModel.h.

◆ Property

vtkSMStringVectorProperty* vtkSMSILModel::Property
protected

Definition at line 201 of file vtkSMSILModel.h.

◆ SIL

vtkGraph* vtkSMSILModel::SIL
protected

Definition at line 202 of file vtkSMSILModel.h.

◆ PropertyObserver

vtkCommand* vtkSMSILModel::PropertyObserver
protected

Definition at line 203 of file vtkSMSILModel.h.

◆ DomainObserver

vtkCommand* vtkSMSILModel::DomainObserver
protected

Definition at line 204 of file vtkSMSILModel.h.


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