DDraceNetwork Docs
map_view.h
Go to the documentation of this file.
1#ifndef GAME_EDITOR_MAP_VIEW_H
2#define GAME_EDITOR_MAP_VIEW_H
3
4#include <base/vmath.h>
5
6#include "component.h"
7#include "map_grid.h"
8#include "proof_mode.h"
9#include "smooth_value.h"
10
11class CLayerGroup;
12
14{
15public:
16 void OnInit(CEditor *pEditor) override;
17 void OnReset() override;
18 void OnMapLoad() override;
19
20 void ZoomMouseTarget(float ZoomFactor);
21 void UpdateZoom();
22
23 void RenderGroupBorder();
24 void RenderMap();
25
26 bool IsFocused();
27 void Focus();
28
32 void ResetZoom();
33
37 float ScaleLength(float Value) const;
38
39 bool m_ShowPicker; // TODO: make private
40
41 float GetWorldZoom() const;
42
43 void OffsetWorld(vec2 Offset);
44 void OffsetEditor(vec2 Offset);
45 void SetWorldOffset(vec2 WorldOffset);
46 void SetEditorOffset(vec2 EditorOffset);
47 vec2 GetWorldOffset() const;
48 vec2 GetEditorOffset() const;
49
51 const CSmoothValue *Zoom() const;
53 const CProofMode *ProofMode() const;
55 const CMapGrid *MapGrid() const;
56
57private:
58 CSmoothValue m_Zoom = CSmoothValue(200.0f, 10.0f, 2000.0f);
60
63
66};
67
68#endif
Definition: component.h:9
Definition: editor.h:276
Definition: layer_group.h:10
Definition: map_grid.h:9
Definition: map_view.h:14
CProofMode m_ProofMode
Definition: map_view.h:61
bool IsFocused()
Definition: map_view.cpp:38
void ResetZoom()
Definition: map_view.cpp:132
CMapGrid m_MapGrid
Definition: map_view.h:62
float m_WorldZoom
Definition: map_view.h:59
void SetEditorOffset(vec2 EditorOffset)
Definition: map_view.cpp:218
float ScaleLength(float Value) const
Definition: map_view.cpp:138
vec2 m_EditorOffset
Definition: map_view.h:65
CSmoothValue m_Zoom
Definition: map_view.h:58
CMapGrid * MapGrid()
Definition: map_view.cpp:193
void UpdateZoom()
Definition: map_view.cpp:162
void OnMapLoad() override
Definition: map_view.cpp:33
vec2 GetEditorOffset() const
Definition: map_view.cpp:228
vec2 m_WorldOffset
Definition: map_view.h:64
void OffsetWorld(vec2 Offset)
Definition: map_view.cpp:203
void ZoomMouseTarget(float ZoomFactor)
Definition: map_view.cpp:143
bool m_ShowPicker
Definition: map_view.h:39
void OffsetEditor(vec2 Offset)
Definition: map_view.cpp:208
void SetWorldOffset(vec2 WorldOffset)
Definition: map_view.cpp:213
void RenderGroupBorder()
Definition: map_view.cpp:54
void OnReset() override
Definition: map_view.cpp:19
vec2 GetWorldOffset() const
Definition: map_view.cpp:223
void Focus()
Definition: map_view.cpp:46
void OnInit(CEditor *pEditor) override
Definition: map_view.cpp:11
void RenderMap()
Definition: map_view.cpp:83
float GetWorldZoom() const
Definition: map_view.cpp:233
CSmoothValue * Zoom()
Definition: map_view.cpp:173
CProofMode * ProofMode()
Definition: map_view.cpp:183
Definition: proof_mode.h:7
Definition: smooth_value.h:12