| 1 |
/*************************************************************************** |
| 2 |
* Copyright (C) 2005-2019 by the FIFE team * |
| 3 |
* http://www.fifengine.net * |
| 4 |
* This file is part of FIFE. * |
| 5 |
* * |
| 6 |
* FIFE is free software; you can redistribute it and/or * |
| 7 |
* modify it under the terms of the GNU Lesser General Public * |
| 8 |
* License as published by the Free Software Foundation; either * |
| 9 |
* version 2.1 of the License, or (at your option) any later version. * |
| 10 |
* * |
| 11 |
* This library is distributed in the hope that it will be useful, * |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 14 |
* Lesser General Public License for more details. * |
| 15 |
* * |
| 16 |
* You should have received a copy of the GNU Lesser General Public * |
| 17 |
* License along with this library; if not, write to the * |
| 18 |
* Free Software Foundation, Inc., * |
| 19 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * |
| 20 |
***************************************************************************/ |
| 21 |
|
| 22 |
#ifndef FIFE_RENDERERNODE_H |
| 23 |
#define FIFE_RENDERERNODE_H |
| 24 |
|
| 25 |
// Standard C++ library includes |
| 26 |
//#include <vector> |
| 27 |
|
| 28 |
// 3rd party library includes |
| 29 |
|
| 30 |
// FIFE includes |
| 31 |
// These includes are split up in two parts, separated by one empty line |
| 32 |
// First block: files included from the FIFE root src directory |
| 33 |
// Second block: files included from the same folder |
| 34 |
|
| 35 |
namespace FIFE { |
| 36 |
|
| 37 |
class InstanceDeleteListener; |
| 38 |
|
| 39 |
class RendererNode { |
| 40 |
public: |
| 41 |
RendererNode(Instance* attached_instance, const Location &relative_location, Layer* relative_layer, const Point &relative_point = Point(0,0)); |
| 42 |
RendererNode(Instance* attached_instance, const Location &relative_location, const Point &relative_point = Point(0,0)); |
| 43 |
RendererNode(Instance* attached_instance, Layer* relative_layer, const Point &relative_point = Point(0,0)); |
| 44 |
RendererNode(Instance* attached_instance, const Point &relative_point = Point(0,0)); |
| 45 |
RendererNode(const Location &attached_location, Layer* relative_layer, const Point &relative_point = Point(0,0)); |
| 46 |
RendererNode(const Location &attached_location, const Point &relative_point = Point(0,0)); |
| 47 |
RendererNode(Layer* attached_layer, const Point &relative_point = Point(0,0)); |
| 48 |
RendererNode(const Point &attached_point); |
| 49 |
RendererNode(const RendererNode &old); |
| 50 |
RendererNode& operator=(const RendererNode &source); |
| 51 |
~RendererNode(); |
| 52 |
|
| 53 |
void setAttached(Instance* attached_instance, const Location &relative_location, const Point &relative_point); |
| 54 |
void setAttached(Instance* attached_instance, const Location &relative_location); |
| 55 |
void setAttached(Instance* attached_instance, const Point &relative_point); |
| 56 |
void setAttached(Instance* attached_instance); |
| 57 |
void setAttached(const Location &attached_location, const Point &relative_point); |
| 58 |
void setAttached(const Location &attached_location); |
| 59 |
void setAttached(Layer* attached_layer); |
| 60 |
void setAttached(const Point &attached_point); |
| 61 |
|
| 62 |
void setRelative(const Location &relative_location); |
| 63 |
void setRelative(const Location &relative_location, Point relative_point); |
| 64 |
void setRelative(const Point &relative_point); |
| 65 |
|
| 66 |
Instance* getAttachedInstance(); |
| 67 |
Location getAttachedLocation(); |
| 68 |
Layer* getAttachedLayer(); |
| 69 |
Point getAttachedPoint(); |
| 70 |
|
| 71 |
Location getOffsetLocation(); |
| 72 |
Point getOffsetPoint(); |
| 73 |
|
| 74 |
Instance* getInstance(); |
| 75 |
Location getLocation(); |
| 76 |
const Location& getLocationRef(); |
| 77 |
Layer* getLayer(); |
| 78 |
Point getPoint(); |
| 79 |
const Point& getPointRef(); |
| 80 |
|
| 81 |
void addInstance(Instance* instance); |
| 82 |
void changeInstance(Instance* instance); |
| 83 |
void removeInstance(Instance* instance, bool listener = true); |
| 84 |
|
| 85 |
Point getCalculatedPoint(Camera* cam, Layer* layer, const bool zoomed = false); |
| 86 |
private: |
| 87 |
void checkDeleteListener(); |
| 88 |
|
| 89 |
Instance* m_instance; |
| 90 |
Location m_location; |
| 91 |
Layer* m_layer; |
| 92 |
Point m_point; |
| 93 |
InstanceDeleteListener* m_listener; |
| 94 |
}; |
| 95 |
} |
| 96 |
|
| 97 |
#endif |