Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94259126
shape.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Dec 5, 05:27
Size
1 KB
Mime Type
text/x-c++
Expires
Sat, Dec 7, 05:27 (2 d)
Engine
blob
Format
Raw Data
Handle
22771745
Attached To
rSYMKIT symkit
shape.h
View Options
#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
Log In to Comment