95 } |
95 } |
96 } |
96 } |
97 |
97 |
98 void ViewToolset::resetView() |
98 void ViewToolset::resetView() |
99 { |
99 { |
100 m_window->R()->resetAngles(); |
100 m_window->renderer()->resetAngles(); |
101 m_window->R()->update(); |
101 m_window->renderer()->update(); |
102 } |
102 } |
103 |
103 |
104 void ViewToolset::screenshot() |
104 void ViewToolset::screenshot() |
105 { |
105 { |
106 setlocale (LC_ALL, "C"); |
106 setlocale (LC_ALL, "C"); |
107 |
107 |
108 int w, h; |
108 int w, h; |
109 uchar* imgdata = m_window->R()->getScreencap (w, h); |
109 uchar* imgdata = m_window->renderer()->getScreencap (w, h); |
110 QImage img = GetImageFromScreencap (imgdata, w, h); |
110 QImage img = GetImageFromScreencap (imgdata, w, h); |
111 |
111 |
112 QString root = Basename (currentDocument()->name()); |
112 QString root = Basename (currentDocument()->name()); |
113 |
113 |
114 if (root.right (4) == ".dat") |
114 if (root.right (4) == ".dat") |
126 |
126 |
127 void ViewToolset::axes() |
127 void ViewToolset::axes() |
128 { |
128 { |
129 m_config->setDrawAxes (not m_config->drawAxes()); |
129 m_config->setDrawAxes (not m_config->drawAxes()); |
130 m_window->updateActions(); |
130 m_window->updateActions(); |
131 m_window->R()->update(); |
131 m_window->renderer()->update(); |
132 } |
132 } |
133 |
133 |
134 void ViewToolset::visibilityToggle() |
134 void ViewToolset::visibilityToggle() |
135 { |
135 { |
136 for (LDObject* obj : selectedObjects()) |
136 for (LDObject* obj : selectedObjects()) |
150 } |
150 } |
151 |
151 |
152 void ViewToolset::wireframe() |
152 void ViewToolset::wireframe() |
153 { |
153 { |
154 m_config->setDrawWireframe (not m_config->drawWireframe()); |
154 m_config->setDrawWireframe (not m_config->drawWireframe()); |
155 m_window->R()->refresh(); |
155 m_window->renderer()->refresh(); |
156 } |
156 } |
157 |
157 |
158 void ViewToolset::setOverlay() |
158 void ViewToolset::setOverlay() |
159 { |
159 { |
160 OverlayDialog dlg; |
160 OverlayDialog dlg; |
161 |
161 |
162 if (not dlg.exec()) |
162 if (not dlg.exec()) |
163 return; |
163 return; |
164 |
164 |
165 m_window->R()->setupOverlay ((ECamera) dlg.camera(), dlg.fpath(), dlg.ofsx(), |
165 m_window->renderer()->setupOverlay ((ECamera) dlg.camera(), dlg.fpath(), dlg.ofsx(), |
166 dlg.ofsy(), dlg.lwidth(), dlg.lheight()); |
166 dlg.ofsy(), dlg.lwidth(), dlg.lheight()); |
167 } |
167 } |
168 |
168 |
169 void ViewToolset::clearOverlay() |
169 void ViewToolset::clearOverlay() |
170 { |
170 { |
171 m_window->R()->clearOverlay(); |
171 m_window->renderer()->clearOverlay(); |
172 } |
172 } |
173 |
173 |
174 void ViewToolset::drawAngles() |
174 void ViewToolset::drawAngles() |
175 { |
175 { |
176 m_config->setDrawAngles (not m_config->drawAngles()); |
176 m_config->setDrawAngles (not m_config->drawAngles()); |
177 m_window->R()->refresh(); |
177 m_window->renderer()->refresh(); |
178 } |
178 } |
179 |
179 |
180 void ViewToolset::setDrawDepth() |
180 void ViewToolset::setDrawDepth() |
181 { |
181 { |
182 if (m_window->R()->camera() == EFreeCamera) |
182 if (m_window->renderer()->camera() == EFreeCamera) |
183 return; |
183 return; |
184 |
184 |
185 bool ok; |
185 bool ok; |
186 double depth = QInputDialog::getDouble (m_window, "Set Draw Depth", |
186 double depth = QInputDialog::getDouble (m_window, "Set Draw Depth", |
187 format ("Depth value for %1 Camera:", m_window->R()->getCameraName()), |
187 format ("Depth value for %1 Camera:", m_window->renderer()->getCameraName()), |
188 m_window->R()->getDepthValue(), -10000.0f, 10000.0f, 3, &ok); |
188 m_window->renderer()->getDepthValue(), -10000.0f, 10000.0f, 3, &ok); |
189 |
189 |
190 if (ok) |
190 if (ok) |
191 m_window->R()->setDepthValue (depth); |
191 m_window->renderer()->setDepthValue (depth); |
192 } |
192 } |
193 |
193 |
194 #if 0 |
194 #if 0 |
195 // This is a test to draw a dummy axle. Meant to be used as a primitive gallery, |
195 // This is a test to draw a dummy axle. Meant to be used as a primitive gallery, |
196 // but I can't figure how to generate these pictures properly. Multi-threading |
196 // but I can't figure how to generate these pictures properly. Multi-threading |
277 |
277 |
278 if (m_config->randomColors()) |
278 if (m_config->randomColors()) |
279 m_config->setBfcRedGreenView (false); |
279 m_config->setBfcRedGreenView (false); |
280 |
280 |
281 m_window->updateActions(); |
281 m_window->updateActions(); |
282 m_window->R()->refresh(); |
282 m_window->renderer()->refresh(); |
283 } |
283 } |
284 |
284 |
285 void ViewToolset::drawSurfaces() |
285 void ViewToolset::drawSurfaces() |
286 { |
286 { |
287 m_config->setDrawSurfaces (not m_config->drawSurfaces()); |
287 m_config->setDrawSurfaces (not m_config->drawSurfaces()); |