Message: Re: Regarding G4VisAttributes Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Regarding G4VisAttributes 

Forum: Geometry
Re: Question Regarding G4VisAttributes (Aqsa)
Date: Mar 20, 02:26
From: John Allison <John Allison>

If you look in B5DetectorConstruction.hh you will see that fVisAttributes is a std::vector<G4VisAttributes*>.

If you study any book on C++, or Google "C++ vector", you will see that a vector is a container - it stores things. You will also see that push_back is the name of the function for adding elements to the end.

So the writer of B5 is simply using fVisAttributes as somewhere to keep pointers to G4VisAttributes objects simply so that they may be cleanly deleted at the end of the job:

    100   for (auto visAttributes: fVisAttributes) {
    101     delete visAttributes;
    102   }  

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Ok: Re: Regarding G4VisAttributes   (Aqsa - Mar 21, 22:24)
 Add Message Add Message
to: "Re: Regarding G4VisAttributes"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]