forked from rubenwardy/NodeBoxEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.h
44 lines (38 loc) · 875 Bytes
/
Node.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
#ifndef _NODE_H_INCLUDED_
#define _NODE_H_INCLUDED_
#include "common.h"
#include "EditorState.h"
#include "Nodebox.h"
class EditorState;
class NodeBox;
class Node
{
public:
// Construction / Destruction
Node(IrrlichtDevice* mdevice,EditorState* state);
~Node();
// Node box manager
int GetId(){return _id;}
NodeBox* GetCurrentNodeBox();
NodeBox* GetNodeBox(int id);
NodeBox* addNodeBox();
void deleteNodebox(int id);
void select(int id){_id = id;}
// Node properties
vector3di getPosition() const{return nd_position;}
void setPosition(vector3di in){nd_position = in;}
stringc name;
// Node bulk updaters
void remesh(); // creates the node mesh
void defrag(); // Defragments node array
private:
// Data
NodeBox* boxes[NODEB_MAX];
int _id;
int number;
vector3di nd_position;
// Irrlicht
IrrlichtDevice* _device;
EditorState* _state;
};
#endif