Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 48 of file G4DrawVoxels.hh.

Constructor & Destructor Documentation

◆ G4DrawVoxels()

G4DrawVoxels::G4DrawVoxels ( )

Definition at line 47 of file G4DrawVoxels.cc.

48{
49 fVoxelsVisAttributes[0].SetColour(G4Colour(1.,0.,0.));
50 fVoxelsVisAttributes[1].SetColour(G4Colour(0.,1.,0.));
51 fVoxelsVisAttributes[2].SetColour(G4Colour(0.,0.,1.));
52 fBoundingBoxVisAttributes.SetColour(G4Colour(.3,0.,.2));
53}
void SetColour(const G4Colour &)

◆ ~G4DrawVoxels()

G4DrawVoxels::~G4DrawVoxels ( )
default

Member Function Documentation

◆ CreatePlacedPolyhedra()

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

Definition at line 183 of file G4DrawVoxels.cc.

184{
185 auto pplist = new G4PlacedPolyhedronList;
186 G4VoxelLimits limits; // Working object for recursive call.
187 ComputeVoxelPolyhedra(lv,lv->GetVoxelHeader(),limits,pplist);
188 return pplist; //it s up to the calling program to destroy it then!
189}
std::vector< G4PlacedPolyhedron > G4PlacedPolyhedronList
G4SmartVoxelHeader * GetVoxelHeader() const

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

◆ DrawVoxels()

void G4DrawVoxels::DrawVoxels ( const G4LogicalVolume * lv) const

Definition at line 193 of file G4DrawVoxels.cc.

194{
196
197 if (lv->GetNoDaughters()<=0)
198 {
199 return;
200 }
201
202 // Computing the transformation according to the world volume
203 // (the drawing is directly in the world volume while the axis
204 // are relative to the mother volume of lv's daughter.)
205
206 G4TouchableHandle aTouchable =
208 GetNavigatorForTracking()->CreateTouchableHistoryHandle();
209 G4AffineTransform globTransform =
210 aTouchable->GetHistory()->GetTopTransform().Inverse();
211 G4Transform3D transf3D(globTransform.NetRotation(),
212 globTransform.NetTranslation());
213
215 if(pVVisManager != nullptr)
216 {
217 // Drawing the bounding and voxel polyhedra for the pVolume
218 //
219 for (const auto & i : *pplist)
220 {
221 pVVisManager->Draw(i.GetPolyhedron(),
222 i.GetTransform()*transf3D);
223 }
224 }
225 else
226 {
227 G4Exception("G4DrawVoxels::DrawVoxels()",
228 "GeomNav1002", JustWarning,
229 "Pointer to visualization manager is null!");
230 }
231 delete pplist;
232}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4AffineTransform Inverse() const
G4ThreeVector NetTranslation() const
G4RotationMatrix NetRotation() const
G4PlacedPolyhedronList * CreatePlacedPolyhedra(const G4LogicalVolume *) const
std::size_t GetNoDaughters() const
const G4AffineTransform & GetTopTransform() const
virtual const G4NavigationHistory * GetHistory() const
static G4TransportationManager * GetTransportationManager()
static G4VVisManager * GetConcreteInstance()
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0

◆ SetBoundingBoxVisAttributes()

void G4DrawVoxels::SetBoundingBoxVisAttributes ( G4VisAttributes & VA_boundingbox)

Definition at line 70 of file G4DrawVoxels.cc.

71{
72 fBoundingBoxVisAttributes = VA_boundingbox;
73}

◆ SetVoxelsVisAttributes()

void G4DrawVoxels::SetVoxelsVisAttributes ( G4VisAttributes & VA_voxelX,
G4VisAttributes & VA_voxelY,
G4VisAttributes & VA_voxelZ )

Definition at line 61 of file G4DrawVoxels.cc.

64{
65 fVoxelsVisAttributes[0] = VA_voxelX;
66 fVoxelsVisAttributes[1] = VA_voxelY;
67 fVoxelsVisAttributes[2] = VA_voxelZ;
68}

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