nomlib
Loading...
Searching...
No Matches
nom::Shape Class Referenceabstract
Inheritance diagram for nom::Shape:
[legend]

Public Types

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

Public Member Functions

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.
virtual void update (void)=0
virtual void draw (RenderTarget &) const =0
 Render the object onto the primary video buffer – your visible screen.
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.

Protected Member Functions

 Shape (void)

Private Attributes

Color4i outline_color_
 RGBA color used in rendering the outline of a shape.
Color4i fill_color_
 RGBA color used in rendering the inside (fill) of a shape.

Additional Inherited Members

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

Detailed Description

Definition at line 38 of file Shape.hpp.

Member Typedef Documentation

◆ self_type

typedef Shape nom::Shape::self_type

Definition at line 41 of file Shape.hpp.

Constructor & Destructor Documentation

◆ Shape()

nom::Shape::Shape ( void )
protected

Default constructor; initialize the outline rendering color to nom::Color4i::White & the fill rendering color to nom::Color4i::Black.

Member Function Documentation

◆ clone()

virtual Shape * nom::Shape::clone ( ) const
pure virtual

Copy assignment operator.

Implemented in nom::Line, and nom::Rectangle.

◆ type()

ObjectTypeInfo nom::Shape::type ( ) const
overridevirtual

Re-implements the IObject::type method.

Remarks
This uniquely identifies the object's type.

Reimplemented from nom::IDrawable.

Member Data Documentation

◆ fill_color_

Color4i nom::Shape::fill_color_
private

RGBA color used in rendering the inside (fill) of a shape.

Definition at line 81 of file Shape.hpp.

◆ outline_color_

Color4i nom::Shape::outline_color_
private

RGBA color used in rendering the outline of a shape.

Definition at line 78 of file Shape.hpp.


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