Geant4-11
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends
G4GMocrenFileSceneHandler Class Reference

#include <G4GMocrenFileSceneHandler.hh>

Inheritance diagram for G4GMocrenFileSceneHandler:
G4VSceneHandler G4VGraphicsScene

Data Structures

class  Detector
 
class  Index3D
 

Public Types

enum  MarkerSizeType { world , screen }
 

Public Member Functions

virtual void AddCompound (const G4Mesh &)
 
virtual void AddCompound (const G4THitsMap< G4double > &)
 
void AddCompound (const G4THitsMap< G4double > &hits)
 
virtual void AddCompound (const G4THitsMap< G4StatDouble > &)
 
void AddCompound (const G4THitsMap< G4StatDouble > &hits)
 
virtual void AddCompound (const G4VDigi &)
 
void AddCompound (const G4VDigi &hit)
 
virtual void AddCompound (const G4VHit &)
 
void AddCompound (const G4VHit &hit)
 
virtual void AddCompound (const G4VTrajectory &)
 
void AddCompound (const G4VTrajectory &traj)
 
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 G4Square &)
 
virtual void AddPrimitive (const G4Square &)=0
 
void AddPrimitive (const G4Text &)
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddSolid (const G4Box &)
 
void AddSolid (const G4Box &box)
 
virtual void AddSolid (const G4Cons &)
 
void AddSolid (const G4Cons &cons)
 
virtual void AddSolid (const G4Ellipsoid &)
 
virtual void AddSolid (const G4Orb &)
 
virtual void AddSolid (const G4Para &)
 
void AddSolid (const G4Para &para)
 
virtual void AddSolid (const G4Polycone &)
 
virtual void AddSolid (const G4Polyhedra &)
 
virtual void AddSolid (const G4Sphere &)
 
void AddSolid (const G4Sphere &sphere)
 
virtual void AddSolid (const G4TessellatedSolid &)
 
virtual void AddSolid (const G4Torus &)
 
void AddSolid (const G4Torus &torus)
 
virtual void AddSolid (const G4Trap &)
 
void AddSolid (const G4Trap &trap)
 
virtual void AddSolid (const G4Trd &)
 
void AddSolid (const G4Trd &trd)
 
virtual void AddSolid (const G4Tubs &)
 
void AddSolid (const G4Tubs &tubs)
 
virtual void AddSolid (const G4VSolid &)
 
void AddSolid (const G4VSolid &solid)
 
template<class T >
void AddSolidT (const T &solid)
 
template<class T >
void AddSolidWithAuxiliaryEdges (const T &solid)
 
void AddViewerToList (G4VViewer *pView)
 
virtual void BeginModeling ()
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation)
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation=G4Transform3D())
 
void BeginSavingGdd (void)
 
virtual void ClearStore ()
 
void ClearTransientStore ()
 
G4ModelingParametersCreateModelingParameters ()
 
void DrawEndOfRunModels ()
 
void DrawEvent (const G4Event *)
 
virtual void EndModeling ()
 
virtual void EndPrimitives ()
 
virtual void EndPrimitives2D ()
 
void EndSavingGdd (void)
 
 G4GMocrenFileSceneHandler (G4GMocrenFile &system, G4GMocrenMessenger &messenger, 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
 
const char * GetGddFileName ()
 
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
 
G4GMocrenFileGetSystem ()
 
const G4ColourGetTextColor (const G4Text &)
 
const G4ColourGetTextColour (const G4Text &)
 
G4bool GetTransientsDrawnThisEvent () const
 
G4bool GetTransientsDrawnThisRun () const
 
G4int GetViewCount () const
 
const G4ViewerListGetViewerList () const
 
void GFBeginModeling ()
 
void GFEndModeling ()
 
G4bool GFIsInModeling ()
 
G4int IncrementViewCount ()
 
G4bool IsReadyForTransients () const
 
G4bool IsSavingGdd (void)
 
virtual void PostAddSolid ()
 
virtual void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void RemoveViewerFromList (G4VViewer *pView)
 
void SetCurrentViewer (G4VViewer *)
 
void SetGddFileName ()
 
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 ~G4GMocrenFileSceneHandler ()
 

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 Member Functions

void AddDetector (const G4VSolid &solid)
 
void ExtractDetector ()
 
void GetNestedVolumeIndex (G4int, G4int[3])
 
void InitializeParameters ()
 
G4bool IsVisible ()
 

Private Attributes

G4bool kbModelingTrajectory
 
G4bool kbSetModalityVoxelSize
 
std::vector< DetectorkDetectors
 
G4bool kFlagInModeling
 
G4int kFlagParameterization
 
G4bool kFlagProcessedInteractiveScorer
 
G4bool kFlagSaving_g4_gdd
 
std::ofstream kGddDest
 
char kGddDestDir [256]
 
char kGddFileName [256]
 
G4GMocrenIOkgMocrenIO
 
G4int kMaxFileNum
 
G4GMocrenMessengerkMessenger
 
std::map< G4int, float > kModality
 
G4int kModalitySize [3]
 
std::map< G4String, std::map< Index3D, G4double > > kNestedHitsList
 
std::map< Index3D, float > kNestedModality
 
G4int kNestedVolumeDimension [3]
 
G4int kNestedVolumeDirAxis [3]
 
std::vector< G4StringkNestedVolumeNames
 
G4GMocrenFilekSystem
 
G4ThreeVector kVolumeSize
 
G4Transform3D kVolumeTrans3D
 
G4ThreeVector kVoxelDimension
 

Static Private Attributes

static G4int kSceneIdCount = 0
 

Friends

class G4GMocrenFileViewer
 

Detailed Description

Definition at line 53 of file G4GMocrenFileSceneHandler.hh.

Member Enumeration Documentation

◆ MarkerSizeType

Enumerator
world 
screen 

Definition at line 58 of file G4VSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4GMocrenFileSceneHandler()

G4GMocrenFileSceneHandler::G4GMocrenFileSceneHandler ( G4GMocrenFile system,
G4GMocrenMessenger messenger,
const G4String name = "" 
)

Definition at line 121 of file G4GMocrenFileSceneHandler.cc.

124 : G4VSceneHandler(system, kSceneIdCount++, name),
125 kSystem(system),
126 kMessenger(messenger),
127 kgMocrenIO(new G4GMocrenIO()),
130// kGddDest(0),
131 kFlagInModeling(false),
132 kFlagSaving_g4_gdd(false),
135
136 // g4.gdd filename and its directory
137 if(std::getenv("G4GMocrenFile_DEST_DIR") == NULL) {
138 kGddDestDir[0] = '\0';
139 //std::strcpy(kGddDestDir , ""); // output dir
140 //std::strcpy(kGddFileName, DEFAULT_GDD_FILE_NAME); // filename
142 std::strlen(DEFAULT_GDD_FILE_NAME)+1); // filename
143 } else {
144 const char * env = std::getenv("G4GMocrenFile_DEST_DIR");
145 int len = std::strlen(env);
146 if(len > 256) {
147 G4Exception("G4GMocrenFileSceneHandler::G4GMocrenFileSceneHandler(*)",
148 "gMocren1000", FatalException,
149 "Invalid length of string set in G4GMocrenFile_DEST_DIR");
150 }
151 std::strncpy(kGddDestDir, env, len+1); // output dir
153 std::strlen(DEFAULT_GDD_FILE_NAME)+1); // filename
154 }
155
156 // maximum number of g4.gdd files in the dest directory
157 kMaxFileNum = FR_MAX_FILE_NUM ; // initialization
158 if ( std::getenv( "G4GMocrenFile_MAX_FILE_NUM" ) != NULL ) {
159 char * pcFileNum = std::getenv("G4GMocrenFile_MAX_FILE_NUM");
160 char c10FileNum[10];
161 std::strncpy(c10FileNum, pcFileNum, 9);
162 c10FileNum[9] = '\0';
163 kMaxFileNum = std::atoi(c10FileNum);
164
165 } else {
167 }
168 if( kMaxFileNum < 1 ) { kMaxFileNum = 1 ; }
169
171
172}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
const G4int FR_MAX_FILE_NUM
const char DEFAULT_GDD_FILE_NAME[]
G4VSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")
const char * name(G4int ptype)

References DEFAULT_GDD_FILE_NAME, FatalException, FR_MAX_FILE_NUM, G4Exception(), InitializeParameters(), kGddDestDir, kGddFileName, and kMaxFileNum.

◆ ~G4GMocrenFileSceneHandler()

G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler ( )
virtual

Definition at line 176 of file G4GMocrenFileSceneHandler.cc.

177{
179 G4cout << "***** ~G4GMocrenFileSceneHandler" << G4endl;
180
181 if(kGddDest) {
182 //----- End of modeling
183 // close g4.gdd
185 }
186 if(kgMocrenIO != NULL) delete kgMocrenIO;
187
188}
const G4bool GFDEBUG
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()

References G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFDEBUG, GFEndModeling(), kGddDest, and kgMocrenIO.

Member Function Documentation

◆ AddCompound() [1/11]

void G4VSceneHandler::AddCompound ( const G4Mesh mesh)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 132 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}
@ JustWarning
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)

◆ AddCompound() [2/11]

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

Reimplemented from G4VSceneHandler.

Definition at line 130 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}
bool G4bool
Definition: G4Types.hh:86
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

◆ AddCompound() [3/11]

void G4GMocrenFileSceneHandler::AddCompound ( const G4THitsMap< G4double > &  hits)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1742 of file G4GMocrenFileSceneHandler.cc.

1742 {
1743 if(GFDEBUG_HIT)
1744 G4cout << " ::AddCompound(const std::map<G4int, G4double*> &) >>>>>>>>> " << G4endl;
1745
1746
1747 std::vector<G4String> hitScorerNames = kMessenger.getHitScorerNames();
1748 G4int nhitname = (G4int)hitScorerNames.size();
1749 G4String scorername = static_cast<G4VHitsCollection>(hits).GetName();
1750
1751 //-- --//
1752 /*
1753 std::vector<G4String> hitScorerNames = kMessenger.getHitScorerNames();
1754 if(GFDEBUG_HIT) {
1755 std::vector<G4String>::iterator itr = hitScorerNames.begin();
1756 for(; itr != hitScorerNames.end(); itr++)
1757 G4cout << " PS name : " << *itr << G4endl;
1758 }
1759 */
1760
1761 { // Scope bracket to avoid compiler messages about shadowing (JA).
1762 //for(G4int i = 0; i < nhitname; i++) { // this selection trusts
1763 //if(scorername == hitScorerNames[i]) { // thea command /vis/scene/add/psHits hit_name.
1764
1765 G4int idx[3];
1766 std::map<G4int, G4double*> * map = hits.GetMap();
1767 std::map<G4int, G4double*>::const_iterator itr = map->begin();
1768 for(; itr != map->end(); itr++) {
1769 GetNestedVolumeIndex(itr->first, idx);
1770 Index3D id(idx[0], idx[1], idx[2]);
1771
1772 std::map<G4String, std::map<Index3D, G4double> >::iterator nestedHitsListItr;
1773 nestedHitsListItr = kNestedHitsList.find(scorername);
1774 if(nestedHitsListItr != kNestedHitsList.end()) {
1775 nestedHitsListItr->second[id] = *(itr->second);
1776 } else {
1777 std::map<Index3D, G4double> hit;
1778 hit.insert(std::map<Index3D, G4double>::value_type(id, *(itr->second)));
1779 kNestedHitsList[scorername] = hit;
1780 }
1781 }
1782
1783 //break;
1784 //}
1785 //}
1786 }
1787
1788 if(GFDEBUG_HIT) {
1789 G4String meshname = static_cast<G4VHitsCollection>(hits).GetSDname();
1790 G4cout << " >>>>> " << meshname << " : " << scorername << G4endl;
1791
1792 for(G4int i = 0; i < nhitname; i++)
1793 if(scorername == hitScorerNames[i])
1794 G4cout << " !!!! Hit scorer !!!! " << scorername << G4endl;
1795
1796 G4cout << " dimension: "
1797 << kNestedVolumeDimension[0] << " x "
1798 << kNestedVolumeDimension[1] << " x "
1800
1801 G4int id[3];
1802 std::map<G4int, G4double*> * map = hits.GetMap();
1803 std::map<G4int, G4double*>::const_iterator itr = map->begin();
1804 for(; itr != map->end(); itr++) {
1805 GetNestedVolumeIndex(itr->first, id);
1806 G4cout << "[" << itr->first << "] "
1807 << "("<< id[0] << "," << id[1] << "," << id[2] << ")"
1808 << *(itr->second) << ", ";
1809 }
1810 G4cout << G4endl;
1811 }
1812}
const G4bool GFDEBUG_HIT
int G4int
Definition: G4Types.hh:85
void GetNestedVolumeIndex(G4int, G4int[3])
std::map< G4String, std::map< Index3D, G4double > > kNestedHitsList
virtual std::vector< G4String > getHitScorerNames()
Map_t * GetMap() const
Definition: G4THitsMap.hh:155

References G4cout, G4endl, G4GMocrenMessenger::getHitScorerNames(), G4VTHitsMap< T, Map_t >::GetMap(), G4VSceneHandler::GetName(), GetNestedVolumeIndex(), GFDEBUG_HIT, kMessenger, kNestedHitsList, kNestedVolumeDimension, and anonymous_namespace{G4QuasiElRatios.cc}::map.

◆ AddCompound() [4/11]

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

Reimplemented from G4VSceneHandler.

Definition at line 131 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}

◆ AddCompound() [5/11]

void G4GMocrenFileSceneHandler::AddCompound ( const G4THitsMap< G4StatDouble > &  hits)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1814 of file G4GMocrenFileSceneHandler.cc.

1814 {
1815 if(GFDEBUG_HIT)
1816 G4cout << " ::AddCompound(const std::map<G4int, G4StatDouble*> &) >>>>>>>>> " << G4endl;
1817
1818
1819 std::vector<G4String> hitScorerNames = kMessenger.getHitScorerNames();
1820 G4int nhitname = (G4int)hitScorerNames.size();
1821 G4String scorername = static_cast<G4VHitsCollection>(hits).GetName();
1822
1823 //-- --//
1824 /*
1825 std::vector<G4String> hitScorerNames = kMessenger.getHitScorerNames();
1826 if(GFDEBUG_HIT) {
1827 std::vector<G4String>::iterator itr = hitScorerNames.begin();
1828 for(; itr != hitScorerNames.end(); itr++)
1829 G4cout << " PS name : " << *itr << G4endl;
1830 }
1831 */
1832
1833 { // Scope bracket to avoid compiler messages about shadowing (JA).
1834 //for(G4int i = 0; i < nhitname; i++) { // this selection trusts
1835 //if(scorername == hitScorerNames[i]) { // thea command /vis/scene/add/psHits hit_name.
1836
1837 G4int idx[3];
1838 std::map<G4int, G4StatDouble*> * map = hits.GetMap();
1839 std::map<G4int, G4StatDouble*>::const_iterator itr = map->begin();
1840 for(; itr != map->end(); itr++) {
1841 GetNestedVolumeIndex(itr->first, idx);
1842 Index3D id(idx[0], idx[1], idx[2]);
1843
1844 std::map<G4String, std::map<Index3D, G4double> >::iterator nestedHitsListItr;
1845 nestedHitsListItr = kNestedHitsList.find(scorername);
1846 if(nestedHitsListItr != kNestedHitsList.end()) {
1847 nestedHitsListItr->second[id] = itr->second->sum_wx();
1848 } else {
1849 std::map<Index3D, G4double> hit;
1850 hit.insert(std::map<Index3D, G4double>::value_type(id, itr->second->sum_wx()));
1851 kNestedHitsList[scorername] = hit;
1852 }
1853 }
1854
1855 //break;
1856 //}
1857 //}
1858 }
1859
1860 if(GFDEBUG_HIT) {
1861 G4String meshname = static_cast<G4VHitsCollection>(hits).GetSDname();
1862 G4cout << " >>>>> " << meshname << " : " << scorername << G4endl;
1863
1864 for(G4int i = 0; i < nhitname; i++)
1865 if(scorername == hitScorerNames[i])
1866 G4cout << " !!!! Hit scorer !!!! " << scorername << G4endl;
1867
1868 G4cout << " dimension: "
1869 << kNestedVolumeDimension[0] << " x "
1870 << kNestedVolumeDimension[1] << " x "
1872
1873 G4int id[3];
1874 std::map<G4int, G4StatDouble*> * map = hits.GetMap();
1875 std::map<G4int, G4StatDouble*>::const_iterator itr = map->begin();
1876 for(; itr != map->end(); itr++) {
1877 GetNestedVolumeIndex(itr->first, id);
1878 G4cout << "[" << itr->first << "] "
1879 << "("<< id[0] << "," << id[1] << "," << id[2] << ")"
1880 << itr->second->sum_wx() << ", ";
1881 }
1882 G4cout << G4endl;
1883 }
1884}

References G4cout, G4endl, G4GMocrenMessenger::getHitScorerNames(), G4VTHitsMap< T, Map_t >::GetMap(), G4VSceneHandler::GetName(), GetNestedVolumeIndex(), GFDEBUG_HIT, kMessenger, kNestedHitsList, kNestedVolumeDimension, and anonymous_namespace{G4QuasiElRatios.cc}::map.

◆ AddCompound() [6/11]

void G4VSceneHandler::AddCompound ( const G4VDigi digi)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 129 of file G4VSceneHandler.cc.

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

◆ AddCompound() [7/11]

void G4GMocrenFileSceneHandler::AddCompound ( const G4VDigi hit)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1737 of file G4GMocrenFileSceneHandler.cc.

1737 {
1738 if(GFDEBUG_DIGI) G4cout << " ::AddCompound(const G4VDigi&) >>>>>>>>> " << G4endl;
1740}
const G4bool GFDEBUG_DIGI
virtual void AddCompound(const G4VTrajectory &)

References G4VSceneHandler::AddCompound(), G4cout, G4endl, and GFDEBUG_DIGI.

◆ AddCompound() [8/11]

void G4VSceneHandler::AddCompound ( const G4VHit hit)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 128 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() [9/11]

void G4GMocrenFileSceneHandler::AddCompound ( const G4VHit hit)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1637 of file G4GMocrenFileSceneHandler.cc.

1637 {
1638 if(GFDEBUG_HIT) G4cout << " ::AddCompound(const G4VHit&) >>>>>>>>> " << G4endl;
1639
1641
1642 /*
1643 const std::map<G4String, G4AttDef> * map = hit.GetAttDefs();
1644 if(!map) return;
1645 std::map<G4String, G4AttDef>::const_iterator itr = map->begin();
1646 for(; itr != map->end(); itr++) {
1647 G4cout << itr->first << " : " << itr->second.GetName()
1648 << " , " << itr->second.GetDesc() << G4endl;
1649 }
1650 */
1651
1652 std::vector<G4String> hitNames = kMessenger.getHitNames();
1653 if(GFDEBUG_HIT) {
1654 std::vector<G4String>::iterator itr = hitNames.begin();
1655 for(; itr != hitNames.end(); itr++)
1656 G4cout << " hit name : " << *itr << G4endl;
1657 }
1658
1659 std::vector<G4AttValue> * attval = hit.CreateAttValues();
1660 if(!attval) {G4cout << "0 empty " << G4endl;}
1661 else {
1662
1663 G4bool bid[3] = {false, false, false};
1664 Index3D id;
1665
1666 std::vector<G4AttValue>::iterator itr;
1667 // First, get IDs
1668 for(itr = attval->begin(); itr != attval->end(); itr++) {
1669 std::string stmp = itr->GetValue();
1670 std::istringstream sval(stmp.c_str());
1671
1672 if(itr->GetName() == G4String("XID")) {
1673 sval >> id.x;
1674 bid[0] = true;
1675 continue;
1676 }
1677 if(itr->GetName() == G4String("YID")) {
1678 sval >> id.y;
1679 bid[1] = true;
1680 continue;
1681 }
1682 if(itr->GetName() == G4String("ZID")) {
1683 sval >> id.z;
1684 bid[2] = true;
1685 continue;
1686 }
1687 }
1688
1689 G4int nhitname = (G4int)hitNames.size();
1690
1691 if(bid[0] && bid[1] && bid[2]) {
1692
1693 if(GFDEBUG_HIT)
1694 G4cout << " Hit : index(" << id.x << ", " << id.y << ", "
1695 << id.z << ")" << G4endl;
1696
1697 // Get attributes
1698 for(itr = attval->begin(); itr != attval->end(); itr++) {
1699 for(G4int i = 0; i < nhitname; i++) {
1700 if(itr->GetName() == hitNames[i]) {
1701
1702 std::string stmp = itr->GetValue();
1703 std::istringstream sval(stmp.c_str());
1704 G4double value;
1705 G4String unit;
1706 sval >> value >> unit;
1707
1708 std::map<G4String, std::map<Index3D, G4double> >::iterator kNestedHitsListItr;
1709 kNestedHitsListItr = kNestedHitsList.find(hitNames[i]);
1710 if(kNestedHitsListItr != kNestedHitsList.end()) {
1711 //fTempNestedHits = &kNestedHitsListItr->second;
1712 //(*fTempNestedHits)[id] = value;
1713 kNestedHitsListItr->second[id] = value;
1714 } else {
1715 std::map<Index3D, G4double> hits;
1716 hits.insert(std::map<Index3D, G4double>::value_type(id, value));
1717 kNestedHitsList[hitNames[i]] = hits;
1718 }
1719
1720
1721 if(GFDEBUG_HIT)
1722 G4cout << " : " << hitNames[i] << " -> " << value
1723 << " [" << unit << "]" << G4endl;
1724 }
1725 }
1726 }
1727 } else {
1728 G4Exception("G4GMocrenFileSceneHandler::AddCompound(const G4VHit &)",
1729 "gMocren0014", FatalException, "Error");
1730 }
1731
1732 delete attval;
1733 }
1734
1735}
double G4double
Definition: G4Types.hh:83
virtual std::vector< G4String > getHitNames()
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition: G4VHit.hh:64

References G4VSceneHandler::AddCompound(), G4VHit::CreateAttValues(), FatalException, G4cout, G4endl, G4Exception(), G4GMocrenMessenger::getHitNames(), GFDEBUG_HIT, kMessenger, and kNestedHitsList.

◆ AddCompound() [10/11]

void G4VSceneHandler::AddCompound ( const G4VTrajectory traj)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 127 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}
virtual void DrawTrajectory() const

◆ AddCompound() [11/11]

void G4GMocrenFileSceneHandler::AddCompound ( const G4VTrajectory traj)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1597 of file G4GMocrenFileSceneHandler.cc.

1597 {
1598
1599 kbModelingTrajectory = true;
1600
1602
1603 if(GFDEBUG_TRK) {
1604 G4cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << G4endl;
1605 G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
1606 if (!pTrModel) {
1608 ("G4VSceneHandler::AddCompound(const G4VTrajectory&)",
1609 "gMocren0013", FatalException, "Not a G4TrajectoriesModel.");
1610 } else {
1611 traj.DrawTrajectory();
1612
1613 const G4VTrajectory * trj = pTrModel->GetCurrentTrajectory();
1614 G4cout << "------ track" << G4endl;
1615 G4cout << " name: " << trj->GetParticleName() << G4endl;
1616 G4cout << " id: " << trj->GetTrackID() << G4endl;
1617 G4cout << " charge: " << trj->GetCharge() << G4endl;
1618 G4cout << " momentum: " << trj->GetInitialMomentum() << G4endl;
1619
1620 G4int nPnt = trj->GetPointEntries();
1621 G4cout << " point: ";
1622 for(G4int i = 0; i < nPnt; i++) {
1623 G4cout << trj->GetPoint(i)->GetPosition() << ", ";
1624 }
1625 G4cout << G4endl;
1626 }
1627 G4cout << G4endl;
1628 }
1629
1630 kbModelingTrajectory = false;
1631}
const G4bool GFDEBUG_TRK
const G4VTrajectory * GetCurrentTrajectory() const
virtual const G4ThreeVector GetPosition() const =0
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
virtual G4int GetPointEntries() const =0
virtual G4String GetParticleName() const =0
virtual G4int GetTrackID() const =0
virtual G4ThreeVector GetInitialMomentum() const =0
virtual G4double GetCharge() const =0

References G4VSceneHandler::AddCompound(), G4VTrajectory::DrawTrajectory(), FatalException, G4VSceneHandler::fpModel, G4cout, G4endl, G4Exception(), G4VTrajectory::GetCharge(), G4TrajectoriesModel::GetCurrentTrajectory(), G4VTrajectory::GetInitialMomentum(), G4VTrajectory::GetParticleName(), G4VTrajectory::GetPoint(), G4VTrajectory::GetPointEntries(), G4VTrajectoryPoint::GetPosition(), G4VTrajectory::GetTrackID(), GFDEBUG_TRK, and kbModelingTrajectory.

◆ AddDetector()

void G4GMocrenFileSceneHandler::AddDetector ( const G4VSolid solid)
private

Definition at line 1918 of file G4GMocrenFileSceneHandler.cc.

1918 {
1919
1920 Detector detector;
1921
1922 // detector name
1923 detector.name = solid.GetName();
1924 if(GFDEBUG_DET > 1)
1925 G4cout << "0 Detector name : " << detector.name << G4endl;
1926
1927 const G4VModel* pv_model = GetModel();
1928 if (!pv_model) { return ; }
1929 G4PhysicalVolumeModel* pPVModel =
1930 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
1931 if (!pPVModel) { return ; }
1932
1933 // edge points of the detector
1934 std::vector<G4float *> dedges;
1935 G4Polyhedron * poly = solid.CreatePolyhedron();
1936 detector.polyhedron = poly;
1937 detector.transform3D = fObjectTransformation;
1938
1939 // retrieve color
1940 unsigned char uccolor[3] = {30, 30, 30};
1941 if(pPVModel->GetCurrentLV()->GetVisAttributes()) {
1942 G4Color color = pPVModel->GetCurrentLV()->GetVisAttributes()->GetColor();
1943 uccolor[0] = (unsigned char)(color.GetRed()*255);
1944 uccolor[1] = (unsigned char)(color.GetGreen()*255);
1945 uccolor[2] = (unsigned char)(color.GetBlue()*255);
1946 //if(uccolor[0] < 2 && uccolor[1] < 2 && uccolor[2] < 2)
1947 //uccolor[0] = uccolor[1] = uccolor[2] = 30; // dark grey
1948 }
1949 for(G4int i = 0; i < 3; i++) detector.color[i] = uccolor[i];
1950 //
1951 kDetectors.push_back(detector);
1952
1953 if(GFDEBUG_DET > 1) {
1954 G4cout << "0 color: (" << (G4int)uccolor[0] << ", "
1955 << (G4int)uccolor[1] << ", " << (G4int)uccolor[2] << ")"
1956 << G4endl;
1957 }
1958
1959}
const G4int GFDEBUG_DET
G4double GetBlue() const
Definition: G4Colour.hh:154
G4double GetRed() const
Definition: G4Colour.hh:152
G4double GetGreen() const
Definition: G4Colour.hh:153
std::vector< Detector > kDetectors
const G4VisAttributes * GetVisAttributes() const
G4LogicalVolume * GetCurrentLV() const
G4VModel * GetModel() const
G4Transform3D fObjectTransformation
G4String GetName() const
virtual G4Polyhedron * CreatePolyhedron() const
Definition: G4VSolid.cc:700
const G4Color & GetColor() const

References G4GMocrenFileSceneHandler::Detector::color, G4VSolid::CreatePolyhedron(), G4VSceneHandler::fObjectTransformation, G4VSceneHandler::fpModel, G4cout, G4endl, G4Colour::GetBlue(), G4VisAttributes::GetColor(), G4PhysicalVolumeModel::GetCurrentLV(), G4Colour::GetGreen(), G4VSceneHandler::GetModel(), G4VSolid::GetName(), G4Colour::GetRed(), G4LogicalVolume::GetVisAttributes(), GFDEBUG_DET, kDetectors, G4GMocrenFileSceneHandler::Detector::name, G4GMocrenFileSceneHandler::Detector::polyhedron, and G4GMocrenFileSceneHandler::Detector::transform3D.

Referenced by AddSolid().

◆ AddPrimitive() [1/12]

void G4GMocrenFileSceneHandler::AddPrimitive ( const G4Circle mark_circle)
virtual

Implements G4VSceneHandler.

Definition at line 663 of file G4GMocrenFileSceneHandler.cc.

664{
665 // to avoid a warning in the compile process
666 G4Circle dummycircle = mark_circle;
667
668 if (fProcessing2D) {
669 static G4bool warned = false;
670 if (!warned) {
671 warned = true;
673 ("G4GMocrenFileSceneHandler::AddPrimitive (const G4Circle&)",
674 "gMocren1003", JustWarning,
675 "2D circles not implemented. Ignored.");
676 }
677 return;
678 }
679
680 //-----
682 G4cout << "***** AddPrimitive( G4Circle )" << G4endl;
683
684 //----- Initialize IF NECESSARY
686
687
688} // G4GMocrenFileSceneHandler::AddPrimitive ( mark_circle )

References G4VisManager::confirmations, G4VSceneHandler::fProcessing2D, G4cout, G4endl, G4Exception(), G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and JustWarning.

◆ AddPrimitive() [2/12]

virtual void G4VSceneHandler::AddPrimitive ( const G4Circle )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [3/12]

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/12]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyhedron )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [5/12]

void G4GMocrenFileSceneHandler::AddPrimitive ( const G4Polyhedron p)
virtual

Implements G4VSceneHandler.

Definition at line 720 of file G4GMocrenFileSceneHandler.cc.

721{
722 //-----
724 G4cout << "***** AddPrimitive( G4Polyhedron )" << G4endl;
725
726
727 if (polyhedron.GetNoFacets() == 0) return;
728
729 if (fProcessing2D) {
730 static G4bool warned = false;
731 if (!warned) {
732 warned = true;
734 ("G4GMocrenFileSceneHandler::AddPrimitive (const G4Polyhedron&)",
735 "gMocren1005", JustWarning,
736 "2D polyhedra not implemented. Ignored.");
737 }
738 return;
739 }
740
741 //----- Initialize if necessary
743
744 //---------- (3) Facet block
745 for (G4int f = polyhedron.GetNoFacets(); f; f--){
746 G4bool notLastEdge = true;
747 G4int index = -1; // initialization
748 G4int edgeFlag = 1;
749 //G4int preedgeFlag = 1;
750 //G4int work[4], i = 0;
751 G4int i = 0;
752 do {
753 //preedgeFlag = edgeFlag;
754 notLastEdge = polyhedron.GetNextVertexIndex(index, edgeFlag);
755 //work[i++] = index;
756 i++;
757 }while (notLastEdge);
758 switch (i){
759 case 3:
760 //SendStrInt3(FR_FACET, work[0], work[1], work[2] );
761 break;
762 case 4:
763 //SendStrInt4(FR_FACET, work[0], work[1], work[2], work[3] );
764 break;
765 default:
767 G4cout <<
768 "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl;
769 G4PhysicalVolumeModel* pPVModel =
770 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
771 if (pPVModel)
773 G4cout << "Volume " << pPVModel->GetCurrentPV()->GetName() <<
774 ", Solid " << pPVModel->GetCurrentLV()->GetSolid()->GetName() <<
775 " (" << pPVModel->GetCurrentLV()->GetSolid()->GetEntityType();
776
778 G4cout <<
779 "\nG4Polyhedron facet with " << i << " edges" << G4endl;
780 }
781 }
782
783} // G4GMocrenFileSceneHandler::AddPrimitive (polyhedron)
G4VPhysicalVolume * GetCurrentPV() const
virtual G4GeometryType GetEntityType() const =0

References G4VisManager::confirmations, G4VSceneHandler::fpModel, G4VSceneHandler::fProcessing2D, G4cout, G4endl, G4Exception(), G4PhysicalVolumeModel::GetCurrentLV(), G4PhysicalVolumeModel::GetCurrentPV(), G4VSolid::GetEntityType(), G4VPhysicalVolume::GetName(), G4VSolid::GetName(), HepPolyhedron::GetNextVertexIndex(), HepPolyhedron::GetNoFacets(), G4LogicalVolume::GetSolid(), G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and JustWarning.

◆ AddPrimitive() [6/12]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyline )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [7/12]

void G4GMocrenFileSceneHandler::AddPrimitive ( const G4Polyline line)
virtual

Implements G4VSceneHandler.

Definition at line 543 of file G4GMocrenFileSceneHandler.cc.

544{
546 G4cout << "***** AddPrimitive" << G4endl;
547
548 if (fProcessing2D) {
549 static G4bool warned = false;
550 if (!warned) {
551 warned = true;
553 ("G4GMocrenFileSceneHandler::AddPrimitive (const G4Polyline&)",
554 "gMocren1001", JustWarning,
555 "2D polylines not implemented. Ignored.");
556 }
557 return;
558 }
559
560 //----- Initialize if necessary
562
563 static G4int numTrajectories = 0;
564 if(numTrajectories >= MAX_NUM_TRAJECTORIES) return;
565
566 // draw trajectories
568
569 G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
570 if (!pTrModel) {
572 ("G4VSceneHandler::AddCompound(const G4Polyline&)",
573 "gMocren0002", FatalException, "Not a G4TrajectoriesModel.");
574 }
575
576 G4ThreeVector trans;
580
581 if(GFDEBUG_TRK) G4cout << " trajectory points : " << G4endl;
582 std::vector<G4float *> trajectory;
583 if(polyline.size() < 2) return;
584 G4Polyline::const_iterator preitr = polyline.begin();
585 G4Polyline::const_iterator postitr = preitr; postitr++;
586 for(; postitr != polyline.end(); preitr++, postitr++) {
587 G4ThreeVector prePts(preitr->x(), preitr->y(), preitr->z());
588 prePts -= trans;
589 prePts.transform(rot);
590 G4ThreeVector postPts(postitr->x(), postitr->y(), postitr->z());
591 postPts -= trans;
592 postPts.transform(rot);
593 G4float * stepPts = new G4float[6];
594 stepPts[0] = prePts.x();
595 stepPts[1] = prePts.y();
596 stepPts[2] = prePts.z();
597 stepPts[3] = postPts.x();
598 stepPts[4] = postPts.y();
599 stepPts[5] = postPts.z();
600 trajectory.push_back(stepPts);
601
602 if(GFDEBUG_TRK) {
603 G4cout << " ("
604 << stepPts[0] << ", "
605 << stepPts[1] << ", "
606 << stepPts[2] << ") - ("
607 << stepPts[3] << ", "
608 << stepPts[4] << ", "
609 << stepPts[5] << ")" << G4endl;
610 }
611 }
612
613 const G4VisAttributes * att = polyline.GetVisAttributes();
614 G4Color color = att->GetColor();
615 unsigned char trkcolor[3];
616 trkcolor[0] = (unsigned char)(color.GetRed()*255);
617 trkcolor[1] = (unsigned char)(color.GetGreen()*255);
618 trkcolor[2] = (unsigned char)(color.GetBlue()*255);
619 if(GFDEBUG_TRK) {
620 G4cout << " color : ["
621 << color.GetRed() << ", "
622 << color.GetGreen() << ", "
623 << color.GetBlue() << "]" << G4endl;
624 }
625
626 kgMocrenIO->addTrack(trajectory, trkcolor);
627
628 numTrajectories++;
629 }
630
631} // G4GMocrenFileSceneHandler::AddPrimitive (polyline)
const G4int MAX_NUM_TRAJECTORIES
float G4float
Definition: G4Types.hh:84
double x() const
Hep3Vector & transform(const HepRotation &)
Definition: ThreeVectorR.cc:20
HepRotation inverse() const
void addTrack(float *_tracks)
CLHEP::HepRotation getRotation() const
CLHEP::Hep3Vector getTranslation() const

References G4GMocrenIO::addTrack(), G4VisManager::confirmations, FatalException, G4VSceneHandler::fpModel, G4VSceneHandler::fProcessing2D, G4cout, G4endl, G4Exception(), G4Colour::GetBlue(), G4VisAttributes::GetColor(), G4Colour::GetGreen(), G4Colour::GetRed(), HepGeom::Transform3D::getRotation(), HepGeom::Transform3D::getTranslation(), G4VisManager::GetVerbosity(), G4Visible::GetVisAttributes(), GFBeginModeling(), GFDEBUG, GFDEBUG_TRK, CLHEP::HepRotation::inverse(), JustWarning, kbModelingTrajectory, kgMocrenIO, kVolumeTrans3D, MAX_NUM_TRAJECTORIES, CLHEP::Hep3Vector::transform(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ AddPrimitive() [8/12]

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/12]

void G4GMocrenFileSceneHandler::AddPrimitive ( const G4Square mark_square)
virtual

Implements G4VSceneHandler.

Definition at line 692 of file G4GMocrenFileSceneHandler.cc.

693{
694 // to avoid a warning in the compile process
695 G4Square dummysquare = mark_square;
696
697 if (fProcessing2D) {
698 static G4bool warned = false;
699 if (!warned) {
700 warned = true;
702 ("G4GMocrenFileSceneHandler::AddPrimitive (const G4Square&)",
703 "gMocren1004", JustWarning,
704 "2D squares not implemented. Ignored.");
705 }
706 return;
707 }
708
709 //-----
711 G4cout << "***** AddPrimitive( G4Square )" << G4endl;
712
713 //----- Initialize if necessary
715
716} // G4GMocrenFileSceneHandler::AddPrimitive ( mark_square )

References G4VisManager::confirmations, G4VSceneHandler::fProcessing2D, G4cout, G4endl, G4Exception(), G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and JustWarning.

◆ AddPrimitive() [10/12]

virtual void G4VSceneHandler::AddPrimitive ( const G4Square )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [11/12]

void G4GMocrenFileSceneHandler::AddPrimitive ( const G4Text text)
virtual

Implements G4VSceneHandler.

Definition at line 635 of file G4GMocrenFileSceneHandler.cc.

636{
637 if (fProcessing2D) {
638 static G4bool warned = false;
639 if (!warned) {
640 warned = true;
642 ("G4GMocrenFileSceneHandler::AddPrimitive (const G4Text&)",
643 "gMocren1002", JustWarning,
644 "2D text not implemented. Ignored.");
645 }
646 return;
647 }
648
649 // to avoid a warning in the compile process
650 G4Text dummytext = text;
651
652 //-----
654 G4cout << "***** AddPrimitive( G4Text )" << G4endl;
655
656 //----- Initialize IF NECESSARY
658
659} // G4GMocrenFileSceneHandler::AddPrimitive ( text )
Definition: G4Text.hh:72

References G4VisManager::confirmations, G4VSceneHandler::fProcessing2D, G4cout, G4endl, G4Exception(), G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and JustWarning.

◆ AddPrimitive() [12/12]

virtual void G4VSceneHandler::AddPrimitive ( const G4Text )
virtual

Implements G4VSceneHandler.

◆ AddSolid() [1/23]

void G4VSceneHandler::AddSolid ( const G4Box box)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 98 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)

◆ AddSolid() [2/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Box box)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 839 of file G4GMocrenFileSceneHandler.cc.

840{
842 G4cout << "***** AddSolid ( box )" << G4endl;
843
844 if(GFDEBUG_DET > 0)
845 G4cout << "G4GMocrenFileSceneHandler::AddSolid(const G4Box&) : "
846 << box.GetName() << G4endl;
847
848 //----- skip drawing invisible primitive
849 if( !IsVisible() ) { return ; }
850
851 //----- Initialize if necessary
853
854
855 //--
856 if(GFDEBUG_DET > 1) {
857 G4cout << "-------" << G4endl;
858 G4cout << " " << box.GetName() << G4endl;
859 G4Polyhedron * poly = box.CreatePolyhedron();
861 //G4int nv = poly->GetNoVertices();
862 G4Point3D v1, v2;
863 G4int next;
864 //while(1) { // next flag isn't functional.
865 for(G4int i = 0; i < 12; i++) { // # of edges is 12.
866 poly->GetNextEdge(v1, v2, next);
867 if(next == 0) break;
868 G4cout << " (" << v1.x() << ", "
869 << v1.y() << ", "
870 << v1.z() << ") - ("
871 << v2.x() << ", "
872 << v2.y() << ", "
873 << v2.z() << ") [" << next << "]"
874 << G4endl;
875 }
876 delete poly;
877 }
878
879
880 // the volume name set by /vis/gMocren/setVolumeName
882
883
884 if(kFlagParameterization != 2) {
886 if(pScrMan) {
887 G4ScoringBox * pScBox = dynamic_cast<G4ScoringBox*>(pScrMan->FindMesh(volName));
888 G4bool bMesh = false;
889 if(pScBox != NULL) bMesh = true;
890 if(bMesh) kFlagParameterization = 2;
891 if(GFDEBUG_DET > 0) G4cout << " G4ScoringManager::FindMesh() : "
892 << volName << " - " << bMesh << G4endl;
893 }
894 }
895
896 const G4VModel* pv_model = GetModel();
897 if (!pv_model) { return ; }
898 G4PhysicalVolumeModel* pPVModel =
899 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
900 if (!pPVModel) { return ; }
901
902
903 //-- debug information
904 if(GFDEBUG_DET > 0) {
905 G4Material * mat = pPVModel->GetCurrentMaterial();
906 G4String name = mat->GetName();
907 G4double dens = mat->GetDensity()/(g/cm3);
908 G4int copyNo = pPVModel->GetCurrentPV()->GetCopyNo();
909 G4int depth = pPVModel->GetCurrentDepth();
910 G4cout << " copy no.: " << copyNo << G4endl;
911 G4cout << " depth : " << depth << G4endl;
912 G4cout << " density : " << dens << " [g/cm3]" << G4endl;
913 G4cout << " location: " << pPVModel->GetCurrentPV()->GetObjectTranslation() << G4endl;
914 G4cout << " Multiplicity : " << pPVModel->GetCurrentPV()->GetMultiplicity() << G4endl;
915 G4cout << " Is replicated? : " << pPVModel->GetCurrentPV()->IsReplicated() << G4endl;
916 G4cout << " Is parameterised? : " << pPVModel->GetCurrentPV()->IsParameterised() << G4endl;
917 G4cout << " top phys. vol. name : " << pPVModel->GetTopPhysicalVolume()->GetName() << G4endl;
918 }
919
920 //-- check the parameterised volume
921 if(box.GetName() == volName) {
922
924 // coordination system correction for gMocren
925 G4ThreeVector raxis(1., 0., 0.), dummy(0.,0.,0.);
926 G4RotationMatrix rot(raxis, pi*rad);
927 G4Transform3D trot(rot, dummy);
928 if(GFDEBUG_DET) {
931 G4cout << "kVolumeTrans3D: " << trans1 << G4endl << rot1 << G4endl;
932 }
934 if(GFDEBUG_DET) G4cout << " Parameterised volume : " << box.GetName() << G4endl;
935
936
937
938 //
939 G4VPhysicalVolume * pv[3] = {0,0,0};
940 pv[0] = pPVModel->GetCurrentPV()->GetLogicalVolume()->GetDaughter(0);
941 if(!pv[0]) {
942 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
943 "gMocren0003", FatalException, "Unexpected volume.");
944 }
945 G4int dirAxis[3] = {-1,-1,-1};
946 G4int nDaughters[3] = {0,0,0};
947
948 EAxis axis; G4int nReplicas; G4double width; G4double offset; G4bool consuming;
949 pv[0]->GetReplicationData(axis, nReplicas, width, offset, consuming);
950 nDaughters[0] = nReplicas;
951 switch(axis) {
952 case kXAxis: dirAxis[0] = 0; break;
953 case kYAxis: dirAxis[0] = 1; break;
954 case kZAxis: dirAxis[0] = 2; break;
955 default:
956 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
957 "gMocren0004", FatalException, "Error.");
958 }
959 kNestedVolumeNames.push_back(pv[0]->GetName());
960 if(GFDEBUG_DET)
961 G4cout << " daughter name : " << pv[0]->GetName()
962 << " # : " << nDaughters[0] << G4endl;
963
964 //
965 if(GFDEBUG_DET) {
966 if(pv[0]->GetLogicalVolume()->GetNoDaughters()) {
967 G4cout << "# of daughters : "
968 << pv[0]->GetLogicalVolume()->GetNoDaughters() << G4endl;
969 } else {
970 //G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
971 // "gMocren0005", FatalException, "Error.");
972 }
973 }
974
975 // check whether nested or regular parameterization
976 if(GFDEBUG_DET) G4cout << "# of daughters : "
977 << pv[0]->GetLogicalVolume()->GetNoDaughters() << G4endl;
978 if(pv[0]->GetLogicalVolume()->GetNoDaughters() == 0) {
980 //G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
981 // "gMocren0006", FatalException, "Error.");
982 }
983
984 if(kFlagParameterization == 0) {
985
986 pv[1] = pv[0]->GetLogicalVolume()->GetDaughter(0);
987 if(pv[1]) {
988 pv[1]->GetReplicationData(axis, nReplicas, width, offset, consuming);
989 nDaughters[1] = nReplicas;
990 switch(axis) {
991 case kXAxis: dirAxis[1] = 0; break;
992 case kYAxis: dirAxis[1] = 1; break;
993 case kZAxis: dirAxis[1] = 2; break;
994 default:
995 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
996 "gMocren0007", FatalException, "Error.");
997 }
998 kNestedVolumeNames.push_back(pv[1]->GetName());
999 if(GFDEBUG_DET)
1000 G4cout << " sub-daughter name : " << pv[1]->GetName()
1001 << " # : " << nDaughters[1]<< G4endl;
1002
1003 //
1004 pv[2] = pv[1]->GetLogicalVolume()->GetDaughter(0);
1005 if(pv[2]) {
1006 nDaughters[2] = pv[2]->GetMultiplicity();
1007 kNestedVolumeNames.push_back(pv[2]->GetName());
1008 if(GFDEBUG_DET)
1009 G4cout << " sub-sub-daughter name : " << pv[2]->GetName()
1010 << " # : " << nDaughters[2] << G4endl;
1011
1012 if(nDaughters[2] > 1) {
1013 G4VNestedParameterisation * nestPara
1014 = dynamic_cast<G4VNestedParameterisation*>(pv[2]->GetParameterisation());
1015 if(nestPara == NULL)
1016 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
1017 "gMocren0008", FatalException, "Non-nested parameterisation");
1018
1019 nestPara->ComputeTransformation(0, pv[2]);
1020 G4ThreeVector trans0 = pv[2]->GetObjectTranslation();
1021 nestPara->ComputeTransformation(1, pv[2]);
1022 G4ThreeVector trans1 = pv[2]->GetObjectTranslation();
1023 G4ThreeVector diff(trans0 - trans1);
1024 if(GFDEBUG_DET)
1025 G4cout << trans0 << " - " << trans1 << " - " << diff << G4endl;
1026
1027 if(diff.x() != 0.) dirAxis[2] = 0;
1028 else if(diff.y() != 0.) dirAxis[2] = 1;
1029 else if(diff.z() != 0.) dirAxis[2] = 2;
1030 else
1031 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
1032 "gMocren0009", FatalException, "Unexpected nested parameterisation");
1033 }
1034 }
1035 }
1036
1037 for(G4int i = 0; i < 3; i++) {
1038 kNestedVolumeDimension[i] = nDaughters[i];
1039 //kNestedVolumeDimension[i] = nDaughters[dirAxis[i]];
1040 kNestedVolumeDirAxis[i] = dirAxis[i];
1041 }
1042 //G4cout << "@@@@@@@@@ "
1043 // << dirAxis[0] << ", " << dirAxis[1] << ", " << dirAxis[2] << G4endl;
1044
1045 // get densities
1046 G4VNestedParameterisation * nestPara
1047 = dynamic_cast<G4VNestedParameterisation*>(pv[2]->GetParameterisation());
1048 if(nestPara != NULL) {
1049 G4double prexyz[3] = {0.,0.,0.}, xyz[3] = {0.,0.,0.};
1050 for(G4int n0 = 0; n0 < nDaughters[0]; n0++) {
1051 for(G4int n1 = 0; n1 < nDaughters[1]; n1++) {
1052 for(G4int n2 = 0; n2 < nDaughters[2]; n2++) {
1053
1054 G4GMocrenTouchable * touch = new G4GMocrenTouchable(n1, n0);
1055 if(GFDEBUG_DET)
1056 G4cout << " retrieve volume : copy # : " << n0
1057 << ", " << n1 << ", " << n2 << G4endl;
1058 G4Material * mat = nestPara->ComputeMaterial(pv[2], n2, touch);
1059 delete touch;
1060 G4double dens = mat->GetDensity()/(g/cm3);
1061
1062 if(GFDEBUG_DET)
1063 G4cout << " density :" << dens << " [g/cm3]" << G4endl;
1064
1065 G4Box tbox(box);
1066 nestPara->ComputeDimensions(tbox, n2, pv[2]);
1067 xyz[0] = tbox.GetXHalfLength()/mm;
1068 xyz[1] = tbox.GetYHalfLength()/mm;
1069 xyz[2] = tbox.GetZHalfLength()/mm;
1070 if(n0 != 0 || n1 != 0 || n2 != 0) {
1071 for(G4int i = 0; i < 3; i++) {
1072 if(xyz[i] != prexyz[i])
1073 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
1074 "gMocren0010", FatalException, "Unsupported parameterisation");
1075 }
1076 }
1077 if(GFDEBUG_DET)
1078 G4cout << " size : " << tbox.GetXHalfLength()/mm << " x "
1079 << tbox.GetYHalfLength()/mm << " x "
1080 << tbox.GetZHalfLength()/mm << " [mm3]" << G4endl;
1081
1082 G4int idx[3];
1083 idx[dirAxis[0]] = n0;
1084 idx[dirAxis[1]] = n1;
1085 idx[dirAxis[2]] = n2;
1086 Index3D i3d(idx[0],idx[1],idx[2]);
1087 kNestedModality[i3d] = dens;
1088 if(GFDEBUG_DET)
1089 G4cout << " index: " << idx[0] << ", " << idx[1] << ", " << idx[2]
1090 << " density: " << dens << G4endl;
1091
1092 for(G4int i = 0; i < 3; i++) prexyz[i] = xyz[i];
1093 }
1094 }
1095 }
1096
1098 box.GetYHalfLength()*2/mm,
1099 box.GetZHalfLength()*2/mm);
1100 // mesh size
1102 G4float spacing[3] = {static_cast<G4float>(2*xyz[0]),
1103 static_cast<G4float>(2*xyz[1]),
1104 static_cast<G4float>(2*xyz[2])};
1105 kgMocrenIO->setVoxelSpacing(spacing);
1106 kVoxelDimension.set(spacing[0], spacing[1], spacing[2]);
1108 }
1109
1110 } else {
1111 if(GFDEBUG_DET)
1112 G4cout << pv[2]->GetName() << G4endl;
1113 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
1114 "gMocren0011", FatalException, "Non-nested parameterisation");
1115 }
1116
1117
1118
1119 //-- debug
1120 if(GFDEBUG_DET > 1) {
1121 if(pPVModel->GetCurrentPV()->IsParameterised()) {
1123 G4cout << " Is nested parameterisation? : " << para->IsNested() << G4endl;
1124
1125
1126 G4int npvp = pPVModel->GetDrawnPVPath().size();
1127 G4cout << " physical volume node id : "
1128 << "size: " << npvp << ", PV name: ";
1129 for(G4int i = 0; i < npvp; i++) {
1130 G4cout << pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->GetName()
1131 << " [param:"
1132 << pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->IsParameterised()
1133 << ",rep:"
1134 << pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->IsReplicated();
1135 if(pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->GetParameterisation()) {
1136 G4cout << ",nest:"
1137 << pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->GetParameterisation()->IsNested();
1138 }
1139 G4cout << ",copyno:"
1140 << pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->GetCopyNo();
1141 G4cout << "] - ";
1142 }
1143 G4cout << G4endl;
1144
1145
1146 pPVModel->GetCurrentPV()->GetReplicationData(axis, nReplicas, width, offset, consuming);
1147 G4cout << " # replicas : " << nReplicas << G4endl;
1148 G4double pareDims[3] = {0.,0.,0.};
1149 G4Box * pbox = dynamic_cast<G4Box *>(pPVModel->GetDrawnPVPath()[npvp-2].GetPhysicalVolume()->GetLogicalVolume()->GetSolid());
1150 if(pbox) {
1151 pareDims[0] = 2.*pbox->GetXHalfLength()*mm;
1152 pareDims[1] = 2.*pbox->GetYHalfLength()*mm;
1153 pareDims[2] = 2.*pbox->GetZHalfLength()*mm;
1154 G4cout << " mother size ["
1155 << pPVModel->GetDrawnPVPath()[npvp-2].GetPhysicalVolume()->GetName()
1156 << "] : "
1157 << pareDims[0] << " x "
1158 << pareDims[1] << " x "
1159 << pareDims[2] << " [mm3]"
1160 << G4endl;
1161 }
1162 G4double paraDims[3];
1163 G4Box * boxP = dynamic_cast<G4Box *>(pPVModel->GetDrawnPVPath()[npvp-1].GetPhysicalVolume()->GetLogicalVolume()->GetSolid());
1164 if(boxP) {
1165 paraDims[0] = 2.*boxP->GetXHalfLength()*mm;
1166 paraDims[1] = 2.*boxP->GetYHalfLength()*mm;
1167 paraDims[2] = 2.*boxP->GetZHalfLength()*mm;
1168 G4cout << " parameterised volume? ["
1169 << pPVModel->GetDrawnPVPath()[npvp-1].GetPhysicalVolume()->GetName()
1170 << "] : "
1171 << paraDims[0] << " x "
1172 << paraDims[1] << " x "
1173 << paraDims[2] << " [mm3] : "
1174 << G4int(pareDims[0]/paraDims[0]) << " x "
1175 << G4int(pareDims[1]/paraDims[1]) << " x "
1176 << G4int(pareDims[2]/paraDims[2]) << G4endl;
1177 } else {
1178 G4cout << pPVModel->GetDrawnPVPath()[npvp-2].GetPhysicalVolume()->GetName()
1179 << " isn't a G4Box." << G4endl;
1180 }
1181 }
1182 }
1183
1184
1185 } else if(kFlagParameterization == 1) { // G4PhantomParameterisation based geom. construnction
1186
1187 // get the dimension of the parameterized patient geometry
1188 G4PhantomParameterisation * phantomPara
1189 = dynamic_cast<G4PhantomParameterisation*>(pv[0]->GetParameterisation());
1190 if(phantomPara == NULL) {
1191 G4Exception("G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )",
1192 "gMocren0012", FatalException, "no G4PhantomParameterisation");
1193 } else {
1194 ;
1195 }
1196
1197 kNestedVolumeDimension[0] = phantomPara->GetNoVoxelsX();
1198 kNestedVolumeDimension[1] = phantomPara->GetNoVoxelsY();
1199 kNestedVolumeDimension[2] = phantomPara->GetNoVoxelsZ();
1200 kNestedVolumeDirAxis[0] = 0;
1201 kNestedVolumeDirAxis[1] = 1;
1202 kNestedVolumeDirAxis[2] = 2;
1203
1204 // get densities of the parameterized patient geometry
1207
1208 for(G4int n0 = 0; n0 < kNestedVolumeDimension[0]; n0++) {
1209 for(G4int n1 = 0; n1 < kNestedVolumeDimension[1]; n1++) {
1210 for(G4int n2 = 0; n2 < kNestedVolumeDimension[2]; n2++) {
1211
1212 G4int repNo = n0 + n1*nX + n2*nXY;
1213 G4Material * mat = phantomPara->ComputeMaterial(repNo, pv[0]);
1214 G4double dens = mat->GetDensity()/(g/cm3);
1215
1216
1217 G4int idx[3];
1218 idx[kNestedVolumeDirAxis[0]] = n0;
1219 idx[kNestedVolumeDirAxis[1]] = n1;
1220 idx[kNestedVolumeDirAxis[2]] = n2;
1221 Index3D i3d(idx[0],idx[1],idx[2]);
1222 kNestedModality[i3d] = dens;
1223
1224 if(GFDEBUG_DET)
1225 G4cout << " index: " << idx[0] << ", " << idx[1] << ", " << idx[2]
1226 << " density: " << dens << G4endl;
1227
1228 }
1229 }
1230 }
1231
1233 box.GetYHalfLength()*2/mm,
1234 box.GetZHalfLength()*2/mm);
1235
1236 // mesh size
1238 G4float spacing[3] = {static_cast<G4float>(2*phantomPara->GetVoxelHalfX()),
1239 static_cast<G4float>(2*phantomPara->GetVoxelHalfY()),
1240 static_cast<G4float>(2*phantomPara->GetVoxelHalfZ())};
1241 kgMocrenIO->setVoxelSpacing(spacing);
1242 kVoxelDimension.set(spacing[0], spacing[1], spacing[2]);
1244 }
1245 }
1246
1247 } // if(box.GetName() == volName)
1248
1249
1250 // processing geometry construction based on the interactive PS
1252
1253
1254 // get the dimension of the geometry defined in G4VScoringMesh
1256 //if(!pScrMan) return;
1257 if(pScrMan) {
1258 G4ScoringBox * scoringBox
1259 = dynamic_cast<G4ScoringBox*>(pScrMan->FindMesh(volName));
1260 //if(scoringBox == NULL) return;
1261 if(scoringBox) {
1262
1263
1264
1265 G4int nVoxels[3];
1266 scoringBox->GetNumberOfSegments(nVoxels);
1267 // this order depends on the G4ScoringBox
1268 kNestedVolumeDimension[0] = nVoxels[2];
1269 kNestedVolumeDimension[1] = nVoxels[1];
1270 kNestedVolumeDimension[2] = nVoxels[0];
1271 kNestedVolumeDirAxis[0] = 2;
1272 kNestedVolumeDirAxis[1] = 1;
1273 kNestedVolumeDirAxis[2] = 0;
1274
1275 // get densities of the parameterized patient geometry
1276 for(G4int n0 = 0; n0 < kNestedVolumeDimension[0]; n0++) {
1277 for(G4int n1 = 0; n1 < kNestedVolumeDimension[1]; n1++) {
1278 for(G4int n2 = 0; n2 < kNestedVolumeDimension[2]; n2++) {
1279
1280 G4double dens = 0.*(g/cm3);
1281
1282 G4int idx[3];
1283 idx[kNestedVolumeDirAxis[0]] = n0;
1284 idx[kNestedVolumeDirAxis[1]] = n1;
1285 idx[kNestedVolumeDirAxis[2]] = n2;
1286 Index3D i3d(idx[0],idx[1],idx[2]);
1287 kNestedModality[i3d] = dens;
1288
1289 }
1290 }
1291 }
1292
1293 G4ThreeVector boxSize = scoringBox->GetSize();
1294 if(GFDEBUG_DET > 1) {
1295 G4cout << "Interactive Scorer : size - "
1296 << boxSize.x()/cm << " x "
1297 << boxSize.y()/cm << " x "
1298 << boxSize.z()/cm << " [cm3]" << G4endl;
1299 G4cout << "Interactive Scorer : # voxels - "
1300 << nVoxels[0] << " x "
1301 << nVoxels[1] << " x "
1302 << nVoxels[2] << G4endl;
1303 }
1304 kVolumeSize.set(boxSize.x()*2,
1305 boxSize.y()*2,
1306 boxSize.z()*2);
1307
1308 // mesh size
1310 G4float spacing[3] = {static_cast<G4float>(boxSize.x()*2/nVoxels[0]),
1311 static_cast<G4float>(boxSize.y()*2/nVoxels[1]),
1312 static_cast<G4float>(boxSize.z()*2/nVoxels[2])};
1313
1314 kgMocrenIO->setVoxelSpacing(spacing);
1315 kVoxelDimension.set(spacing[0], spacing[1], spacing[2]);
1317
1318 }
1319
1320
1322
1323 // translation for the scoring mesh
1324 G4ThreeVector sbth = scoringBox->GetTranslation();
1325 G4Translate3D sbtranslate(sbth);
1326 kVolumeTrans3D = kVolumeTrans3D*sbtranslate;
1327
1328 // rotation matrix for the scoring mesh
1329 G4RotationMatrix sbrm;
1330 sbrm = scoringBox->GetRotationMatrix();
1331 if(!sbrm.isIdentity()) {
1332 G4ThreeVector sbdummy(0.,0.,0.);
1333 G4Transform3D sbrotate(sbrm.inverse(), sbdummy);
1334 kVolumeTrans3D = kVolumeTrans3D*sbrotate;
1335 }
1336
1337
1338 // coordination system correction for gMocren
1339 G4ThreeVector raxisY(0., 1., 0.), dummyY(0.,0.,0.);
1340 G4RotationMatrix rotY(raxisY, pi*rad);
1341 G4Transform3D trotY(rotY, dummyY);
1342 G4ThreeVector raxisZ(0., 0., 1.), dummyZ(0.,0.,0.);
1343 G4RotationMatrix rotZ(raxisZ, pi*rad);
1344 G4Transform3D trotZ(rotZ, dummyZ);
1345
1346 kVolumeTrans3D = kVolumeTrans3D*trotY*trotZ;
1347
1348 }
1349 }
1350 //
1352 }
1353
1354
1355 static G4VPhysicalVolume * volPV = NULL;
1356 if(pPVModel->GetCurrentPV()->GetName() == volName) {
1357 volPV = pPVModel->GetCurrentPV();
1358 }
1359
1360 //-- add detectors
1361 G4bool bAddDet = true;
1363
1364 if(kFlagParameterization == 0) { // nested parameterisation
1365 /*
1366 G4String volDSolidName;
1367 if(volPV) {
1368 G4int nDaughter = volPV->GetLogicalVolume()->GetNoDaughters();
1369 G4VPhysicalVolume * volDPV = NULL;
1370 if(nDaughter > 0) volDPV = volPV->GetLogicalVolume()->GetDaughter(0);
1371 if(volDPV) {
1372 nDaughter = volDPV->GetLogicalVolume()->GetNoDaughters();
1373 if(nDaughter > 0)
1374 volDSolidName = volDPV->GetLogicalVolume()->GetDaughter(0)
1375 ->GetLogicalVolume()->GetSolid()->GetName();
1376 }
1377 }
1378 */
1379
1380 //std::cout << "Parameterization volume: " << volName << " - "
1381 // << box.GetName() << std::endl;
1382
1383 if(volName == box.GetName()) {
1384 bAddDet = false;
1385 }
1386
1387 std::vector<G4String>::iterator itr = kNestedVolumeNames.begin();
1388 for(; itr != kNestedVolumeNames.end(); itr++) {
1389 if(*itr == box.GetName()) {
1390 bAddDet = false;
1391 break;
1392 }
1393 }
1394 } else if(kFlagParameterization == 1) { // phantom paramemterisation
1395
1396 G4String volDSolidName;
1397 if(volPV) {
1398 volDSolidName = volPV->GetLogicalVolume()->GetDaughter(0)
1400 }
1401
1402 //std::cout << "Phantom Parameterization volume: " << volDSolidName
1403 // << " - " << box.GetName() << std::endl;
1404
1405 if(volDSolidName == box.GetName()) {
1406 bAddDet = false;
1407 }
1408
1409 } else if(kFlagParameterization == 2) { // interactive primitive scorer
1410 //std::cout << "Regular Parameterization volume: " << box.GetName() << std::endl;
1411 }
1412
1413 }
1414 if(bAddDet) AddDetector(box);
1415
1416
1417} // void G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )
static constexpr double cm3
Definition: G4SIunits.hh:101
static constexpr double rad
Definition: G4SIunits.hh:129
static constexpr double mm
Definition: G4SIunits.hh:95
static constexpr double g
Definition: G4SIunits.hh:168
static constexpr double pi
Definition: G4SIunits.hh:55
static constexpr double cm
Definition: G4SIunits.hh:99
double z() const
double y() const
void set(double x, double y, double z)
bool isIdentity() const
Definition: Rotation.cc:167
Definition: G4Box.hh:56
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
G4Polyhedron * CreatePolyhedron() const
Definition: G4Box.cc:544
std::vector< G4String > kNestedVolumeNames
void AddDetector(const G4VSolid &solid)
std::map< Index3D, float > kNestedModality
void setVoxelSpacing(float _spacing[3])
virtual G4bool getDrawVolumeGrid()
virtual G4String getVolumeName()
size_t GetNoDaughters() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
G4double GetDensity() const
Definition: G4Material.hh:176
const G4String & GetName() const
Definition: G4Material.hh:173
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
size_t GetNoVoxelsZ() const
G4double GetVoxelHalfZ() const
G4double GetVoxelHalfY() const
G4double GetVoxelHalfX() const
size_t GetNoVoxelsY() const
size_t GetNoVoxelsX() const
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
G4VPhysicalVolume * GetTopPhysicalVolume() const
G4Material * GetCurrentMaterial() const
static G4ScoringManager * GetScoringManager()
G4VScoringMesh * FindMesh(G4VHitsCollection *map)
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeTransformation(const G4int no, G4VPhysicalVolume *currentPV) const =0
virtual G4Material * ComputeMaterial(G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch=nullptr)=0
virtual G4bool IsNested() const
virtual G4bool IsReplicated() const =0
virtual G4int GetMultiplicity() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
virtual G4int GetCopyNo() const =0
virtual G4VPVParameterisation * GetParameterisation() const =0
G4ThreeVector GetObjectTranslation() const
virtual G4bool IsParameterised() const =0
G4ThreeVector GetTranslation() const
G4ThreeVector GetSize() const
void GetNumberOfSegments(G4int nSegment[3])
G4RotationMatrix GetRotationMatrix() const
HepPolyhedron & Transform(const G4Transform3D &t)
G4bool GetNextEdge(G4Point3D &p1, G4Point3D &p2, G4int &edgeFlag) const
EAxis
Definition: geomdefs.hh:54
@ kYAxis
Definition: geomdefs.hh:56
@ kXAxis
Definition: geomdefs.hh:55
@ kZAxis
Definition: geomdefs.hh:57

References AddDetector(), cm, cm3, G4VNestedParameterisation::ComputeDimensions(), G4PhantomParameterisation::ComputeMaterial(), G4VNestedParameterisation::ComputeMaterial(), G4VNestedParameterisation::ComputeTransformation(), G4VisManager::confirmations, G4Box::CreatePolyhedron(), FatalException, G4ScoringManager::FindMesh(), G4VSceneHandler::fObjectTransformation, G4VSceneHandler::fpModel, g, G4cout, G4endl, G4Exception(), G4VPhysicalVolume::GetCopyNo(), G4PhysicalVolumeModel::GetCurrentDepth(), G4PhysicalVolumeModel::GetCurrentMaterial(), G4PhysicalVolumeModel::GetCurrentPV(), G4LogicalVolume::GetDaughter(), G4Material::GetDensity(), G4PhysicalVolumeModel::GetDrawnPVPath(), G4GMocrenMessenger::getDrawVolumeGrid(), G4VPhysicalVolume::GetLogicalVolume(), G4VSceneHandler::GetModel(), G4VPhysicalVolume::GetMultiplicity(), G4VPhysicalVolume::GetName(), G4VSolid::GetName(), G4Material::GetName(), G4VSceneHandler::GetName(), HepPolyhedron::GetNextEdge(), G4LogicalVolume::GetNoDaughters(), G4PhantomParameterisation::GetNoVoxelsX(), G4PhantomParameterisation::GetNoVoxelsY(), G4PhantomParameterisation::GetNoVoxelsZ(), G4VScoringMesh::GetNumberOfSegments(), G4VPhysicalVolume::GetObjectTranslation(), G4VPhysicalVolume::GetParameterisation(), G4VPhysicalVolume::GetReplicationData(), HepGeom::Transform3D::getRotation(), G4VScoringMesh::GetRotationMatrix(), G4ScoringManager::GetScoringManager(), G4VScoringMesh::GetSize(), G4LogicalVolume::GetSolid(), G4PhysicalVolumeModel::GetTopPhysicalVolume(), G4VScoringMesh::GetTranslation(), HepGeom::Transform3D::getTranslation(), G4VisManager::GetVerbosity(), G4GMocrenMessenger::getVolumeName(), G4PhantomParameterisation::GetVoxelHalfX(), G4PhantomParameterisation::GetVoxelHalfY(), G4PhantomParameterisation::GetVoxelHalfZ(), G4Box::GetXHalfLength(), G4Box::GetYHalfLength(), G4Box::GetZHalfLength(), GFBeginModeling(), GFDEBUG, GFDEBUG_DET, CLHEP::HepRotation::inverse(), CLHEP::HepRotation::isIdentity(), G4VPVParameterisation::IsNested(), G4VPhysicalVolume::IsParameterised(), G4VPhysicalVolume::IsReplicated(), IsVisible(), kbSetModalityVoxelSize, kFlagParameterization, kFlagProcessedInteractiveScorer, kgMocrenIO, kMessenger, kNestedModality, kNestedVolumeDimension, kNestedVolumeDirAxis, kNestedVolumeNames, kVolumeSize, kVolumeTrans3D, kVoxelDimension, kXAxis, kYAxis, kZAxis, mm, G4InuclParticleNames::name(), pi, rad, CLHEP::Hep3Vector::set(), G4GMocrenIO::setVoxelSpacing(), HepPolyhedron::Transform(), HepGeom::BasicVector3D< T >::x(), CLHEP::Hep3Vector::x(), HepGeom::BasicVector3D< T >::y(), CLHEP::Hep3Vector::y(), HepGeom::BasicVector3D< T >::z(), and CLHEP::Hep3Vector::z().

◆ AddSolid() [3/23]

void G4VSceneHandler::AddSolid ( const G4Cons cons)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 99 of file G4VSceneHandler.cc.

266 {
267 AddSolidT (cons);
268}

◆ AddSolid() [4/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Cons cons)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1465 of file G4GMocrenFileSceneHandler.cc.

1466{
1468 G4cout << "***** AddSolid ( cons )" << G4endl;
1469
1470 //----- skip drawing invisible primitive
1471 if( !IsVisible() ) { return ; }
1472
1473 //----- Initialize if necessary
1475
1476 //
1477 AddDetector(cons);
1478
1479}// G4GMocrenFileSceneHandler::AddSolid( cons )

References AddDetector(), G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and IsVisible().

◆ AddSolid() [5/23]

void G4VSceneHandler::AddSolid ( const G4Ellipsoid ellipsoid)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 109 of file G4VSceneHandler.cc.

298 {
299 AddSolidWithAuxiliaryEdges (ellipsoid);
300}
void AddSolidWithAuxiliaryEdges(const T &solid)

◆ AddSolid() [6/23]

void G4VSceneHandler::AddSolid ( const G4Orb orb)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 100 of file G4VSceneHandler.cc.

270 {
272}

◆ AddSolid() [7/23]

void G4VSceneHandler::AddSolid ( const G4Para para)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 101 of file G4VSceneHandler.cc.

274 {
275 AddSolidT (para);
276}

◆ AddSolid() [8/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Para para)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1520 of file G4GMocrenFileSceneHandler.cc.

1521{
1523 G4cout << "***** AddSolid ( para )" << G4endl;
1524
1525 //----- skip drawing invisible primitive
1526 if( !IsVisible() ) { return ; }
1527
1528 //----- Initialize if necessary
1530
1531 //
1532 AddDetector(para);
1533
1534} // G4GMocrenFileSceneHandler::AddSolid ( para )

References AddDetector(), G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and IsVisible().

◆ AddSolid() [9/23]

void G4VSceneHandler::AddSolid ( const G4Polycone polycone)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 110 of file G4VSceneHandler.cc.

302 {
303 AddSolidT (polycone);
304}

◆ AddSolid() [10/23]

void G4VSceneHandler::AddSolid ( const G4Polyhedra polyhedra)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 111 of file G4VSceneHandler.cc.

306 {
307 AddSolidT (polyhedra);
308}

◆ AddSolid() [11/23]

void G4VSceneHandler::AddSolid ( const G4Sphere sphere)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 102 of file G4VSceneHandler.cc.

278 {
280}

◆ AddSolid() [12/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Sphere sphere)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1502 of file G4GMocrenFileSceneHandler.cc.

1503{
1505 G4cout << "***** AddSolid ( sphere )" << G4endl;
1506
1507 //----- skip drawing invisible primitive
1508 if( !IsVisible() ) { return ; }
1509
1510 //----- Initialize if necessary
1512
1513 //
1514 AddDetector(sphere);
1515
1516} // G4GMocrenFileSceneHandler::AddSolid ( sphere )

References AddDetector(), G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and IsVisible().

◆ AddSolid() [13/23]

void G4VSceneHandler::AddSolid ( const G4TessellatedSolid tess)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 112 of file G4VSceneHandler.cc.

310 {
311 AddSolidT (tess);
312}

◆ AddSolid() [14/23]

void G4VSceneHandler::AddSolid ( const G4Torus torus)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 103 of file G4VSceneHandler.cc.

282 {
284}

◆ AddSolid() [15/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Torus torus)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1557 of file G4GMocrenFileSceneHandler.cc.

1558{
1560 G4cout << "***** AddSolid ( torus )" << G4endl;
1561
1562 //----- skip drawing invisible primitive
1563 if( !IsVisible() ) { return ; }
1564
1565 //----- Initialize if necessary
1567
1568 //
1569 AddDetector(torus);
1570
1571} // void G4GMocrenFileSceneHandler::AddSolid( const G4Torus& )

References AddDetector(), G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and IsVisible().

◆ AddSolid() [16/23]

void G4VSceneHandler::AddSolid ( const G4Trap trap)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 104 of file G4VSceneHandler.cc.

286 {
287 AddSolidT (trap);
288}

◆ AddSolid() [17/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Trap trap)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1538 of file G4GMocrenFileSceneHandler.cc.

1539{
1541 G4cout << "***** AddSolid ( trap )" << G4endl;
1542
1543 //----- skip drawing invisible primitive
1544 if( !IsVisible() ) { return ; }
1545
1546 //----- Initialize if necessary
1548
1549 //
1550 AddDetector(trap);
1551
1552} // G4GMocrenFileSceneHandler::AddSolid (const G4Trap& trap)

References AddDetector(), G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and IsVisible().

◆ AddSolid() [18/23]

void G4VSceneHandler::AddSolid ( const G4Trd trd)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 105 of file G4VSceneHandler.cc.

290 {
291 AddSolidT (trd);
292}

◆ AddSolid() [19/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Trd trd)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1483 of file G4GMocrenFileSceneHandler.cc.

1484{
1486 G4cout << "***** AddSolid ( trd )" << G4endl;
1487
1488
1489 //----- skip drawing invisible primitive
1490 if( !IsVisible() ) { return ; }
1491
1492 //----- Initialize if necessary
1494
1495 //
1496 AddDetector(trd);
1497
1498} // G4GMocrenFileSceneHandler::AddSolid ( trd )

References AddDetector(), G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFBeginModeling(), GFDEBUG, and IsVisible().

◆ AddSolid() [20/23]

void G4VSceneHandler::AddSolid ( const G4Tubs tubs)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 106 of file G4VSceneHandler.cc.

294 {
295 AddSolidT (tubs);
296}

◆ AddSolid() [21/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4Tubs tubs)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1422 of file G4GMocrenFileSceneHandler.cc.

1423{
1425 G4cout << "***** AddSolid ( tubes )" << G4endl;
1426
1427 //----- skip drawing invisible primitive
1428 if( !IsVisible() ) { return ; }
1429
1430 //----- Initialize if necessary
1432
1433 //
1434 AddDetector(tubes);
1435
1436
1437 // for a debug
1438 if(GFDEBUG_DET > 0) {
1439 G4cout << "-------" << G4endl;
1440 G4cout << " " << tubes.GetName() << G4endl;
1441 G4Polyhedron * poly = tubes.CreatePolyhedron();
1442 G4int nv = poly->GetNoVertices();
1443 for(G4int i = 0; i < nv; i++) {
1444 G4cout << " (" << poly->GetVertex(i).x() << ", "
1445 << poly->GetVertex(i).y() << ", "
1446 << poly->GetVertex(i).z() << ")" << G4endl;
1447 }
1448 delete poly;
1449 }
1450
1451 const G4VModel* pv_model = GetModel();
1452 if (!pv_model) { return ; }
1453 G4PhysicalVolumeModel* pPVModel =
1454 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
1455 if (!pPVModel) { return ; }
1456 G4Material * mat = pPVModel->GetCurrentMaterial();
1457 G4String name = mat->GetName();
1458
1459} // void G4GMocrenFileSceneHandler::AddSolid( const G4Tubs& )
G4Point3D GetVertex(G4int index) const
G4int GetNoVertices() const

References AddDetector(), G4VisManager::confirmations, G4Tubs::CreatePolyhedron(), G4VSceneHandler::fpModel, G4cout, G4endl, G4PhysicalVolumeModel::GetCurrentMaterial(), G4VSceneHandler::GetModel(), G4VSolid::GetName(), G4Material::GetName(), HepPolyhedron::GetNoVertices(), G4VisManager::GetVerbosity(), HepPolyhedron::GetVertex(), GFBeginModeling(), GFDEBUG, GFDEBUG_DET, IsVisible(), G4InuclParticleNames::name(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

◆ AddSolid() [22/23]

void G4VSceneHandler::AddSolid ( const G4VSolid solid)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 115 of file G4VSceneHandler.cc.

314 {
315 AddSolidT (solid);
316}

◆ AddSolid() [23/23]

void G4GMocrenFileSceneHandler::AddSolid ( const G4VSolid solid)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1576 of file G4GMocrenFileSceneHandler.cc.

1577{
1578 //----- skip drawing invisible primitive
1579 if( !IsVisible() ) { return ; }
1580
1581 //----- Initialize if necessary
1583
1584 //
1585 AddDetector(solid);
1586
1587 //----- Send a primitive
1588 G4VSceneHandler::AddSolid( solid ) ;
1589
1590} //G4GMocrenFileSceneHandler::AddSolid ( const G4VSolid& )
virtual void AddSolid(const G4Box &)

References AddDetector(), G4VSceneHandler::AddSolid(), GFBeginModeling(), and IsVisible().

◆ 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}
G4VViewer * fpViewer
const G4VisAttributes * fpVisAttribs
virtual void RequestPrimitives(const G4VSolid &solid)
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const

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().

◆ 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()

virtual void G4GMocrenFileSceneHandler::BeginModeling ( )
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 73 of file G4GMocrenFileSceneHandler.hh.

References G4VSceneHandler::BeginModeling().

◆ BeginPrimitives()

void G4GMocrenFileSceneHandler::BeginPrimitives ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 814 of file G4GMocrenFileSceneHandler.cc.

815{
817 G4cout << "***** BeginPrimitives " << G4endl;
818
820
821 G4VSceneHandler::BeginPrimitives (objectTransformation);
822
823}
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())

References G4VSceneHandler::BeginPrimitives(), G4VisManager::confirmations, G4cout, G4endl, G4VisManager::GetVerbosity(), GFBeginModeling(), and GFDEBUG.

◆ 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().

◆ BeginSavingGdd()

void G4GMocrenFileSceneHandler::BeginSavingGdd ( void  )

Definition at line 281 of file G4GMocrenFileSceneHandler.cc.

282{
284 G4cout << "***** BeginSavingGdd (called)" << G4endl;
285
286 if( !IsSavingGdd() ) {
287
289 G4cout << "***** (started) " ;
290 G4cout << "(open g4.gdd, ##)" << G4endl;
291 }
292
293 SetGddFileName() ; // result set to kGddFileName
294 kFlagSaving_g4_gdd = true;
295
296
298 short minmax[2];
299 minmax[0] = ctdens.GetMinCT();
300 minmax[1] = ctdens.GetMaxCT();
302 std::vector<G4float> map;
303 G4float dens;
304 for(G4int i = minmax[0]; i <= minmax[1]; i++) {
305 dens = ctdens.GetDensity(i);
306 map.push_back(dens);
307 }
309
310 /*
311 G4String fname = "modality-map.dat";
312 std::ifstream ifile(fname);
313 if(ifile) {
314 short minmax[2];
315 ifile >> minmax[0] >> minmax[1];
316 kgMocrenIO->setModalityImageMinMax(minmax);
317 std::vector<G4float> map;
318 G4float dens;
319 for(G4int i = minmax[0]; i <= minmax[1]; i++) {
320 ifile >> dens;
321 map.push_back(dens);
322 }
323 kgMocrenIO->setModalityImageDensityMap(map);
324
325 } else {
326 G4cout << "cann't open the file : " << fname << G4endl;
327 }
328 */
329
330 // mesh size
331 //kMessenger.getNoVoxels(kModalitySize[0], kModalitySize[1], kModalitySize[2]);
332 //kgMocrenIO->setModalityImageSize(kModalitySize);
333
334 // initializations
335 //kgMocrenIO->clearModalityImage();
340 std::vector<Detector>::iterator itr = kDetectors.begin();
341 for(; itr != kDetectors.end(); itr++) {
342 itr->clear();
343 }
344 kDetectors.clear();
345
346 kNestedHitsList.clear();
347 kNestedVolumeNames.clear();
348
349 }
350}
G4double GetDensity(G4int &_ct) const
void setModalityImageDensityMap(std::vector< float > &_map)
void clearDetector()
Definition: G4GMocrenIO.hh:451
void clearROIAll()
void setModalityImageMinMax(short _minmax[2])
void clearDoseDistAll()
void clearTracks()
Definition: G4GMocrenIO.hh:439

References G4GMocrenIO::clearDetector(), G4GMocrenIO::clearDoseDistAll(), G4GMocrenIO::clearROIAll(), G4GMocrenIO::clearTracks(), G4VisManager::confirmations, G4cout, G4endl, G4GMocrenFileCTtoDensityMap::GetDensity(), G4GMocrenFileCTtoDensityMap::GetMaxCT(), G4GMocrenFileCTtoDensityMap::GetMinCT(), G4VisManager::GetVerbosity(), GFDEBUG, IsSavingGdd(), kDetectors, kFlagSaving_g4_gdd, kgMocrenIO, kNestedHitsList, kNestedVolumeNames, anonymous_namespace{G4QuasiElRatios.cc}::map, SetGddFileName(), G4GMocrenIO::setModalityImageDensityMap(), and G4GMocrenIO::setModalityImageMinMax().

Referenced by GFBeginModeling().

◆ ClearStore()

void G4VSceneHandler::ClearStore ( )
virtualinherited

◆ ClearTransientStore()

void G4GMocrenFileSceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1905 of file G4GMocrenFileSceneHandler.cc.

1906{
1907 // This is typically called after an update and before drawing hits
1908 // of the next event. To simulate the clearing of "transients"
1909 // (hits, etc.) the detector is redrawn...
1910 if (fpViewer) {
1911 fpViewer -> SetView ();
1912 fpViewer -> ClearView ();
1913 fpViewer -> DrawView ();
1914 }
1915}

References G4VSceneHandler::fpViewer.

◆ 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

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
const G4VisExtent & GetExtent() const
const G4ViewParameters & GetViewParameters() 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()

virtual void G4GMocrenFileSceneHandler::EndModeling ( )
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 74 of file G4GMocrenFileSceneHandler.hh.

References G4VSceneHandler::EndModeling().

◆ EndPrimitives()

void G4GMocrenFileSceneHandler::EndPrimitives ( )
virtual

◆ EndPrimitives2D()

void G4VSceneHandler::EndPrimitives2D ( )
virtualinherited

◆ EndSavingGdd()

void G4GMocrenFileSceneHandler::EndSavingGdd ( void  )

Definition at line 352 of file G4GMocrenFileSceneHandler.cc.

353{
355 G4cout << "***** EndSavingGdd (called)" << G4endl;
356
357 if(IsSavingGdd()) {
359 G4cout << "***** (started) (close "
360 << kGddFileName << ")" << G4endl;
361
362 if(kGddDest) kGddDest.close();
363 kFlagSaving_g4_gdd = false;
364
365 std::map<Index3D, G4float>::iterator itr = kNestedModality.begin();
366 G4int xmax=0, ymax=0, zmax=0;
367 for(; itr != kNestedModality.end(); itr++) {
368 if(itr->first.x > xmax) xmax = itr->first.x;
369 if(itr->first.y > ymax) ymax = itr->first.y;
370 if(itr->first.z > zmax) zmax = itr->first.z;
371 }
372 // mesh size
373 kModalitySize[0] = xmax+1;
374 kModalitySize[1] = ymax+1;
375 kModalitySize[2] = zmax+1;
377 if(GFDEBUG) G4cout << "gMocren-file driver : modality size : "
378 << kModalitySize[0] << " x "
379 << kModalitySize[1] << " x "
380 << kModalitySize[2] << G4endl;
381
383 //std::map<G4int, G4float>::iterator itr;
384 for(G4int z = 0; z < kModalitySize[2]; z++) {
385 short * modality = new short[nxy];
386 for(G4int y = 0; y < kModalitySize[1]; y++) {
387 for(G4int x = 0; x < kModalitySize[0]; x++) {
388 //for(G4int x = kModalitySize[0]-1; x >= 0 ; x--) {
389 //G4int ixy = x + (kModalitySize[1]-y-1)*kModalitySize[0];
390
391 G4int ixy = x + y*kModalitySize[0];
392 Index3D idx(x,y,z);
393 itr = kNestedModality.find(idx);
394 if(itr != kNestedModality.end()) {
395
396 modality[ixy] = kgMocrenIO->convertDensityToHU(itr->second);
397 } else {
398 modality[ixy] = -1024;
399 }
400
401 }
402 }
403 kgMocrenIO->setModalityImage(modality);
404 }
405
406 //-- dose
407 size_t nhits = kNestedHitsList.size();
408 if(GFDEBUG) G4cout << "gMocren-file driver : # hits = " << nhits << G4endl;
409
410 std::map<Index3D, G4double>::iterator hitsItr;
411 std::map<G4String, std::map<Index3D, G4double> >::iterator hitsListItr = kNestedHitsList.begin();
412
413 for(G4int n = 0; hitsListItr != kNestedHitsList.end(); hitsListItr++, n++) {
414
416 kgMocrenIO->setDoseDistName(hitsListItr->first, n);
418
419 G4double minmax[2] = {DBL_MAX, -DBL_MAX};
420 for(G4int z = 0 ; z < kModalitySize[2]; z++) {
421 G4double * values = new G4double[nxy];
422 for(G4int y = 0; y < kModalitySize[1]; y++) {
423 for(G4int x = 0; x < kModalitySize[0]; x++) {
424
425 G4int ixy = x + y*kModalitySize[0];
426 Index3D idx(x,y,z);
427 hitsItr = hitsListItr->second.find(idx);
428 if(hitsItr != hitsListItr->second.end()) {
429
430 values[ixy] = hitsItr->second;
431 } else {
432 values[ixy] = 0.;
433 }
434 if(values[ixy] < minmax[0]) minmax[0] = values[ixy];
435 if(values[ixy] > minmax[1]) minmax[1] = values[ixy];
436 }
437 }
438 kgMocrenIO->setDoseDist(values, n);
439 }
441 G4double lower = 0.;
442 if(minmax[0] < 0) lower = minmax[0];
443 G4double scale = (minmax[1]-lower)/25000.;
445 G4String sunit("unit?"); //temporarily
447 }
448
449
450 //-- draw axes
451 if(false) {//true,false
452 G4ThreeVector trans;
456 // x
457 std::vector<G4float *> tracks;
458 unsigned char colors[3];
459 G4float * trk = new G4float[6];
460 tracks.push_back(trk);
461
462 G4ThreeVector orig(0.,0.,0), xa(2000.,0.,0.), ya(0.,2000.,0.), za(0.,0.,2000.);
463 orig -= trans;
464 orig.transform(rot);
465 xa -= trans;
466 xa.transform(rot);
467 ya -= trans;
468 ya.transform(rot);
469 za -= trans;
470 za.transform(rot);
471 for(G4int i = 0; i < 3; i++) trk[i] = orig[i];
472 for(G4int i = 0; i < 3; i++) trk[i+3] = xa[i];
473 colors[0] = 255; colors[1] = 0; colors[2] = 0;
474 kgMocrenIO->addTrack(tracks, colors);
475 // y
476 for(G4int i = 0; i < 3; i++) trk[i+3] = ya[i];
477 colors[0] = 0; colors[1] = 255; colors[2] = 0;
478 kgMocrenIO->addTrack(tracks, colors);
479 // z
480 for(G4int i = 0; i < 3; i++) trk[i+3] = za[i];
481 colors[0] = 0; colors[1] = 0; colors[2] = 255;
482 kgMocrenIO->addTrack(tracks, colors);
483 }
484
485 //-- detector
487
488
489 if(GFDEBUG_DET) G4cout << ">>>>>>>>>>>>>>>>>>>>>> (";
490 std::vector<G4float> transformObjects;
491 for(G4int i = 0; i < 3; i++) {
492 // need to check!!
493 transformObjects.push_back((kVolumeSize[i]/2. - kVoxelDimension[i]/2.));
494 if(GFDEBUG_DET) G4cout << transformObjects[i] << ", ";
495 }
496 if(GFDEBUG_DET) G4cout << ")" << G4endl;
497
498
499 kgMocrenIO->translateTracks(transformObjects);
500 kgMocrenIO->translateDetector(transformObjects);
501
502 // store
504 }
505
506}
void setModalityImageSize(int _size[3])
void setDoseDistUnit(std::string &_unit, int _num=0)
short convertDensityToHU(float &_dens)
void setDoseDistMinMax(short _minmax[2], int _num=0)
void setDoseDistScale(double &_scale, int _num=0)
void translateDetector(std::vector< float > &_translate)
void setDoseDistName(std::string _name, int _num=0)
bool storeData(char *_filename)
Definition: G4GMocrenIO.cc:457
void setModalityImage(short *_image)
void setDoseDistSize(int _size[3], int _num=0)
void newDoseDist()
void setDoseDist(double *_image, int _num=0)
void translateTracks(std::vector< float > &_translateo)
#define DBL_MAX
Definition: templates.hh:62

References G4GMocrenIO::addTrack(), G4VisManager::confirmations, G4GMocrenIO::convertDensityToHU(), DBL_MAX, ExtractDetector(), G4cout, G4endl, HepGeom::Transform3D::getRotation(), HepGeom::Transform3D::getTranslation(), G4VisManager::GetVerbosity(), GFDEBUG, GFDEBUG_DET, CLHEP::HepRotation::inverse(), IsSavingGdd(), kFlagSaving_g4_gdd, kGddDest, kGddFileName, kgMocrenIO, kModalitySize, kNestedHitsList, kNestedModality, kVolumeSize, kVolumeTrans3D, kVoxelDimension, CLHEP::detail::n, G4GMocrenIO::newDoseDist(), G4GMocrenIO::setDoseDist(), G4GMocrenIO::setDoseDistMinMax(), G4GMocrenIO::setDoseDistName(), G4GMocrenIO::setDoseDistScale(), G4GMocrenIO::setDoseDistSize(), G4GMocrenIO::setDoseDistUnit(), G4GMocrenIO::setModalityImage(), G4GMocrenIO::setModalityImageSize(), G4GMocrenIO::storeData(), CLHEP::Hep3Vector::transform(), G4GMocrenIO::translateDetector(), and G4GMocrenIO::translateTracks().

Referenced by GFEndModeling().

◆ ExtractDetector()

void G4GMocrenFileSceneHandler::ExtractDetector ( )
private

Definition at line 1962 of file G4GMocrenFileSceneHandler.cc.

1962 {
1963
1964 std::vector<Detector>::iterator itr = kDetectors.begin();
1965
1966 for(; itr != kDetectors.end(); itr++) {
1967
1968 // detector name
1969 G4String detname = itr->name;
1970 if(GFDEBUG_DET > 1)
1971 G4cout << "Detector name : " << detname << G4endl;
1972
1973 // edge points of the detector
1974 std::vector<G4float *> dedges;
1975 G4Polyhedron * poly = itr->polyhedron;
1976 poly->Transform(itr->transform3D);
1977 G4Transform3D invVolTrans = kVolumeTrans3D.inverse();
1978 poly->Transform(invVolTrans);
1979
1980 G4Point3D v1, v2;
1981 G4bool bnext = true;
1982 G4int next;
1983 G4int nedges = 0;
1984 //
1985 while(bnext) {
1986 if(!(poly->GetNextEdge(v1, v2, next))) bnext =false;
1987 G4float * edge = new G4float[6];
1988 edge[0] = v1.x()/mm;
1989 edge[1] = v1.y()/mm;
1990 edge[2] = v1.z()/mm;
1991 edge[3] = v2.x()/mm;
1992 edge[4] = v2.y()/mm;
1993 edge[5] = v2.z()/mm;
1994 dedges.push_back(edge);
1995 nedges++;
1996 }
1997 //delete poly;
1998 // detector color
1999 unsigned char uccolor[3] = {itr->color[0],
2000 itr->color[1],
2001 itr->color[2]};
2002 //
2003 kgMocrenIO->addDetector(detname, dedges, uccolor);
2004 for(G4int i = 0; i < nedges; i++) { // # of edges is 12.
2005 delete [] dedges[i];
2006 }
2007 dedges.clear();
2008
2009 if(GFDEBUG_DET > 1) {
2010 G4cout << " color: (" << (G4int)uccolor[0] << ", "
2011 << (G4int)uccolor[1] << ", " << (G4int)uccolor[2] << ")"
2012 << G4endl;
2013 }
2014 }
2015}
void addDetector(std::string &_name, std::vector< float * > &_det, unsigned char _color[3])
Transform3D inverse() const
Definition: Transform3D.cc:141

References G4GMocrenIO::addDetector(), G4cout, G4endl, HepPolyhedron::GetNextEdge(), GFDEBUG_DET, HepGeom::Transform3D::inverse(), kDetectors, kgMocrenIO, kVolumeTrans3D, mm, HepPolyhedron::Transform(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

Referenced by EndSavingGdd().

◆ 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 G4OpenInventorSceneHandler::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

Definition at line 1000 of file G4VSceneHandler.cc.

1000 {
1001 auto pVA = visible.GetVisAttributes();
1003 return pVA->GetColour();
1004}
const G4Colour & GetColour() const
const G4VisAttributes * GetVisAttributes() const

References G4VSceneHandler::fpViewer, G4VisAttributes::GetColour(), G4ViewParameters::GetDefaultVisAttributes(), G4VViewer::GetViewParameters(), and G4Visible::GetVisAttributes().

◆ 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(), G4OpenInventorSceneHandler::AddProperties(), G4OpenInventorSceneHandler::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().

◆ GetGddFileName()

const char * G4GMocrenFileSceneHandler::GetGddFileName ( )
inline

◆ 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 G4OpenInventorSceneHandler::AddCircleSquare(), G4Qt3DSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), G4HepRepFileSceneHandler::AddPrimitive(), G4OpenGLSceneHandler::AddPrimitive(), G4OpenInventorSceneHandler::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

◆ GetNestedVolumeIndex()

void G4GMocrenFileSceneHandler::GetNestedVolumeIndex ( G4int  _idx,
G4int  _idx3d[3] 
)
private

Definition at line 2017 of file G4GMocrenFileSceneHandler.cc.

2017 {
2018 if(kNestedVolumeDimension[0] == 0 ||
2019 kNestedVolumeDimension[1] == 0 ||
2020 kNestedVolumeDimension[2] == 0) {
2021 for(G4int i = 0; i < 3; i++) _idx3d[i] = 0;
2022 return;
2023 }
2024
2025
2026 if(kFlagParameterization == 0) {
2027
2029 G4int line = kNestedVolumeDimension[2];
2030
2031 /*
2032 G4int idx3d[3];
2033 idx3d[0] = _idx/plane;
2034 idx3d[1] = (_idx%plane)/line;
2035 idx3d[2] = (_idx%plane)%line;
2036 _idx3d[0] = idx3d[kNestedVolumeDirAxis[0]];
2037 _idx3d[1] = idx3d[kNestedVolumeDirAxis[1]];
2038 _idx3d[2] = idx3d[kNestedVolumeDirAxis[2]];
2039 */
2040
2041 _idx3d[kNestedVolumeDirAxis[0]] = _idx/plane;
2042 _idx3d[kNestedVolumeDirAxis[1]] = (_idx%plane)/line;
2043 _idx3d[kNestedVolumeDirAxis[2]] = (_idx%plane)%line;
2044
2045
2046
2047 /*
2048
2049 G4cout << "G4GMocrenFileSceneHandler::GetNestedVolumeIndex : " << G4endl;
2050 G4cout << "(depi, depj, depk) : "
2051 << kNestedVolumeDirAxis[0] << ", "
2052 << kNestedVolumeDirAxis[1] << ", "
2053 << kNestedVolumeDirAxis[2] << G4endl;
2054 G4cout << "(ni, nj, nk) :"
2055 << kNestedVolumeDimension[0] << ", "
2056 << kNestedVolumeDimension[1] << ", "
2057 << kNestedVolumeDimension[2] << " - " << G4endl;
2058
2059 G4cout << " _idx = " << _idx << " : plane = "
2060 << plane << " , line = " << line << G4endl;
2061 G4cout << "(idx,idy,idz) + " << _idx3d[0] << ", "
2062 << _idx3d[1] << ", " << _idx3d[2] << " + " << G4endl;
2063
2064 */
2065
2066
2067
2068 } else {
2069
2071 G4int line = kNestedVolumeDimension[0];
2072 _idx3d[kNestedVolumeDirAxis[2]] = _idx/plane;
2073 _idx3d[kNestedVolumeDirAxis[1]] = (_idx%plane)/line;
2074 _idx3d[kNestedVolumeDirAxis[0]] = (_idx%plane)%line;
2075
2076 }
2077
2078}

References kFlagParameterization, kNestedVolumeDimension, and kNestedVolumeDirAxis.

Referenced by AddCompound().

◆ 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

◆ GetSystem()

G4GMocrenFile & G4GMocrenFileSceneHandler::GetSystem ( )
inline

Definition at line 110 of file G4GMocrenFileSceneHandler.hh.

110{ return kSystem ; }

References kSystem.

◆ 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

◆ GFBeginModeling()

void G4GMocrenFileSceneHandler::GFBeginModeling ( void  )

Definition at line 510 of file G4GMocrenFileSceneHandler.cc.

511{
513
514 if( !GFIsInModeling() ) {
515
517 G4cout << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl;
518
519 //----- Send saving command and heading comment
521
522 kFlagInModeling = true ;
523
524 // These models are entrusted to user commands /vis/scene/add/psHits or hits
525 //GetScene()->AddEndOfEventModel(new G4PSHitsModel());
526 //GetScene()->AddEndOfRunModel(new G4PSHitsModel());
527 //scene->AddEndOfEventModel(new G4HitsModel());
528 if(GFDEBUG_HIT) {
529 G4Scene * scene = GetScene();
530 std::vector<G4Scene::Model> vmodel = scene->GetEndOfEventModelList();
531 std::vector<G4Scene::Model>::iterator itr = vmodel.begin();
532 for(; itr != vmodel.end(); itr++) {
533 G4cout << " IIIIII model name: " << itr->fpModel->GetGlobalTag() << G4endl;
534 }
535 }
536 }
537}
const std::vector< Model > & GetEndOfEventModelList() const
G4Scene * GetScene() const

References G4VSceneHandler::BeginModeling(), BeginSavingGdd(), G4VisManager::confirmations, G4cout, G4endl, G4Scene::GetEndOfEventModelList(), G4VSceneHandler::GetScene(), G4VisManager::GetVerbosity(), GFDEBUG, GFDEBUG_HIT, GFIsInModeling(), and kFlagInModeling.

Referenced by AddPrimitive(), AddSolid(), BeginPrimitives(), G4GMocrenFileViewer::ClearView(), and G4GMocrenFileViewer::DrawView().

◆ GFEndModeling()

void G4GMocrenFileSceneHandler::GFEndModeling ( )

Definition at line 787 of file G4GMocrenFileSceneHandler.cc.

788{
790
791 //-----
793 G4cout << "***** GFEndModeling (called)" << G4endl;
794
795 if( GFIsInModeling() ) {
796
798 G4cout << "***** GFEndModeling (started) " ;
799 G4cout << "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl;
800 }
801
802 //----- End saving data to g4.gdd
803 EndSavingGdd() ;
804
805 //------ Reset flag
806 kFlagInModeling = false ;
807
808 }
809
810}

References G4VisManager::confirmations, G4VSceneHandler::EndModeling(), EndSavingGdd(), G4cout, G4endl, G4VisManager::GetVerbosity(), GFDEBUG, GFIsInModeling(), and kFlagInModeling.

Referenced by G4GMocrenFileViewer::ShowView(), and ~G4GMocrenFileSceneHandler().

◆ GFIsInModeling()

G4bool G4GMocrenFileSceneHandler::GFIsInModeling ( )
inline

Definition at line 103 of file G4GMocrenFileSceneHandler.hh.

103{ return kFlagInModeling ; }

References kFlagInModeling.

Referenced by GFBeginModeling(), GFEndModeling(), and G4GMocrenFileViewer::ShowView().

◆ IncrementViewCount()

G4int G4VSceneHandler::IncrementViewCount ( )
inherited

◆ InitializeParameters()

void G4GMocrenFileSceneHandler::InitializeParameters ( )
private

Definition at line 191 of file G4GMocrenFileSceneHandler.cc.

191 {
192
194
195 for(G4int i = 0; i < 3; i++) {
196 kModalitySize[i] = 0;
198 kNestedVolumeDirAxis[i] = -1;
199 }
200
201 // delete kgMocrenIO;
202
203}

References kbSetModalityVoxelSize, kModalitySize, kNestedVolumeDimension, and kNestedVolumeDirAxis.

Referenced by G4GMocrenFileSceneHandler().

◆ IsReadyForTransients()

G4bool G4VSceneHandler::IsReadyForTransients ( ) const
inherited

◆ IsSavingGdd()

G4bool G4GMocrenFileSceneHandler::IsSavingGdd ( void  )
inline

Definition at line 105 of file G4GMocrenFileSceneHandler.hh.

105{ return kFlagSaving_g4_gdd ; }

References kFlagSaving_g4_gdd.

Referenced by BeginSavingGdd(), and EndSavingGdd().

◆ IsVisible()

G4bool G4GMocrenFileSceneHandler::IsVisible ( void  )
private

Definition at line 1887 of file G4GMocrenFileSceneHandler.cc.

1888{
1889 //-----
1890 G4bool visibility = true ;
1891
1892 const G4VisAttributes* pVisAttribs =
1894
1895 if(pVisAttribs) {
1896 visibility = pVisAttribs->IsVisible();
1897 }
1898
1899 return visibility ;
1900
1901} // G4GMocrenFileSceneHandler::IsVisible()
G4bool IsVisible() const

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

Referenced by AddSolid().

◆ 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
std::vector< G4AttValue > * CreateCurrentAttValues() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
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 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 G4OpenInventorSceneHandler::AddCircleSquare(), G4OpenInventorSceneHandler::AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), and G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal().

◆ PostAddSolid()

void G4VSceneHandler::PostAddSolid ( )
virtualinherited

◆ PreAddSolid()

void G4VSceneHandler::PreAddSolid ( const G4Transform3D objectTransformation,
const G4VisAttributes visAttribs 
)
virtualinherited

◆ 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
void DrawEvent(const G4Event *)
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 *)
G4ViewParameters::DrawingStyle GetDrawingStyle(const G4VisAttributes *)
virtual void AddPrimitive(const G4Polyline &)=0
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

◆ SetGddFileName()

void G4GMocrenFileSceneHandler::SetGddFileName ( )

Definition at line 206 of file G4GMocrenFileSceneHandler.cc.

207{
208 // g4_00.gdd, g4_01.gdd, ..., g4_MAX_FILE_INDEX.gdd
209 const G4int MAX_FILE_INDEX = kMaxFileNum - 1 ;
210
211 // dest directory (null if no environmental variables is set)
212 std::strncpy(kGddFileName, kGddDestDir, sizeof(kGddFileName)-1);
213 kGddFileName[sizeof(kGddFileName)-1] = '\0';
214
215 // create full path name (default)
216 std::strncat ( kGddFileName, DEFAULT_GDD_FILE_NAME,
217 sizeof(kGddFileName) - std::strlen(kGddFileName) - 1);
218
219 // Automatic updation of file names
220 static G4int currentNumber = 0;
221 for( G4int i = currentNumber ; i < kMaxFileNum ; i++) {
222
223 // Message in the final execution
224 if( i == MAX_FILE_INDEX )
225 {
227 G4cout << "===========================================" << G4endl;
228 G4cout << "WARNING MESSAGE from GMocrenFile driver: " << G4endl;
229 G4cout << " This file name is the final one in the " << G4endl;
230 G4cout << " automatic updation of the output file name." << G4endl;
231 G4cout << " You may overwrite existing files, i.e. " << G4endl;
232 G4cout << " g4_XX.gdd." << G4endl;
233 G4cout << "===========================================" << G4endl;
234 }
235 }
236
237 // re-determine file name as G4GMocrenFile_DEST_DIR/g4_XX.gdd
238 std::ostringstream filename;
239 filename
241 << std::setw(2) << std::setfill('0') << i << ".wrl";
242 strncpy(kGddFileName,filename.str().c_str(),sizeof(kGddFileName)-1);
243 kGddFileName[sizeof(kGddFileName)-1] = '\0';
244
245 // check validity of the file name
246 std::ifstream fin(kGddFileName);
247 if(GFDEBUG)
248 G4cout << "FILEOPEN: " << i << " : " << kGddFileName << fin.fail()
249 << G4endl;
250 if(!fin) {
251 // new file
252 fin.close();
253 currentNumber = i+1;
254 break;
255 } else {
256 // already exists (try next)
257 fin.close();
258 }
259
260 } // for
261
262 G4cout << "======================================================================" << G4endl;
263 G4cout << "Output file: " << kGddFileName << G4endl;
264 G4cout << "Destination directory (current dir if NULL): " << kGddDestDir << G4endl;
265 G4cout << "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl;
266 G4cout << "Note:" << G4endl;
267 G4cout << " * The maximum number is customizable as: " << G4endl;
268 G4cout << " % setenv G4GMocrenFile_MAX_FILE_NUM number " << G4endl;
269 G4cout << " * The destination directory is customizable as:" << G4endl;
270 G4cout << " % setenv G4GMocrenFile_DEST_DIR dir_name/ " << G4endl;
271 G4cout << " ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl;
272 //G4cout << " dir_name, e.g. \"./tmp/\"." << G4endl;
273 G4cout << G4endl;
274 G4cout << "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl;
275 G4cout << "======================================================================" << G4endl;
276
277} // G4GMocrenFileSceneHandler::SetGddFileName()
const char GDD_FILE_HEADER[]

References DEFAULT_GDD_FILE_NAME, G4cout, G4endl, GDD_FILE_HEADER, G4VisManager::GetVerbosity(), GFDEBUG, kGddDestDir, kGddFileName, kMaxFileNum, MAX_NUM_TRAJECTORIES, and G4VisManager::warnings.

Referenced by BeginSavingGdd().

◆ 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

◆ G4GMocrenFileViewer

friend class G4GMocrenFileViewer
friend

Definition at line 55 of file G4GMocrenFileSceneHandler.hh.

Field Documentation

◆ 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().

◆ 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

◆ 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 G4OpenInventorSceneHandler::AddCircleSquare(), G4VtkSceneHandler::AddCompound(), G4HepRepFileSceneHandler::AddHepRepInstance(), G4ToolsSGSceneHandler::AddPrimitive(), G4OpenGLSceneHandler::AddPrimitive(), G4Qt3DSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), G4OpenInventorSceneHandler::AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(), G4VtkSceneHandler::AddPrimitiveTensorGlyph(), G4OpenInventorSceneHandler::AddProperties(), G4HepRepFileSceneHandler::AddSolid(), G4VSceneHandler::AddSolidT(), G4VSceneHandler::AddSolidWithAuxiliaryEdges(), G4OpenInventorSceneHandler::AddTransform(), G4OpenGLImmediateSceneHandler::BeginPrimitives2D(), G4OpenGLStoredQtSceneHandler::ClearStore(), ClearTransientStore(), G4HepRepFileSceneHandler::ClearTransientStore(), G4OpenGLImmediateSceneHandler::ClearTransientStore(), G4OpenGLStoredQtSceneHandler::ClearTransientStore(), G4OpenGLStoredSceneHandler::ClearTransientStore(), G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::CreateSectionSolid(), G4OpenGLStoredSceneHandler::EndModeling(), G4OpenGLStoredQtSceneHandler::ExtraPOProcessing(), G4OpenInventorSceneHandler::GeneratePrerequisites(), G4VSceneHandler::GetAuxEdgeVisible(), G4VSceneHandler::GetColour(), G4VSceneHandler::GetDrawingStyle(), G4VSceneHandler::GetLineWidth(), G4VSceneHandler::GetMarkerSize(), G4VSceneHandler::GetNoOfSides(), G4VSceneHandler::GetNumberOfCloudPoints(), G4VSceneHandler::GetTextColour(), IsVisible(), G4VSceneHandler::RequestPrimitives(), and G4OpenGLStoredQtSceneHandler::SetScene().

◆ fpVisAttribs

const G4VisAttributes* G4VSceneHandler::fpVisAttribs
protectedinherited

◆ fReadyForTransients

G4bool G4VSceneHandler::fReadyForTransients
protectedinherited

◆ fSceneHandlerId

const G4int G4VSceneHandler::fSceneHandlerId
protectedinherited

Definition at line 346 of file G4VSceneHandler.hh.

◆ fSystem

G4VGraphicsSystem& G4VSceneHandler::fSystem
protectedinherited

Definition at line 345 of file G4VSceneHandler.hh.

Referenced by G4VSceneHandler::AddPrimitive().

◆ 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

◆ kbModelingTrajectory

G4bool G4GMocrenFileSceneHandler::kbModelingTrajectory
private

Definition at line 137 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddCompound(), and AddPrimitive().

◆ kbSetModalityVoxelSize

G4bool G4GMocrenFileSceneHandler::kbSetModalityVoxelSize
private

Definition at line 136 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddSolid(), and InitializeParameters().

◆ kDetectors

std::vector<Detector> G4GMocrenFileSceneHandler::kDetectors
private

Definition at line 154 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddDetector(), BeginSavingGdd(), and ExtractDetector().

◆ kFlagInModeling

G4bool G4GMocrenFileSceneHandler::kFlagInModeling
private

◆ kFlagParameterization

G4int G4GMocrenFileSceneHandler::kFlagParameterization
private

Definition at line 194 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddSolid(), and GetNestedVolumeIndex().

◆ kFlagProcessedInteractiveScorer

G4bool G4GMocrenFileSceneHandler::kFlagProcessedInteractiveScorer
private

Definition at line 197 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddSolid().

◆ kFlagSaving_g4_gdd

G4bool G4GMocrenFileSceneHandler::kFlagSaving_g4_gdd
private

Definition at line 192 of file G4GMocrenFileSceneHandler.hh.

Referenced by BeginSavingGdd(), EndSavingGdd(), and IsSavingGdd().

◆ kGddDest

std::ofstream G4GMocrenFileSceneHandler::kGddDest
private

Definition at line 182 of file G4GMocrenFileSceneHandler.hh.

Referenced by EndSavingGdd(), and ~G4GMocrenFileSceneHandler().

◆ kGddDestDir

char G4GMocrenFileSceneHandler::kGddDestDir[256]
private

Definition at line 199 of file G4GMocrenFileSceneHandler.hh.

Referenced by G4GMocrenFileSceneHandler(), and SetGddFileName().

◆ kGddFileName

char G4GMocrenFileSceneHandler::kGddFileName[256]
private

◆ kgMocrenIO

G4GMocrenIO* G4GMocrenFileSceneHandler::kgMocrenIO
private

◆ kMaxFileNum

G4int G4GMocrenFileSceneHandler::kMaxFileNum
private

Definition at line 201 of file G4GMocrenFileSceneHandler.hh.

Referenced by G4GMocrenFileSceneHandler(), and SetGddFileName().

◆ kMessenger

G4GMocrenMessenger& G4GMocrenFileSceneHandler::kMessenger
private

Definition at line 130 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddCompound(), and AddSolid().

◆ kModality

std::map<G4int, float> G4GMocrenFileSceneHandler::kModality
private

Definition at line 133 of file G4GMocrenFileSceneHandler.hh.

◆ kModalitySize

G4int G4GMocrenFileSceneHandler::kModalitySize[3]
private

Definition at line 134 of file G4GMocrenFileSceneHandler.hh.

Referenced by EndSavingGdd(), and InitializeParameters().

◆ kNestedHitsList

std::map<G4String, std::map<Index3D, G4double> > G4GMocrenFileSceneHandler::kNestedHitsList
private

Definition at line 179 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddCompound(), BeginSavingGdd(), and EndSavingGdd().

◆ kNestedModality

std::map<Index3D, float> G4GMocrenFileSceneHandler::kNestedModality
private

Definition at line 177 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddSolid(), and EndSavingGdd().

◆ kNestedVolumeDimension

G4int G4GMocrenFileSceneHandler::kNestedVolumeDimension[3]
private

◆ kNestedVolumeDirAxis

G4int G4GMocrenFileSceneHandler::kNestedVolumeDirAxis[3]
private

◆ kNestedVolumeNames

std::vector<G4String> G4GMocrenFileSceneHandler::kNestedVolumeNames
private

Definition at line 157 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddSolid(), and BeginSavingGdd().

◆ kSceneIdCount

G4int G4GMocrenFileSceneHandler::kSceneIdCount = 0
staticprivate

Definition at line 139 of file G4GMocrenFileSceneHandler.hh.

◆ kSystem

G4GMocrenFile& G4GMocrenFileSceneHandler::kSystem
private

Definition at line 129 of file G4GMocrenFileSceneHandler.hh.

Referenced by GetSystem().

◆ kVolumeSize

G4ThreeVector G4GMocrenFileSceneHandler::kVolumeSize
private

Definition at line 155 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddSolid(), and EndSavingGdd().

◆ kVolumeTrans3D

G4Transform3D G4GMocrenFileSceneHandler::kVolumeTrans3D
private

◆ kVoxelDimension

G4ThreeVector G4GMocrenFileSceneHandler::kVoxelDimension
private

Definition at line 156 of file G4GMocrenFileSceneHandler.hh.

Referenced by AddSolid(), and EndSavingGdd().


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