22 void set( T def ) { def_ = std::move( def ); }
24 const T &
get()
const {
return def_; }
25 T &
get() {
return def_; }
30 return id ? map_[id] : def_;
35 (*this)[id] = std::move( v );
43 auto it = map_.find(
id );
44 if ( it != map_.end() )
60 return map_.erase(
id ) > 0;
78 std::map<ViewportId, T> map_;
Definition MRViewportId.h:16
Definition MRViewportProperty.h:17
ViewportProperty()=default
ViewportProperty(const T &def)
Definition MRViewportProperty.h:20
T & get()
Definition MRViewportProperty.h:25
void set(T v, ViewportId id)
sets specific property value for given viewport (or default value if !id)
Definition MRViewportProperty.h:33
T & operator[](ViewportId id)
returns direct access to value associated with given viewport (or default value if !...
Definition MRViewportProperty.h:28
const T & get() const
gets default property value
Definition MRViewportProperty.h:24
const T & get(ViewportId id, bool *isDef=nullptr) const
Definition MRViewportProperty.h:39
bool reset()
Definition MRViewportProperty.h:68
void set(T def)
sets default property value
Definition MRViewportProperty.h:22
bool reset(ViewportId id)
Definition MRViewportProperty.h:57
Definition MRCameraOrientationPlugin.h:8