add addProperties for Workspace
This commit is contained in:
parent
73ab158eec
commit
a74117d95f
|
|
@ -25,6 +25,7 @@ namespace RNR
|
|||
Camera* getCurrentCamera() const;
|
||||
void setCurrentCamera(Camera *value);
|
||||
private:
|
||||
virtual void addProperties(std::vector<ReflectionProperty>& properties);
|
||||
virtual void deserializeProperty(char* prop_name, pugi::xml_node prop);
|
||||
void buildGeomInstance(Instance* instance);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ namespace RNR
|
|||
|
||||
std::string ReflectionProperty::toString()
|
||||
{
|
||||
if(m_getter(m_object) == 0)
|
||||
return std::string("NULL");
|
||||
switch(m_type)
|
||||
{
|
||||
case PROPERTY_STD_STRING:
|
||||
|
|
|
|||
|
|
@ -105,4 +105,16 @@ namespace RNR
|
|||
printf("Workspace::deserializeProperty: camera ref invalid (%s)\n", node.text().as_string());
|
||||
}
|
||||
}
|
||||
|
||||
void Workspace::addProperties(std::vector<ReflectionProperty>& properties)
|
||||
{
|
||||
ReflectionProperty _properties[] = {
|
||||
{ this, std::string("CurrentCamera"), std::string(""),
|
||||
ACCESS_NONE, OPERATION_READWRITE, PROPERTY_INSTANCE,
|
||||
REFLECTION_GETTER(Workspace* instance = (Workspace*)object; return instance->currentCamera.get(); ),
|
||||
REFLECTION_SETTER(Workspace* instance = (Workspace*)object; instance->setCurrentCamera((Camera*)value); ) },
|
||||
};
|
||||
|
||||
properties.insert(properties.end(), _properties, _properties+(sizeof(_properties)/sizeof(ReflectionProperty)));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue