next up previous contents
Next: Culling Up: Visualization attributes Previous: Where to set G4VisAttributes

How to use G4VisAttributes in coding

    //-------- run/example2/MyDetectorConstruction (modified) 
   ...........

       // Create a G4VisAttributes object with color entry "Blue"
    G4VisAttributes * calorimeterVisAtt
        = new G4VisAttributes(G4Colour(0.,0.,1.));

       // Set "Forced wireframe style" to the G4VisAttributes object 
    calorimeterVisAtt->SetForceWireframe(true);

       // Set "Invisibility" to  the G4VisAttributes object 
    calorimeterVisAtt->SetVisibility(false);

       // Set the G4VisAttributes* to a logical volume
    calorimeter_log->SetVisAttributes(calorimeterVisAtt);

   ...........



Satoshi Tanaka
3/13/1998