VAPOR3 3.9.4
BookmarkParams.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2016 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: BookmarkParams
10//
11// Author: Stas Jaroszynski
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14
15#pragma once
16
17#include <vapor/ParamsBase.h>
18
19class MouseModeParams;
20
22public:
26
27 static string GetClassType() { return ("BookmarkParams"); }
28
29 static const string NameTag;
30 static const string DataTag;
31 static const string IconDataTag;
32 static const string IconSizeTag;
33
34 void SetName(const string &name) { SetValueString(NameTag, "", name); }
35 string GetName() const { return GetValueString(NameTag, ""); }
36
37 void SetData(const string &data) { SetValueString(DataTag, "", data); }
38 string GetData() const { return GetValueString(DataTag, ""); }
39
40 string GetIconData() const { return GetValueString(IconDataTag, ""); }
41 int GetIconSize() const { return GetValueLong(IconSizeTag, 0); }
42
43 size_t GetIconDataSize() const
44 {
45 size_t s = GetIconSize();
46 return s * s * 3;
47 }
48
49 void SetIcon(int size, const string &data)
50 {
51 SetIconData(data);
52 SetIconSize(size);
53 }
54
55 static int DefaultIconSize() { return 32; }
56
57private:
58 void SetIconData(const string &data) { SetValueString(IconDataTag, "", data); }
59 void SetIconSize(int size) { SetValueLong(IconSizeTag, "", size); }
60 void _init();
61};
void SetData(const string &data)
size_t GetIconDataSize() const
static int DefaultIconSize()
int GetIconSize() const
BookmarkParams(VAPoR::ParamsBase::StateSave *ssave)
string GetData() const
static const string IconSizeTag
BookmarkParams(const BookmarkParams &rhs)
string GetName() const
static const string DataTag
static const string NameTag
string GetIconData() const
void SetIcon(int size, const string &data)
void SetName(const string &name)
static string GetClassType()
static const string IconDataTag
BookmarkParams(VAPoR::ParamsBase::StateSave *ssave, VAPoR::XmlNode *node)
A class for describing mouse modes in use in VAPOR.
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
virtual void SetValueString(const string &tag, string description, const string &value)
virtual string GetValueString(const string tag, string defaultVal) const
virtual void SetValueLong(const string &tag, string description, long value)
virtual long GetValueLong(const string tag, long defaultVal) const
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77