-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphics.h
87 lines (67 loc) · 1.89 KB
/
graphics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* graphic depictions, a visual workbench for graphs
*
* Copyright (C) 2016 Matvey Soloviev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GRAPHICS_H_
#define _GRAPHICS_H_
#include "stdafx.h"
#include "imgui/imgui.h"
#include <vector>
class CSEngine;
class CSEffect;
class CSFont;
class CSGraphics {
public:
CSEngine *e;
int framectr;
float mx, my;
struct {
float bg[4];
float grid[4];
float edge[4];
float e_select[4];
float n_edge[4];
float n_fill[4];
float n_select[4];
float selection[4];
} config;
/* selection box */
float sx0, sy0, sx1, sy1;
/* target x,y,z */
float tx, ty, tz;
float angle,vangle,zoom;
float dangle,dvangle,dzoom;
bool dragging1,dragging2,dragging3;
/* node appearance */
char nodelook[9][32];
float nodecol[9][4];
CSFont *nodefont;
public:
void Init(CSEngine *ep);
void SetupCamera();
void DoDraw();
void OrthoAtSpatial(float,float,float);
void ReturnToSpace();
/* current camera setup */
int c_viewport[4];
double c_mvmatrix[16],c_projmatrix[16];
void ResetView();
void SpaceToScreen(float,float,float, float&, float&);
void ScreenToSpace(float,float,float&, float&, float&);
void IncrementFrame();
};
#endif