VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtFeatureSettingsRecord.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: $ $Revision: $ $State: $
7 ******************************************************************************/
8 
12 
13 #pragma once
15 #include <string>
16 #include <vector>
17 #include <utility>
18 
19 namespace makArchives
20 {
23  {
24  public:
25 
26  struct Color
27  {
28  Color(float r, float g, float b, float a)
29  : red(r)
30  , green(g)
31  , blue(b)
32  , alpha(a)
33  {
34  }
35 
37  : red(1.0)
38  , green(1.0)
39  , blue(1.0)
40  , alpha(1.0)
41  {
42  }
43 
44  Color(const float* rgba)
45  : red(rgba[0])
46  , green(rgba[1])
47  , blue(rgba[2])
48  , alpha(rgba[3])
49  {
50  }
51 
52  template<class Archive>
53  void serialize(Archive & ar, const unsigned int version)
54  {
55  ar & BOOST_SERIALIZATION_NVP(red);
56  ar & BOOST_SERIALIZATION_NVP(green);
57  ar & BOOST_SERIALIZATION_NVP(blue);
58  ar & BOOST_SERIALIZATION_NVP(alpha);
59  }
60 
61  const float* rgba() const
62  {
63  return &red;
64  }
65 
66  float red;
67  float green;
68  float blue;
69  float alpha;
70  };
71 
72  typedef std::vector< std::pair< std::string, Color> > ColorList;
73 
74 
79 
80  bool autoLoad() const;
81  void setAutoLoad(bool autoLoad);
82 
84  const ColorList& featureColors() const;
85 
87  void setFeatureColors(const ColorList& list);
88 
90  void swapFeatureColors(ColorList& list);
91 
92  protected:
93 
94  friend class boost::serialization::access;
95 
99  template<class Archive>
100  void serialize(Archive & ar, const unsigned int version)
101  {
102  ar & BOOST_SERIALIZATION_NVP(myAutoLoadFlag);
103  ar & BOOST_SERIALIZATION_NVP(myColors);
104  }
105 
106  protected:
107 
108 
110  std::vector< std::pair< std::string, Color> > myColors;
111  };
112 }
113 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)