Fri, 04 Jul 2014 23:44:44 +0300
- merged with main
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | * Copyright (C) 2013, 2014 Santeri Piippo |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #pragma once |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #include <QGLWidget> |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | #include "main.h" |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include "macros.h" |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include "ldObject.h" |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | #include "ldDocument.h" |
706
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
25 | #include "glShared.h" |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
26 | #include "editmodes/abstracteditmode.h" |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | |
706
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
28 | class GLCompiler; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | class MessageManager; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | class QDialogButtonBox; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | class RadioGroup; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | class QDoubleSpinBox; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | class QSpinBox; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | class QLineEdit; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | class QTimer; |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
36 | class MagicWandMode; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
38 | // |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | // Meta for overlays |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
40 | // |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | struct LDGLOverlay |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | Vertex v0, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | v1; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | int ox, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | oy; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
47 | double lw, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | lh; |
789
4b7306f52bb5
- String -> QString
Santeri Piippo <crimsondusk64@gmail.com>
parents:
784
diff
changeset
|
49 | QString fname; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | QImage* img; |
706
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
51 | bool invalid; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | }; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
53 | |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
54 | struct LDFixedCamera |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
56 | const char glrotate[3]; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | const Axis axisX, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
58 | axisY; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
59 | const bool negX, |
742
f10de1bf22e7
- vertex snapping is now smarter, does a depth compare to favor vertices closer to camera and does a short-range 2d check + out-of-range 2d check
Santeri Piippo <crimsondusk64@gmail.com>
parents:
741
diff
changeset
|
60 | negY, |
f10de1bf22e7
- vertex snapping is now smarter, does a depth compare to favor vertices closer to camera and does a short-range 2d check + out-of-range 2d check
Santeri Piippo <crimsondusk64@gmail.com>
parents:
741
diff
changeset
|
61 | negatedDepth; // is greater depth value closer to camera? |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
62 | }; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
63 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
64 | // |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | // Document-specific data |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
66 | // |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | struct LDGLData |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
68 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
69 | double rotX, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
70 | rotY, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
71 | rotZ, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
72 | panX[7], |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
73 | panY[7], |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | zoom[7]; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
75 | double depthValues[6]; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
76 | LDGLOverlay overlays[6]; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
77 | bool init; |
737
e58bdb21cc54
- more elegant version of ded0a9b, do not zoom to fit in setDocument, instead zoom to fit before rendering
Santeri Piippo <crimsondusk64@gmail.com>
parents:
718
diff
changeset
|
78 | bool needZoomToFit; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
79 | |
737
e58bdb21cc54
- more elegant version of ded0a9b, do not zoom to fit in setDocument, instead zoom to fit before rendering
Santeri Piippo <crimsondusk64@gmail.com>
parents:
718
diff
changeset
|
80 | LDGLData() : |
e58bdb21cc54
- more elegant version of ded0a9b, do not zoom to fit in setDocument, instead zoom to fit before rendering
Santeri Piippo <crimsondusk64@gmail.com>
parents:
718
diff
changeset
|
81 | rotX (0.0), |
e58bdb21cc54
- more elegant version of ded0a9b, do not zoom to fit in setDocument, instead zoom to fit before rendering
Santeri Piippo <crimsondusk64@gmail.com>
parents:
718
diff
changeset
|
82 | rotY (0.0), |
e58bdb21cc54
- more elegant version of ded0a9b, do not zoom to fit in setDocument, instead zoom to fit before rendering
Santeri Piippo <crimsondusk64@gmail.com>
parents:
718
diff
changeset
|
83 | rotZ (0.0), |
e58bdb21cc54
- more elegant version of ded0a9b, do not zoom to fit in setDocument, instead zoom to fit before rendering
Santeri Piippo <crimsondusk64@gmail.com>
parents:
718
diff
changeset
|
84 | init (false), |
e58bdb21cc54
- more elegant version of ded0a9b, do not zoom to fit in setDocument, instead zoom to fit before rendering
Santeri Piippo <crimsondusk64@gmail.com>
parents:
718
diff
changeset
|
85 | needZoomToFit (true) |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
86 | { |
706
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
87 | for (int i = 0; i < 7; ++i) |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
88 | { |
706
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
89 | if (i < 6) |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
90 | { |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
91 | overlays[i].img = null; |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
92 | overlays[i].invalid = false; |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
93 | depthValues[i] = 0.0f; |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
94 | } |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
95 | |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
96 | zoom[i] = 30.0; |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
97 | panX[i] = 0.0; |
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
98 | panY[i] = 0.0; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
99 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
100 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
101 | }; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | |
762
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
103 | enum ECamera |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
104 | { |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
105 | ETopCamera, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
106 | EFrontCamera, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
107 | ELeftCamera, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
108 | EBottomCamera, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
109 | EBackCamera, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
110 | ERightCamera, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
111 | EFreeCamera, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
112 | |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
113 | ENumCameras, |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
114 | EFirstCamera = ETopCamera |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
115 | }; |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
116 | |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
117 | NUMERIC_ENUM_OPERATORS (ECamera) |
d259256e1394
- added a macro for adding operator++ and operator-- to enums, less cast hell this way
Santeri Piippo <crimsondusk64@gmail.com>
parents:
760
diff
changeset
|
118 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
119 | // |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
120 | // CameraIcon::img is a heap-allocated QPixmap because otherwise it gets |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
121 | // initialized before program gets to main() and constructs a QApplication |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
122 | // and Qt doesn't like that. |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
123 | // |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
124 | struct CameraIcon |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
125 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
126 | QPixmap* img; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
127 | QRect srcRect, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
128 | destRect, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
129 | selRect; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
130 | ECamera cam; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
131 | }; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
132 | |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
133 | // |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
134 | // The main renderer object, draws the brick on the screen, manages the camera |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
135 | // and selection picking. The instance of GLRenderer is accessible as |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
136 | // g_win->R() |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
137 | // |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
138 | class GLRenderer : public QGLWidget |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
139 | { |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
140 | public: |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
141 | Q_OBJECT |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
142 | PROPERTY (public, bool, isDrawOnly, setDrawOnly, STOCK_WRITE) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
143 | PROPERTY (public, MessageManager*, messageLog, setMessageLog, STOCK_WRITE) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
144 | PROPERTY (private, bool, isPicking, setPicking, CUSTOM_WRITE) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
145 | PROPERTY (public, LDDocumentPtr, document, setDocument, CUSTOM_WRITE) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
146 | PROPERTY (private, GLCompiler*, compiler, setCompiler, STOCK_WRITE) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
147 | PROPERTY (public, LDObjectWeakPtr, objectAtCursor, setObjectAtCursor, STOCK_WRITE) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
148 | PROPERTY (private, bool, isCameraMoving, setCameraMoving, STOCK_WRITE) |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
149 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
150 | public: |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
151 | GLRenderer (QWidget* parent = null); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
152 | ~GLRenderer(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
153 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
154 | inline ECamera camera() const; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
155 | void clearOverlay(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
156 | void compileObject (LDObjectPtr obj); |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
157 | Vertex coordconv2_3 (const QPoint& pos2d, bool snap) const; |
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
158 | QPoint coordconv3_2 (const Vertex& pos3d) const; |
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
159 | EditModeType currentEditModeType() const; |
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
160 | void drawBlip (QPainter& paint, QPoint pos) const; |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
161 | void drawGLScene(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
162 | void forgetObject (LDObjectPtr obj); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
163 | Axis getCameraAxis (bool y, ECamera camid = (ECamera) -1); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
164 | const char* getCameraName() const; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
165 | double getDepthValue() const; |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
166 | LDFixedCamera const& getFixedCamera (ECamera cam) const; |
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
167 | void getRelativeAxes (Axis& relX, Axis& relY) const; |
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
168 | Axis getRelativeZ() const; |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
169 | LDGLOverlay& getOverlay (int newcam); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
170 | uchar* getScreencap (int& w, int& h); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
171 | void hardRefresh(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
172 | void highlightCursorObject(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
173 | void initGLData(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
174 | void initOverlaysFromObjects(); |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
175 | QPen linePen() const; |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
176 | void needZoomToFit(); |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
177 | Vertex const& position3D() const; |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
178 | void refresh(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
179 | void resetAngles(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
180 | void resetAllAngles(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
181 | void setBackground(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
182 | void setCamera (const ECamera cam); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
183 | void setDepthValue (double depth); |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
184 | void setEditMode (EditModeType type); |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
185 | bool setupOverlay (ECamera cam, QString file, int x, int y, int w, int h); |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
186 | QPen textPen() const; |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
187 | void updateOverlayObjects(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
188 | void zoomNotch (bool inward); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
189 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
190 | static QColor getMainColor(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
191 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
192 | protected: |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
193 | void contextMenuEvent (QContextMenuEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
194 | void dragEnterEvent (QDragEnterEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
195 | void dropEvent (QDropEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
196 | void initializeGL(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
197 | void keyPressEvent (QKeyEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
198 | void keyReleaseEvent (QKeyEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
199 | void leaveEvent (QEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
200 | void mouseDoubleClickEvent (QMouseEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
201 | void mousePressEvent (QMouseEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
202 | void mouseMoveEvent (QMouseEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
203 | void mouseReleaseEvent (QMouseEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
204 | void paintEvent (QPaintEvent* ev); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
205 | void resizeGL (int w, int h); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
206 | void wheelEvent (QWheelEvent* ev); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
207 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
208 | private: |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
209 | CameraIcon m_cameraIcons[7]; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
210 | QTimer* m_toolTipTimer; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
211 | Qt::MouseButtons m_lastButtons; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
212 | Qt::KeyboardModifiers m_keymods; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
213 | Vertex m_position3D; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
214 | double m_virtWidth, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
215 | m_virtHeight; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
216 | bool m_darkbg, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
217 | m_drawToolTip, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
218 | m_screencap, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
219 | m_panning; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
220 | QPoint m_mousePosition, |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
221 | m_globalpos; |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
222 | QPen m_thickBorderPen, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
223 | m_thinBorderPen; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
224 | ECamera m_camera, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
225 | m_toolTipCamera; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
226 | GLuint m_axeslist; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
227 | int m_width, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
228 | m_height, |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
229 | m_totalmove; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
230 | QColor m_bgcolor; |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
231 | AbstractEditMode* m_editmode; |
706
d79083b9f74d
Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents:
655
diff
changeset
|
232 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
233 | void calcCameraIcons(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
234 | void clampAngle (double& angle) const; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
235 | inline LDGLData& currentDocumentData() const; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
236 | void drawVBOs (EVBOSurface surface, EVBOComplement colors, GLenum type); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
237 | LDOverlayPtr findOverlayObject (ECamera cam); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
238 | inline double& pan (Axis ax); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
239 | inline const double& pan (Axis ax) const; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
240 | void pick (int mouseX, int mouseY); |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
802
diff
changeset
|
241 | LDObjectPtr pickOneObject (int mouseX, int mouseY); |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
242 | inline double& rot (Axis ax); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
243 | inline double& zoom(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
244 | void zoomToFit(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
245 | void zoomAllToFit(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
246 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
247 | template<typename... Args> |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
248 | inline QString format (QString fmtstr, Args... args) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
249 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
250 | return ::format (fmtstr, args...); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
251 | } |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
252 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
253 | private slots: |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
254 | void slot_toolTipTimer(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
255 | void initializeAxes(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
256 | }; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
257 | |
802
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
258 | inline ECamera GLRenderer::camera() const |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
259 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
260 | return m_camera; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
261 | } |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
262 | |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
263 | inline LDGLData& GLRenderer::currentDocumentData() const |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
264 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
265 | return *document()->getGLData(); |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
266 | } |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
267 | |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
268 | inline double& GLRenderer::rot (Axis ax) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
269 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
270 | return |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
271 | (ax == X) ? currentDocumentData().rotX : |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
272 | (ax == Y) ? currentDocumentData().rotY : |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
273 | currentDocumentData().rotZ; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
274 | } |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
275 | |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
276 | inline double& GLRenderer::pan (Axis ax) |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
277 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
278 | return (ax == X) ? currentDocumentData().panX[camera()] : |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
279 | currentDocumentData().panY[camera()]; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
280 | } |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
281 | |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
282 | inline double const& GLRenderer::pan (Axis ax) const |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
283 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
284 | return (ax == X) ? currentDocumentData().panX[camera()] : |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
285 | currentDocumentData().panY[camera()]; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
286 | } |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
287 | |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
288 | inline double& GLRenderer::zoom() |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
289 | { |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
290 | return currentDocumentData().zoom[camera()]; |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
291 | } |
2e220b9083bf
- refactor glRenderer.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
790
diff
changeset
|
292 | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
293 | extern const char* g_CameraNames[7]; |