1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
#include "ParamsRegister3.h"
/***********************************************************************/
ParamsRegister3::ParamsRegister3()
{
}
/***********************************************************************/
ParamsRegister3::~ParamsRegister3()
{
//dtor
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, int value)
{
setOrModify( name, value);
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, float value)
{
setOrModify( name, value);
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, glm::vec2 value)
{
setOrModify( name, value);
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, glm::vec3 value)
{
setOrModify( name, value);
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, glm::vec4 value)
{
setOrModify( name, value);
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, glm::mat3 value)
{
setOrModify( name, value);
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, glm::mat4 value)
{
setOrModify( name, value);
}
/***********************************************************************/
void ParamsRegister3::set ( std::string name, bool value)
{
setOrModify( name, value);
}
/***********************************************************************/
boost::any ParamsRegister3::get (std::string name) const
{
for ( auto i : mvProperties)
{
if (i.name == name)
{
return i.value;
}
}
}
/***********************************************************************/
int ParamsRegister3::geti (std::string name) const
{
return boost::any_cast<int>(get(name));
}
/***********************************************************************/
float ParamsRegister3::getf (std::string name) const
{
return boost::any_cast<float>(get(name));
}
/***********************************************************************/
glm::vec2 ParamsRegister3::getv2 (std::string name) const
{
return boost::any_cast<glm::vec2>(get(name));
}
/***********************************************************************/
glm::vec3 ParamsRegister3::getv3 (std::string name) const
{
return boost::any_cast<glm::vec3>(get(name));
}
/***********************************************************************/
glm::vec4 ParamsRegister3::getv4 (std::string name) const
{
return boost::any_cast<glm::vec4>(get(name));
}
/***********************************************************************/
glm::mat3 ParamsRegister3::getm3 (std::string name) const
{
return boost::any_cast<glm::mat3>(get(name));
}
/***********************************************************************/
glm::mat4 ParamsRegister3::getm4 (std::string name) const
{
return boost::any_cast<glm::mat4>(get(name));
}
/***********************************************************************/
bool ParamsRegister3::getb (std::string name) const
{
return boost::any_cast<bool>(get(name));
}
/***********************************************************************/
void ParamsRegister3::setOrModify (std::string name, boost::any value )
{
// delete entry
for (std::vector<property>::iterator it = mvProperties.begin(); it != mvProperties.end(); )
{
if ((*it).name == name)
it = mvProperties.erase(it);
else
++it;
}
// set entry
property p(name, value);
mvProperties.push_back( p);
}
/***********************************************************************/ |
Partager