VR-Forces Developer's Guide
 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 
9 
10 #pragma once
12 #include <string>
13 #include <vector>
14 #include <utility>
15 
16 namespace makArchives
17 {
20  {
21  public:
22 
23  struct Color
24  {
25  Color(float r, float g, float b, float a)
26  : red(r)
27  , green(g)
28  , blue(b)
29  , alpha(a)
30  {
31  }
32 
34  : red(1.0)
35  , green(1.0)
36  , blue(1.0)
37  , alpha(1.0)
38  {
39  }
40 
41  Color(const float* rgba)
42  : red(rgba[0])
43  , green(rgba[1])
44  , blue(rgba[2])
45  , alpha(rgba[3])
46  {
47  }
48 
49  template<class Archive>
50  void serialize(Archive & ar, const unsigned int version)
51  {
52  ar & BOOST_SERIALIZATION_NVP(red);
53  ar & BOOST_SERIALIZATION_NVP(green);
54  ar & BOOST_SERIALIZATION_NVP(blue);
55  ar & BOOST_SERIALIZATION_NVP(alpha);
56  }
57 
58  const float* rgba() const
59  {
60  return &red;
61  }
62 
63  float red;
64  float green;
65  float blue;
66  float alpha;
67  };
68 
69  typedef std::vector< std::pair< std::string, Color> > ColorList;
70 
71 
76 
77  bool autoLoad() const;
78  void setAutoLoad(bool autoLoad);
79 
81  const ColorList& featureColors() const;
82 
84  void setFeatureColors(const ColorList& list);
85 
87  void swapFeatureColors(ColorList& list);
88 
89  protected:
90 
91  friend class boost::serialization::access;
92 
96  template<class Archive>
97  void serialize(Archive & ar, const unsigned int version)
98  {
99  ar & BOOST_SERIALIZATION_NVP(myAutoLoadFlag);
100  ar & BOOST_SERIALIZATION_NVP(myColors);
101  }
102 
103  protected:
104 
105 
107  std::vector< std::pair< std::string, Color> > myColors;
108  };
109 }
110 
void serialize(Archive &ar, const unsigned int version)
Definition: DtFeatureSettingsRecord.h:50
Color(float r, float g, float b, float a)
Definition: DtFeatureSettingsRecord.h:25
Definition: DtFeatureSettingsRecord.h:19
Color(const float *rgba)
Definition: DtFeatureSettingsRecord.h:41
Contains DLL export macros.
Color()
Definition: DtFeatureSettingsRecord.h:33
std::vector< std::pair< std::string, Color > > ColorList
Definition: DtFeatureSettingsRecord.h:69
float red
Definition: DtFeatureSettingsRecord.h:63
const float * rgba() const
Definition: DtFeatureSettingsRecord.h:58
Definition: DtFeatureSettingsRecord.h:23
float blue
Definition: DtFeatureSettingsRecord.h:65
float alpha
Definition: DtFeatureSettingsRecord.h:66
std::vector< std::pair< std::string, Color > > myColors
Definition: DtFeatureSettingsRecord.h:107
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
bool myAutoLoadFlag
Definition: DtFeatureSettingsRecord.h:106
float green
Definition: DtFeatureSettingsRecord.h:64
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:97

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)