94 fMarkForClearingTransientStore (true),
98 fReadyForTransients (true),
99 fProcessingSolid (false),
100 fProcessing2D (false),
106 fpScene = pVMan -> GetCurrentScene ();
108 std::ostringstream ost;
149 if (fNestingDepth > 1)
151 (
"G4VSceneHandler::BeginPrimitives",
153 "Nesting detected. It is illegal to nest Begin/EndPrimitives.");
154 fObjectTransformation = objectTransformation;
171 if (fNestingDepth > 1)
173 (
"G4VSceneHandler::BeginPrimitives2D",
175 "Nesting detected. It is illegal to nest Begin/EndPrimitives.");
176 fObjectTransformation = objectTransformation;
177 fProcessing2D =
true;
263 (
"G4VSceneHandler::AddCompound(const G4VTrajectory&)",
286 G4bool scoreMapHits =
false;
288 if (scoringManager) {
290 for (
size_t iMesh = 0; iMesh < nMeshes; ++iMesh) {
294 for(MeshScoreMap::const_iterator i = scoreMap.begin();
295 i != scoreMap.end(); ++i) {
298 if (foundHits == &hits) {
301 mesh->
DrawMesh(scoreMapName, &colorMap);
308 static G4bool first =
true;
312 "Scoring map drawn with default parameters."
313 "\n To get gMocren file for gMocren browser:"
314 "\n /vis/open gMocrenFile"
315 "\n /vis/viewer/flush"
316 "\n Many other options available with /score/draw... commands."
317 "\n You might want to \"/vis/viewer/set/autoRefresh false\"."
335 const G4double oneMinusMargin (1. - margin);
341 const G4double halfLength(length / 2.);
342 const G4double tickLength(length / 20.);
354 G4Polyline scaleLine, tick11, tick12, tick21, tick22;
366 scaleLine.push_back(r1);
367 scaleLine.push_back(r2);
370 tick11.push_back(r1 + ticky);
371 tick11.push_back(r1 - ticky);
372 tick12.push_back(r1 + tickz);
373 tick12.push_back(r1 - tickz);
374 tick21.push_back(r2 + ticky);
375 tick21.push_back(r2 - ticky);
376 tick22.push_back(r2 + tickz);
377 tick22.push_back(r2 - tickz);
378 G4Point3D textPosition(0., tickLength, 0.);
398 sxmid = xmin + oneMinusMargin * (xmax - xmin);
399 symid = ymin + margin * (ymax - ymin);
400 szmid = zmin + oneMinusMargin * (zmax - zmin);
413 transformation = translation * rotation;
437 for (
size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
448 for (
size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
457 for (
size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
476 (*i) -> SetNeedKernelVisit (
true);
484 switch (
fpViewer -> GetViewParameters () . GetRepStyle ()) {
488 static G4bool warned =
false;
492 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
493 "!!!!! NURBS are deprecated and will be removed in the next major release."
494 "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
506 "ERROR: G4VSceneHandler::RequestPrimitives"
507 "\n NURBS not available for "
526 "ERROR: G4VSceneHandler::RequestPrimitives"
527 "\n Polyhedron not available for " << solid.
GetName () <<
528 ".\n This means it cannot be visualized on most systems."
529 "\n Contact the Visualization Coordinator." <<
G4endl;
560 const std::vector<G4Scene::Model>& runDurationModelList =
561 fpScene -> GetRunDurationModelList ();
563 if (runDurationModelList.size ()) {
573 for (
size_t i = 0; i < runDurationModelList.size (); i++) {
574 if (runDurationModelList[i].fActive) {
575 G4VModel* pModel = runDurationModelList[i].fpModel;
580 pModel -> SetModelingParameters (pMP);
582 pModel -> DescribeYourselfTo (*
this);
583 pModel -> SetModelingParameters (0);
609 const std::vector<const G4Event*>* events =
611 size_t nKeptEvents = 0;
612 if (events) nKeptEvents = events->size();
621 if (events && events->size()) event = events->back();
629 for (
size_t i = 0; i < nKeptEvents; ++i) {
630 const G4Event*
event = (*events)[i];
637 "WARNING: Cannot refresh events accumulated over more"
638 "\n than one runs. Refreshed just the last run."
660 const std::vector<G4Scene::Model>& EOEModelList =
661 fpScene -> GetEndOfEventModelList ();
662 size_t nModels = EOEModelList.size();
666 for (
size_t i = 0; i < nModels; i++) {
667 if (EOEModelList[i].fActive) {
668 G4VModel* pModel = EOEModelList[i].fpModel;
669 pModel -> SetModelingParameters(pMP);
671 pModel -> DescribeYourselfTo (*
this);
672 pModel -> SetModelingParameters(0);
682 const std::vector<G4Scene::Model>& EORModelList =
683 fpScene -> GetEndOfRunModelList ();
684 size_t nModels = EORModelList.size();
688 for (
size_t i = 0; i < nModels; i++) {
689 if (EORModelList[i].fActive) {
690 G4VModel* pModel = EORModelList[i].fpModel;
691 pModel -> SetModelingParameters(pMP);
693 pModel -> DescribeYourselfTo (*
this);
694 pModel -> SetModelingParameters(0);
727 G4bool reallyCullCovered =
756 return pModelingParams;
767 new G4Box(
"_sectioner", safe, safe, 1.
e-5 * radius);
778 transform =
G4Rotate3D(angle, axis) * transform;
781 (
"_displaced_sectioning_box", sectionBox, transform);
796 const std::map<G4String,G4AttDef>* vaDefs =
807 const std::map<G4String,G4AttDef>* pvDefs = pPVModel->
GetAttDefs();
816 const std::map<G4String,G4AttDef>* trajModelDefs = trajModel->
GetAttDefs();
822 const std::map<G4String,G4AttDef>* trajDefs = traj->
GetAttDefs();
827 for (
G4int i = 0; i < nPoints; ++i) {
829 const std::map<G4String,G4AttDef>* pointDefs = trajPoint->
GetAttDefs();
840 const std::map<G4String,G4AttDef>* hitsDefs = hit->
GetAttDefs();
857 pVA =
fpViewer -> GetViewParameters (). GetDefaultTextVisAttributes ();
866 if (lineWidth < 1.) lineWidth = 1.;
867 lineWidth *=
fpViewer -> GetViewParameters().GetGlobalLineWidthScale();
868 if (lineWidth < 1.) lineWidth = 1.;
878 fpViewer->GetViewParameters().GetDrawingStyle();
879 if (pVisAttribs -> IsForceDrawingStyle ()) {
881 pVisAttribs -> GetForcedDrawingStyle ();
884 switch (forcedStyle) {
914 if (pVisAttribs -> IsForceAuxEdgeVisible()) isAuxEdgeVisible =
true;
915 return isAuxEdgeVisible;
924 fpViewer -> GetViewParameters().GetDefaultMarker();
929 markerSizeType = world;
932 size = userSpecified ?
935 markerSizeType = screen;
937 size *= fpViewer -> GetViewParameters().GetGlobalMarkerScale();
938 if (markerSizeType == screen && size < 1.) size = 1.;
951 const G4int nSegmentsMin = 12;
952 if (lineSegmentsPerCircle < nSegmentsMin) {
953 lineSegmentsPerCircle = nSegmentsMin;
955 "G4VSceneHandler::GetNoOfSides: attempt to set the"
956 "\nnumber of line segements per circle < " << nSegmentsMin
957 <<
"; forced to " << lineSegmentsPerCircle <<
G4endl;
960 return lineSegmentsPerCircle;
965 os <<
"Scene handler " << sh.
fName <<
" has "
967 for (
size_t i = 0; i < sh.
fViewerList.size (); i++) {
975 os <<
"\n This scene handler currently has no scene.";