Public Member Functions | Private Attributes | List of all members
nom::Rectangle Class Reference

3D Rectangle shape More...

#include <Rectangle.hpp>

Inheritance diagram for nom::Rectangle:
[legend]
Collaboration diagram for nom::Rectangle:
[legend]

Public Member Functions

 Rectangle (void)
 Default constructor; construct component objects with their sane defaults.
 
virtual ~Rectangle (void)
 Lazy destructor with nothing to do. Please inherit me!
 
 Rectangle (const Rectangle &rect)
 
 Rectangle (const Coords &coords, const Color &color)
 
 Rectangle (int32 x1, int32 y1, int32 width, int32 height, const Color &color)
 
void update (void)
 
void draw (RenderTarget target) const
 
- Public Member Functions inherited from nom::IDrawable
 IDrawable (void)
 Do nothing at all default constructor.
 
virtual ~IDrawable (void)
 Do nothing at all destructor.
 

Private Attributes

Coords coords
 X, Y signed integer rendering coordinates.
 
Color color
 Rendering color (RGBA).
 

Additional Inherited Members

- Public Types inherited from nom::IDrawable
typedef std::unique_ptr
< IDrawable > 
UniquePtr
 std::unique_ptr definition type for your convenience, sir!
 
typedef std::shared_ptr
< IDrawable > 
SharedPtr
 std::shared_ptr definition type at your leisure, sir!
 
typedef std::vector
< std::shared_ptr< IDrawable > > 
SharedDrawables
 Vector of std::shared_ptr definition type for the brotherhood, sir!
 
typedef std::vector
< std::unique_ptr< IDrawable > > 
UniqueDrawables
 std::unique_ptr vector container type
 
typedef const Window & RenderTarget
 

Detailed Description

3D Rectangle shape

Todo:
Perhaps look at implementing the multi-rectangle variant; SDL_RenderFillRects. I bet, in terms of efficiency, gains are to be seen! Jeffrey Carpenter jeffr.nosp@m.ey.c.nosp@m.arp@g.nosp@m.mail.nosp@m..com @ 2013-10-03

Definition at line 48 of file Rectangle.hpp.

Constructor & Destructor Documentation

nom::Rectangle::Rectangle ( const Rectangle &  rect)

Construct a Rectangle object using an existing Rectangle instance. (This is a typical copy constructor).

Definition at line 36 of file Rectangle.cpp.

nom::Rectangle::Rectangle ( const Coords &  coords,
const Color &  color 
)

Construct a Rectangle object using a nom::Coords (X, Y, width & height) coordinates and a chosen color.

Definition at line 42 of file Rectangle.cpp.

nom::Rectangle::Rectangle ( int32  x1,
int32  y1,
int32  width,
int32  height,
const Color &  color 
)

Construct a Rectangle object using a nom::Coords (X, Y, width & height) coordinates and a chosen color.

Definition at line 48 of file Rectangle.cpp.

Member Function Documentation

void nom::Rectangle::draw ( RenderTarget  target) const
virtual

Draw a 3D four sided cube shape (rectangle) onto the the attached renderer

Implements nom::IDrawable.

Definition at line 56 of file Rectangle.cpp.

Here is the call graph for this function:

void nom::Rectangle::update ( void  )
virtual

Do nothing method; we have it only because it is required by interface contract with IDrawable (which is fine).

Todo:
Measure performance (CPU cycles, ticks/FPS, ...) difference with using a return / abort on rendering when our line object is up-to-date and determine if it is worth the implementation VS risk of inconsistency. Jeffrey Carpenter jeffr.nosp@m.ey.c.nosp@m.arp@g.nosp@m.mail.nosp@m..com @ 2013-10-03

Implements nom::IDrawable.

Definition at line 54 of file Rectangle.cpp.


The documentation for this class was generated from the following files: