Klamp't
0.9.0
Main Page
Modules
Classes
Files
File List
include
Klampt
Interface
SceneGraphGUI.h
1
2
/*
3
class GenericSceneGraphBackendBase : public GenericBackendBase
4
{
5
bool SendNodeAdd(const string& name,const string& parent);
6
bool SendNodeDelete(const string& name);
7
bool SendNodeAppearance(const string& name,const string& item,const AnyValue& value);
8
bool SendNodeTransform(const string& name,const Math3D::Matrix4& mat);
9
bool SendNodeColor(const string& name,const Math3D::Vector4& color);
10
bool SendNodeGeometry(const string& name,const string& data);
11
bool SendNodeGeometryFile(const string& name,const string& file);
12
};
13
14
class GenericSceneGraphGUIBase : public GenericGUIBase
15
{
16
public:
17
struct SceneGraphNode
18
{
19
string name;
20
string parent;
21
Geometry::AnyGeometry3D geometry;
22
Math3D::Matrix4 T; //current transform
23
GLDraw::GeometryAppearance appearance;
24
};
25
26
GenericSceneGraphGUIBase();
27
void DrawGL();
28
void DrawScreenGL();
29
virtual bool ProcessMessage(const AnyCollection& msg);
30
virtual bool OnNodeAdd(const string& name,const string& parent);
31
virtual bool OnNodeDelete(const string& name);
32
virtual bool OnNodeAppearance(const string& name,const string& item,const string& value);
33
virtual bool OnNodeTransform(const string& name,const Matrix3& mat);
34
virtual bool OnNodeColor(const string& name,const GLColor& color);
35
virtual bool OnNodeGeometry(const string& name,const string& data);
36
virtual bool OnNodeGeometryFile(const string& name,const string& file);
37
38
map<string,SceneGraphNode> sceneGraph;
39
vector<ConsolePrintout>
40
};
41
42
*/
43
44
45
117
/*
118
bool GenericSceneGraphGUIBase::ProcessMessage(const AnyCollection& msg)
119
{
120
string type = msg.get("type",string("error"));
121
if(type == "node_add") {
122
return OnNodeAdd(msg["name"],msg["parent"]);
123
}
124
else if(type == "node_delete") {
125
return OnNodeDelete(msg["name"]);
126
}
127
else if(type == "node_appearance") {
128
return OnNodeAppearance(msg["name"],msg["item"],msg["value"]);
129
}
130
//virtual bool OnNodeTransform(const string& name,const Math3D::RigidTransform& mat) { return false; }
131
//virtual bool OnNodeColor(const string& name,const Math3D::Vector4& color) { return false; }
132
else if(type == "node_geometry") {
133
return OnNodeGeometry(msg["name"],msg["data"]);
134
}
135
else if(type == "node_geometry_file") {
136
return OnNodeGeometryFile(msg["name"],msg["file"]);
137
}
138
return GenericGUIBase::ProcessMessage(msg);
139
}
140
*/
Generated by
1.8.11