// Ryzom - MMORPG Framework
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
#ifndef RZ_VIEW_POLYGON_H
#define RZ_VIEW_POLYGON_H
#include "view_base.h"
#include "view_renderer.h"
//
#include "nel/misc/geom_ext.h"
#include "nel/misc/polygon.h"
/** Display of an arbitrary polygon in the ui.
* polygon is clipped & batched
*
* \author Nicolas Vizerie
* \author Nevrax France
* \date 1/2006
*/
class CViewPolygon : public CViewBase
{
public:
CViewPolygon();
virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); }
virtual void updateCoords();
virtual void draw();
void setVertices(const std::vector &vertices);
// color
void setColorRGBA(NLMISC::CRGBA col) { _Color = col; }
NLMISC::CRGBA getColorRGBA() const { return _Color; }
// from CViewBase
virtual sint32 getAlpha() const { return (sint32) _Color.A; }
virtual void setAlpha (sint32 a);
private:
NLMISC::CPolygon _Poly;
bool _Touched;
NLMISC::CRGBA _Color;
std::vector _Tris;
std::vector _RealTris; // clipped tris in screen coordinates
};
#endif