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

3D Line segment shape More...

#include <Line.hpp>

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

Public Member Functions

 Line (void)
 Default constructor; construct component objects with their sane defaults.
 
virtual ~Line (void)
 Lazy destructor with nothing to do. Please inherit me!
 
 Line (const Coords &coords, const Color &color)
 
 Line (int32 x, int32 y, int32 width, int32 height, const Color &color)
 
void update (void)
 
void draw (RenderTarget target) const
 Draw a 3D line segment onto the the attached renderer.
 
- 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 Line segment shape

Todo:
Perhaps look at implementing the multi-line variant; SDL_RenderDrawLines. 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 Line.hpp.

Constructor & Destructor Documentation

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

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

Definition at line 36 of file Line.cpp.

nom::Line::Line ( int32  x,
int32  y,
int32  width,
int32  height,
const Color &  color 
)

Construct a Line object using X, Y, width and height integers and a chosen color.

Definition at line 42 of file Line.cpp.

Member Function Documentation

void nom::Line::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 48 of file Line.cpp.


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