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 | #ifdef G4VIS_BUILD_OPENGL_DRIVER1 |
34 | |
35 | #include "G4OpenGLStoredSceneHandler.hh" |
36 | |
37 | #include "G4PhysicalVolumeModel.hh" |
38 | #include "G4LogicalVolumeModel.hh" |
39 | #include "G4VPhysicalVolume.hh" |
40 | #include "G4LogicalVolume.hh" |
41 | #include "G4Polyline.hh" |
42 | #include "G4Polymarker.hh" |
43 | #include "G4Text.hh" |
44 | #include "G4Circle.hh" |
45 | #include "G4Square.hh" |
46 | #include "G4Polyhedron.hh" |
47 | #include "G4AttHolder.hh" |
48 | #include "G4OpenGLTransform3D.hh" |
49 | #include "G4OpenGLViewer.hh" |
50 | #include "G4AttHolder.hh" |
51 | |
52 | #include <typeinfo> |
53 | |
54 | G4OpenGLStoredSceneHandler::PO::PO(): |
55 | fDisplayListId(0), |
56 | fPickName(0), |
57 | fpG4TextPlus(0), |
58 | fMarkerOrPolyline(false) |
59 | {} |
60 | |
61 | G4OpenGLStoredSceneHandler::PO::PO(const G4OpenGLStoredSceneHandler::PO& po): |
62 | fDisplayListId(po.fDisplayListId), |
63 | fTransform(po.fTransform), |
64 | fPickName(po.fPickName), |
65 | fColour(po.fColour), |
66 | fpG4TextPlus(po.fpG4TextPlus? new G4TextPlus(*po.fpG4TextPlus): 0), |
67 | fMarkerOrPolyline(po.fMarkerOrPolyline) |
68 | {} |
69 | |
70 | G4OpenGLStoredSceneHandler::PO::PO(G4int id, const G4Transform3D& tr): |
71 | fDisplayListId(id), |
72 | fTransform(tr), |
73 | fPickName(0), |
74 | fpG4TextPlus(0), |
75 | fMarkerOrPolyline(false) |
76 | {} |
77 | |
78 | G4OpenGLStoredSceneHandler::PO::~PO() |
79 | { |
80 | delete fpG4TextPlus; |
81 | } |
82 | |
83 | G4OpenGLStoredSceneHandler::PO& G4OpenGLStoredSceneHandler::PO::operator= |
84 | (const G4OpenGLStoredSceneHandler::PO& rhs) |
85 | { |
86 | if (&rhs == this) return *this; |
87 | fDisplayListId = rhs.fDisplayListId; |
88 | fTransform = rhs.fTransform; |
89 | fPickName = rhs.fPickName; |
90 | fColour = rhs.fColour; |
91 | fpG4TextPlus = rhs.fpG4TextPlus? new G4TextPlus(*rhs.fpG4TextPlus): 0; |
92 | fMarkerOrPolyline = rhs.fMarkerOrPolyline; |
93 | return *this; |
94 | } |
95 | |
96 | G4OpenGLStoredSceneHandler::TO::TO(): |
97 | fDisplayListId(0), |
98 | fPickName(0), |
99 | fStartTime(-DBL_MAXstd::numeric_limits<double>::max()), |
100 | fEndTime(DBL_MAXstd::numeric_limits<double>::max()), |
101 | fpG4TextPlus(0), |
102 | fMarkerOrPolyline(false) |
103 | {} |
104 | |
105 | G4OpenGLStoredSceneHandler::TO::TO(const G4OpenGLStoredSceneHandler::TO& to): |
106 | fDisplayListId(to.fDisplayListId), |
107 | fTransform(to.fTransform), |
108 | fPickName(to.fPickName), |
109 | fStartTime(to.fStartTime), |
110 | fEndTime(to.fEndTime), |
111 | fColour(to.fColour), |
112 | fpG4TextPlus(to.fpG4TextPlus? new G4TextPlus(*to.fpG4TextPlus): 0), |
113 | fMarkerOrPolyline(to.fMarkerOrPolyline) |
114 | {} |
115 | |
116 | G4OpenGLStoredSceneHandler::TO::TO(G4int id, const G4Transform3D& tr): |
117 | fDisplayListId(id), |
118 | fTransform(tr), |
119 | fPickName(0), |
120 | fStartTime(-DBL_MAXstd::numeric_limits<double>::max()), |
121 | fEndTime(DBL_MAXstd::numeric_limits<double>::max()), |
122 | fpG4TextPlus(0), |
123 | fMarkerOrPolyline(false) |
124 | {} |
125 | |
126 | G4OpenGLStoredSceneHandler::TO::~TO() |
127 | { |
128 | delete fpG4TextPlus; |
129 | } |
130 | |
131 | G4OpenGLStoredSceneHandler::TO& G4OpenGLStoredSceneHandler::TO::operator= |
132 | (const G4OpenGLStoredSceneHandler::TO& rhs) |
133 | { |
134 | if (&rhs == this) return *this; |
135 | fDisplayListId = rhs.fDisplayListId; |
136 | fTransform = rhs.fTransform; |
137 | fPickName = rhs.fPickName; |
138 | fStartTime = rhs.fStartTime; |
139 | fEndTime = rhs.fEndTime; |
140 | fColour = rhs.fColour; |
141 | fpG4TextPlus = rhs.fpG4TextPlus? new G4TextPlus(*rhs.fpG4TextPlus): 0; |
142 | fMarkerOrPolyline = rhs.fMarkerOrPolyline; |
143 | return *this; |
144 | } |
145 | |
146 | G4OpenGLStoredSceneHandler::G4OpenGLStoredSceneHandler |
147 | (G4VGraphicsSystem& system, |
148 | const G4String& name): |
149 | G4OpenGLSceneHandler (system, fSceneIdCount++, name), |
150 | fTopPODL (0) |
151 | {} |
152 | |
153 | G4OpenGLStoredSceneHandler::~G4OpenGLStoredSceneHandler () |
154 | {} |
155 | |
156 | void G4OpenGLStoredSceneHandler::BeginPrimitives |
157 | (const G4Transform3D& objectTransformation) |
158 | { |
159 | G4OpenGLSceneHandler::BeginPrimitives (objectTransformation); |
160 | if (fReadyForTransients) glDrawBuffer (GL_FRONT0x0404); |
161 | |
162 | } |
163 | |
164 | void G4OpenGLStoredSceneHandler::EndPrimitives () |
165 | { |
166 | |
167 | ScaledFlush(); |
168 | glDrawBuffer (GL_BACK0x0405); |
169 | G4OpenGLSceneHandler::EndPrimitives (); |
170 | } |
171 | |
172 | void G4OpenGLStoredSceneHandler::BeginPrimitives2D |
173 | (const G4Transform3D& objectTransformation) |
174 | { |
175 | G4OpenGLSceneHandler::BeginPrimitives2D(objectTransformation); |
176 | if (fReadyForTransients) glDrawBuffer (GL_FRONT0x0404); |
177 | } |
178 | |
179 | void G4OpenGLStoredSceneHandler::EndPrimitives2D () |
180 | { |
181 | |
182 | ScaledFlush(); |
183 | glDrawBuffer (GL_BACK0x0405); |
184 | G4OpenGLSceneHandler::EndPrimitives2D (); |
185 | } |
186 | |
187 | G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreamble(const G4VMarker& visible) |
188 | { |
189 | return AddPrimitivePreambleInternal(visible, true, false); |
190 | } |
191 | G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreamble(const G4Polyline& visible) |
192 | { |
193 | return AddPrimitivePreambleInternal(visible, false, true); |
194 | } |
195 | G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreamble(const G4Polyhedron& visible) |
196 | { |
197 | return AddPrimitivePreambleInternal(visible, false, false); |
198 | } |
199 | |
200 | G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(const G4Visible& visible, bool isMarker, bool isPolyline) |
201 | { |
202 | const G4Colour& c = GetColour (visible); |
203 | G4double opacity = c.GetAlpha (); |
204 | |
205 | G4bool transparency_enabled = true; |
206 | G4bool isMarkerNotHidden = true; |
207 | G4OpenGLViewer* pViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer); |
| 1 | 'pViewer' initialized here | |
|
208 | if (pViewer) { |
| 2 | | Assuming 'pViewer' is null | |
|
| |
209 | transparency_enabled = pViewer->transparency_enabled; |
210 | isMarkerNotHidden = pViewer->fVP.IsMarkerNotHidden(); |
211 | } |
212 | |
213 | G4bool isTransparent = opacity < 1.; |
214 | G4bool isMarkerOrPolyline = isMarker || isPolyline; |
215 | G4bool treatAsTransparent = transparency_enabled && isTransparent; |
216 | G4bool treatAsNotHidden = isMarkerNotHidden && isMarkerOrPolyline; |
217 | |
218 | if (fProcessing2D) glDisable (GL_DEPTH_TEST0x0B71); |
| |
219 | else { |
220 | if (isMarkerOrPolyline && isMarkerNotHidden) |
221 | glDisable (GL_DEPTH_TEST0x0B71); |
222 | else {glEnable (GL_DEPTH_TEST0x0B71); glDepthFunc (GL_LEQUAL0x0203);} |
223 | } |
224 | |
225 | if (fThreePassCapable) { |
| |
226 | |
227 | |
228 | |
229 | |
230 | if (!(fSecondPassForTransparency || fThirdPassForNonHiddenMarkers)) { |
231 | |
232 | if (treatAsTransparent) { |
233 | fSecondPassForTransparencyRequested = true; |
234 | } |
235 | if (treatAsNotHidden) { |
236 | fThirdPassForNonHiddenMarkersRequested = true; |
237 | } |
238 | |
239 | if (treatAsTransparent || treatAsNotHidden) { |
240 | return false; |
241 | } |
242 | } |
243 | |
244 | |
245 | if (fSecondPassForTransparency) { |
246 | if (!treatAsTransparent) { |
247 | return false; |
248 | } |
249 | } |
250 | |
251 | |
252 | if (fThirdPassForNonHiddenMarkers) { |
253 | if (!treatAsNotHidden) { |
254 | return false; |
255 | |
256 | } |
257 | } |
258 | } |
259 | |
260 | |
261 | G4bool isPicking = false; |
262 | if (fpViewer->GetViewParameters().IsPicking()) { |
| |
263 | isPicking = true; |
264 | glLoadName(++fPickName); |
265 | G4AttHolder* holder = new G4AttHolder; |
266 | LoadAtts(visible, holder); |
267 | fPickMap[fPickName] = holder; |
268 | } |
269 | |
270 | |
271 | const G4VSolid* pSolid = 0; |
272 | G4PhysicalVolumeModel* pPVModel = |
273 | dynamic_cast<G4PhysicalVolumeModel*>(fpModel); |
274 | if (fpViewer->GetViewParameters().GetVisAttributesModifiers().size()) |
| |
275 | |
276 | goto end_of_display_list_reuse_test; |
277 | if (pPVModel) { |
| 8 | | Assuming 'pPVModel' is non-null | |
|
| |
278 | |
279 | |
280 | G4LogicalVolumeModel* pLVModel = |
281 | dynamic_cast<G4LogicalVolumeModel*>(pPVModel); |
282 | if (pLVModel) |
| 10 | | Assuming 'pLVModel' is null | |
|
| |
283 | |
284 | goto end_of_display_list_reuse_test; |
285 | if (pViewer->fVP.IsSection() || pViewer->fVP.IsCutaway()) |
| 12 | | Called C++ object pointer is null |
|
286 | |
287 | goto end_of_display_list_reuse_test; |
288 | |
289 | |
290 | |
291 | |
292 | |
293 | G4VPhysicalVolume* pPV = pPVModel->GetCurrentPV(); |
294 | if (!pPV) |
295 | |
296 | goto end_of_display_list_reuse_test; |
297 | G4LogicalVolume* pLV = pPV->GetLogicalVolume(); |
298 | if (!pLV) |
299 | |
300 | goto end_of_display_list_reuse_test; |
301 | pSolid = pLV->GetSolid(); |
302 | EAxis axis = kRho; |
303 | G4VPhysicalVolume* pCurrentPV = pPVModel->GetCurrentPV(); |
304 | if (pCurrentPV -> IsReplicated ()) { |
305 | G4int nReplicas; |
306 | G4double width; |
307 | G4double offset; |
308 | G4bool consuming; |
309 | pCurrentPV->GetReplicationData(axis,nReplicas,width,offset,consuming); |
310 | } |
311 | |
312 | |
313 | if (!(pCurrentPV -> IsParameterised ()) && |
314 | |
315 | |
316 | !(pCurrentPV -> IsReplicated () && axis == kRho) && |
317 | |
318 | (fSolidMap.find (pSolid) != fSolidMap.end ())) { |
319 | fDisplayListId = fSolidMap [pSolid]; |
320 | PO po(fDisplayListId,fObjectTransformation); |
321 | if (isPicking) po.fPickName = fPickName; |
322 | po.fColour = c; |
323 | po.fMarkerOrPolyline = isMarkerOrPolyline; |
324 | fPOList.push_back(po); |
325 | |
326 | |
327 | |
328 | |
329 | (void) ExtraPOProcessing(G4Visible(), fPOList.size() - 1); |
330 | return false; |
331 | } |
332 | } |
333 | end_of_display_list_reuse_test: |
334 | |
335 | |
336 | |
337 | |
338 | |
339 | if (fMemoryForDisplayLists) { |
340 | fDisplayListId = glGenLists (1); |
341 | if (glGetError() == GL_OUT_OF_MEMORY0x0505 || |
342 | fDisplayListId > fDisplayListLimit) { |
343 | G4cout(*G4cout_p) << |
344 | "********************* WARNING! ********************" |
345 | "\n* Display list limit reached in OpenGL." |
346 | "\n* Continuing drawing WITHOUT STORING. Scene only partially refreshable." |
347 | "\n* Current limit: " << fDisplayListLimit << |
348 | ". Change with \"/vis/ogl/set/displayListLimit\"." |
349 | "\n***************************************************" |
350 | << G4endlstd::endl; |
351 | fMemoryForDisplayLists = false; |
352 | } |
353 | } |
354 | |
355 | if (pSolid) fSolidMap [pSolid] = fDisplayListId; |
356 | |
357 | if (fMemoryForDisplayLists) { |
358 | if (fReadyForTransients) { |
359 | TO to(fDisplayListId, fObjectTransformation); |
360 | if (isPicking) to.fPickName = fPickName; |
361 | to.fColour = c; |
362 | const G4VisAttributes* pVA = |
363 | fpViewer->GetApplicableVisAttributes(visible.GetVisAttributes()); |
364 | to.fStartTime = pVA->GetStartTime(); |
365 | to.fEndTime = pVA->GetEndTime(); |
366 | to.fMarkerOrPolyline = isMarkerOrPolyline; |
367 | fTOList.push_back(to); |
368 | |
369 | |
370 | |
371 | |
372 | |
373 | glPushMatrix(); |
374 | G4OpenGLTransform3D oglt (fObjectTransformation); |
375 | glMultMatrixd (oglt.GetGLMatrix ()); |
376 | if (transparency_enabled) { |
377 | glColor4d(c.GetRed(),c.GetGreen(),c.GetBlue(),c.GetAlpha()); |
378 | } else { |
379 | glColor3d(c.GetRed(),c.GetGreen(),c.GetBlue()); |
380 | } |
381 | (void) ExtraTOProcessing(visible, fTOList.size() - 1); |
382 | |
383 | |
384 | |
385 | glNewList (fDisplayListId, GL_COMPILE_AND_EXECUTE0x1301); |
386 | } else { |
387 | PO po(fDisplayListId, fObjectTransformation); |
388 | if (isPicking) po.fPickName = fPickName; |
389 | po.fColour = c; |
390 | po.fMarkerOrPolyline = isMarkerOrPolyline; |
391 | fPOList.push_back(po); |
392 | |
393 | |
394 | |
395 | |
396 | |
397 | if (transparency_enabled) { |
398 | glColor4d(c.GetRed(),c.GetGreen(),c.GetBlue(),c.GetAlpha()); |
399 | } else { |
400 | glColor3d(c.GetRed(),c.GetGreen(),c.GetBlue()); |
401 | } |
402 | G4bool usesGLCommands = ExtraPOProcessing(visible, fPOList.size() - 1); |
403 | |
404 | |
405 | |
406 | |
407 | |
408 | |
409 | |
410 | |
411 | |
412 | if (!usesGLCommands) return false; |
413 | glNewList (fDisplayListId, GL_COMPILE0x1300); |
414 | } |
415 | } else { |
416 | glDrawBuffer (GL_FRONT0x0404); |
417 | glPushMatrix(); |
418 | G4OpenGLTransform3D oglt (fObjectTransformation); |
419 | glMultMatrixd (oglt.GetGLMatrix ()); |
420 | if (transparency_enabled) { |
421 | glColor4d(c.GetRed(),c.GetGreen(),c.GetBlue(),c.GetAlpha()); |
422 | } else { |
423 | glColor3d(c.GetRed(),c.GetGreen(),c.GetBlue()); |
424 | } |
425 | } |
426 | |
427 | if (fProcessing2D) { |
428 | |
429 | |
430 | glMatrixMode (GL_PROJECTION0x1701); |
431 | glPushMatrix(); |
432 | glLoadIdentity(); |
433 | if (pViewer) { |
434 | pViewer->g4GlOrtho (-1., 1., -1., 1., -G4OPENGL_FLT_BIG1.e20, G4OPENGL_FLT_BIG1.e20); |
435 | } |
436 | glMatrixMode (GL_MODELVIEW0x1700); |
437 | glPushMatrix(); |
438 | glLoadIdentity(); |
439 | G4OpenGLTransform3D oglt (fObjectTransformation); |
440 | glMultMatrixd (oglt.GetGLMatrix ()); |
441 | glDisable (GL_LIGHTING0x0B50); |
442 | } else { |
443 | glEnable (GL_LIGHTING0x0B50); |
444 | } |
445 | |
446 | return true; |
447 | } |
448 | |
449 | void G4OpenGLStoredSceneHandler::AddPrimitivePostamble() |
450 | { |
451 | if (fProcessing2D) { |
452 | |
453 | glMatrixMode (GL_PROJECTION0x1701); |
454 | glPopMatrix(); |
455 | glMatrixMode (GL_MODELVIEW0x1700); |
456 | glPopMatrix(); |
457 | } |
458 | |
459 | |
460 | if (glGetError() == GL_OUT_OF_MEMORY0x0505) { |
461 | G4cerr(*G4cerr_p) << |
462 | "ERROR: G4OpenGLStoredSceneHandler::AddPrimitivePostamble: Failure" |
463 | " to allocate display List for fTopPODL - try OpenGL Immediated mode." |
464 | << G4endlstd::endl; |
465 | } |
466 | if (fMemoryForDisplayLists) { |
467 | glEndList(); |
468 | if (glGetError() == GL_OUT_OF_MEMORY0x0505) { |
469 | G4cerr(*G4cerr_p) << |
470 | "ERROR: G4OpenGLStoredSceneHandler::AddPrimitivePostamble: Failure" |
471 | " to allocate display List for fTopPODL - try OpenGL Immediated mode." |
472 | << G4endlstd::endl; |
473 | } |
474 | } |
475 | if (fReadyForTransients || !fMemoryForDisplayLists) { |
476 | glPopMatrix(); |
477 | } |
478 | } |
479 | |
480 | void G4OpenGLStoredSceneHandler::AddPrimitive (const G4Polyline& polyline) |
481 | { |
482 | G4bool furtherprocessing = AddPrimitivePreamble(polyline); |
483 | if (furtherprocessing) { |
484 | G4OpenGLSceneHandler::AddPrimitive(polyline); |
485 | AddPrimitivePostamble(); |
486 | } |
487 | } |
488 | |
489 | void G4OpenGLStoredSceneHandler::AddPrimitive (const G4Polymarker& polymarker) |
490 | { |
491 | G4bool furtherprocessing = AddPrimitivePreamble(polymarker); |
492 | if (furtherprocessing) { |
493 | G4OpenGLSceneHandler::AddPrimitive(polymarker); |
494 | AddPrimitivePostamble(); |
495 | } |
496 | } |
497 | |
498 | void G4OpenGLStoredSceneHandler::AddPrimitive (const G4Text& text) |
499 | { |
500 | |
501 | |
502 | |
503 | G4bool furtherprocessing = AddPrimitivePreamble(text); |
504 | if (furtherprocessing) { |
505 | G4OpenGLSceneHandler::AddPrimitive(text); |
506 | AddPrimitivePostamble(); |
507 | } |
508 | } |
509 | |
510 | void G4OpenGLStoredSceneHandler::AddPrimitive (const G4Circle& circle) |
511 | { |
512 | G4bool furtherprocessing = AddPrimitivePreamble(circle); |
513 | if (furtherprocessing) { |
514 | G4OpenGLSceneHandler::AddPrimitive(circle); |
515 | AddPrimitivePostamble(); |
516 | } |
517 | } |
518 | |
519 | void G4OpenGLStoredSceneHandler::AddPrimitive (const G4Square& square) |
520 | { |
521 | G4bool furtherprocessing = AddPrimitivePreamble(square); |
522 | if (furtherprocessing) { |
523 | G4OpenGLSceneHandler::AddPrimitive(square); |
524 | AddPrimitivePostamble(); |
525 | } |
526 | } |
527 | |
528 | void G4OpenGLStoredSceneHandler::AddPrimitive (const G4Scale& scale) |
529 | { |
530 | |
531 | G4OpenGLSceneHandler::AddPrimitive(scale); |
532 | } |
533 | |
534 | void G4OpenGLStoredSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron) |
535 | { |
536 | |
537 | |
538 | |
539 | G4bool furtherprocessing = AddPrimitivePreamble(polyhedron); |
540 | if (furtherprocessing) { |
541 | G4OpenGLSceneHandler::AddPrimitive(polyhedron); |
542 | AddPrimitivePostamble(); |
543 | } |
544 | } |
545 | |
546 | void G4OpenGLStoredSceneHandler::BeginModeling () { |
547 | G4VSceneHandler::BeginModeling(); |
548 | |
549 | |
550 | |
551 | |
552 | } |
553 | |
554 | void G4OpenGLStoredSceneHandler::EndModeling () { |
555 | |
556 | fTopPODL = glGenLists (1); |
557 | if (glGetError() == GL_OUT_OF_MEMORY0x0505) { |
558 | G4cerr(*G4cerr_p) << |
559 | "ERROR: G4OpenGLStoredSceneHandler::EndModeling: Failure to allocate" |
560 | " display List for fTopPODL - try OpenGL Immediated mode." |
561 | << G4endlstd::endl; |
562 | } else { |
563 | |
564 | glNewList (fTopPODL, GL_COMPILE0x1300); { |
565 | for (size_t i = 0; i < fPOList.size (); i++) { |
566 | glPushMatrix(); |
567 | G4OpenGLTransform3D oglt (fPOList[i].fTransform); |
568 | glMultMatrixd (oglt.GetGLMatrix ()); |
569 | if (fpViewer->GetViewParameters().IsPicking()) |
570 | glLoadName(fPOList[i].fPickName); |
571 | glCallList (fPOList[i].fDisplayListId); |
572 | glPopMatrix(); |
573 | } |
574 | } |
575 | glEndList (); |
576 | |
577 | if (glGetError() == GL_OUT_OF_MEMORY0x0505) { |
578 | G4cerr(*G4cerr_p) << |
579 | "ERROR: G4OpenGLStoredSceneHandler::EndModeling: Failure to allocate" |
580 | " display List for fTopPODL - try OpenGL Immediated mode." |
581 | << G4endlstd::endl; |
582 | } |
583 | } |
584 | |
585 | G4VSceneHandler::EndModeling (); |
586 | } |
587 | |
588 | void G4OpenGLStoredSceneHandler::ClearStore () { |
589 | |
590 | |
591 | |
592 | G4VSceneHandler::ClearStore (); |
593 | |
594 | |
595 | for (size_t i = 0; i < fPOList.size (); i++) |
596 | glDeleteLists (fPOList[i].fDisplayListId, 1); |
597 | if (fTopPODL) glDeleteLists (fTopPODL, 1); |
598 | fTopPODL = 0; |
599 | |
600 | |
601 | fPOList.clear (); |
602 | fSolidMap.clear (); |
603 | ClearAndDestroyAtts(); |
604 | |
605 | |
606 | for (size_t i = 0; i < fTOList.size (); i++) |
607 | glDeleteLists(fTOList[i].fDisplayListId, 1); |
608 | fTOList.clear (); |
609 | |
610 | fMemoryForDisplayLists = true; |
611 | } |
612 | |
613 | void G4OpenGLStoredSceneHandler::ClearTransientStore () |
614 | { |
615 | |
616 | |
617 | |
618 | for (size_t i = 0; i < fTOList.size (); i++) |
619 | glDeleteLists(fTOList[i].fDisplayListId, 1); |
620 | fTOList.clear (); |
621 | |
622 | fMemoryForDisplayLists = true; |
623 | |
624 | |
625 | if (fpViewer) { |
626 | fpViewer -> SetView (); |
627 | fpViewer -> ClearView (); |
628 | fpViewer -> DrawView (); |
629 | } |
630 | } |
631 | |
632 | G4int G4OpenGLStoredSceneHandler::fSceneIdCount = 0; |
633 | |
634 | G4int G4OpenGLStoredSceneHandler::fDisplayListId = 0; |
635 | G4bool G4OpenGLStoredSceneHandler::fMemoryForDisplayLists = true; |
636 | G4int G4OpenGLStoredSceneHandler::fDisplayListLimit = 50000; |
637 | |
638 | #endif |