172 { |
172 { |
173 if (m_window->renderer()->camera() == Camera::Free) |
173 if (m_window->renderer()->camera() == Camera::Free) |
174 return; |
174 return; |
175 |
175 |
176 bool ok; |
176 bool ok; |
177 double depth = QInputDialog::getDouble(m_window, "Set Draw Depth", |
177 double depth = QInputDialog::getDouble( |
178 format("Depth value for %1:", m_window->renderer()->currentCamera().name()), |
178 m_window, |
179 m_window->renderer()->getDepthValue(), -10000.0f, 10000.0f, 3, &ok); |
179 tr("Set draw depth"), |
|
180 format( |
|
181 tr("Depth value for %1:"), |
|
182 m_window->renderer()->currentCamera().name() |
|
183 ), |
|
184 m_window->renderer()->getDepthValue(), |
|
185 -10000.0f, |
|
186 10000.0f, |
|
187 4, |
|
188 &ok |
|
189 ); |
180 |
190 |
181 if (ok) |
191 if (ok) |
182 m_window->renderer()->setDepthValue (depth); |
192 m_window->renderer()->setDepthValue(depth); |
|
193 } |
|
194 |
|
195 void ViewToolset::setCullDepth() |
|
196 { |
|
197 if (m_window->renderer()->camera() == Camera::Free) |
|
198 return; |
|
199 |
|
200 bool ok; |
|
201 double depth = QInputDialog::getDouble( |
|
202 m_window, |
|
203 tr("Set cull value"), |
|
204 format( |
|
205 tr("Cull depth for %1:\nPolygons closer than at this depth are not shown."), |
|
206 m_window->renderer()->currentCamera().name() |
|
207 ), |
|
208 m_window->renderer()->currentCullValue(), |
|
209 -GLRenderer::far, |
|
210 GLRenderer::far, |
|
211 4, |
|
212 &ok |
|
213 ); |
|
214 |
|
215 if (ok) |
|
216 m_window->renderer()->setCullValue(depth); |
|
217 } |
|
218 |
|
219 void ViewToolset::clearCullDepth() |
|
220 { |
|
221 m_window->renderer()->clearCurrentCullValue(); |
183 } |
222 } |
184 |
223 |
185 #if 0 |
224 #if 0 |
186 // This is a test to draw a dummy axle. Meant to be used as a primitive gallery, |
225 // This is a test to draw a dummy axle. Meant to be used as a primitive gallery, |
187 // but I can't figure how to generate these pictures properly. Multi-threading |
226 // but I can't figure how to generate these pictures properly. Multi-threading |