Page MenuHomec4science

shape.h
No OneTemporary

File Metadata

Created
Thu, Dec 5, 05:27
#ifndef __SHAPE_H__
#define __SHAPE_H__
#include "vect3d.h"
/* basic graphical object class */
typedef unsigned int sid_t;
struct render_s
{
unsigned char update:1;
unsigned char render:1;
unsigned char static_r:1;
unsigned char null:5; // TODO void to fill
};
const struct render_s def_render_flags = {1, 1, 0, 0};
class Shape
{
public:
Shape( sid_t sid,
const std::string &label = "",
const struct render_s *flags = 0);
~Shape();
sid_t sid() const;
std::string label() const;
bool isUpdating() const;
bool isRendering() const;
struct render_s* getFlags(struct render_s *flags);
void setUpdate(bool flag);
void setRender(bool flag);
void setFlags(const struct render_s *flags);
/* update call to graphical engine */
virtual void render() const;
/* returs the centre position */
virtual const Vector& position() const = 0;
/* sets a new centre position */
virtual void setPosition(const Vector& centre) = 0;
/* updates the centre position relatively to the old one */
virtual void move(const Vector& delta) = 0;
/* update component */
virtual void update(const float &dt) = 0;
private:
/* technical informations */
sid_t _sid;
std::string _label;
struct render_s flags;
/* graphical components */
// TODO
};
#endif

Event Timeline