nomlib
Loading...
Searching...
No Matches
nom::Point Class Reference

2D Point (pixel representation) More...

#include <Point.hpp>

Inheritance diagram for nom::Point:
[legend]

Public Member Functions

 Point (void)
 Default constructor.
virtual ~Point (void)
 Destructor; should be fine to inherit from.
 Point (const Point2i &pos, const Color4i &fill)
 Construct a Point from parameters.
void update (void)
void draw (RenderTarget &target) const
 Render the point coordinate.
Public Member Functions inherited from nom::Shape
virtual ~Shape (void)
 Destructor.
 Shape (const Shape &copy)
 Copy constructor.
virtual Shapeclone () const =0
 Copy assignment operator.
ObjectTypeInfo type () const override
 Re-implements the IObject::type method.
const Color4i & outline_color (void) const
 Obtain the outline color used in rendering a shape.
const Color4i & fill_color (void) const
 Obtain the inside fill color used in rendering a shape.
void set_outline_color (const Color4i &color)
 Set the outline color of the shape to be rendered.
void set_fill_color (const Color4i &color)
 Set the inside (fill) color of the shape to be rendered.
Public Member Functions inherited from nom::Transformable
 Transformable (const Point2i &pos, const Size2i &size)
 Transformable (const IntRect &bounds)
 Construct an object using a complete set of coordinates (bounds).
ObjectTypeInfo type () const override
 Re-implements the IObject::type method.
const Point2i & position (void) const
 Getter for stored positioning coordinates.
const Size2i & size (void) const
 Getter for stored size dimensions.
virtual void set_position (const Point2i &coords)
 Set the positioning – X & Y rendering coordinates – of the object.
virtual void set_size (const Size2i &size)
 Set the size dimensions– width & height rendering coordinates of the object.
virtual void set_bounds (const IntRect &bounds)
 Set the complete bounds of the object – position (X, Y) and size (width and height) dimensions.
void set_position (int x, int y)
void set_size (int w, int h)
virtual void translate (const Point2i &pos)
Public Member Functions inherited from nom::IDrawable
 IDrawable (void)
 Do nothing at all default constructor.
virtual ~IDrawable (void)
 Do nothing at all destructor.
Public Member Functions inherited from nom::IObject
 IObject (void)
 Default constructor.
virtual ~IObject (void)
 Virtual destructor.
virtual bool is_type (const ObjectTypeInfo &rhs) const
 Compare this object type with another object's type.

Additional Inherited Members

Public Types inherited from nom::Shape
typedef Shape self_type
Public Types inherited from nom::Transformable
typedef Transformable self_type
Public Types inherited from nom::IDrawable
typedef IDrawable self_type
typedef self_type * raw_ptr
 A type definition for a C pointer – raw pointer – to an IDrawable object.
typedef std::unique_ptr< self_type > unique_ptr
 A type definition for a C++11 std::unique_ptr to an IDrawable object.
typedef std::shared_ptr< self_type > shared_ptr
 A type definition for a C++11 std::shared_ptr to an IDrawable object.
typedef const RenderWindow RenderTarget
Public Types inherited from nom::IObject
typedef IObject self_type
typedef IObjectraw_ptr
Static Public Member Functions inherited from nom::IObject
template<typename Base, typename Derived>
static bool is_a (const Derived object)
 Compare two objects to determine if a derived class inherits from a base class object.
static void * operator new (nom::size_type mem)
static void operator delete (void *ptr)
Static Public Attributes inherited from nom::IObject
static uint64 total_alloc_bytes
static uint64 total_dealloc_bytes
Protected Member Functions inherited from nom::Shape
 Shape (void)

Detailed Description

2D Point (pixel representation)

Todo
Use SDL2's new multi-point API; see SDL_RenderDrawPoints.

Definition at line 44 of file Point.hpp.

Constructor & Destructor Documentation

◆ Point()

nom::Point::Point ( const Point2i & pos,
const Color4i & fill )

Construct a Point from parameters.

Parameters
posnom::Point2i object containing the coordinates.
fillnom::Color4i color to render the point as.

Member Function Documentation

◆ draw()

void nom::Point::draw ( RenderTarget & target) const
virtual

Render the point coordinate.

Parameters
targetnom::RenderWindow object to render to.

Implements nom::IDrawable.

◆ update()

void nom::Point::update ( void )
virtual

Intended to be used internally by the class re-implementing this method; for use in preparing the buffer to be drawn using the draw method call. Whereas both Update & Draw are typically publicly exposed to the end-user, only the Draw method call should be expected of the end-user to be explicitly called.

Todo
Not all the interfaced (inherited) IDrawable objects in this library conform to the expectations stated above. We need to first figure out if we wish to stay on this course (of expectation), or diverge all together. Undecided. Jeffrey Carpenter i8deg.nosp@m.rees.nosp@m.@gmai.nosp@m.l.co.nosp@m.m @ 2013-10-03

Implements nom::IDrawable.


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