#ifndef TREE_HPP
#define TREE_HPP

#include <vector>
#include <cstdlib>
#include <string>
#include "Body.hpp"
#include "Box.hpp"

namespace nbody {
	using namespace std;

	class Node;

	class Tree {
		friend class Node;
	protected:
		Node* nodes;
	public:
		static vector<Body> dubinskiParse(string filename);

		Tree();
		virtual ~Tree();
		virtual void clean();
		virtual void build(vector<Body> bodies) = 0;
		virtual int numberOfChildren() = 0;
		virtual unsigned long numberOfNodes();
		virtual void accumulateForceOnto(Body& body);
		virtual void computeForces();
		virtual void moveBodies();
		virtual vector<Body> extractBodies();
		virtual vector<Body> extractRefinements(Box domain);
		virtual void rebuild();
		virtual Box getRootBB();
		virtual void print();
		virtual bool isCorrect();
	};


}

#endif
