Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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().

57 {
58  fVoxelsVisAttributes[0].SetColour(G4Colour(1.,0.,0.));
59  fVoxelsVisAttributes[1].SetColour(G4Colour(0.,1.,0.));
60  fVoxelsVisAttributes[2].SetColour(G4Colour(0.,0.,1.));
61  fBoundingBoxVisAttributes.SetColour(G4Colour(.3,0.,.2));
62 }
void SetColour(const G4Colour &)
G4DrawVoxels::~G4DrawVoxels ( )

Definition at line 66 of file G4DrawVoxels.cc.

67 {
68 }

Member Function Documentation

G4PlacedPolyhedronList * G4DrawVoxels::CreatePlacedPolyhedra ( const G4LogicalVolume lv) const

Definition at line 194 of file G4DrawVoxels.cc.

References G4LogicalVolume::GetVoxelHeader().

Referenced by G4LogicalVolumeModel::DescribeYourselfTo(), and DrawVoxels().

195 {
197  G4VoxelLimits limits; // Working object for recursive call.
198  ComputeVoxelPolyhedra(lv,lv->GetVoxelHeader(),limits,pplist);
199  return pplist; //it s up to the calling program to destroy it then!
200 }
G4SmartVoxelHeader * GetVoxelHeader() const
std::vector< G4PlacedPolyhedron > G4PlacedPolyhedronList
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().

203 {
205 
206  if (lv->GetNoDaughters()<=0)
207  {
208  return;
209  }
210 
211  // Computing the transformation according to the world volume
212  // (the drawing is directly in the world volume while the axis
213  // are relative to the mother volume of lv's daughter.)
214 
215  G4TouchableHistoryHandle aTouchable =
217  GetNavigatorForTracking()->CreateTouchableHistoryHandle();
218  G4AffineTransform globTransform =
219  aTouchable->GetHistory()->GetTopTransform().Inverse();
220  G4Transform3D transf3D(globTransform.NetRotation(),
221  globTransform.NetTranslation());
222 
224  if(pVVisManager)
225  {
226  // Drawing the bounding and voxel polyhedra for the pVolume
227  //
228  for (size_t i=0;i<pplist->size();i++)
229  {
230  pVVisManager->Draw((*pplist)[i].GetPolyhedron(),
231  (*pplist)[i].GetTransform()*transf3D);
232  }
233  }
234  else
235  {
236  G4Exception("G4DrawVoxels::DrawVoxels()",
237  "GeomNav1002", JustWarning,
238  "Pointer to visualization manager is null!");
239  }
240  delete pplist;
241 }
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
static G4VVisManager * GetConcreteInstance()
G4PlacedPolyhedronList * CreatePlacedPolyhedra(const G4LogicalVolume *) const
G4ThreeVector NetTranslation() const
G4int GetNoDaughters() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4TransportationManager * GetTransportationManager()
G4RotationMatrix NetRotation() const
std::vector< G4PlacedPolyhedron > G4PlacedPolyhedronList
void G4DrawVoxels::SetBoundingBoxVisAttributes ( G4VisAttributes VA_boundingbox)

Definition at line 81 of file G4DrawVoxels.cc.

82 {
83  fBoundingBoxVisAttributes=VA_boundingbox;
84 }
void G4DrawVoxels::SetVoxelsVisAttributes ( G4VisAttributes VA_voxelX,
G4VisAttributes VA_voxelY,
G4VisAttributes VA_voxelZ 
)

Definition at line 72 of file G4DrawVoxels.cc.

75 {
76  fVoxelsVisAttributes[0]=VA_voxelX;
77  fVoxelsVisAttributes[1]=VA_voxelY;
78  fVoxelsVisAttributes[2]=VA_voxelZ;
79 }

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