but the GUI don't know how much properties an object contains, nor with which function I can set/get the properties. So Have anybody an idea, how I can solve this problem?
this is a basic Idea of me:
Code: Select all
class Property
{
public:
Property();
virtual ~Property();
setProperty( const std::string &p_Name, SimVariant & Value) = 0;
SimVariant getProperty( const std::string &p_Name) = 0;
};
class Object : public Property
{
setRotation(int Value);
setScale(int Value);
setProperty( const std::string &p_Name, SimVariant & Value)
{
if(p_Name.compare("roation") == 0)
setRotation(Value.toInt());
if(p_Name.compare("scale") == 0)
setScale(Value.toInt());
}
}
class Camera : public Object
{
setDOF(int Value);
setProperty( const std::string &p_Name, SimVariant & Value)
{
Object::setProperty( p_Name, Value);
if(p_Name.compare("DOF") == 0)
setDOF(Value.toInt());
}
}