G4DrawVoxels Class Reference

#include <G4DrawVoxels.hh>


Public Member Functions

 G4DrawVoxels ()
 ~G4DrawVoxels ()
void DrawVoxels (const G4LogicalVolume *lv) const
G4PlacedPolyhedronListCreatePlacedPolyhedra (const G4LogicalVolume *) const
void SetVoxelsVisAttributes (G4VisAttributes &, G4VisAttributes &, G4VisAttributes &)
void SetBoundingBoxVisAttributes (G4VisAttributes &)


Detailed Description

Definition at line 56 of file G4DrawVoxels.hh.


Constructor & Destructor Documentation

G4DrawVoxels::G4DrawVoxels (  ) 

Definition at line 56 of file G4DrawVoxels.cc.

References G4VisAttributes::SetColour().

00057 {
00058   fVoxelsVisAttributes[0].SetColour(G4Colour(1.,0.,0.));
00059   fVoxelsVisAttributes[1].SetColour(G4Colour(0.,1.,0.));
00060   fVoxelsVisAttributes[2].SetColour(G4Colour(0.,0.,1.));
00061   fBoundingBoxVisAttributes.SetColour(G4Colour(.3,0.,.2));
00062 }

G4DrawVoxels::~G4DrawVoxels (  ) 

Definition at line 66 of file G4DrawVoxels.cc.

00067 {
00068 }


Member Function Documentation

G4PlacedPolyhedronList * G4DrawVoxels::CreatePlacedPolyhedra ( const G4LogicalVolume  )  const

Definition at line 194 of file G4DrawVoxels.cc.

References G4LogicalVolume::GetVoxelHeader().

Referenced by DrawVoxels().

00195 {
00196   G4PlacedPolyhedronList* pplist=new G4PlacedPolyhedronList;
00197   G4VoxelLimits limits;  // Working object for recursive call.
00198   ComputeVoxelPolyhedra(lv,lv->GetVoxelHeader(),limits,pplist);
00199   return pplist; //it s up to the calling program to destroy it then!
00200 }

void G4DrawVoxels::DrawVoxels ( const G4LogicalVolume lv  )  const

Definition at line 202 of file G4DrawVoxels.cc.

References CreatePlacedPolyhedra(), G4VVisManager::Draw(), G4Exception(), G4VVisManager::GetConcreteInstance(), G4LogicalVolume::GetNoDaughters(), G4TransportationManager::GetTransportationManager(), JustWarning, G4AffineTransform::NetRotation(), and G4AffineTransform::NetTranslation().

00203 {   
00204    G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
00205 
00206    if (lv->GetNoDaughters()<=0)
00207    {
00208      return;
00209    }
00210 
00211    // Computing the transformation according to the world volume 
00212    // (the drawing is directly in the world volume while the axis
00213    // are relative to the mother volume of lv's daughter.)
00214 
00215    G4TouchableHistoryHandle aTouchable =
00216      G4TransportationManager::GetTransportationManager()->
00217      GetNavigatorForTracking()->CreateTouchableHistoryHandle();
00218    G4AffineTransform globTransform =
00219      aTouchable->GetHistory()->GetTopTransform().Inverse();
00220    G4Transform3D transf3D(globTransform.NetRotation(),
00221                           globTransform.NetTranslation());
00222 
00223    G4PlacedPolyhedronList* pplist=CreatePlacedPolyhedra(lv);
00224    if(pVVisManager)
00225    {
00226      // Drawing the bounding and voxel polyhedra for the pVolume
00227      //
00228      for (size_t i=0;i<pplist->size();i++)
00229      {
00230        pVVisManager->Draw((*pplist)[i].GetPolyhedron(),
00231                           (*pplist)[i].GetTransform()*transf3D);
00232      }
00233    }
00234    else
00235    {
00236      G4Exception("G4DrawVoxels::DrawVoxels()",
00237                  "GeomNav1002", JustWarning,
00238                  "Pointer to visualization manager is null!");
00239    }
00240    delete pplist;
00241 }

void G4DrawVoxels::SetBoundingBoxVisAttributes ( G4VisAttributes  ) 

Definition at line 81 of file G4DrawVoxels.cc.

00082 {
00083   fBoundingBoxVisAttributes=VA_boundingbox;
00084 }

void G4DrawVoxels::SetVoxelsVisAttributes ( G4VisAttributes ,
G4VisAttributes ,
G4VisAttributes  
)

Definition at line 72 of file G4DrawVoxels.cc.

00075 {
00076   fVoxelsVisAttributes[0]=VA_voxelX;
00077   fVoxelsVisAttributes[1]=VA_voxelY;
00078   fVoxelsVisAttributes[2]=VA_voxelZ;
00079 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:49 2013 for Geant4 by  doxygen 1.4.7