File: SlotsNode.h

package info (click to toggle)
meshlab 1.3.2%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 21,060 kB
  • ctags: 33,549
  • sloc: cpp: 224,813; ansic: 8,170; xml: 119; makefile: 80
file content (151 lines) | stat: -rw-r--r-- 3,087 bytes parent folder | download | duplicates (5)
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151

#include <utility>
#include <map>
#include <list>
#include "Node.h"

using namespace std;

class ValueNode: public Node
{
public:
	ValueNode(void){node_type = VALUE_NODE;value = "empty";};
	int node_type;
	string value; //tra due tag
	virtual void printNode();
	virtual int qualifyNode();

	void setValue(ValueNode vn){value = vn.value;};
	void setValue(const char* cvn){value = cvn;};
};

void ValueNode::printNode()
{
	cout<<"ValueNode: Node type is "<<node_type<<"\n";
	cout<<"ValueNode: Node value is "<<value<<"\n";
}

int ValueNode::qualifyNode()
{return node_type;}

class EntryNode: public Node
{
public:
	EntryNode(void){node_type = ENTRY_NODE; type = "empty";};
	int node_type;
	const char* type;
	ValueNode value;
	void addValue(ValueNode vn);
	void setEntry(EntryNode en);
	virtual void printNode();
	virtual int qualifyNode();
};
void EntryNode::addValue(ValueNode vn)
{
	value.setValue(vn);
}
void EntryNode::setEntry(EntryNode en)
{
	type = en.type;
	addValue(en.value);
}

void EntryNode::printNode()
{
	cout<<"EntryNode: Node type is "<<node_type<<"\n";
	cout<<"EntryNode: Node attr. type is "<<type<<"\n";
	value.printNode();
}

int EntryNode::qualifyNode()
{return node_type;}

class OwnSlotNode: public Node
{
public:
	OwnSlotNode(void){node_type = OWNSLOT_NODE; name = "empty";};
	int node_type;
	const char* name;
	EntryNode entry;
	virtual void printNode();
	virtual int qualifyNode();
	void addEntry(EntryNode en);
	void setName(const char* s){name = s;};
};

void OwnSlotNode::printNode()
{
	cout<<"OwnSlotNode: Node type is "<<node_type<<"\n";
	cout<<"OwnSlotNode: Node name is "<<name<<"\n";
	entry.printNode();
}

int OwnSlotNode::qualifyNode()
{return node_type;}

void OwnSlotNode::addEntry(EntryNode en)
{
	entry.setEntry(en);
}

class SlotNode: public Node
{
public:
	SlotNode(void){node_type = SLOT_NODE;};
	int node_type;
	NodeGroup	own_slot;
	virtual void printNode();
	virtual int qualifyNode();
	void addOwnSlot(OwnSlotNode* os);

};

void SlotNode::addOwnSlot(OwnSlotNode* os)
{
	//OwnSlotNode* osn = new OwnSlotNode;
//	own_slots.Sons.push_back(new OwnSlotNode);
	
		own_slot.addNode(os);
}

void SlotNode::printNode()
{
	cout<<"SlotNode: Node type is "<<node_type<<"\n";
	list<Node*>::iterator it;
	for(it = own_slot.Sons.begin(); it!=own_slot.Sons.end(); ++it)
		(*it)->printNode();
}

int SlotNode::qualifyNode()
{return node_type;}

class SlotsNode: public Node
{
public:
	SlotsNode(void){node_type = SLOTS_NODE;};
	int node_type;
	NodeGroup slot;
	void addSlot(SlotNode* sn);
	virtual void printNode();
	virtual int qualifyNode();
};

void SlotsNode::addSlot(SlotNode* sn)
{
	slot.Sons.push_back(new SlotNode);
	SlotNode* slp = (SlotNode*) slot.Sons.front();
	list<Node*>::iterator it;
	for(it = sn->own_slot.Sons.begin(); it!=sn->own_slot.Sons.end(); ++it)
		slp->addOwnSlot(((OwnSlotNode*)(*it)));
}

void SlotsNode::printNode()
{
	cout<<"SlotsNode: Node type is "<<node_type<<"\n";
	list<Node*>::iterator it;
	for(it = slot.Sons.begin(); it!=slot.Sons.end(); ++it)
		(*it)->printNode();
}

int SlotsNode::qualifyNode()
{return node_type;}