#pragma once
#include "Vector3D.h"
#include "windows.h"

class Polygon3D
{
public:
	Polygon3D();
	Polygon3D(int index0, int index1, int index2, int uvIndex0, int uvIndex1, int uvIndex2);
	Polygon3D(const Polygon3D& other);

	~Polygon3D();

	size_t GetPolygonVertexCount() const;
	size_t GetPolygonUVCount() const;

	int GetIndex(int index) const;
	int GetUVIndex(int index) const;

	void SetNormal(const Vector3D& normal);
	const Vector3D& GetNormal() const;
	void NormalizeNormal();
		
	void SetColor(int red, int green, int blue);
	void SetColor(const COLORREF color);

	int GetR() const;
	void SetR(const int r);
	int GetG() const;
	void SetG(const int g);
	int GetB() const;
	void SetB(const int b);

	COLORREF GetColor() const;

	void SetDepth(float depth);
	float GetDepth() const;
	void SetCulled(bool culled);
	bool GetCulled() const;		
	                                                          
	Polygon3D& operator= (const Polygon3D& rhs);
		
private:
	int _indices[3];
	int _uvIndices[3];

	Vector3D _normal;
	float _depth;
	bool _culled;	

	int _r;
	int _g;
	int _b;	

	void Copy(const Polygon3D& other);
};

