162 vector<CVect3<float> > verts3d;
171 verts.resize(verts3d.size());
172 for (
size_t i = 0;
i < verts3d.size(); ++
i)
173 verts[
i].Set(verts3d[
i].X(), verts3d[
i].Y());
182 bool has_color =
false;
190 vector<CVect4<unsigned char> > colors_uc;
193 for (
size_t i = 0;
i < colors_uc.size(); ++
i)
194 colors.push_back(
CRgbaColor(colors_uc[
i][0], colors_uc[
i][1], colors_uc[
i][2], colors_uc[
i][3]));
198 if (has_color && is_greyscale) {
199 for (
size_t i = 0;
i <
colors.size(); ++
i) {
class CRgbaColor provides a simple abstraction for managing colors.
static const Colors colors
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const T * GetData() const
void SetTexCoordBuffer(const vector< CVect2< float > > &data)
virtual ~CGlVboNode()
Delete all buffers.
void SetTexCoordBuffer1D(const vector< float > &data)
void SetVertexBuffer2D(const vector< CVect2< float > > &data)
void Get2DVertexBuffer(std::vector< CVect2< float > > &verts) const
bool GetDefaultColor(CRgbaColor &default_color, bool is_greyscale) const
Return default color from node in default_color.
static CGlResMgr & Instance()
void GetVertexBuffer3D(vector< CVect3< float > > &data) const
bool GetColors(std::vector< CRgbaColor > &colors, bool is_greyscale) const
void GetColorBuffer(vector< CRgbaColor > &data) const
void GetColorBufferUC(vector< CVect4< unsigned char > > &data) const
CMatrix4< float > GetTransformedPosition(size_t idx)
return the position with rotation and pixel offset baked in
CIRef< IVboGeom > m_VBOGeom
subclass for vboset representing point, line, tri or quad geometry
vector< CMatrix4< float > > m_Positions
Set of positions (transformations) at which to render this node.
void SetVertexBuffer3D(const vector< CVect3< float > > &data)
void SetVBOGeom(IVboGeom *geom)
Set/get geometry object. These can be shared between nodes.
void GetTexCoordBuffer1D(vector< float > &data) const
IVboGeom::EVertexFormat GetVertexFormat() const
void GetTexCoordBuffer(vector< CVect2< float > > &data) const
CRgbaColor GetColor() const
void SetColorBufferUC(const vector< CVect4< unsigned char > > &data)
CGlVboNode()
Buffers are initially NULL and draw mode is not set.
IVboGeom::ESecondaryFormat GetSecondaryFormat() const
virtual void x_Render()
Render VBO(s)
void GetVertexBuffer2D(vector< CVect2< float > > &data) const
void SetColorBuffer(const vector< CRgbaColor > &data)
@ kSecondaryFormatColorUChar
@ kSecondaryFormatColorFloat
CRgbaColor GetGreyscale() const
Returns the greyscale equivalent of the current color.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.