#ifndef OctreeSupport_H
#define OctreeSupport_H

/*
These structs are designed to be used by/with Octree and OctreeNode classes.
For documentation, go look at the top of Octree.hpp
*/

struct Path {
	unsigned int x, y, z;
	Path(unsigned int X, unsigned int Y, unsigned int Z): x(X), y(Y), z(Z) {}
	Path(void): x(0), y(0), z(0) {}
	
	void Print(void) const;
};

/****************************************************************************/

struct Vector {
	double x, y, z;
	Vector(const Vector& V): x(V.x), y(V.y), z(V.z) {}
	Vector(const double X, const double Y, const double Z): x(X), y(Y), z(Z) {}
	Vector(void): x(0), y(0), z(0) {}
	void SetValues(const double X, const double Y, const double Z) {
		x = X;
		y = Y;
		z = Z;
	}
	void MultiplyBy(const double scaleFactor);
	double Norm();
	
	Vector& operator-=(const Vector& V);
	Vector& operator+=(const Vector& V);
	
	bool StrictlyLessThan(const Vector& V)const {
		return ((x < V.x) && (y < V.y) && (z < V.z));
	}
	bool StrictlyGreaterThan(const Vector& V)const {
		return ((x > V.x) && (y > V.y) && (z > V.z));
	}
	bool StrictlyLessOrEqualTo(const Vector& V)const {
		return ((x <= V.x) && (y <= V.y) && (z <= V.z));
	}
	bool StrictlyGreaterOrEqualTo(const Vector& V)const {
		return ((x >= V.x) && (y >= V.y) && (z >= V.z));
	}
	
	void Print(void) const;
};

Vector operator+ (Vector U, const Vector& V);
Vector operator- (Vector U, const Vector& V);

/****************************************************************************/
//for Octree.tcc
int Octree_PickMaxRatio(double& Xratio, const double Yratio, const double Zratio);
int Octree_PickMinPositiveRatio(const double Xratio, const double Yratio, const double Zratio);
//for OctreeNode.tcc
void OctreeNode_PrintTabs(int num);



#endif
