Geant4-11
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends
G4OpenInventorSceneHandler Class Reference

#include <G4OpenInventorSceneHandler.hh>

Inheritance diagram for G4OpenInventorSceneHandler:
G4VSceneHandler G4VGraphicsScene

Public Types

enum  MarkerSizeType { world , screen }
 

Public Member Functions

virtual void AddCompound (const G4Mesh &)
 
virtual void AddCompound (const G4THitsMap< G4double > &)
 
virtual void AddCompound (const G4THitsMap< G4StatDouble > &)
 
virtual void AddCompound (const G4VDigi &)
 
virtual void AddCompound (const G4VHit &)
 
virtual void AddCompound (const G4VTrajectory &)
 
void AddPrimitive (const G4Circle &)
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Plotter &)
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
void AddPrimitive (const G4Polyhedron &p)
 
virtual void AddPrimitive (const G4Polyline &)=0
 
void AddPrimitive (const G4Polyline &line)
 
virtual void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Square &)
 
virtual void AddPrimitive (const G4Square &)=0
 
void AddPrimitive (const G4Text &)
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddSolid (const G4Box &)
 
virtual void AddSolid (const G4Cons &)
 
virtual void AddSolid (const G4Ellipsoid &)
 
virtual void AddSolid (const G4Orb &)
 
virtual void AddSolid (const G4Para &)
 
virtual void AddSolid (const G4Polycone &)
 
virtual void AddSolid (const G4Polyhedra &)
 
virtual void AddSolid (const G4Sphere &)
 
virtual void AddSolid (const G4TessellatedSolid &)
 
virtual void AddSolid (const G4Torus &)
 
virtual void AddSolid (const G4Trap &)
 
virtual void AddSolid (const G4Trd &)
 
virtual void AddSolid (const G4Tubs &)
 
virtual void AddSolid (const G4VSolid &)
 
template<class T >
void AddSolidT (const T &solid)
 
template<class T >
void AddSolidWithAuxiliaryEdges (const T &solid)
 
void AddViewerToList (G4VViewer *pView)
 
virtual void BeginModeling ()
 
void BeginPrimitives (const G4Transform3D &objectTransformation)
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation=G4Transform3D())
 
void ClearStore ()
 
void ClearTransientStore ()
 
G4ModelingParametersCreateModelingParameters ()
 
void DrawEndOfRunModels ()
 
void DrawEvent (const G4Event *)
 
virtual void EndModeling ()
 
virtual void EndPrimitives ()
 
virtual void EndPrimitives2D ()
 
 G4OpenInventorSceneHandler (G4OpenInventor &system, const G4String &name="")
 
G4bool GetAuxEdgeVisible (const G4VisAttributes *)
 
const G4ColourGetColor ()
 
const G4ColourGetColor (const G4Visible &)
 
const G4ColourGetColour ()
 
const G4ColourGetColour (const G4Visible &)
 
G4VViewerGetCurrentViewer () const
 
G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes *)
 
virtual const G4VisExtentGetExtent () const
 
G4VGraphicsSystemGetGraphicsSystem () const
 
G4double GetLineWidth (const G4VisAttributes *)
 
G4double GetMarkerDiameter (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerRadius (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerSize (const G4VMarker &, MarkerSizeType &)
 
G4bool GetMarkForClearingTransientStore () const
 
G4VModelGetModel () const
 
const G4StringGetName () const
 
G4int GetNoOfSides (const G4VisAttributes *)
 
G4int GetNumberOfCloudPoints (const G4VisAttributes *) const
 
const G4Transform3DGetObjectTransformation () const
 
G4SceneGetScene () const
 
G4int GetSceneHandlerId () const
 
const G4ColourGetTextColor (const G4Text &)
 
const G4ColourGetTextColour (const G4Text &)
 
G4bool GetTransientsDrawnThisEvent () const
 
G4bool GetTransientsDrawnThisRun () const
 
G4int GetViewCount () const
 
const G4ViewerListGetViewerList () const
 
G4int IncrementViewCount ()
 
G4bool IsReadyForTransients () const
 
virtual void PostAddSolid ()
 
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &visAttribs)
 
void RemoveViewerFromList (G4VViewer *pView)
 
void SetCurrentViewer (G4VViewer *)
 
void SetMarkForClearingTransientStore (G4bool)
 
void SetModel (G4VModel *)
 
void SetName (const G4String &)
 
void SetObjectTransformation (const G4Transform3D &)
 
virtual void SetScene (G4Scene *)
 
void SetTransientsDrawnThisEvent (G4bool)
 
void SetTransientsDrawnThisRun (G4bool)
 
G4ViewerListSetViewerList ()
 
virtual ~G4OpenInventorSceneHandler ()
 

Protected Member Functions

virtual G4DisplacedSolidCreateCutawaySolid ()
 
virtual G4DisplacedSolidCreateSectionSolid ()
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 
virtual void ProcessScene ()
 
virtual void RequestPrimitives (const G4VSolid &solid)
 

Protected Attributes

const G4Transform3D fIdentityTransformation
 
G4bool fMarkForClearingTransientStore
 
G4String fName
 
G4int fNestingDepth
 
G4Transform3D fObjectTransformation
 
G4VModelfpModel
 
G4bool fProcessing2D
 
G4bool fProcessingSolid
 
G4ScenefpScene
 
G4VViewerfpViewer
 
const G4VisAttributesfpVisAttribs
 
G4bool fReadyForTransients
 
const G4int fSceneHandlerId
 
G4VGraphicsSystemfSystem
 
G4bool fTransientsDrawnThisEvent
 
G4bool fTransientsDrawnThisRun
 
G4int fViewCount
 
G4ViewerList fViewerList
 

Private Types

enum  G4OIMarker { G4OICircle , G4OISquare }
 

Private Member Functions

void AddCircleSquare (G4OIMarker markerType, const G4VMarker &)
 
void AddProperties (const G4VisAttributes *)
 
void AddTransform (const G4Point3D &translation=G4Point3D())
 
void GeneratePrerequisites ()
 

Private Attributes

SoSeparator * fCurrentSeparator
 
SoSeparator * fDetectorRoot
 
G4bool fModelingSolid
 
bool fPreviewAndFull
 
G4bool fReducedWireFrame
 
SoSeparator * fRoot
 
std::map< G4LogicalVolume *, SoSeparator *, std::less< G4LogicalVolume * > > fSeparatorMap
 
Geant4_SoStyleCache * fStyleCache
 
SoSeparator * fTransientRoot
 

Static Private Attributes

static G4int fSceneIdCount = 0
 

Friends

class G4OpenInventorViewer
 

Detailed Description

Definition at line 49 of file G4OpenInventorSceneHandler.hh.

Member Enumeration Documentation

◆ G4OIMarker

◆ MarkerSizeType

Enumerator
world 
screen 

Definition at line 58 of file G4VSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4OpenInventorSceneHandler()

G4OpenInventorSceneHandler::G4OpenInventorSceneHandler ( G4OpenInventor system,
const G4String name = "" 
)

Definition at line 100 of file G4OpenInventorSceneHandler.cc.

103,fRoot(0)
107,fModelingSolid(false)
109,fStyleCache(0)
110,fPreviewAndFull(true)
111{
113 fStyleCache->ref();
114
115 fRoot = new SoSeparator;
116 fRoot->ref();
117 fRoot->setName("Root");
118
119 fDetectorRoot = new SoSeparator;
120 fDetectorRoot->setName("StaticRoot");
121 fRoot->addChild(fDetectorRoot);
122
123 fTransientRoot = new SoSeparator;
124 fTransientRoot->setName("TransientRoot");
125 fRoot->addChild(fTransientRoot);
126
128}
#define SoStyleCache
Definition: SoStyleCache.h:41
G4VSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")
const char * name(G4int ptype)

References fCurrentSeparator, fDetectorRoot, fRoot, fStyleCache, fTransientRoot, and SoStyleCache.

◆ ~G4OpenInventorSceneHandler()

G4OpenInventorSceneHandler::~G4OpenInventorSceneHandler ( )
virtual

Definition at line 130 of file G4OpenInventorSceneHandler.cc.

131{
132 fRoot->unref();
133 fStyleCache->unref();
134}

References fRoot, and fStyleCache.

Member Function Documentation

◆ AddCircleSquare()

void G4OpenInventorSceneHandler::AddCircleSquare ( G4OIMarker  markerType,
const G4VMarker marker 
)
private

Definition at line 437 of file G4OpenInventorSceneHandler.cc.

439{
440 if (fProcessing2D) {
441 static G4bool warned = false;
442 if (!warned) {
443 warned = true;
445 ("G4OpenInventorSceneHandler::AddCircleSquare",
446 "OpenInventor-0004", JustWarning,
447 "2D circles and squares not implemented. Ignored.");
448 }
449 return;
450 }
451
452 // Get vis attributes - pick up defaults if none.
453 const G4VisAttributes* pVA =
454 fpViewer -> GetApplicableVisAttributes (marker.GetVisAttributes ());
455
456 AddProperties(pVA); // Colour, etc.
457 AddTransform(); // Transformation
458
459 MarkerSizeType sizeType;
460 G4double screenSize = GetMarkerSize (marker, sizeType);
461 switch (sizeType) {
462 default:
463 case screen:
464 // Draw in screen coordinates. OK.
465 break;
466 case world:
467 // Draw in world coordinates. Not implemented. Use size = 10.
468 screenSize = 10.;
469 break;
470 }
471
472 G4Point3D centre = marker.GetPosition();
473
474 // Borrowed from AddPrimitive(G4Polymarker) - inefficient? JA
475 SbVec3f* points = new SbVec3f[1];
476 points[0].setValue((float)centre.x(),
477 (float)centre.y(),
478 (float)centre.z());
479 SoCoordinate3* coordinate3 = new SoCoordinate3;
480 coordinate3->point.setValues(0,1,points);
481 fCurrentSeparator->addChild(coordinate3);
482
483 SoG4MarkerSet* markerSet = new SoG4MarkerSet;
484 markerSet->numPoints = 1;
485
486 // Loads G4Atts for picking...
487 if (fpViewer->GetViewParameters().IsPicking()) LoadAtts(marker, markerSet);
488
489 G4VMarker::FillStyle style = marker.GetFillStyle();
490 switch (markerType) {
491 case G4OICircle:
492 if (screenSize <= 5.) {
493 if (style == G4VMarker::filled) {
495 } else {
497 }
498 } else if (screenSize <= 7.) {
499 if (style == G4VMarker::filled) {
501 } else {
503 }
504 } else {
505 if (style == G4VMarker::filled) {
507 } else {
509 }
510 }
511 break;
512 case G4OISquare:
513 if (screenSize <= 5.) {
514 if (style == G4VMarker::filled) {
516 } else {
518 }
519 } else if (screenSize <= 7.) {
520 if (style == G4VMarker::filled) {
522 } else {
524 }
525 } else {
526 if (style == G4VMarker::filled) {
528 } else {
530 }
531 }
532 break;
533 }
534 fCurrentSeparator->addChild(markerSet);
535
536 delete [] points;
537}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
void AddTransform(const G4Point3D &translation=G4Point3D())
void AddProperties(const G4VisAttributes *)
FillStyle GetFillStyle() const
G4Point3D GetPosition() const
void LoadAtts(const G4Visible &, G4AttHolder *)
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
G4VViewer * fpViewer
const G4ViewParameters & GetViewParameters() const
G4bool IsPicking() const
const G4VisAttributes * GetVisAttributes() const
SoMFInt32 markerIndex
Definition: SoMarkerSet.h:38

References AddProperties(), AddTransform(), HEPVis_SoMarkerSet::CIRCLE_FILLED_5_5, HEPVis_SoMarkerSet::CIRCLE_FILLED_7_7, HEPVis_SoMarkerSet::CIRCLE_FILLED_9_9, HEPVis_SoMarkerSet::CIRCLE_LINE_5_5, HEPVis_SoMarkerSet::CIRCLE_LINE_7_7, HEPVis_SoMarkerSet::CIRCLE_LINE_9_9, fCurrentSeparator, G4VMarker::filled, G4VSceneHandler::fProcessing2D, G4VSceneHandler::fpViewer, G4Exception(), G4OICircle, G4OISquare, G4VMarker::GetFillStyle(), G4VSceneHandler::GetMarkerSize(), G4VMarker::GetPosition(), G4VViewer::GetViewParameters(), G4Visible::GetVisAttributes(), G4ViewParameters::IsPicking(), JustWarning, G4VSceneHandler::LoadAtts(), HEPVis_SoMarkerSet::markerIndex, G4VSceneHandler::screen, HEPVis_SoMarkerSet::SQUARE_FILLED_5_5, HEPVis_SoMarkerSet::SQUARE_FILLED_7_7, HEPVis_SoMarkerSet::SQUARE_FILLED_9_9, HEPVis_SoMarkerSet::SQUARE_LINE_5_5, HEPVis_SoMarkerSet::SQUARE_LINE_7_7, HEPVis_SoMarkerSet::SQUARE_LINE_9_9, G4VSceneHandler::world, HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

Referenced by AddPrimitive().

◆ AddCompound() [1/6]

void G4VSceneHandler::AddCompound ( const G4Mesh mesh)
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4GMocrenFileSceneHandler, G4HepRepFileSceneHandler, G4OpenGLSceneHandler, G4Qt3DSceneHandler, G4VRML2FileSceneHandler, and G4VtkSceneHandler.

Definition at line 426 of file G4VSceneHandler.cc.

427{
429 ed << "There has been an attempt to draw a mesh (a nested parameterisation),"
430 "\nbut it is not implemented by the current graphics driver. Here we simply"
431 "\ndraw the container, \"" << mesh.GetContainerVolume()->GetName() << "\".";
432 G4Exception("G4VSceneHandler::AddCompound(const G4Mesh&)",
433 "visman0107", JustWarning, ed);
434
435 const auto& pv = mesh.GetContainerVolume();
436 const auto& lv = pv->GetLogicalVolume();
437 const auto& solid = lv->GetSolid();
438 const auto& transform = mesh.GetTransform();
439 // Make sure container is visible
440 const auto& saveVisAtts = lv->GetVisAttributes();
441 auto tmpVisAtts = *saveVisAtts;
442 tmpVisAtts.SetVisibility(true);
443 auto colour = saveVisAtts->GetColour();
444 colour.SetAlpha(1.);
445 tmpVisAtts.SetColour(colour);
446 // Draw container
447 PreAddSolid(transform,tmpVisAtts);
448 solid->DescribeYourselfTo(*this);
449 PostAddSolid();
450 // Restore vis attributes
451 lv->SetVisAttributes(saveVisAtts);
452}
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4VSolid * GetSolid() const
G4VPhysicalVolume * GetContainerVolume() const
Definition: G4Mesh.hh:61
const G4Transform3D & GetTransform() const
Definition: G4Mesh.hh:64
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
virtual void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
virtual void PostAddSolid()
G4bool transform(G4String &input, const G4String &type)

References G4Exception(), G4Mesh::GetContainerVolume(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4LogicalVolume::GetSolid(), G4Mesh::GetTransform(), JustWarning, G4VSceneHandler::PostAddSolid(), G4VSceneHandler::PreAddSolid(), and G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform().

◆ AddCompound() [2/6]

void G4VSceneHandler::AddCompound ( const G4THitsMap< G4double > &  hits)
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4GMocrenFileSceneHandler, G4HepRepFileSceneHandler, G4OpenGLSceneHandler, G4VRML2FileSceneHandler, and G4GMocrenFileSceneHandler.

Definition at line 340 of file G4VSceneHandler.cc.

340 {
341 using MeshScoreMap = G4VScoringMesh::MeshScoreMap;
342 //G4cout << "AddCompound: hits: " << &hits << G4endl;
343 G4bool scoreMapHits = false;
345 if (scoringManager) {
346 size_t nMeshes = scoringManager->GetNumberOfMesh();
347 for (size_t iMesh = 0; iMesh < nMeshes; ++iMesh) {
348 G4VScoringMesh* mesh = scoringManager->GetMesh(iMesh);
349 if (mesh && mesh->IsActive()) {
350 MeshScoreMap scoreMap = mesh->GetScoreMap();
351 const G4String& mapNam = const_cast<G4THitsMap<G4double>&>(hits).GetName();
352 for(MeshScoreMap::const_iterator i = scoreMap.begin();
353 i != scoreMap.end(); ++i) {
354 const G4String& scoreMapName = i->first;
355 if (scoreMapName == mapNam) {
356 G4DefaultLinearColorMap colorMap("G4VSceneHandlerColorMap");
357 scoreMapHits = true;
358 mesh->DrawMesh(scoreMapName, &colorMap);
359 }
360 }
361 }
362 }
363 }
364 if (scoreMapHits) {
365 static G4bool first = true;
366 if (first) {
367 first = false;
368 G4cout <<
369 "Scoring map drawn with default parameters."
370 "\n To get gMocren file for gMocren browser:"
371 "\n /vis/open gMocrenFile"
372 "\n /vis/viewer/flush"
373 "\n Many other options available with /score/draw... commands."
374 "\n You might want to \"/vis/viewer/set/autoRefresh false\"."
375 << G4endl;
376 }
377 } else { // Not score map hits. Just call DrawAllHits.
378 // Cast away const because DrawAllHits is non-const!!!!
379 const_cast<G4THitsMap<G4double>&>(hits).DrawAllHits();
380 }
381}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4VScoringMesh * GetMesh(G4int i) const
size_t GetNumberOfMesh() const
static G4ScoringManager * GetScoringManagerIfExist()
const G4String & GetName() const
G4bool IsActive() const
std::map< G4String, RunScore * > MeshScoreMap
void DrawMesh(const G4String &psName, G4VScoreColorMap *colorMap, G4int axflg=111)
MeshScoreMap GetScoreMap() const

References G4VScoringMesh::DrawMesh(), G4cout, G4endl, G4ScoringManager::GetMesh(), G4VSceneHandler::GetName(), G4ScoringManager::GetNumberOfMesh(), G4VScoringMesh::GetScoreMap(), G4ScoringManager::GetScoringManagerIfExist(), and G4VScoringMesh::IsActive().

◆ AddCompound() [3/6]

void G4VSceneHandler::AddCompound ( const G4THitsMap< G4StatDouble > &  hits)
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4GMocrenFileSceneHandler, G4HepRepFileSceneHandler, G4OpenGLSceneHandler, G4VRML2FileSceneHandler, and G4GMocrenFileSceneHandler.

Definition at line 383 of file G4VSceneHandler.cc.

383 {
384 using MeshScoreMap = G4VScoringMesh::MeshScoreMap;
385 //G4cout << "AddCompound: hits: " << &hits << G4endl;
386 G4bool scoreMapHits = false;
388 if (scoringManager) {
389 size_t nMeshes = scoringManager->GetNumberOfMesh();
390 for (size_t iMesh = 0; iMesh < nMeshes; ++iMesh) {
391 G4VScoringMesh* mesh = scoringManager->GetMesh(iMesh);
392 if (mesh && mesh->IsActive()) {
393 MeshScoreMap scoreMap = mesh->GetScoreMap();
394 for(MeshScoreMap::const_iterator i = scoreMap.begin();
395 i != scoreMap.end(); ++i) {
396 const G4String& scoreMapName = i->first;
397 const G4THitsMap<G4StatDouble>* foundHits = i->second;
398 if (foundHits == &hits) {
399 G4DefaultLinearColorMap colorMap("G4VSceneHandlerColorMap");
400 scoreMapHits = true;
401 mesh->DrawMesh(scoreMapName, &colorMap);
402 }
403 }
404 }
405 }
406 }
407 if (scoreMapHits) {
408 static G4bool first = true;
409 if (first) {
410 first = false;
411 G4cout <<
412 "Scoring map drawn with default parameters."
413 "\n To get gMocren file for gMocren browser:"
414 "\n /vis/open gMocrenFile"
415 "\n /vis/viewer/flush"
416 "\n Many other options available with /score/draw... commands."
417 "\n You might want to \"/vis/viewer/set/autoRefresh false\"."
418 << G4endl;
419 }
420 } else { // Not score map hits. Just call DrawAllHits.
421 // Cast away const because DrawAllHits is non-const!!!!
422 const_cast<G4THitsMap<G4StatDouble>&>(hits).DrawAllHits();
423 }
424}

References G4VScoringMesh::DrawMesh(), G4cout, G4endl, G4ScoringManager::GetMesh(), G4ScoringManager::GetNumberOfMesh(), G4VScoringMesh::GetScoreMap(), G4ScoringManager::GetScoringManagerIfExist(), and G4VScoringMesh::IsActive().

◆ AddCompound() [4/6]

void G4VSceneHandler::AddCompound ( const G4VDigi digi)
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4GMocrenFileSceneHandler, G4HepRepFileSceneHandler, G4OpenGLSceneHandler, G4VRML2FileSceneHandler, and G4GMocrenFileSceneHandler.

Definition at line 335 of file G4VSceneHandler.cc.

335 {
336 // Cast away const because Draw is non-const!!!!
337 const_cast<G4VDigi&>(digi).Draw();
338}

◆ AddCompound() [5/6]

void G4VSceneHandler::AddCompound ( const G4VHit hit)
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4GMocrenFileSceneHandler, G4HepRepFileSceneHandler, G4HepRepFileSceneHandler, G4OpenGLSceneHandler, G4VRML2FileSceneHandler, and G4GMocrenFileSceneHandler.

Definition at line 330 of file G4VSceneHandler.cc.

330 {
331 // Cast away const because Draw is non-const!!!!
332 const_cast<G4VHit&>(hit).Draw();
333}
Definition: G4VHit.hh:48

◆ AddCompound() [6/6]

void G4VSceneHandler::AddCompound ( const G4VTrajectory traj)
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4GMocrenFileSceneHandler, G4HepRepFileSceneHandler, G4HepRepFileSceneHandler, G4OpenGLSceneHandler, G4VRML2FileSceneHandler, and G4GMocrenFileSceneHandler.

Definition at line 318 of file G4VSceneHandler.cc.

318 {
319 G4TrajectoriesModel* trajectoriesModel =
320 dynamic_cast<G4TrajectoriesModel*>(fpModel);
321 if (trajectoriesModel)
322 traj.DrawTrajectory();
323 else {
325 ("G4VSceneHandler::AddCompound(const G4VTrajectory&)",
326 "visman0105", FatalException, "Not a G4TrajectoriesModel.");
327 }
328}
@ FatalException
virtual void DrawTrajectory() const

References G4VTrajectory::DrawTrajectory(), FatalException, G4VSceneHandler::fpModel, and G4Exception().

Referenced by G4Qt3DSceneHandler::AddCompound(), G4VtkSceneHandler::AddCompound(), G4HepRepFileSceneHandler::AddCompound(), G4OpenGLSceneHandler::AddCompound(), and G4GMocrenFileSceneHandler::AddCompound().

◆ AddPrimitive() [1/13]

void G4OpenInventorSceneHandler::AddPrimitive ( const G4Circle circle)
virtual

Implements G4VSceneHandler.

Definition at line 426 of file G4OpenInventorSceneHandler.cc.

426 {
428}
void AddCircleSquare(G4OIMarker markerType, const G4VMarker &)

References AddCircleSquare(), and G4OICircle.

◆ AddPrimitive() [2/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Circle )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [3/13]

void G4VSceneHandler::AddPrimitive ( const G4Plotter )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 192 of file G4VSceneHandler.cc.

501 {
502 G4cerr << "WARNING: Plotter not implemented for " << fSystem.GetName() << G4endl;
503 G4cerr << " Open a plotter-aware graphics system or remove plotter with" << G4endl;
504 G4cerr << " /vis/scene/removeModel Plotter" << G4endl;
505}
G4GLOB_DLL std::ostream G4cerr
const G4String & GetName() const
G4VGraphicsSystem & fSystem

◆ AddPrimitive() [4/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyhedron )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [5/13]

void G4OpenInventorSceneHandler::AddPrimitive ( const G4Polyhedron p)
virtual

Implements G4VSceneHandler.

Definition at line 542 of file G4OpenInventorSceneHandler.cc.

543{
544 if (polyhedron.GetNoFacets() == 0) return;
545
546 if (fProcessing2D) {
547 static G4bool warned = false;
548 if (!warned) {
549 warned = true;
551 ("G4OpenInventorSceneHandler::AddPrimitive (const G4Polyhedron&)",
552 "OpenInventor-0005", JustWarning,
553 "2D polyhedra not implemented. Ignored.");
554 }
555 return;
556 }
557
558 // Get vis attributes - pick up defaults if none.
559 const G4VisAttributes* pVA =
560 fpViewer -> GetApplicableVisAttributes (polyhedron.GetVisAttributes ());
561
562 AddProperties(pVA); // Colour, etc.
563 AddTransform(); // Transformation
564
565 SoG4Polyhedron* soPolyhedron = new SoG4Polyhedron(polyhedron);
566
567 // Loads G4Atts for picking...
569 LoadAtts(polyhedron, soPolyhedron);
570
571 SbString name = "Non-geometry";
572 G4PhysicalVolumeModel* pPVModel =
573 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
574 if (pPVModel) {
575 name = pPVModel->GetCurrentLV()->GetName().c_str();
576 }
577 SbName sbName(name);
578 soPolyhedron->setName(sbName);
579 soPolyhedron->solid.setValue(fModelingSolid);
580 soPolyhedron->reducedWireFrame.setValue(fReducedWireFrame?TRUE:FALSE);
581 fCurrentSeparator->addChild(soPolyhedron);
582}
#define TRUE
Definition: Globals.hh:27
#define FALSE
Definition: Globals.hh:23
const G4String & GetName() const
G4LogicalVolume * GetCurrentLV() const

References AddProperties(), AddTransform(), FALSE, fCurrentSeparator, fModelingSolid, G4VSceneHandler::fpModel, G4VSceneHandler::fProcessing2D, G4VSceneHandler::fpViewer, fReducedWireFrame, G4Exception(), G4PhysicalVolumeModel::GetCurrentLV(), G4LogicalVolume::GetName(), HepPolyhedron::GetNoFacets(), G4VViewer::GetViewParameters(), G4Visible::GetVisAttributes(), G4ViewParameters::IsPicking(), JustWarning, G4VSceneHandler::LoadAtts(), G4InuclParticleNames::name(), Geant4_SoPolyhedron::reducedWireFrame, Geant4_SoPolyhedron::solid, and TRUE.

◆ AddPrimitive() [6/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyline )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [7/13]

void G4OpenInventorSceneHandler::AddPrimitive ( const G4Polyline line)
virtual

Implements G4VSceneHandler.

Definition at line 180 of file G4OpenInventorSceneHandler.cc.

181{
182 if (fProcessing2D) {
183 static G4bool warned = false;
184 if (!warned) {
185 warned = true;
187 ("G4OpenInventorSceneHandler::AddPrimitive (const G4Polyline&)",
188 "OpenInventor-0001", JustWarning,
189 "2D polylines not implemented. Ignored.");
190 }
191 return;
192 }
193
194 // Get vis attributes - pick up defaults if none.
195 const G4VisAttributes* pVA =
196 fpViewer -> GetApplicableVisAttributes (line.GetVisAttributes ());
197
198 AddProperties(pVA); // Colour, etc.
199 AddTransform(); // Transformation
200
201 G4int nPoints = line.size();
202 SbVec3f* pCoords = new SbVec3f[nPoints];
203
204 for (G4int iPoint = 0; iPoint < nPoints ; iPoint++) {
205 pCoords[iPoint].setValue((float)line[iPoint].x(),
206 (float)line[iPoint].y(),
207 (float)line[iPoint].z());
208 }
209
210 //
211 // Point Set
212 //
213 SoCoordinate3 *polyCoords = new SoCoordinate3;
214 polyCoords->point.setValues(0,nPoints,pCoords);
215 fCurrentSeparator->addChild(polyCoords);
216
217 //
218 // Wireframe
219 //
220 SoDrawStyle* drawStyle = fStyleCache->getLineStyle();
221 fCurrentSeparator->addChild(drawStyle);
222
223 SoG4LineSet *pLine = new SoG4LineSet;
224
225 // Loads G4Atts for picking...
226 if (fpViewer->GetViewParameters().IsPicking()) LoadAtts(line, pLine);
227
228#ifdef INVENTOR2_0
229 pLine->numVertices.setValues(0,1,(const long *)&nPoints);
230#else
231 pLine->numVertices.setValues(0,1,&nPoints);
232#endif
233
234 fCurrentSeparator->addChild(pLine);
235
236 delete [] pCoords;
237}
int G4int
Definition: G4Types.hh:85

References AddProperties(), AddTransform(), fCurrentSeparator, G4VSceneHandler::fProcessing2D, G4VSceneHandler::fpViewer, fStyleCache, G4Exception(), G4VViewer::GetViewParameters(), G4Visible::GetVisAttributes(), G4ViewParameters::IsPicking(), JustWarning, and G4VSceneHandler::LoadAtts().

◆ AddPrimitive() [8/13]

void G4VSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 190 of file G4VSceneHandler.cc.

458 {
459 switch (polymarker.GetMarkerType()) {
460 default:
462 {
463 G4Circle dot (polymarker);
464 dot.SetWorldSize (0.);
465 dot.SetScreenSize (0.1); // Very small circle.
466 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
467 dot.SetPosition (polymarker[iPoint]);
468 AddPrimitive (dot);
469 }
470 }
471 break;
473 {
474 G4Circle circle (polymarker); // Default circle
475 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
476 circle.SetPosition (polymarker[iPoint]);
477 AddPrimitive (circle);
478 }
479 }
480 break;
482 {
483 G4Square square (polymarker); // Default square
484 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
485 square.SetPosition (polymarker[iPoint]);
486 AddPrimitive (square);
487 }
488 }
489 break;
490 }
491}
void AddPrimitive(const G4Polyline &line)
MarkerType GetMarkerType() const

◆ AddPrimitive() [9/13]

void G4OpenInventorSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 239 of file G4OpenInventorSceneHandler.cc.

240{
241 if (fProcessing2D) {
242 static G4bool warned = false;
243 if (!warned) {
244 warned = true;
246 ("G4OpenInventorSceneHandler::AddPrimitive (const G4Polymarker&)",
247 "OpenInventor-0002", JustWarning,
248 "2D polymarkers not implemented. Ignored.");
249 }
250 return;
251 }
252
253 // Get vis attributes - pick up defaults if none.
254 const G4VisAttributes* pVA =
255 fpViewer -> GetApplicableVisAttributes (polymarker.GetVisAttributes ());
256
257 AddProperties(pVA); // Colour, etc.
258 AddTransform(); // Transformation
259
260 G4int pointn = polymarker.size();
261 if(pointn<=0) return;
262
263 SbVec3f* points = new SbVec3f[pointn];
264 for (G4int iPoint = 0; iPoint < pointn ; iPoint++) {
265 points[iPoint].setValue((float)polymarker[iPoint].x(),
266 (float)polymarker[iPoint].y(),
267 (float)polymarker[iPoint].z());
268 }
269
270 SoCoordinate3* coordinate3 = new SoCoordinate3;
271 coordinate3->point.setValues(0,pointn,points);
272 fCurrentSeparator->addChild(coordinate3);
273
274 MarkerSizeType sizeType;
275 G4double screenSize = GetMarkerSize (polymarker, sizeType);
276 switch (sizeType) {
277 default:
278 case screen:
279 // Draw in screen coordinates. OK.
280 break;
281 case world:
282 // Draw in world coordinates. Not implemented. Use screenSize = 10.
283 screenSize = 10.;
284 break;
285 }
286
287 SoG4MarkerSet* markerSet = new SoG4MarkerSet;
288 markerSet->numPoints = pointn;
289
290 // Loads G4Atts for picking...
292 LoadAtts(polymarker, markerSet);
293
294 G4VMarker::FillStyle style = polymarker.GetFillStyle();
295 switch (polymarker.GetMarkerType()) {
296 default:
297 // Are available 5_5, 7_7 and 9_9
299 if (screenSize <= 5.) {
301 } else if (screenSize <= 7.) {
303 } else {
305 }
306 break;
308 if (screenSize <= 5.) {
309 if (style == G4VMarker::filled) {
311 } else {
313 }
314 } else if (screenSize <= 7.) {
315 if (style == G4VMarker::filled) {
317 } else {
319 }
320 } else {
321 if (style == G4VMarker::filled) {
323 } else {
325 }
326 }
327 break;
329 if (screenSize <= 5.) {
330 if (style == G4VMarker::filled) {
332 } else {
334 }
335 } else if (screenSize <= 7.) {
336 if (style == G4VMarker::filled) {
338 } else {
340 }
341 } else {
342 if (style == G4VMarker::filled) {
344 } else {
346 }
347 }
348 }
349 fCurrentSeparator->addChild(markerSet);
350
351 delete [] points;
352}

References AddProperties(), AddTransform(), HEPVis_SoMarkerSet::CIRCLE_FILLED_5_5, HEPVis_SoMarkerSet::CIRCLE_FILLED_7_7, HEPVis_SoMarkerSet::CIRCLE_FILLED_9_9, HEPVis_SoMarkerSet::CIRCLE_LINE_5_5, HEPVis_SoMarkerSet::CIRCLE_LINE_7_7, HEPVis_SoMarkerSet::CIRCLE_LINE_9_9, G4Polymarker::circles, G4Polymarker::dots, fCurrentSeparator, G4VMarker::filled, G4VSceneHandler::fProcessing2D, G4VSceneHandler::fpViewer, G4Exception(), G4VMarker::GetFillStyle(), G4VSceneHandler::GetMarkerSize(), G4Polymarker::GetMarkerType(), G4VViewer::GetViewParameters(), G4Visible::GetVisAttributes(), G4ViewParameters::IsPicking(), JustWarning, G4VSceneHandler::LoadAtts(), HEPVis_SoMarkerSet::markerIndex, G4VSceneHandler::screen, HEPVis_SoMarkerSet::SQUARE_FILLED_5_5, HEPVis_SoMarkerSet::SQUARE_FILLED_7_7, HEPVis_SoMarkerSet::SQUARE_FILLED_9_9, HEPVis_SoMarkerSet::SQUARE_LINE_5_5, HEPVis_SoMarkerSet::SQUARE_LINE_7_7, HEPVis_SoMarkerSet::SQUARE_LINE_9_9, G4Polymarker::squares, and G4VSceneHandler::world.

◆ AddPrimitive() [10/13]

void G4OpenInventorSceneHandler::AddPrimitive ( const G4Square square)
virtual

Implements G4VSceneHandler.

Definition at line 433 of file G4OpenInventorSceneHandler.cc.

433 {
435}

References AddCircleSquare(), and G4OISquare.

◆ AddPrimitive() [11/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Square )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [12/13]

void G4OpenInventorSceneHandler::AddPrimitive ( const G4Text text)
virtual

Implements G4VSceneHandler.

Definition at line 356 of file G4OpenInventorSceneHandler.cc.

357{
358 if (fProcessing2D) {
359 static G4bool warned = false;
360 if (!warned) {
361 warned = true;
363 ("G4OpenInventorSceneHandler::AddPrimitive (const G4Text&)",
364 "OpenInventor-0003", JustWarning,
365 "2D text not implemented. Ignored.");
366 }
367 return;
368 }
369
370 AddProperties(text.GetVisAttributes()); // Colour, etc.
371 AddTransform(text.GetPosition()); // Transformation
372
373 //
374 // Color. Note: text colour is worked out differently. This
375 // over-rides the colour added in AddProperties...
376 //
377 const G4Colour& c = GetTextColour (text);
378 SoMaterial* material =
379 fStyleCache->getMaterial((float)c.GetRed(),
380 (float)c.GetGreen(),
381 (float)c.GetBlue(),
382 (float)(1-c.GetAlpha()));
383 fCurrentSeparator->addChild(material);
384
385 MarkerSizeType sizeType;
386 G4double size = GetMarkerSize (text, sizeType);
387 switch (sizeType) {
388 default:
389 case screen:
390 // Draw in screen coordinates. OK.
391 break;
392 case world:
393 // Draw in world coordinates. Not implemented. Use size = 20.
394 size = 20.;
395 break;
396 }
397
398 //
399 // Font
400 //
401 SoFont *g4Font = new SoFont();
402 g4Font->size = size;
403 fCurrentSeparator->addChild(g4Font);
404
405 //
406 // Text
407 //
408 SoText2 *g4String = new SoText2();
409 g4String->string.setValue(text.GetText());
410 g4String->spacing = 2.0;
411 switch (text.GetLayout()) {
412 default:
413 case G4Text::left:
414 g4String->justification = SoText2::LEFT; break;
415 case G4Text::centre:
416 g4String->justification = SoText2::CENTER; break;
417 case G4Text::right:
418 g4String->justification = SoText2::RIGHT; break;
419 }
420 fCurrentSeparator->addChild(g4String);
421}
G4double GetBlue() const
Definition: G4Colour.hh:154
G4double GetAlpha() const
Definition: G4Colour.hh:155
G4double GetRed() const
Definition: G4Colour.hh:152
G4double GetGreen() const
Definition: G4Colour.hh:153
Layout GetLayout() const
G4String GetText() const
@ centre
Definition: G4Text.hh:76
@ right
Definition: G4Text.hh:76
@ left
Definition: G4Text.hh:76
const G4Colour & GetTextColour(const G4Text &)
string material
Definition: eplot.py:19

References AddProperties(), AddTransform(), G4Text::centre, fCurrentSeparator, G4VSceneHandler::fProcessing2D, fStyleCache, G4Exception(), G4Colour::GetAlpha(), G4Colour::GetBlue(), G4Colour::GetGreen(), G4Text::GetLayout(), G4VSceneHandler::GetMarkerSize(), G4VMarker::GetPosition(), G4Colour::GetRed(), G4Text::GetText(), G4VSceneHandler::GetTextColour(), G4Visible::GetVisAttributes(), JustWarning, G4Text::left, eplot::material, G4Text::right, G4VSceneHandler::screen, and G4VSceneHandler::world.

◆ AddPrimitive() [13/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Text )
virtual

Implements G4VSceneHandler.

◆ AddProperties()

void G4OpenInventorSceneHandler::AddProperties ( const G4VisAttributes visAtts)
private

Definition at line 772 of file G4OpenInventorSceneHandler.cc.

773{
774 // Use the applicable vis attributes...
775 const G4VisAttributes* pApplicableVisAttribs =
777
778 // First find the color attributes...
779 const G4Colour& g4Col = pApplicableVisAttribs->GetColour ();
780 const double red = g4Col.GetRed ();
781 const double green = g4Col.GetGreen ();
782 const double blue = g4Col.GetBlue ();
783 double transparency = 1 - g4Col.GetAlpha();
784
785 // Drawing style...
786 G4ViewParameters::DrawingStyle drawing_style =
787 GetDrawingStyle(pApplicableVisAttribs);
788 switch (drawing_style) {
790 fModelingSolid = false;
791 break;
795 fModelingSolid = true;
796 break;
798 fModelingSolid = false;
799 break;
800 }
801
802 // Edge visibility...
803 G4bool isAuxEdgeVisible = GetAuxEdgeVisible (pApplicableVisAttribs);
804 fReducedWireFrame = !isAuxEdgeVisible;
805
806 SoMaterial* material =
807 fStyleCache->getMaterial((float)red,
808 (float)green,
809 (float)blue,
810 (float)transparency);
811 fCurrentSeparator->addChild(material);
812
813 SoLightModel* lightModel =
814 fModelingSolid ? fStyleCache->getLightModelPhong() :
815 fStyleCache->getLightModelBaseColor();
816 fCurrentSeparator->addChild(lightModel);
817}
G4ViewParameters::DrawingStyle GetDrawingStyle(const G4VisAttributes *)
G4bool GetAuxEdgeVisible(const G4VisAttributes *)
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
const G4Colour & GetColour() const

References G4ViewParameters::cloud, fCurrentSeparator, fModelingSolid, G4VSceneHandler::fpViewer, fReducedWireFrame, fStyleCache, G4Colour::GetAlpha(), G4VViewer::GetApplicableVisAttributes(), G4VSceneHandler::GetAuxEdgeVisible(), G4Colour::GetBlue(), G4VisAttributes::GetColour(), G4VSceneHandler::GetDrawingStyle(), G4Colour::GetGreen(), G4Colour::GetRed(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, eplot::material, and G4ViewParameters::wireframe.

Referenced by AddCircleSquare(), and AddPrimitive().

◆ AddSolid() [1/14]

void G4VSceneHandler::AddSolid ( const G4Box box)
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4DAWNFILESceneHandler, G4GMocrenFileSceneHandler, G4HepRepFileSceneHandler, G4OpenGLSceneHandler, G4VRML2FileSceneHandler, G4VRML2FileSceneHandler, G4DAWNFILESceneHandler, G4GMocrenFileSceneHandler, and G4VtkSceneHandler.

Definition at line 247 of file G4VSceneHandler.cc.

247 {
248 AddSolidT (box);
249 // If your graphics system is sophisticated enough to handle a
250 // particular solid shape as a primitive, in your derived class write a
251 // function to override this.
252 // Your function might look like this...
253 // void G4MySceneHandler::AddSolid (const G4Box& box) {
254 // Get and check applicable vis attributes.
255 // fpVisAttribs = fpViewer->GetApplicableVisAttributes(fpVisAttribs);
256 // Do not draw if not visible.
257 // if (fpVisAttribs->IsVisible()) {
258 // Get parameters of appropriate object, e.g.:
259 // G4double dx = box.GetXHalfLength ();
260 // G4double dy = box.GetYHalfLength ();
261 // G4double dz = box.GetZHalfLength ();
262 // ...
263 // and Draw or Store in your display List.
264}
void AddSolidT(const T &solid)

References G4VSceneHandler::AddSolidT().

Referenced by G4Qt3DSceneHandler::AddCompound(), G4VtkSceneHandler::AddSolid(), G4HepRepFileSceneHandler::AddSolid(), and G4GMocrenFileSceneHandler::AddSolid().

◆ AddSolid() [2/14]

void G4VSceneHandler::AddSolid ( const G4Cons cons)
virtualinherited

◆ AddSolid() [3/14]

void G4VSceneHandler::AddSolid ( const G4Ellipsoid ellipsoid)
virtualinherited

◆ AddSolid() [4/14]

void G4VSceneHandler::AddSolid ( const G4Orb orb)
virtualinherited

◆ AddSolid() [5/14]

void G4VSceneHandler::AddSolid ( const G4Para para)
virtualinherited

◆ AddSolid() [6/14]

void G4VSceneHandler::AddSolid ( const G4Polycone polycone)
virtualinherited

◆ AddSolid() [7/14]

void G4VSceneHandler::AddSolid ( const G4Polyhedra polyhedra)
virtualinherited

◆ AddSolid() [8/14]

void G4VSceneHandler::AddSolid ( const G4Sphere sphere)
virtualinherited

◆ AddSolid() [9/14]

void G4VSceneHandler::AddSolid ( const G4TessellatedSolid tess)
virtualinherited

◆ AddSolid() [10/14]

void G4VSceneHandler::AddSolid ( const G4Torus torus)
virtualinherited

◆ AddSolid() [11/14]

void G4VSceneHandler::AddSolid ( const G4Trap trap)
virtualinherited

◆ AddSolid() [12/14]

void G4VSceneHandler::AddSolid ( const G4Trd trd)
virtualinherited

◆ AddSolid() [13/14]

void G4VSceneHandler::AddSolid ( const G4Tubs tubs)
virtualinherited

◆ AddSolid() [14/14]

void G4VSceneHandler::AddSolid ( const G4VSolid solid)
virtualinherited

◆ AddSolidT()

template<class T >
void G4VSceneHandler::AddSolidT ( const T &  solid)
inherited

Definition at line 220 of file G4VSceneHandler.cc.

222{
223 // Get and check applicable vis attributes.
225 RequestPrimitives (solid);
226}
const G4VisAttributes * fpVisAttribs
virtual void RequestPrimitives(const G4VSolid &solid)

References G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4VViewer::GetApplicableVisAttributes(), and G4VSceneHandler::RequestPrimitives().

Referenced by G4VSceneHandler::AddSolid().

◆ AddSolidWithAuxiliaryEdges()

template<class T >
void G4VSceneHandler::AddSolidWithAuxiliaryEdges ( const T &  solid)
inherited

Definition at line 228 of file G4VSceneHandler.cc.

230{
231 // Get and check applicable vis attributes.
233 // Draw with auxiliary edges unless otherwise specified.
235 // Create a vis atts object for the modified vis atts.
236 // It is static so that we may return a reliable pointer to it.
237 static G4VisAttributes visAttsWithAuxEdges;
238 // Initialise it with the current vis atts and reset the pointer.
239 visAttsWithAuxEdges = *fpVisAttribs;
240 // Force auxiliary edges visible.
241 visAttsWithAuxEdges.SetForceAuxEdgeVisible();
242 fpVisAttribs = &visAttsWithAuxEdges;
243 }
244 RequestPrimitives (solid);
245}
void SetForceAuxEdgeVisible(G4bool=true)
G4bool IsForceAuxEdgeVisible() const

References G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4VViewer::GetApplicableVisAttributes(), G4VisAttributes::IsForceAuxEdgeVisible(), G4VSceneHandler::RequestPrimitives(), and G4VisAttributes::SetForceAuxEdgeVisible().

Referenced by G4VSceneHandler::AddSolid().

◆ AddTransform()

void G4OpenInventorSceneHandler::AddTransform ( const G4Point3D translation = G4Point3D())
private

Definition at line 819 of file G4OpenInventorSceneHandler.cc.

820{
821 // AddTransform takes fObjectTransformation and "adds" a translation.
822 // Set up the geometrical transformation for the coming
823 fCurrentSeparator->addChild(fStyleCache->getResetTransform());
824
825 SoMatrixTransform* matrixTransform = new SoMatrixTransform;
827 (fObjectTransformation * G4Translate3D(translation));
828 SbMatrix* sbMatrix = oiTran.GetSbMatrix();
829
831 SbMatrix sbScale;
832 sbScale.setScale
833 (SbVec3f((float)scale.x(),(float)scale.y(),(float)scale.z()));
834 sbMatrix->multRight(sbScale);
835
836 matrixTransform->matrix.setValue(*sbMatrix);
837 delete sbMatrix;
838 fCurrentSeparator->addChild(matrixTransform);
839}
HepGeom::Translate3D G4Translate3D
G4Transform3D fObjectTransformation
const G4Vector3D & GetScaleFactor() const

References fCurrentSeparator, G4VSceneHandler::fObjectTransformation, G4VSceneHandler::fpViewer, fStyleCache, G4OpenInventorTransform3D::GetSbMatrix(), G4ViewParameters::GetScaleFactor(), G4VViewer::GetViewParameters(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

Referenced by AddCircleSquare(), and AddPrimitive().

◆ AddViewerToList()

void G4VSceneHandler::AddViewerToList ( G4VViewer pView)
inherited

Definition at line 454 of file G4VSceneHandler.cc.

454 {
455 fViewerList.push_back (pViewer);
456}
G4ViewerList fViewerList

References G4VSceneHandler::fViewerList.

◆ BeginModeling()

void G4VSceneHandler::BeginModeling ( )
virtualinherited

◆ BeginPrimitives()

void G4OpenInventorSceneHandler::BeginPrimitives ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 165 of file G4OpenInventorSceneHandler.cc.

166 {
167
168 G4VSceneHandler::BeginPrimitives (objectTransformation);
169
170 // If thread of control has already passed through PreAddSolid,
171 // avoid opening a graphical data base component again.
172 if (!fProcessingSolid) {
174 }
175}
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())

References G4VSceneHandler::BeginPrimitives(), G4VSceneHandler::fProcessingSolid, and GeneratePrerequisites().

◆ BeginPrimitives2D()

void G4VSceneHandler::BeginPrimitives2D ( const G4Transform3D objectTransformation = G4Transform3D())
virtualinherited

Implements G4VGraphicsScene.

Reimplemented in G4HepRepFileSceneHandler, G4OpenGLImmediateSceneHandler, G4OpenGLSceneHandler, G4OpenGLStoredSceneHandler, and G4Qt3DSceneHandler.

Definition at line 184 of file G4VSceneHandler.cc.

185 {
187 if (fNestingDepth > 1)
189 ("G4VSceneHandler::BeginPrimitives2D",
190 "visman0103", FatalException,
191 "Nesting detected. It is illegal to nest Begin/EndPrimitives.");
192 fObjectTransformation = objectTransformation;
193 fProcessing2D = true;
194}

References G4VSceneHandler::fNestingDepth, and G4Exception().

Referenced by G4HepRepFileSceneHandler::BeginPrimitives2D(), G4OpenGLSceneHandler::BeginPrimitives2D(), and G4Qt3DSceneHandler::BeginPrimitives2D().

◆ ClearStore()

void G4OpenInventorSceneHandler::ClearStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 136 of file G4OpenInventorSceneHandler.cc.

137{
138 fDetectorRoot->removeAllChildren();
139 fSeparatorMap.clear();
140
141 fTransientRoot->removeAllChildren();
142}
std::map< G4LogicalVolume *, SoSeparator *, std::less< G4LogicalVolume * > > fSeparatorMap

References fDetectorRoot, fSeparatorMap, and fTransientRoot.

◆ ClearTransientStore()

void G4OpenInventorSceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 144 of file G4OpenInventorSceneHandler.cc.

145{
146 fTransientRoot->removeAllChildren();
147}

References fTransientRoot.

◆ CreateCutawaySolid()

G4DisplacedSolid * G4VSceneHandler::CreateCutawaySolid ( )
protectedvirtualinherited

Reimplemented in G4OpenGLSceneHandler.

Definition at line 904 of file G4VSceneHandler.cc.

905{
906 // To be reviewed.
907 return 0;
908 /*** An alternative way of getting a cutaway is to use
909 Command /vis/scene/add/volume
910 Guidance :
911 Adds a physical volume to current scene, with optional clipping volume.
912 If physical-volume-name is "world" (the default), the top of the
913 main geometry tree (material world) is added. If "worlds", the
914 top of all worlds - material world and parallel worlds, if any - are
915 added. Otherwise a search of all worlds is made, taking the first
916 matching occurrence only. To see a representation of the geometry
917 hierarchy of the worlds, try "/vis/drawTree [worlds]" or one of the
918 driver/browser combinations that have the required functionality, e.g., HepRep.
919 If clip-volume-type is specified, the subsequent parameters are used to
920 to define a clipping volume. For example,
921 "/vis/scene/add/volume ! ! ! -box km 0 1 0 1 0 1" will draw the world
922 with the positive octant cut away. (If the Boolean Processor issues
923 warnings try replacing 0 by 0.000000001 or something.)
924 If clip-volume-type is prepended with '-', the clip-volume is subtracted
925 (cutaway). (This is the default if there is no prepended character.)
926 If '*' is prepended, the intersection of the physical-volume and the
927 clip-volume is made. (You can make a section/DCUT with a thin box, for
928 example).
929 For "box", the parameters are xmin,xmax,ymin,ymax,zmin,zmax.
930 Only "box" is programmed at present.
931 ***/
932}

Referenced by G4VSceneHandler::CreateModelingParameters().

◆ CreateModelingParameters()

G4ModelingParameters * G4VSceneHandler::CreateModelingParameters ( )
inherited

Definition at line 798 of file G4VSceneHandler.cc.

799{
800 // Create modeling parameters from View Parameters...
801 if (!fpViewer) return NULL;
802
803 const G4ViewParameters& vp = fpViewer -> GetViewParameters ();
804
805 // Convert drawing styles...
806 G4ModelingParameters::DrawingStyle modelDrawingStyle =
808 switch (vp.GetDrawingStyle ()) {
809 default:
811 modelDrawingStyle = G4ModelingParameters::wf;
812 break;
814 modelDrawingStyle = G4ModelingParameters::hlr;
815 break;
817 modelDrawingStyle = G4ModelingParameters::hsr;
818 break;
820 modelDrawingStyle = G4ModelingParameters::hlhsr;
821 break;
823 modelDrawingStyle = G4ModelingParameters::cloud;
824 break;
825 }
826
827 // Decide if covered daughters are really to be culled...
828 G4bool reallyCullCovered =
829 vp.IsCullingCovered() // Culling daughters depends also on...
830 && !vp.IsSection () // Sections (DCUT) not requested.
831 && !vp.IsCutaway () // Cutaways not requested.
832 ;
833
834 G4ModelingParameters* pModelingParams = new G4ModelingParameters
836 modelDrawingStyle,
837 vp.IsCulling (),
838 vp.IsCullingInvisible (),
839 vp.IsDensityCulling (),
840 vp.GetVisibleDensity (),
841 reallyCullCovered,
842 vp.GetNoOfSides ()
843 );
844
845 pModelingParams->SetNumberOfCloudPoints(vp.GetNumberOfCloudPoints());
846 pModelingParams->SetWarning
848
849 pModelingParams->SetCBDAlgorithmNumber(vp.GetCBDAlgorithmNumber());
850 pModelingParams->SetCBDParameters(vp.GetCBDParameters());
851
852 pModelingParams->SetExplodeFactor(vp.GetExplodeFactor());
853 pModelingParams->SetExplodeCentre(vp.GetExplodeCentre());
854
855 pModelingParams->SetSectionSolid(CreateSectionSolid());
856 pModelingParams->SetCutawaySolid(CreateCutawaySolid());
857 // The polyhedron objects are deleted in the modeling parameters destructor.
858
860
861 pModelingParams->SetSpecialMeshRendering(vp.IsSpecialMeshRendering());
862 pModelingParams->SetSpecialMeshVolumes(vp.GetSpecialMeshVolumes());
863
864 return pModelingParams;
865}
void SetCBDParameters(const std::vector< G4double > &)
void SetWarning(G4bool)
void SetNumberOfCloudPoints(G4int)
void SetCBDAlgorithmNumber(G4int)
void SetExplodeFactor(G4double explodeFactor)
void SetVisAttributesModifiers(const std::vector< VisAttributesModifier > &)
void SetExplodeCentre(const G4Point3D &explodeCentre)
void SetCutawaySolid(G4DisplacedSolid *pCutawaySolid)
void SetSectionSolid(G4DisplacedSolid *pSectionSolid)
void SetSpecialMeshVolumes(const std::vector< PVNameCopyNo > &)
void SetSpecialMeshRendering(G4bool)
virtual G4DisplacedSolid * CreateSectionSolid()
virtual G4DisplacedSolid * CreateCutawaySolid()
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers() const
G4int GetNoOfSides() const
G4bool IsSpecialMeshRendering() const
G4double GetExplodeFactor() const
G4int GetNumberOfCloudPoints() const
G4bool IsCutaway() const
G4bool IsSection() const
G4bool IsCulling() const
const std::vector< G4double > & GetCBDParameters() const
G4int GetCBDAlgorithmNumber() const
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() const
G4bool IsCullingInvisible() const
const G4VisAttributes * GetDefaultVisAttributes() const
G4bool IsDensityCulling() const
G4double GetVisibleDensity() const
const G4Point3D & GetExplodeCentre() const
G4bool IsCullingCovered() const
DrawingStyle GetDrawingStyle() const
static Verbosity GetVerbosity()

References G4ViewParameters::cloud, G4ModelingParameters::cloud, G4VSceneHandler::CreateCutawaySolid(), G4VSceneHandler::CreateSectionSolid(), G4VSceneHandler::fpViewer, G4ViewParameters::GetCBDAlgorithmNumber(), G4ViewParameters::GetCBDParameters(), G4ViewParameters::GetDefaultVisAttributes(), G4ViewParameters::GetDrawingStyle(), G4ViewParameters::GetExplodeCentre(), G4ViewParameters::GetExplodeFactor(), G4ViewParameters::GetNoOfSides(), G4ViewParameters::GetNumberOfCloudPoints(), G4ViewParameters::GetSpecialMeshVolumes(), G4VisManager::GetVerbosity(), G4ViewParameters::GetVisAttributesModifiers(), G4ViewParameters::GetVisibleDensity(), G4ViewParameters::hlhsr, G4ModelingParameters::hlhsr, G4ViewParameters::hlr, G4ModelingParameters::hlr, G4ViewParameters::hsr, G4ModelingParameters::hsr, G4ViewParameters::IsCulling(), G4ViewParameters::IsCullingCovered(), G4ViewParameters::IsCullingInvisible(), G4ViewParameters::IsCutaway(), G4ViewParameters::IsDensityCulling(), G4ViewParameters::IsSection(), G4ViewParameters::IsSpecialMeshRendering(), G4ModelingParameters::SetCBDAlgorithmNumber(), G4ModelingParameters::SetCBDParameters(), G4ModelingParameters::SetCutawaySolid(), G4ModelingParameters::SetExplodeCentre(), G4ModelingParameters::SetExplodeFactor(), G4ModelingParameters::SetNumberOfCloudPoints(), G4ModelingParameters::SetSectionSolid(), G4ModelingParameters::SetSpecialMeshRendering(), G4ModelingParameters::SetSpecialMeshVolumes(), G4ModelingParameters::SetVisAttributesModifiers(), G4ModelingParameters::SetWarning(), G4VisManager::warnings, G4ModelingParameters::wf, and G4ViewParameters::wireframe.

Referenced by G4VSceneHandler::DrawEndOfRunModels(), G4VSceneHandler::DrawEvent(), and G4VSceneHandler::ProcessScene().

◆ CreateSectionSolid()

G4DisplacedSolid * G4VSceneHandler::CreateSectionSolid ( )
protectedvirtualinherited

Reimplemented in G4OpenGLSceneHandler.

Definition at line 867 of file G4VSceneHandler.cc.

868{
869 G4DisplacedSolid* sectioner = 0;
870
872 if (vp.IsSection () ) {
873
875 G4double safe = radius + fpScene->GetExtent().GetExtentCentre().mag();
876 G4VSolid* sectionBox =
877 new G4Box("_sectioner", safe, safe, 1.e-5 * radius); // Thin in z-plane...
878 const G4Normal3D originalNormal(0,0,1); // ...so this is original normal.
879
880 const G4Plane3D& sp = vp.GetSectionPlane ();
881 const G4double& a = sp.a();
882 const G4double& b = sp.b();
883 const G4double& c = sp.c();
884 const G4double& d = sp.d();
885 const G4Normal3D newNormal(a,b,c);
886
887 G4Transform3D requiredTransform;
888 // Rotate
889 if (newNormal != originalNormal) {
890 const G4double& angle = std::acos(newNormal.dot(originalNormal));
891 const G4Vector3D& axis = originalNormal.cross(newNormal);
892 requiredTransform = G4Rotate3D(angle, axis);
893 }
894 // Translate
895 requiredTransform = requiredTransform * G4TranslateZ3D(-d);
896
897 sectioner = new G4DisplacedSolid
898 ("_displaced_sectioning_box", sectionBox, requiredTransform);
899 }
900
901 return sectioner;
902}
static const G4double angle[DIMMOTT]
HepGeom::Rotate3D G4Rotate3D
HepGeom::TranslateZ3D G4TranslateZ3D
Definition: G4Box.hh:56
const G4VisExtent & GetExtent() const
const G4Plane3D & GetSectionPlane() const
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:75
const G4Point3D & GetExtentCentre() const
Definition: G4VisExtent.cc:65
BasicVector3D< T > cross(const BasicVector3D< T > &v) const

References angle, HepGeom::BasicVector3D< T >::cross(), HepGeom::BasicVector3D< T >::dot(), G4VSceneHandler::fpScene, G4VSceneHandler::fpViewer, G4Scene::GetExtent(), G4VisExtent::GetExtentCentre(), G4VisExtent::GetExtentRadius(), G4ViewParameters::GetSectionPlane(), G4VViewer::GetViewParameters(), G4ViewParameters::IsSection(), HepGeom::BasicVector3D< T >::mag(), and G4InuclParticleNames::sp.

Referenced by G4VSceneHandler::CreateModelingParameters(), and G4OpenGLSceneHandler::CreateSectionSolid().

◆ DrawEndOfRunModels()

void G4VSceneHandler::DrawEndOfRunModels ( )
inherited

Definition at line 777 of file G4VSceneHandler.cc.

778{
779 const std::vector<G4Scene::Model>& EORModelList =
780 fpScene -> GetEndOfRunModelList ();
781 size_t nModels = EORModelList.size();
782 if (nModels) {
784 pMP->SetEvent(0);
785 for (size_t i = 0; i < nModels; i++) {
786 if (EORModelList[i].fActive) {
787 fpModel = EORModelList[i].fpModel;
788 fpModel -> SetModelingParameters(pMP);
789 fpModel -> DescribeYourselfTo (*this);
790 fpModel -> SetModelingParameters(0);
791 }
792 }
793 fpModel = 0;
794 delete pMP;
795 }
796}
void SetEvent(const G4Event *pEvent)
G4ModelingParameters * CreateModelingParameters()

References G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::fpModel, G4VSceneHandler::fpScene, and G4ModelingParameters::SetEvent().

Referenced by G4VisManager::EndOfRun(), and G4VSceneHandler::ProcessScene().

◆ DrawEvent()

void G4VSceneHandler::DrawEvent ( const G4Event event)
inherited

Definition at line 756 of file G4VSceneHandler.cc.

757{
758 const std::vector<G4Scene::Model>& EOEModelList =
759 fpScene -> GetEndOfEventModelList ();
760 size_t nModels = EOEModelList.size();
761 if (nModels) {
763 pMP->SetEvent(event);
764 for (size_t i = 0; i < nModels; i++) {
765 if (EOEModelList[i].fActive) {
766 fpModel = EOEModelList[i].fpModel;
767 fpModel -> SetModelingParameters(pMP);
768 fpModel -> DescribeYourselfTo (*this);
769 fpModel -> SetModelingParameters(0);
770 }
771 }
772 fpModel = 0;
773 delete pMP;
774 }
775}

References G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::fpModel, G4VSceneHandler::fpScene, and G4ModelingParameters::SetEvent().

Referenced by G4VisManager::EndOfEvent(), and G4VSceneHandler::ProcessScene().

◆ EndModeling()

void G4VSceneHandler::EndModeling ( )
virtualinherited

◆ EndPrimitives()

void G4VSceneHandler::EndPrimitives ( )
virtualinherited

◆ EndPrimitives2D()

void G4VSceneHandler::EndPrimitives2D ( )
virtualinherited

◆ GeneratePrerequisites()

void G4OpenInventorSceneHandler::GeneratePrerequisites ( )
private

Definition at line 584 of file G4OpenInventorSceneHandler.cc.

585{
586 // Utility for PreAddSolid and BeginPrimitives.
587
588 // This routines prepares for adding items to the scene database. We
589 // are expecting two kinds of solids: leaf parts and non-leaf parts.
590 // For non-leaf parts, we create a detector tree kit. This has two
591 // separators. The solid itself goes in the preview separator, the
592 // full separator is forseen for daughters. This separator is not
593 // only created--it is also put in a dictionary for future use by
594 // the leaf part.
595
596 // For leaf parts, we first locate the mother volume and find its
597 // separator through the dictionary.
598
599 // The private member fCurrentSeparator is set to the proper
600 // location on in the scene database so that when the solid is
601 // actually added (in addthis), it is put in the right place.
602
603 G4PhysicalVolumeModel* pPVModel =
604 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
605
606 if (pPVModel) {
607
608 // This call comes from a G4PhysicalVolumeModel. drawnPVPath is
609 // the path of the current drawn (non-culled) volume in terms of
610 // drawn (non-culled) ancestors. Each node is identified by a
611 // PVNodeID object, which is a physical volume and copy number. It
612 // is a vector of PVNodeIDs corresponding to the geometry hierarchy
613 // actually selected, i.e., not culled.
615 typedef std::vector<PVNodeID> PVPath;
616 const PVPath& drawnPVPath = pPVModel->GetDrawnPVPath();
617 //G4int currentDepth = pPVModel->GetCurrentDepth();
618 G4VPhysicalVolume* pCurrentPV = pPVModel->GetCurrentPV();
619 G4LogicalVolume* pCurrentLV = pPVModel->GetCurrentLV();
620 //G4Material* pCurrentMaterial = pPVModel->GetCurrentMaterial();
621 // Note: pCurrentMaterial may be zero (parallel world).
622
623 // The simplest algorithm, used by the Open Inventor Driver
624 // developers, is to rely on the fact the G4PhysicalVolumeModel
625 // traverses the geometry hierarchy in an orderly manner. The last
626 // mother, if any, will be the node to which the volume should be
627 // added. So it is enough to keep a map of scene graph nodes keyed
628 // on the volume path ID. Actually, it is enough to use the logical
629 // volume as the key. (An alternative would be to keep the PVNodeID
630 // in the tree and match the PVPath from the root down.)
631
632 // Find mother. ri points to mother, if any...
633 PVPath::const_reverse_iterator ri;
634 G4LogicalVolume* MotherVolume = 0;
635 ri = ++drawnPVPath.rbegin();
636 if (ri != drawnPVPath.rend()) {
637 // This volume has a mother.
638 MotherVolume = ri->GetPhysicalVolume()->GetLogicalVolume();
639 }
640
641 if (pCurrentLV->GetNoDaughters()!=0 ||
642 pCurrentPV->IsReplicated()) { //????Don't understand this???? JA
643 // This block of code is executed for non-leaf parts:
644
645 // Make the detector tree kit:
646 SoDetectorTreeKit* detectorTreeKit = new SoDetectorTreeKit();
647
648 SoSeparator* previewSeparator =
649 (SoSeparator*) detectorTreeKit->getPart("previewSeparator",TRUE);
650 previewSeparator->renderCaching = SoSeparator::OFF;
651
652 SoSeparator* fullSeparator =
653 (SoSeparator*) detectorTreeKit->getPart("fullSeparator", TRUE);
654 fullSeparator->renderCaching = SoSeparator::OFF;
655
656 if(fPreviewAndFull) detectorTreeKit->setPreviewAndFull();
657 else detectorTreeKit->setPreview(TRUE);
658
659 // Colour, etc., for SoDetectorTreeKit. Treated differently to
660 // othere SoNodes(?). Use fpVisAttribs stored away in
661 // PreAddSolid...
662 const G4VisAttributes* pApplicableVisAttribs =
664
665 // First find the color attributes...
666 const G4Colour& g4Col = pApplicableVisAttribs->GetColour ();
667 const double red = g4Col.GetRed ();
668 const double green = g4Col.GetGreen ();
669 const double blue = g4Col.GetBlue ();
670 double transparency = 1 - g4Col.GetAlpha();
671
672 // Drawing style...
673 G4ViewParameters::DrawingStyle drawing_style =
674 GetDrawingStyle(pApplicableVisAttribs);
675 switch (drawing_style) {
677 fModelingSolid = false;
678 break;
682 fModelingSolid = true;
683 break;
685 fModelingSolid = false;
686 break;
687 }
688
689 SoMaterial* material =
690 fStyleCache->getMaterial((float)red,
691 (float)green,
692 (float)blue,
693 (float)transparency);
694 detectorTreeKit->setPart("appearance.material",material);
695
696 SoLightModel* lightModel =
697 fModelingSolid ? fStyleCache->getLightModelPhong() :
698 fStyleCache->getLightModelBaseColor();
699 detectorTreeKit->setPart("appearance.lightModel",lightModel);
700
701 // Add the full separator to the dictionary; it is indexed by the
702 // address of the logical volume!
703 fSeparatorMap[pCurrentLV] = fullSeparator;
704
705 // Find out where to add this volume.
706 // If no mother can be found, it goes under root.
707 if (MotherVolume) {
708 if (fSeparatorMap.find(MotherVolume) != fSeparatorMap.end()) {
709 //printf("debug : PreAddSolid : mother %s found in map\n",
710 // MotherVolume->GetName().c_str());
711 fSeparatorMap[MotherVolume]->addChild(detectorTreeKit);
712 } else {
713 // Mother not previously encountered. Shouldn't happen, since
714 // G4PhysicalVolumeModel sends volumes as it encounters them,
715 // i.e., mothers before daughters, in its descent of the
716 // geometry tree. Error!
717 G4cout <<
718 "ERROR: G4OpenInventorSceneHandler::GeneratePrerequisites: Mother "
719 << ri->GetPhysicalVolume()->GetName()
720 << ':' << ri->GetCopyNo()
721 << " not previously encountered."
722 "\nShouldn't happen! Please report to visualization coordinator."
723 << G4endl;
724 // Continue anyway. Add to root of scene graph tree...
725 //printf("debug : PreAddSolid : mother %s not found in map !!!\n",
726 // MotherVolume->GetName().c_str());
727 fDetectorRoot->addChild(detectorTreeKit);
728 }
729 } else {
730 //printf("debug : PreAddSolid : has no mother\n");
731 fDetectorRoot->addChild(detectorTreeKit);
732 }
733
734 fCurrentSeparator = previewSeparator;
735
736 } else {
737 // This block of code is executed for leaf parts.
738
739 if (MotherVolume) {
740 if (fSeparatorMap.find(MotherVolume) != fSeparatorMap.end()) {
741 fCurrentSeparator = fSeparatorMap[MotherVolume];
742 } else {
743 // Mother not previously encountered. Shouldn't happen, since
744 // G4PhysicalVolumeModel sends volumes as it encounters them,
745 // i.e., mothers before daughters, in its descent of the
746 // geometry tree. Error!
747 G4cout << "ERROR: G4OpenInventorSceneHandler::PreAddSolid: Mother "
748 << ri->GetPhysicalVolume()->GetName()
749 << ':' << ri->GetCopyNo()
750 << " not previously encountered."
751 "\nShouldn't happen! Please report to visualization coordinator."
752 << G4endl;
753 // Continue anyway. Add to root of scene graph tree...
755 }
756 } else {
758 }
759 }
760
761 } else {
762 // Not from G4PhysicalVolumeModel, so add to root as leaf part...
763
766 } else {
768 }
769 }
770}
#define SoDetectorTreeKit
size_t GetNoDaughters() const
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
G4VPhysicalVolume * GetCurrentPV() const
virtual G4bool IsReplicated() const =0
virtual void setPreview(SbBool Flag)

References G4ViewParameters::cloud, fCurrentSeparator, fDetectorRoot, fModelingSolid, G4VSceneHandler::fpModel, fPreviewAndFull, G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4VSceneHandler::fReadyForTransients, fSeparatorMap, fStyleCache, fTransientRoot, G4cout, G4endl, G4Colour::GetAlpha(), G4VViewer::GetApplicableVisAttributes(), G4Colour::GetBlue(), G4VisAttributes::GetColour(), G4PhysicalVolumeModel::GetCurrentLV(), G4PhysicalVolumeModel::GetCurrentPV(), G4VSceneHandler::GetDrawingStyle(), G4PhysicalVolumeModel::GetDrawnPVPath(), G4Colour::GetGreen(), G4LogicalVolume::GetNoDaughters(), G4Colour::GetRed(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, G4VPhysicalVolume::IsReplicated(), eplot::material, SoDetectorTreeKit::setPreview(), SoDetectorTreeKit::setPreviewAndFull(), SoDetectorTreeKit, TRUE, and G4ViewParameters::wireframe.

Referenced by BeginPrimitives(), and PreAddSolid().

◆ GetAuxEdgeVisible()

G4bool G4VSceneHandler::GetAuxEdgeVisible ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1081 of file G4VSceneHandler.cc.

1081 {
1082 G4bool isAuxEdgeVisible = fpViewer->GetViewParameters().IsAuxEdgeVisible ();
1083 if (pVisAttribs -> IsForceAuxEdgeVisible()) {
1084 isAuxEdgeVisible = pVisAttribs->IsForcedAuxEdgeVisible();
1085 }
1086 return isAuxEdgeVisible;
1087}
G4bool IsAuxEdgeVisible() const
G4bool IsForcedAuxEdgeVisible() const

References G4VSceneHandler::fpViewer, G4VViewer::GetViewParameters(), G4ViewParameters::IsAuxEdgeVisible(), and G4VisAttributes::IsForcedAuxEdgeVisible().

Referenced by G4OpenGLSceneHandler::AddPrimitive(), and AddProperties().

◆ GetColor() [1/2]

const G4Colour & G4VSceneHandler::GetColor ( )
inherited

◆ GetColor() [2/2]

const G4Colour & G4VSceneHandler::GetColor ( const G4Visible )
inherited

◆ GetColour() [1/2]

const G4Colour & G4VSceneHandler::GetColour ( )
inherited

◆ GetColour() [2/2]

const G4Colour & G4VSceneHandler::GetColour ( const G4Visible visible)
inherited

◆ GetCurrentViewer()

G4VViewer * G4VSceneHandler::GetCurrentViewer ( ) const
inherited

◆ GetDrawingStyle()

G4ViewParameters::DrawingStyle G4VSceneHandler::GetDrawingStyle ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1021 of file G4VSceneHandler.cc.

1022 {
1023 // Drawing style is normally determined by the view parameters, but
1024 // it can be overriddden by the ForceDrawingStyle flag in the vis
1025 // attributes.
1027 const G4ViewParameters::DrawingStyle viewerStyle = vp.GetDrawingStyle();
1028 G4ViewParameters::DrawingStyle resultantStyle = viewerStyle;
1029 if (pVisAttribs -> IsForceDrawingStyle ()) {
1031 pVisAttribs -> GetForcedDrawingStyle ();
1032 // This is complicated because if hidden line and surface removal
1033 // has been requested we wish to preserve this sometimes.
1034 switch (forcedStyle) {
1036 switch (viewerStyle) {
1037 case (G4ViewParameters::hlr):
1038 resultantStyle = G4ViewParameters::hlhsr;
1039 break;
1041 resultantStyle = G4ViewParameters::hsr;
1042 break;
1044 resultantStyle = G4ViewParameters::hsr;
1045 break;
1047 case (G4ViewParameters::hsr):
1048 break;
1049 }
1050 break;
1052 resultantStyle = G4ViewParameters::cloud;
1053 break;
1055 default:
1056 // But if forced style is wireframe, do it, because one of its
1057 // main uses is in displaying the consituent solids of a Boolean
1058 // solid and their surfaces overlap with the resulting Booean
1059 // solid, making a mess if hlr is specified.
1060 resultantStyle = G4ViewParameters::wireframe;
1061 break;
1062 }
1063 }
1064 return resultantStyle;
1065}

References G4VisAttributes::cloud, G4ViewParameters::cloud, G4VSceneHandler::fpViewer, G4ViewParameters::GetDrawingStyle(), G4VViewer::GetViewParameters(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, G4VisAttributes::solid, G4VisAttributes::wireframe, and G4ViewParameters::wireframe.

Referenced by G4OpenGLSceneHandler::AddPrimitive(), G4Qt3DSceneHandler::AddPrimitive(), G4ToolsSGSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitiveTensorGlyph(), AddProperties(), GeneratePrerequisites(), and G4VSceneHandler::RequestPrimitives().

◆ GetExtent()

const G4VisExtent & G4VSceneHandler::GetExtent ( ) const
virtualinherited

Reimplemented from G4VGraphicsScene.

Definition at line 134 of file G4VSceneHandler.cc.

135{
136 if (fpScene) {
137 return fpScene->GetExtent();
138 } else {
139 static const G4VisExtent defaultExtent = G4VisExtent();
140 return defaultExtent;
141 }
142}

References G4VSceneHandler::fpScene, and G4Scene::GetExtent().

Referenced by G4VtkViewer::SetView().

◆ GetGraphicsSystem()

G4VGraphicsSystem * G4VSceneHandler::GetGraphicsSystem ( ) const
inherited

◆ GetLineWidth()

G4double G4VSceneHandler::GetLineWidth ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1012 of file G4VSceneHandler.cc.

1013{
1014 G4double lineWidth = pVisAttribs->GetLineWidth();
1015 if (lineWidth < 1.) lineWidth = 1.;
1016 lineWidth *= fpViewer -> GetViewParameters().GetGlobalLineWidthScale();
1017 if (lineWidth < 1.) lineWidth = 1.;
1018 return lineWidth;
1019}
G4double GetLineWidth() const

References G4VSceneHandler::fpViewer, and G4VisAttributes::GetLineWidth().

Referenced by G4OpenGLSceneHandler::AddPrimitive().

◆ GetMarkerDiameter()

G4double G4VSceneHandler::GetMarkerDiameter ( const G4VMarker ,
MarkerSizeType  
)
inherited

◆ GetMarkerRadius()

G4double G4VSceneHandler::GetMarkerRadius ( const G4VMarker ,
MarkerSizeType  
)
inherited

◆ GetMarkerSize()

G4double G4VSceneHandler::GetMarkerSize ( const G4VMarker marker,
G4VSceneHandler::MarkerSizeType markerSizeType 
)
inherited

Definition at line 1089 of file G4VSceneHandler.cc.

1092{
1093 G4bool userSpecified = marker.GetWorldSize() || marker.GetScreenSize();
1094 const G4VMarker& defaultMarker =
1095 fpViewer -> GetViewParameters().GetDefaultMarker();
1096 G4double size = userSpecified ?
1097 marker.GetWorldSize() : defaultMarker.GetWorldSize();
1098 if (size) {
1099 // Draw in world coordinates.
1100 markerSizeType = world;
1101 }
1102 else {
1103 size = userSpecified ?
1104 marker.GetScreenSize() : defaultMarker.GetScreenSize();
1105 // Draw in screen coordinates.
1106 markerSizeType = screen;
1107 }
1108 size *= fpViewer -> GetViewParameters().GetGlobalMarkerScale();
1109 if (markerSizeType == screen && size < 1.) size = 1.;
1110 return size;
1111}
G4double GetScreenSize() const
G4double GetWorldSize() const

References G4VSceneHandler::fpViewer, G4VMarker::GetScreenSize(), G4VMarker::GetWorldSize(), G4VSceneHandler::screen, and G4VSceneHandler::world.

Referenced by AddCircleSquare(), G4Qt3DSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), G4HepRepFileSceneHandler::AddPrimitive(), G4OpenGLSceneHandler::AddPrimitive(), AddPrimitive(), G4ToolsSGSceneHandler::AddPrimitive(), G4OpenGLQtViewer::DrawText(), G4OpenGLViewer::DrawText(), and G4OpenGLXViewer::DrawText().

◆ GetMarkForClearingTransientStore()

G4bool G4VSceneHandler::GetMarkForClearingTransientStore ( ) const
inherited

◆ GetModel()

G4VModel * G4VSceneHandler::GetModel ( ) const
inherited

◆ GetName()

const G4String & G4VSceneHandler::GetName ( ) const
inherited

◆ GetNoOfSides()

G4int G4VSceneHandler::GetNoOfSides ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1113 of file G4VSceneHandler.cc.

1114{
1115 // No. of sides (lines segments per circle) is normally determined
1116 // by the view parameters, but it can be overriddden by the
1117 // ForceLineSegmentsPerCircle in the vis attributes.
1118 G4int lineSegmentsPerCircle = fpViewer->GetViewParameters().GetNoOfSides();
1119 if (pVisAttribs) {
1120 if (pVisAttribs->IsForceLineSegmentsPerCircle())
1121 lineSegmentsPerCircle = pVisAttribs->GetForcedLineSegmentsPerCircle();
1122 if (lineSegmentsPerCircle < pVisAttribs->GetMinLineSegmentsPerCircle()) {
1123 lineSegmentsPerCircle = pVisAttribs->GetMinLineSegmentsPerCircle();
1124 G4cout <<
1125 "G4VSceneHandler::GetNoOfSides: attempt to set the"
1126 "\nnumber of line segments per circle < " << lineSegmentsPerCircle
1127 << "; forced to " << pVisAttribs->GetMinLineSegmentsPerCircle() << G4endl;
1128 }
1129 }
1130 return lineSegmentsPerCircle;
1131}
G4bool IsForceLineSegmentsPerCircle() const
G4int GetForcedLineSegmentsPerCircle() const
static G4int GetMinLineSegmentsPerCircle()

References G4VSceneHandler::fpViewer, G4cout, G4endl, G4VisAttributes::GetForcedLineSegmentsPerCircle(), G4VisAttributes::GetMinLineSegmentsPerCircle(), G4ViewParameters::GetNoOfSides(), G4VViewer::GetViewParameters(), and G4VisAttributes::IsForceLineSegmentsPerCircle().

Referenced by G4OpenGLSceneHandler::AddPrimitive(), and G4VSceneHandler::RequestPrimitives().

◆ GetNumberOfCloudPoints()

G4int G4VSceneHandler::GetNumberOfCloudPoints ( const G4VisAttributes pVisAttribs) const
inherited

Definition at line 1067 of file G4VSceneHandler.cc.

1068 {
1069 // Returns no of cloud points from current view parameters, unless the user
1070 // has forced through the vis attributes, thereby over-riding the
1071 // current view parameter.
1072 G4int numberOfCloudPoints = fpViewer->GetViewParameters().GetNumberOfCloudPoints();
1073 if (pVisAttribs -> IsForceDrawingStyle() &&
1074 pVisAttribs -> GetForcedDrawingStyle() == G4VisAttributes::cloud &&
1075 pVisAttribs -> GetForcedNumberOfCloudPoints() > 0) {
1076 numberOfCloudPoints = pVisAttribs -> GetForcedNumberOfCloudPoints();
1077 }
1078 return numberOfCloudPoints;
1079}

References G4VisAttributes::cloud, G4VSceneHandler::fpViewer, G4ViewParameters::GetNumberOfCloudPoints(), and G4VViewer::GetViewParameters().

Referenced by G4VSceneHandler::RequestPrimitives().

◆ GetObjectTransformation()

const G4Transform3D & G4VSceneHandler::GetObjectTransformation ( ) const
inherited

◆ GetScene()

G4Scene * G4VSceneHandler::GetScene ( ) const
inherited

◆ GetSceneHandlerId()

G4int G4VSceneHandler::GetSceneHandlerId ( ) const
inherited

◆ GetTextColor()

const G4Colour & G4VSceneHandler::GetTextColor ( const G4Text )
inherited

◆ GetTextColour()

const G4Colour & G4VSceneHandler::GetTextColour ( const G4Text text)
inherited

◆ GetTransientsDrawnThisEvent()

G4bool G4VSceneHandler::GetTransientsDrawnThisEvent ( ) const
inherited

◆ GetTransientsDrawnThisRun()

G4bool G4VSceneHandler::GetTransientsDrawnThisRun ( ) const
inherited

◆ GetViewCount()

G4int G4VSceneHandler::GetViewCount ( ) const
inherited

◆ GetViewerList()

const G4ViewerList & G4VSceneHandler::GetViewerList ( ) const
inherited

◆ IncrementViewCount()

G4int G4VSceneHandler::IncrementViewCount ( )
inherited

◆ IsReadyForTransients()

G4bool G4VSceneHandler::IsReadyForTransients ( ) const
inherited

◆ LoadAtts()

void G4VSceneHandler::LoadAtts ( const G4Visible visible,
G4AttHolder holder 
)
protectedinherited

Definition at line 934 of file G4VSceneHandler.cc.

935{
936 // Load G4Atts from G4VisAttributes, if any...
937 const G4VisAttributes* va = visible.GetVisAttributes();
938 if (va) {
939 const std::map<G4String,G4AttDef>* vaDefs =
940 va->GetAttDefs();
941 if (vaDefs) {
942 holder->AddAtts(visible.GetVisAttributes()->CreateAttValues(), vaDefs);
943 }
944 }
945
946 G4PhysicalVolumeModel* pPVModel =
947 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
948 if (pPVModel) {
949 // Load G4Atts from G4PhysicalVolumeModel...
950 const std::map<G4String,G4AttDef>* pvDefs = pPVModel->GetAttDefs();
951 if (pvDefs) {
952 holder->AddAtts(pPVModel->CreateCurrentAttValues(), pvDefs);
953 }
954 }
955
956 G4TrajectoriesModel* trajModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
957 if (trajModel) {
958 // Load G4Atts from trajectory model...
959 const std::map<G4String,G4AttDef>* trajModelDefs = trajModel->GetAttDefs();
960 if (trajModelDefs) {
961 holder->AddAtts(trajModel->CreateCurrentAttValues(), trajModelDefs);
962 }
963 // Load G4Atts from trajectory...
964 const G4VTrajectory* traj = trajModel->GetCurrentTrajectory();
965 if (traj) {
966 const std::map<G4String,G4AttDef>* trajDefs = traj->GetAttDefs();
967 if (trajDefs) {
968 holder->AddAtts(traj->CreateAttValues(), trajDefs);
969 }
970 G4int nPoints = traj->GetPointEntries();
971 for (G4int i = 0; i < nPoints; ++i) {
972 G4VTrajectoryPoint* trajPoint = traj->GetPoint(i);
973 if (trajPoint) {
974 const std::map<G4String,G4AttDef>* pointDefs = trajPoint->GetAttDefs();
975 if (pointDefs) {
976 holder->AddAtts(trajPoint->CreateAttValues(), pointDefs);
977 }
978 }
979 }
980 }
981 }
982
983 G4HitsModel* hitsModel = dynamic_cast<G4HitsModel*>(fpModel);
984 if (hitsModel) {
985 // Load G4Atts from hit...
986 const G4VHit* hit = hitsModel->GetCurrentHit();
987 const std::map<G4String,G4AttDef>* hitsDefs = hit->GetAttDefs();
988 if (hitsDefs) {
989 holder->AddAtts(hit->CreateAttValues(), hitsDefs);
990 }
991 }
992}
void AddAtts(const std::vector< G4AttValue > *values, const std::map< G4String, G4AttDef > *defs)
Definition: G4AttHolder.hh:64
const G4VHit * GetCurrentHit() const
Definition: G4HitsModel.hh:57
std::vector< G4AttValue > * CreateCurrentAttValues() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
const G4VTrajectory * GetCurrentTrajectory() const
std::vector< G4AttValue > * CreateCurrentAttValues() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition: G4VHit.hh:64
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
Definition: G4VHit.hh:58
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
virtual G4int GetPointEntries() const =0
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::vector< G4AttValue > * CreateAttValues() const

References G4AttHolder::AddAtts(), G4VHit::CreateAttValues(), G4VisAttributes::CreateAttValues(), G4VTrajectory::CreateAttValues(), G4VTrajectoryPoint::CreateAttValues(), G4PhysicalVolumeModel::CreateCurrentAttValues(), G4TrajectoriesModel::CreateCurrentAttValues(), G4VSceneHandler::fpModel, G4VHit::GetAttDefs(), G4VisAttributes::GetAttDefs(), G4VTrajectory::GetAttDefs(), G4VTrajectoryPoint::GetAttDefs(), G4PhysicalVolumeModel::GetAttDefs(), G4TrajectoriesModel::GetAttDefs(), G4HitsModel::GetCurrentHit(), G4TrajectoriesModel::GetCurrentTrajectory(), G4VTrajectory::GetPoint(), G4VTrajectory::GetPointEntries(), and G4Visible::GetVisAttributes().

Referenced by AddCircleSquare(), AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), and G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal().

◆ PostAddSolid()

void G4VSceneHandler::PostAddSolid ( )
virtualinherited

◆ PreAddSolid()

void G4OpenInventorSceneHandler::PreAddSolid ( const G4Transform3D objectTransformation,
const G4VisAttributes visAttribs 
)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 152 of file G4OpenInventorSceneHandler.cc.

155{
156 G4VSceneHandler::PreAddSolid (objectTransformation, visAttribs);
157 // Stores arguments away for future use, e.g., AddPrimitives.
158
160}

References GeneratePrerequisites(), and G4VSceneHandler::PreAddSolid().

◆ ProcessScene()

void G4VSceneHandler::ProcessScene ( )
protectedvirtualinherited

Reimplemented in G4OpenGLSceneHandler.

Definition at line 612 of file G4VSceneHandler.cc.

613{
614 // Assumes graphics database store has already been cleared if
615 // relevant for the particular scene handler.
616
617 if(!fpScene)
618 return;
619
621 {
622 G4Exception("G4VSceneHandler::ProcessScene", "visman0106", JustWarning,
623 "The scene has no extent.");
624 }
625
627
628 if(!visManager->GetConcreteInstance())
629 return;
630
631 G4VisManager::Verbosity verbosity = visManager->GetVerbosity();
632
633 fReadyForTransients = false;
634
635 // Reset fMarkForClearingTransientStore. (Leaving
636 // fMarkForClearingTransientStore true causes problems with
637 // recomputing transients below.) Restore it again at end...
638 G4bool tmpMarkForClearingTransientStore = fMarkForClearingTransientStore;
640
641 // Traverse geometry tree and send drawing primitives to window(s).
642
643 const std::vector<G4Scene::Model>& runDurationModelList =
645
646 if(runDurationModelList.size())
647 {
648 if(verbosity >= G4VisManager::confirmations)
649 {
650 G4cout << "Traversing scene data..." << G4endl;
651 }
652
654
655 // Create modeling parameters from view parameters...
657
658 for(size_t i = 0; i < runDurationModelList.size(); i++)
659 {
660 if(runDurationModelList[i].fActive)
661 {
662 fpModel = runDurationModelList[i].fpModel;
665 // To see the extents of each model represented as wireframe boxes,
666 // uncomment the next line and DrawExtent in namespace above
667 // DrawExtent(fpModel);
669 }
670 }
671
672 fpModel = 0;
673 delete pMP;
674
675 EndModeling();
676 }
677
678 fReadyForTransients = true;
679
680 // Refresh event from end-of-event model list.
681 // Allow only in Idle or GeomClosed state...
683 G4ApplicationState state = stateManager->GetCurrentState();
684 if(state == G4State_Idle || state == G4State_GeomClosed)
685 {
686 visManager->SetEventRefreshing(true);
687
688 if(visManager->GetRequestedEvent())
689 {
690 DrawEvent(visManager->GetRequestedEvent());
691 }
692 else
693 {
695 if(runManager)
696 {
697 const G4Run* run = runManager->GetCurrentRun();
698 const std::vector<const G4Event*>* events =
699 run ? run->GetEventVector() : 0;
700 size_t nKeptEvents = 0;
701 if(events)
702 nKeptEvents = events->size();
703 if(nKeptEvents)
704 {
706 {
707 if(verbosity >= G4VisManager::confirmations)
708 {
709 G4cout << "Refreshing event..." << G4endl;
710 }
711 const G4Event* event = 0;
712 if(events && events->size())
713 event = events->back();
714 if(event)
715 DrawEvent(event);
716 }
717 else
718 { // Accumulating events.
719
720 if(verbosity >= G4VisManager::confirmations)
721 {
722 G4cout << "Refreshing events in run..." << G4endl;
723 }
724 for(const auto& event : *events)
725 {
726 if(event)
727 DrawEvent(event);
728 }
729
731 {
732 if(verbosity >= G4VisManager::warnings)
733 {
734 G4cout << "WARNING: Cannot refresh events accumulated over more"
735 "\n than one runs. Refreshed just the last run."
736 << G4endl;
737 }
738 }
739 }
740 }
741 }
742 }
743 visManager->SetEventRefreshing(false);
744 }
745
746 // Refresh end-of-run model list.
747 // Allow only in Idle or GeomClosed state...
748 if(state == G4State_Idle || state == G4State_GeomClosed)
749 {
751 }
752
753 fMarkForClearingTransientStore = tmpMarkForClearingTransientStore;
754}
G4ApplicationState
@ G4State_Idle
@ G4State_GeomClosed
static G4RunManager * GetMasterRunManager()
const G4Run * GetCurrentRun() const
Definition: G4Run.hh:49
const std::vector< Model > & GetRunDurationModelList() const
G4bool GetRefreshAtEndOfEvent() const
G4bool GetRefreshAtEndOfRun() const
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
void SetModelingParameters(const G4ModelingParameters *)
virtual void DescribeYourselfTo(G4VGraphicsScene &)=0
virtual void BeginModeling()
void DrawEvent(const G4Event *)
virtual void EndModeling()
G4bool fMarkForClearingTransientStore
static G4VVisManager * GetConcreteInstance()
static const G4VisExtent & GetNullExtent()
Definition: G4VisExtent.cc:60
void SetEventRefreshing(G4bool)
const G4Event * GetRequestedEvent() const
static G4VisManager * GetInstance()
Definition: run.py:1

References G4VSceneHandler::BeginModeling(), G4VisManager::confirmations, G4VSceneHandler::CreateModelingParameters(), G4VModel::DescribeYourselfTo(), G4VSceneHandler::DrawEndOfRunModels(), G4VSceneHandler::DrawEvent(), G4VSceneHandler::EndModeling(), G4VSceneHandler::fMarkForClearingTransientStore, G4VSceneHandler::fpModel, G4VSceneHandler::fpScene, G4VSceneHandler::fReadyForTransients, G4cout, G4endl, G4Exception(), G4State_GeomClosed, G4State_Idle, G4VVisManager::GetConcreteInstance(), G4RunManager::GetCurrentRun(), G4StateManager::GetCurrentState(), G4Scene::GetExtent(), G4VisManager::GetInstance(), G4RunManagerFactory::GetMasterRunManager(), G4VisExtent::GetNullExtent(), G4Scene::GetRefreshAtEndOfEvent(), G4Scene::GetRefreshAtEndOfRun(), G4VisManager::GetRequestedEvent(), G4Scene::GetRunDurationModelList(), G4StateManager::GetStateManager(), G4VisManager::GetVerbosity(), JustWarning, G4VisManager::SetEventRefreshing(), G4VModel::SetModelingParameters(), and G4VisManager::warnings.

Referenced by G4OpenGLSceneHandler::ProcessScene(), and G4VViewer::ProcessView().

◆ RemoveViewerFromList()

void G4VSceneHandler::RemoveViewerFromList ( G4VViewer pView)
inherited

Definition at line 493 of file G4VSceneHandler.cc.

493 {
494 fViewerList.remove(pViewer); // Does nothing if already removed
495 // And reset current viewer
496 auto visManager = G4VisManager::GetInstance();
497 visManager->SetCurrentViewer(nullptr);
498}
void remove(G4VViewer *)
Definition: G4ViewerList.cc:30

References G4VSceneHandler::fViewerList, G4VisManager::GetInstance(), and G4ViewerList::remove().

Referenced by G4VViewer::~G4VViewer().

◆ RequestPrimitives()

void G4VSceneHandler::RequestPrimitives ( const G4VSolid solid)
protectedvirtualinherited

Reimplemented in G4ASCIITreeSceneHandler, and G4RayTracerSceneHandler.

Definition at line 516 of file G4VSceneHandler.cc.

517{
520
521 switch (style) {
522 default:
527 {
528 // Use polyhedral representation
530 G4Polyhedron* pPolyhedron = solid.GetPolyhedron ();
532 if (pPolyhedron) {
533 pPolyhedron -> SetVisAttributes (fpVisAttribs);
535 AddPrimitive (*pPolyhedron);
536 EndPrimitives ();
537 break;
538 } else { // Print warnings and drop through to cloud
540 static std::set<const G4VSolid*> problematicSolids;
541 if (verbosity >= G4VisManager::errors &&
542 problematicSolids.find(&solid) == problematicSolids.end()) {
543 problematicSolids.insert(&solid);
544 G4cerr <<
545 "ERROR: G4VSceneHandler::RequestPrimitives"
546 "\n Polyhedron not available for " << solid.GetName ();
547 G4PhysicalVolumeModel* pPVModel = dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
548 if (pPVModel) {
549 G4cerr << "\n Touchable path: " << pPVModel->GetFullPVPath();
550 }
551 static G4bool explanation = false;
552 if (!explanation) {
553 explanation = true;
554 G4cerr <<
555 "\n This means it cannot be visualized in the usual way on most systems."
556 "\n 1) The solid may not have implemented the CreatePolyhedron method."
557 "\n 2) For Boolean solids, the BooleanProcessor, which attempts to create"
558 "\n the resultant polyhedron, may have failed."
559 "\n Try RayTracer. It uses Geant4's tracking algorithms instead.";
560 }
561 G4cerr << "\n Drawing solid with cloud of points.";
562 G4cerr << G4endl;
563 }
564 }
565 }
566 [[fallthrough]];
567
569 {
570 // Form solid out of cloud of dots on surface of solid
571 G4Polymarker dots;
572 // Note: OpenGL has a fast implementation of polymarker so it's better
573 // to build a polymarker rather than add a succession of circles.
574 // And anyway, in Qt, in the latter case each circle would be a scene-tree
575 // entry, something we would want to avoid.
578 dots.SetSize(G4VMarker::screen,1.);
579 G4int numberOfCloudPoints = GetNumberOfCloudPoints(fpVisAttribs);
580 if (numberOfCloudPoints <= 0) numberOfCloudPoints = vp.GetNumberOfCloudPoints();
581 for (G4int i = 0; i < numberOfCloudPoints; ++i) {
583 dots.push_back(p);
584 }
586 AddPrimitive(dots);
587 EndPrimitives ();
588 break;
589 }
590 }
591}
const std::vector< G4PhysicalVolumeNodeID > & GetFullPVPath() const
void SetMarkerType(MarkerType)
void SetSize(SizeType, G4double)
Definition: G4VMarker.cc:94
G4int GetNumberOfCloudPoints(const G4VisAttributes *) const
G4int GetNoOfSides(const G4VisAttributes *)
virtual void EndPrimitives()
virtual void AddPrimitive(const G4Polyline &)=0
G4String GetName() const
virtual G4ThreeVector GetPointOnSurface() const
Definition: G4VSolid.cc:152
virtual G4Polyhedron * GetPolyhedron() const
Definition: G4VSolid.cc:705
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:96
static void SetNumberOfRotationSteps(G4int n)
static void ResetNumberOfRotationSteps()

References G4VSceneHandler::AddPrimitive(), G4VSceneHandler::BeginPrimitives(), G4ViewParameters::cloud, G4Polymarker::dots, G4VSceneHandler::EndPrimitives(), G4VisManager::errors, G4VSceneHandler::fObjectTransformation, G4VSceneHandler::fpModel, G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4cerr, G4endl, G4VSceneHandler::GetDrawingStyle(), G4PhysicalVolumeModel::GetFullPVPath(), G4VSolid::GetName(), G4VSceneHandler::GetNoOfSides(), G4ViewParameters::GetNumberOfCloudPoints(), G4VSceneHandler::GetNumberOfCloudPoints(), G4VSolid::GetPointOnSurface(), G4VSolid::GetPolyhedron(), G4VisManager::GetVerbosity(), G4VViewer::GetViewParameters(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, HepPolyhedron::ResetNumberOfRotationSteps(), G4VMarker::screen, G4Polymarker::SetMarkerType(), HepPolyhedron::SetNumberOfRotationSteps(), G4VMarker::SetSize(), G4Visible::SetVisAttributes(), and G4ViewParameters::wireframe.

Referenced by G4VSceneHandler::AddSolidT(), and G4VSceneHandler::AddSolidWithAuxiliaryEdges().

◆ SetCurrentViewer()

void G4VSceneHandler::SetCurrentViewer ( G4VViewer )
inherited

◆ SetMarkForClearingTransientStore()

void G4VSceneHandler::SetMarkForClearingTransientStore ( G4bool  )
inherited

◆ SetModel()

void G4VSceneHandler::SetModel ( G4VModel )
inherited

◆ SetName()

void G4VSceneHandler::SetName ( const G4String )
inherited

◆ SetObjectTransformation()

void G4VSceneHandler::SetObjectTransformation ( const G4Transform3D )
inherited

◆ SetScene()

void G4VSceneHandler::SetScene ( G4Scene pScene)
virtualinherited

Reimplemented in G4OpenGLStoredQtSceneHandler.

Definition at line 507 of file G4VSceneHandler.cc.

507 {
508 fpScene = pScene;
509 // Notify all viewers that a kernel visit is required.
511 for (i = fViewerList.begin(); i != fViewerList.end(); i++) {
512 (*i) -> SetNeedKernelVisit (true);
513 }
514}
std::vector< G4VViewer * >::iterator G4ViewerListIterator
Definition: G4ViewerList.hh:42

References G4VSceneHandler::fpScene, and G4VSceneHandler::fViewerList.

Referenced by G4OpenGLStoredQtSceneHandler::SetScene().

◆ SetTransientsDrawnThisEvent()

void G4VSceneHandler::SetTransientsDrawnThisEvent ( G4bool  )
inherited

◆ SetTransientsDrawnThisRun()

void G4VSceneHandler::SetTransientsDrawnThisRun ( G4bool  )
inherited

◆ SetViewerList()

G4ViewerList & G4VSceneHandler::SetViewerList ( )
inherited

Friends And Related Function Documentation

◆ G4OpenInventorViewer

friend class G4OpenInventorViewer
friend

Definition at line 51 of file G4OpenInventorSceneHandler.hh.

Field Documentation

◆ fCurrentSeparator

SoSeparator* G4OpenInventorSceneHandler::fCurrentSeparator
private

◆ fDetectorRoot

SoSeparator* G4OpenInventorSceneHandler::fDetectorRoot
private

◆ fIdentityTransformation

const G4Transform3D G4VSceneHandler::fIdentityTransformation
protectedinherited

Definition at line 364 of file G4VSceneHandler.hh.

◆ fMarkForClearingTransientStore

G4bool G4VSceneHandler::fMarkForClearingTransientStore
protectedinherited

Definition at line 352 of file G4VSceneHandler.hh.

Referenced by G4VSceneHandler::ProcessScene().

◆ fModelingSolid

G4bool G4OpenInventorSceneHandler::fModelingSolid
private

◆ fName

G4String G4VSceneHandler::fName
protectedinherited

Definition at line 347 of file G4VSceneHandler.hh.

◆ fNestingDepth

G4int G4VSceneHandler::fNestingDepth
protectedinherited

◆ fObjectTransformation

G4Transform3D G4VSceneHandler::fObjectTransformation
protectedinherited

◆ fpModel

G4VModel* G4VSceneHandler::fpModel
protectedinherited

◆ fPreviewAndFull

bool G4OpenInventorSceneHandler::fPreviewAndFull
private

◆ fProcessing2D

G4bool G4VSceneHandler::fProcessing2D
protectedinherited

◆ fProcessingSolid

G4bool G4VSceneHandler::fProcessingSolid
protectedinherited

◆ fpScene

G4Scene* G4VSceneHandler::fpScene
protectedinherited

◆ fpViewer

G4VViewer* G4VSceneHandler::fpViewer
protectedinherited

Definition at line 350 of file G4VSceneHandler.hh.

Referenced by AddCircleSquare(), G4VtkSceneHandler::AddCompound(), G4HepRepFileSceneHandler::AddHepRepInstance(), G4ToolsSGSceneHandler::AddPrimitive(), G4OpenGLSceneHandler::AddPrimitive(), G4Qt3DSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(), G4VtkSceneHandler::AddPrimitiveTensorGlyph(), AddProperties(), G4HepRepFileSceneHandler::AddSolid(), G4VSceneHandler::AddSolidT(), G4VSceneHandler::AddSolidWithAuxiliaryEdges(), AddTransform(), G4OpenGLImmediateSceneHandler::BeginPrimitives2D(), G4OpenGLStoredQtSceneHandler::ClearStore(), G4GMocrenFileSceneHandler::ClearTransientStore(), G4HepRepFileSceneHandler::ClearTransientStore(), G4OpenGLImmediateSceneHandler::ClearTransientStore(), G4OpenGLStoredQtSceneHandler::ClearTransientStore(), G4OpenGLStoredSceneHandler::ClearTransientStore(), G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::CreateSectionSolid(), G4OpenGLStoredSceneHandler::EndModeling(), G4OpenGLStoredQtSceneHandler::ExtraPOProcessing(), GeneratePrerequisites(), G4VSceneHandler::GetAuxEdgeVisible(), G4VSceneHandler::GetColour(), G4VSceneHandler::GetDrawingStyle(), G4VSceneHandler::GetLineWidth(), G4VSceneHandler::GetMarkerSize(), G4VSceneHandler::GetNoOfSides(), G4VSceneHandler::GetNumberOfCloudPoints(), G4VSceneHandler::GetTextColour(), G4GMocrenFileSceneHandler::IsVisible(), G4VSceneHandler::RequestPrimitives(), and G4OpenGLStoredQtSceneHandler::SetScene().

◆ fpVisAttribs

const G4VisAttributes* G4VSceneHandler::fpVisAttribs
protectedinherited

◆ fReadyForTransients

G4bool G4VSceneHandler::fReadyForTransients
protectedinherited

◆ fReducedWireFrame

G4bool G4OpenInventorSceneHandler::fReducedWireFrame
private

Definition at line 94 of file G4OpenInventorSceneHandler.hh.

Referenced by AddPrimitive(), and AddProperties().

◆ fRoot

SoSeparator* G4OpenInventorSceneHandler::fRoot
private

◆ fSceneHandlerId

const G4int G4VSceneHandler::fSceneHandlerId
protectedinherited

Definition at line 346 of file G4VSceneHandler.hh.

◆ fSceneIdCount

G4int G4OpenInventorSceneHandler::fSceneIdCount = 0
staticprivate

Definition at line 80 of file G4OpenInventorSceneHandler.hh.

◆ fSeparatorMap

std::map<G4LogicalVolume*, SoSeparator*, std::less <G4LogicalVolume*> > G4OpenInventorSceneHandler::fSeparatorMap
private

Definition at line 88 of file G4OpenInventorSceneHandler.hh.

Referenced by ClearStore(), and GeneratePrerequisites().

◆ fStyleCache

Geant4_SoStyleCache* G4OpenInventorSceneHandler::fStyleCache
private

◆ fSystem

G4VGraphicsSystem& G4VSceneHandler::fSystem
protectedinherited

Definition at line 345 of file G4VSceneHandler.hh.

Referenced by G4VSceneHandler::AddPrimitive().

◆ fTransientRoot

SoSeparator* G4OpenInventorSceneHandler::fTransientRoot
private

◆ fTransientsDrawnThisEvent

G4bool G4VSceneHandler::fTransientsDrawnThisEvent
protectedinherited

◆ fTransientsDrawnThisRun

G4bool G4VSceneHandler::fTransientsDrawnThisRun
protectedinherited

◆ fViewCount

G4int G4VSceneHandler::fViewCount
protectedinherited

Definition at line 348 of file G4VSceneHandler.hh.

◆ fViewerList

G4ViewerList G4VSceneHandler::fViewerList
protectedinherited

The documentation for this class was generated from the following files: