vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Icon.h
Go to the documentation of this file.
1 #ifndef _DA_ICON_H
2 #define _DA_ICON_H
3 
4 #include "PoB.h"
5 #include "Icon.h"
6 
7 using namespace vrecko;
8 
10 typedef enum IconType {
14 };
15 
17 
26 class Icon : public PoB
27 {
28 public:
29 
30  Icon();
31  ~Icon();
32 
33  void clicked();
34 
35  int load(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode* IconNode);
36 
37  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parametersNode);
38 
39  void postInitialize();
40 
41  void pointed(bool pointed);
42 
43  void save(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* Document, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode* IconNode) ;
44 
46  /*
47  * traverse node structure, find sub-node with given name
48  * change color (material) of founded sub-node
49  *
50  * \param partName name of geometry-part (Cinema4D export function cuts the object names to a length of up to eight characters)
51  * \param newColor pointer to new color (and transparency) of part. if newColor == NULL, original color is used/restored
52  */
53  void setColorofPart(std::string partName, osg::Vec4* newColor);
54 
55  virtual void update();
56 
57 protected:
58 
61 
64 
66  //TODO what about materials?
67  osg::Vec4 originalColor;
68 
69  // Name of part of 3D model which will change color (i.e. during pointing)
70  std::string colorablePartName;
71 };
72 
73 
74 #endif // _DA_ICON_H