A
alessio211734
I have a class NodeScene where it's a tree where every:
class NodeScene
{
public:
enum CLASS_ID { LIGHT, MESH, MARKER,....}
addChild();
getClassID(){ return ID;};
private:
list<NodeScene> * m_child;
CLASS_ID id;
}
and I have some Mesh instance where
class Mesh: public NodeScene.
I build a tree of Mesh instances and I should update a treeview based
on them.
Every Mesh can have a different attribute that set a different
property in the treeview as a different icon.
I think to add a enum to NodeScene node with
enum CLASS_ID { LIGHT, MESH, MARKER,....} and when I visit the tree at
runtime I am able to classify every SceneNode
with node->getClassID().
if (node->getClassID()==LIGHT) setTreeViewIcon("lightIcon")
else if (node->getClassID()==MARKER) setTreeViewIcon("MarkerIcon")
This is not a great solution I looking for better design solution.
Can you suggest me other solution.
Thanks in advance.
class NodeScene
{
public:
enum CLASS_ID { LIGHT, MESH, MARKER,....}
addChild();
getClassID(){ return ID;};
private:
list<NodeScene> * m_child;
CLASS_ID id;
}
and I have some Mesh instance where
class Mesh: public NodeScene.
I build a tree of Mesh instances and I should update a treeview based
on them.
Every Mesh can have a different attribute that set a different
property in the treeview as a different icon.
I think to add a enum to NodeScene node with
enum CLASS_ID { LIGHT, MESH, MARKER,....} and when I visit the tree at
runtime I am able to classify every SceneNode
with node->getClassID().
if (node->getClassID()==LIGHT) setTreeViewIcon("lightIcon")
else if (node->getClassID()==MARKER) setTreeViewIcon("MarkerIcon")
This is not a great solution I looking for better design solution.
Can you suggest me other solution.
Thanks in advance.