VR-Forces 4.8 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 
void serialize(Archive &ar, const unsigned int version)
Definition: DtFeatureSettingsRecord.h:53
Color(float r, float g, float b, float a)
Definition: DtFeatureSettingsRecord.h:28
Definition: DtFeatureSettingsRecord.h:22
Color(const float *rgba)
Definition: DtFeatureSettingsRecord.h:44
Contains DLL export macros.
Color()
Definition: DtFeatureSettingsRecord.h:36
std::vector< std::pair< std::string, Color > > ColorList
Definition: DtFeatureSettingsRecord.h:72
float red
Definition: DtFeatureSettingsRecord.h:66
const float * rgba() const
Definition: DtFeatureSettingsRecord.h:61
Definition: DtFeatureSettingsRecord.h:26
float blue
Definition: DtFeatureSettingsRecord.h:68
float alpha
Definition: DtFeatureSettingsRecord.h:69
std::vector< std::pair< std::string, Color > > myColors
Definition: DtFeatureSettingsRecord.h:110
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
bool myAutoLoadFlag
Definition: DtFeatureSettingsRecord.h:109
float green
Definition: DtFeatureSettingsRecord.h:67
void serialize(Archive &ar, const unsigned int version)
When the class Archive corresponds to an output archive, the &amp; operator is defined similar to &lt;&lt;...
Definition: DtFeatureSettingsRecord.h:100

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)