supertux
node_marker.hpp
1 // SuperTux
2 // Copyright (C) 2016 Hume2 <teratux.mail@gmail.com>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_EDITOR_NODE_MARKER_HPP
18 #define HEADER_SUPERTUX_EDITOR_NODE_MARKER_HPP
19 
20 #include "editor/marker_object.hpp"
21 #include "object/path.hpp"
22 
23 class NodeMarker : public MarkerObject
24 {
25 public:
26  NodeMarker(Path* path_, std::vector<Path::Node>::iterator node_iterator, size_t id_);
27 
28  virtual void move_to(const Vector& pos) override;
29  virtual void editor_delete() override;
30  virtual Vector get_point_vector() const override;
31  virtual Vector get_offset() const override;
32  virtual bool has_settings() const override { return true; }
33  virtual ObjectSettings get_settings() override;
34  virtual void editor_update() override;
35 
36  void update_iterator();
37 
38 private:
39  Path* m_path;
40 
41 public:
42  std::vector<Path::Node>::iterator m_node;
43 
44 private:
45  size_t m_id;
46 
47 private:
48  NodeMarker(const NodeMarker&) = delete;
49  NodeMarker& operator=(const NodeMarker&) = delete;
50 };
51 
52 #endif
53 
54 /* EOF */
Simple two dimensional vector.
Definition: vector.hpp:24
virtual bool has_settings() const override
Indicates if get_settings() is implemented.
Definition: node_marker.hpp:32
virtual void editor_update() override
Called each frame in the editor, used to keep linked objects together (e.g.
Definition: node_marker.cpp:85
Definition: object_settings.hpp:35
Definition: path.hpp:44
Definition: marker_object.hpp:24
virtual void editor_delete() override
The editor requested the deletion of the object.
Definition: node_marker.cpp:70
Definition: node_marker.hpp:23