MeshLib Documentation
Loading...
Searching...
No Matches
MR::ViewportProperty< T > Class Template Reference

#include <MRViewportProperty.h>

Public Member Functions

 ViewportProperty ()=default
 
 ViewportProperty (const T &def)
 
void set (T def)
 sets default property value
 
const T & get () const
 gets default property value
 
T & get ()
 
T & operator[] (ViewportId id)
 returns direct access to value associated with given viewport (or default value if !id)
 
void set (T v, ViewportId id)
 sets specific property value for given viewport (or default value if !id)
 
const T & get (ViewportId id, bool *isDef=nullptr) const
 
bool reset (ViewportId id)
 
bool reset ()
 

Detailed Description

template<typename T>
class MR::ViewportProperty< T >

storage of some viewport-dependent property, which has some default value for all viewports and special values for some specific viewports

Constructor & Destructor Documentation

◆ ViewportProperty() [1/2]

template<typename T >
MR::ViewportProperty< T >::ViewportProperty ( )
default

◆ ViewportProperty() [2/2]

template<typename T >
MR::ViewportProperty< T >::ViewportProperty ( const T & def)
inline

Member Function Documentation

◆ get() [1/3]

template<typename T >
T & MR::ViewportProperty< T >::get ( )
inline

◆ get() [2/3]

template<typename T >
const T & MR::ViewportProperty< T >::get ( ) const
inline

gets default property value

◆ get() [3/3]

template<typename T >
const T & MR::ViewportProperty< T >::get ( ViewportId id,
bool * isDef = nullptr ) const
inline

gets property value for given viewport: specific if available otherwise default one;

Parameters
isDefreceives true if this viewport does not have specific value and default one is returned

◆ operator[]()

template<typename T >
T & MR::ViewportProperty< T >::operator[] ( ViewportId id)
inline

returns direct access to value associated with given viewport (or default value if !id)

◆ reset() [1/2]

template<typename T >
bool MR::ViewportProperty< T >::reset ( )
inline

forgets specific property value for all viewports; returns true if any specific value was removed

◆ reset() [2/2]

template<typename T >
bool MR::ViewportProperty< T >::reset ( ViewportId id)
inline

forgets specific property value for given viewport (or all viewports if !id); returns true if any specific value was removed

◆ set() [1/2]

template<typename T >
void MR::ViewportProperty< T >::set ( T def)
inline

sets default property value

◆ set() [2/2]

template<typename T >
void MR::ViewportProperty< T >::set ( T v,
ViewportId id )
inline

sets specific property value for given viewport (or default value if !id)


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