FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
renderernode.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2017 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 
70 
73 
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 
94  };
95 }
96 
97 #endif
InstanceDeleteListener * m_listener
Definition: renderernode.h:93
Location getAttachedLocation()
void removeInstance(Instance *instance, bool listener=true)
RendererNode(Instance *attached_instance, const Location &relative_location, Layer *relative_layer, const Point &relative_point=Point(0, 0))
Instance * getInstance()
Point getCalculatedPoint(Camera *cam, Layer *layer, const bool zoomed=false)
void setRelative(const Location &relative_location)
void addInstance(Instance *instance)
Location getLocation()
Camera describes properties of a view port shown in the main screen Main screen can have multiple cam...
Definition: camera.h:59
const Point & getPointRef()
PointType2D< int32_t > Point
Definition: point.h:195
A basic layer on a map.
Definition: layer.h:99
Location getOffsetLocation()
void changeInstance(Instance *instance)
const Location & getLocationRef()
Layer * getAttachedLayer()
Instance * getAttachedInstance()
Instance * m_instance
Definition: renderernode.h:89
void setAttached(Instance *attached_instance, const Location &relative_location, const Point &relative_point)
RendererNode & operator=(const RendererNode &source)
An Instance is an "instantiation" of an Object at a Location.
Definition: instance.h:101