#ifndef BOX_HPP
#define BOX_HPP

#include <vector>
#include "Body.hpp"

namespace nbody {
	using namespace std;

	class Box {
		friend class Node;
		friend class MpiSimulation;
	private:
		double min[3];
		double max[3];
	public:
		Box();
		virtual ~Box();
		virtual void extendToCube();
		virtual void extendForBodies(vector<Body> bodies);
		virtual double getMin(int index);
		virtual double getMax(int index);
		virtual void setMin(int index, double value);
		virtual void setMax(int index, double value);
		virtual vector<Body> extractBodies(vector<Body>& bodies);
		virtual vector<Body> copyBodies(vector<Body> bodies);
		virtual bool isContained(Body body);
		virtual bool isContained(Box box);
		virtual double volume();
		virtual double maxSidelength();
		virtual bool isCorrect();
		virtual void print();
		virtual bool overlapsSphere(double* sphereCenter, double sphereRadius);
		virtual double distanceToPosition(double* position);
		virtual double distanceToBox(Box box);
		virtual vector<Box> octreeSplit();
		virtual vector<Box> splitLongestSide();
		virtual bool contained(double* position);
		virtual void extend(Box extender);
		virtual void extend(Body extender);
	};
}

#endif
