Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::IPropertyTransience Class Referenceabstract

Interface of the property transience service. More...

#include <mitkIPropertyTransience.h>

Inheritance diagram for mitk::IPropertyTransience:

Public Member Functions

virtual ~IPropertyTransience ()
 
template<class TData , typename = std::enable_if_t<std::is_base_of_v<BaseData, TData>>>
void AddTransient (const std::string &propertyName)
 Declare a property transient for nodes whose data is-a TData. More...
 
virtual bool IsTransient (const BaseData *data, const std::string &propertyName) const =0
 Check whether a property is transient for the given node data. More...
 

Protected Member Functions

virtual void InternalAddTransient (const std::string &propertyName, std::function< bool(const BaseData *)> dataTypeMatcher)=0
 Register a transient property with a data-type matcher. More...
 

Detailed Description

Interface of the property transience service.

This service manages which DataNode properties are transient, i.e. hold runtime or UI state (like the node "selected" flag) that must not be persisted to scene files. Although such properties live on the DataNode, transience is declared per BaseData type: a rule registered for a type applies to every node whose data is an instance of that type (or a subclass). Register against mitk::BaseData to cover all data types, including data-less nodes (data == nullptr).

At serialization time the scene serializer queries IsTransient() with the node's data to decide whether a property is excluded.

Definition at line 42 of file mitkIPropertyTransience.h.

Constructor & Destructor Documentation

◆ ~IPropertyTransience()

virtual mitk::IPropertyTransience::~IPropertyTransience ( )
virtual

Member Function Documentation

◆ AddTransient()

template<class TData , typename = std::enable_if_t<std::is_base_of_v<BaseData, TData>>>
void mitk::IPropertyTransience::AddTransient ( const std::string &  propertyName)
inline

Declare a property transient for nodes whose data is-a TData.

Template Parameters
TDataBaseData or a subclass the rule applies to. Use mitk::BaseData to mark the property transient for any data type, including data-less nodes (data == nullptr).
Parameters
[in]propertyNameName of the transient property.

Definition at line 55 of file mitkIPropertyTransience.h.

◆ InternalAddTransient()

virtual void mitk::IPropertyTransience::InternalAddTransient ( const std::string &  propertyName,
std::function< bool(const BaseData *)>  dataTypeMatcher 
)
protectedpure virtual

Register a transient property with a data-type matcher.

Called by the public AddTransient() template.

Parameters
[in]propertyNameName of the transient property.
[in]dataTypeMatcherPredicate returning true if the rule applies to the passed BaseData.

Implemented in mitk::PropertyTransience.

◆ IsTransient()

virtual bool mitk::IPropertyTransience::IsTransient ( const BaseData *  data,
const std::string &  propertyName 
) const
pure virtual

Check whether a property is transient for the given node data.

Parameters
[in]dataThe node's BaseData. May be null (e.g. a data-less node); rules registered for mitk::BaseData still match, type-specific rules do not.
[in]propertyNameName of the property to check.
Returns
True if any registered rule for propertyName matches the data type.

Implemented in mitk::PropertyTransience.


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