nomlib
Toggle main menu visibility
Loading...
Searching...
No Matches
include
nomlib
math
Transformable.hpp
1
/******************************************************************************
2
3
nomlib - C++11 cross-platform game engine
4
5
Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
6
All rights reserved.
7
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions are met:
10
11
1. Redistributions of source code must retain the above copyright notice, this
12
list of conditions and the following disclaimer.
13
2. Redistributions in binary form must reproduce the above copyright notice,
14
this list of conditions and the following disclaimer in the documentation
15
and/or other materials provided with the distribution.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28
******************************************************************************/
29
#ifndef NOMLIB_GRAPHICS_TRANSFORMABLE_HPP
30
#define NOMLIB_GRAPHICS_TRANSFORMABLE_HPP
31
32
#include "export.hpp"
33
#include "nomlib/config.hpp"
34
#include "nomlib/math/Size2.hpp"
35
#include "nomlib/graphics/IDrawable.hpp"
36
37
namespace
nom {
38
39
// TODO: Consider upgrading containers to Point3f ..?
40
41
class
NOM_EXPORT Transformable:
public
virtual
IDrawable
42
{
43
public
:
44
typedef
Transformable self_type;
45
46
Transformable(
void
);
47
virtual
~Transformable(
void
);
48
49
Transformable(
const
Point2i& pos,
const
Size2i&
size
);
50
53
Transformable
(
const
IntRect& bounds );
54
58
ObjectTypeInfo
type
()
const override
;
59
61
const
Point2i&
position
(
void
)
const
;
62
64
const
Size2i&
size
(
void
)
const
;
65
73
virtual
void
set_position
(
const
Point2i& coords );
74
82
virtual
void
set_size
(
const
Size2i&
size
);
83
86
virtual
void
set_bounds
(
const
IntRect& bounds );
87
91
void
set_position
(
int
x,
int
y );
92
96
void
set_size
(
int
w,
int
h );
97
99
virtual
void
translate
(
const
Point2i& pos);
100
101
private
:
102
Point2i position_;
103
105
Size2i
size_
;
106
};
107
108
}
// namespace nom
109
110
#endif
// NOMLIB_TRANSFORMABLE_HEADERS defined
nom::IDrawable::IDrawable
IDrawable(void)
Do nothing at all default constructor.
Definition
IDrawable.hpp:63
nom::ObjectTypeInfo
Run-time type information (RTTI) container class.
Definition
ObjectTypeInfo.hpp:42
nom::Transformable::set_size
void set_size(int w, int h)
nom::Transformable::position
const Point2i & position(void) const
Getter for stored positioning coordinates.
nom::Transformable::set_position
virtual void set_position(const Point2i &coords)
Set the positioning – X & Y rendering coordinates – of the object.
nom::Transformable::type
ObjectTypeInfo type() const override
Re-implements the IObject::type method.
nom::Transformable::size
const Size2i & size(void) const
Getter for stored size dimensions.
nom::Transformable::set_position
void set_position(int x, int y)
nom::Transformable::set_bounds
virtual void set_bounds(const IntRect &bounds)
Set the complete bounds of the object – position (X, Y) and size (width and height) dimensions.
nom::Transformable::translate
virtual void translate(const Point2i &pos)
nom::Transformable::Transformable
Transformable(const IntRect &bounds)
Construct an object using a complete set of coordinates (bounds).
nom::Transformable::size_
Size2i size_
The dimensions representing width and height.
Definition
Transformable.hpp:105
nom::Transformable::set_size
virtual void set_size(const Size2i &size)
Set the size dimensions– width & height rendering coordinates of the object.
Generated on
for nomlib by
1.18.0