-
Notifications
You must be signed in to change notification settings - Fork 5
/
tree.h
126 lines (113 loc) · 3.62 KB
/
tree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef __APOLO__TREE__H
#define __APOLO__TREE__H
#include "mrcore.h"
#include "definitions.h"
#include "childView.h"
#include "nodeTree.h"
#include <wx/wx.h>
#include <wx/treectrl.h>
#include <wx/event.h>
#include <wx/imaglist.h>
#include <vector>
#include "bitmaps/icon1.xpm" //file
#include "bitmaps/icon2.xpm" //file select
#include "bitmaps/icon3.xpm" //folder
#include "bitmaps/icon4.xpm" //folder select
#include "bitmaps/universe.xpm"
#include "bitmaps/cylindrical.xpm"
#include "bitmaps/cylindricalSelect.xpm"
#include "bitmaps/joint.xpm"
#include "bitmaps/jointSelect.xpm"
#include "bitmaps/prismatic.xpm"
#include "bitmaps/prismaticSelect.xpm"
#include "bitmaps/sphere.xpm"
#include "bitmaps/sphereSelect.xpm"
#include "bitmaps/composed.xpm"
#include "bitmaps/composedSelect.xpm"
#include "bitmaps/powercube.xpm"
#include "bitmaps/powercubeSelect.xpm"
#include "bitmaps/positionable.xpm"
#include "bitmaps/positionableSelect.xpm"
#include "bitmaps/pioneer.xpm"
#include "bitmaps/pioneerSelect.xpm"
#include "bitmaps/sickLms.xpm"
#include "bitmaps/sickLmsSelect.xpm"
#include "bitmaps/world.xpm"
#include "bitmaps/worldSelect.xpm"
#include "bitmaps/scara.xpm"
#include "bitmaps/scaraSelect.xpm"
#include "bitmaps/universeSelect.xpm"
#include "bitmaps/nemolaser.xpm"
#include "bitmaps/nemolaserSelect.xpm"
#include "bitmaps/meshpart.xpm"
#include "bitmaps/meshpartSelect.xpm"
#include "bitmaps/solidEntity.xpm"
#include "bitmaps/solidEntitySelect.xpm"
#include "bitmaps/laser.xpm"
#include "bitmaps/laserSelect.xpm"
#include "bitmaps/faceSetPart.xpm"
#include "bitmaps/faceSetPartSelect.xpm"
#include "bitmaps/wheeledBase.xpm"
#include "bitmaps/wheeledBaseSelect.xpm"
#include "bitmaps/robotSim.xpm"
#include "bitmaps/robotSimSelect.xpm"
#include "bitmaps/asea.xpm"
#include "bitmaps/aseaSelect.xpm"
#include "bitmaps/link.xpm"
#include "bitmaps/link2.xpm"
#include "bitmaps/euitiBot.xpm"
#include "bitmaps/ultrasonic.xpm"
#include "bitmaps/ultrasonicSelect.xpm"
#include "bitmaps/landmark.xpm"
#include "bitmaps/landmarkSelect.xpm"
class PanelXML;
class MainWindow;
class SimulatedWorld;
class Tree : public wxTreeCtrl
{
private:
wxString text;
wxTreeItemId root;
wxTreeItemId m_parent;
bool sel;
int num;
bool showLinks;
struct m_item {int id; wxString name; wxIcon icon;};
wxTreeItemId PreviousitemId;
vector<NodeTree*> Nod;
DECLARE_EVENT_TABLE();
public:
wxTreeItemId GetWorld(wxTreeItemId i);
Tree(wxWindow * parent, const wxWindowID id);
wxTreeItemId GenerateSubTree(SimulatedWorld *simu);
NodeTree* AddNode(PositionableEntity * pos, wxTreeItemId parent,SimulatedWorld *simu);
void Parent(wxTreeItemId r);
void UpdateTree(SimulatedWorld* N);
void showTreeStructure(bool val);
Tree::m_item SimplyItems(int id,wxString name, wxIcon icon);
void OnItemMenu(wxTreeEvent& event);
wxTreeItemId GenerateSubTree(ComposedEntity* w,SimulatedWorld* simu);
void ManageTreeSelection(wxMouseEvent& event);
void ShowSelection(wxTreeEvent& event);
void SetShowSelection(bool show){sel=show;};
void RestoreItemImage(wxTreeItemId ID);
void ControlMouse(wxMouseEvent& event);
void setShowLinks(bool sh);
bool getShowLinks(){return showLinks;};
void EraseMarks(NodeTree* unlinkedItem);
bool ValidateNodeToLink(TypeNode type);
void UnlinkNode(SimulatedWorld *sim,PositionableEntity* pos);
void SetWorldsNum(int numW){num=numW;}
bool isWorldNode(wxTreeItemId itemId);
void CreateLinksSubTree(PositionableEntity* pos,wxTreeItemId r,SimulatedWorld* simu);
MainWindow* m_mainWin;
PanelXML* XMLPanel;
};
class TreeItemData : public wxTreeItemData
{
public:
TreeItemData(const wxString& dat) : m_dat(dat){}
private:
wxString m_dat;
};
#endif // __APOLO__TREE__H