File: InstancesNode.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 (69 lines) | stat: -rw-r--r-- 1,413 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

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


class InstanceNode: public Node
{
public:
	InstanceNode(void){node_type = INSTANCE_NODE; id = "empty"; type= "empty";};
	char*	id;
	char*	type;
	int		node_type;
	
	OwnSlotsNode own_slots;
	void addOwnSlots(OwnSlotsNode* own_slots);
	virtual void printNode();
	virtual int qualifyNode();
};

void InstanceNode::addOwnSlots(OwnSlotsNode* sn)
{
	own_slots.addOwnSlot(&sn->own_slot);
}



void InstanceNode::printNode()
{
	cout<<"InstanceNode: Node node_type is "<<node_type<<"\n";
	cout<<"InstanceNode: Node type is "<<type<<"\n";
	cout<<"InstanceNode: Node id is "<<id<<"\n";
	own_slots.printNode();
}
int InstanceNode::qualifyNode()
{return node_type;}

class InstancesNode: public Node
{
public:
	InstancesNode(void){node_type = INSTANCES_NODE;};
	int		node_type;
	NodeGroup instances;

	void addInstance(InstanceNode* in);
	virtual void printNode();
	virtual int qualifyNode();
};

void InstancesNode::addInstance(InstanceNode* in)
{
	instances.Sons.push_back(new InstanceNode);
	InstanceNode* ilp = (InstanceNode*) instances.Sons.front();

	ilp->addOwnSlots(&in->own_slots);

}

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

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