Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VtkOffscreenViewer Class Reference

#include <G4VtkOffscreenViewer.hh>

+ Inheritance diagram for G4VtkOffscreenViewer:

Public Member Functions

 G4VtkOffscreenViewer (G4VSceneHandler &, const G4String &name)
 
 ~G4VtkOffscreenViewer () override
 
void Initialise () override
 
void FinishView () override
 
- Public Member Functions inherited from G4VtkViewer
 G4VtkViewer (G4VSceneHandler &, const G4String &name)
 
void Initialise () override
 
 ~G4VtkViewer () override
 
void SetView () override
 
void ClearView () override
 
void DrawView () override
 
void ShowView () override
 
void FinishView () override
 
void ExportScreenShot (G4String, G4String)
 
void ExportOBJScene (G4String)
 
void ExportVRMLScene (G4String)
 
void ExportVTPScene (G4String)
 
void ExportGLTFScene (G4String)
 
void ExportJSONRenderWindowScene (G4String)
 
void ExportVTPCutter (G4String fileName)
 
void ExportFormatStore (G4String fileName, G4String store)
 
void DrawShadows ()
 
void EnableShadows ()
 
void DisableShadows ()
 
void AddViewHUD ()
 
void EnableHUD ()
 
void DisableHUD ()
 
virtual void AddClipperPlaneWidget (const G4Plane3D &plane)
 
void EnableClipper (const G4Plane3D &plane, G4bool widget)
 
void DisableClipper ()
 
virtual void EnableClipperWidget ()
 
virtual void DisableClipperWidget ()
 
virtual void AddCutterPlaneWidget (const G4Plane3D &plane)
 
void EnableCutter (const G4Plane3D &plane, G4bool bWidget)
 
void DisableCutter (G4String name)
 
virtual void EnableCutterWidget ()
 
virtual void DisableCutterWidget ()
 
virtual void AddCameraOrientationWidget ()
 
virtual void EnableCameraOrientationWidget ()
 
virtual void DisableCameraOrientationWidget ()
 
void AddImageOverlay (const G4String &fileName, const G4double alpha, const G4double imageBottomLeft[2], const G4double worldBottomLeft[2], const G4double imageTopRight[2], const G4double worldTopRight[2], const G4double rot[3], const G4double trans[3])
 
void AddGeometryOverlay (const G4String &fileName, const G4double colour[3], const G4double alpha, const G4String &representation, const G4double scale[3], const G4double rotation[3], const G4double translation[3])
 
void Render ()
 
void StartInteractor ()
 
void Print ()
 
void SetPolyhedronPipeline (const G4String &t)
 
virtual void SetWidgetInteractor (vtkAbstractWidget *widget)
 
void ExportView ()
 
void SetGeant4View ()
 
- Public Member Functions inherited from G4VViewer
 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
 
virtual ~G4VViewer ()
 
virtual void ResetView ()
 
void RefreshView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
SceneTreeSceneAccessSceneTreeScene ()
 
G4SceneTreeItemAccessSceneTree ()
 
void UpdateGUISceneTree ()
 
const G4StringGetName () const
 
const G4StringGetShortName () const
 
void SetName (const G4String &)
 
G4int GetViewId () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4ViewParametersGetViewParameters () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
G4double GetKernelVisitElapsedTimeSeconds () const
 
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers () const
 
void SetViewParameters (const G4ViewParameters &vp)
 
void SetDefaultViewParameters (const G4ViewParameters &vp)
 
const G4VisAttributesGetApplicableVisAttributes (const G4VisAttributes *) const
 
void SetNeedKernelVisit (G4bool need)
 
void NeedKernelVisit ()
 
void ProcessView ()
 

Additional Inherited Members

- Public Attributes inherited from G4VtkViewer
vtkNew< vtkTextActor > infoTextActor
 
vtkNew< vtkInfoCallbackinfoCallback
 
vtkNew< vtkGeant4Callbackgeant4Callback
 
vtkSmartPointer< vtkLight > light
 
vtkNew< vtkCamera > camera
 
vtkNew< vtkRenderer > renderer
 
vtkRenderWindow * _renderWindow
 
vtkRenderWindowInteractor * renderWindowInteractor
 
- Protected Member Functions inherited from G4VViewer
void SetTouchable (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
 
void TouchableSetVisibility (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
 
void TouchableSetColour (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
 
- Protected Attributes inherited from G4VtkViewer
G4bool firstSetView = true
 
G4bool firstFinishView = true
 
G4double cameraDistance
 
vtkNew< vtkImplicitPlaneRepresentation > cutterPlaneRepresentation
 
vtkNew< vtkImplicitPlaneWidget2 > cutterPlaneWidget
 
vtkNew< vtkImplicitPlaneRepresentation > clipperPlaneRepresentation
 
vtkNew< vtkImplicitPlaneWidget2 > clipperPlaneWidget
 
vtkNew< vtkCameraOrientationWidget > camOrientWidget
 
bool bCutter = false
 
bool bClipper = false
 
bool bHud = false
 
bool bOrientation = false
 
- Protected Attributes inherited from G4VViewer
G4VSceneHandlerfSceneHandler
 
G4int fViewId
 
G4String fName
 
G4String fShortName
 
G4ViewParameters fVP
 
G4ViewParameters fDefaultVP
 
G4double fKernelVisitElapsedTimeSeconds = 999.
 
SceneTreeScene fSceneTreeScene
 
G4SceneTreeItem fSceneTree
 
G4bool fNeedKernelVisit
 

Detailed Description

Definition at line 31 of file G4VtkOffscreenViewer.hh.

Constructor & Destructor Documentation

◆ G4VtkOffscreenViewer()

G4VtkOffscreenViewer::G4VtkOffscreenViewer ( G4VSceneHandler & sceneHandler,
const G4String & name )

Definition at line 33 of file G4VtkOffscreenViewer.cc.

34 : G4VtkViewer(sceneHandler, name)
35{
36}
G4VtkViewer(G4VSceneHandler &, const G4String &name)

◆ ~G4VtkOffscreenViewer()

G4VtkOffscreenViewer::~G4VtkOffscreenViewer ( )
override

Definition at line 38 of file G4VtkOffscreenViewer.cc.

39{
40}

Member Function Documentation

◆ FinishView()

void G4VtkOffscreenViewer::FinishView ( void )
overridevirtual

Reimplemented from G4VViewer.

Definition at line 48 of file G4VtkOffscreenViewer.cc.

49{
50 auto& fVtkSceneHandler = dynamic_cast<G4VtkSceneHandler&>(fSceneHandler);
51 fVtkSceneHandler.Modified();
52
53 _renderWindow->Render();
54
55 vtkNew<vtkWindowToImageFilter> windowToImageFilter;
56 windowToImageFilter->SetInput(_renderWindow);
57 windowToImageFilter->Update();
58
59 vtkNew<vtkPNGWriter> writer;
60 writer->SetFileName("offscreen.png");
61 writer->SetInputConnection(windowToImageFilter->GetOutputPort());
62 writer->Write();
63}
G4VSceneHandler & fSceneHandler
Definition G4VViewer.hh:253
vtkRenderWindow * _renderWindow

◆ Initialise()

void G4VtkOffscreenViewer::Initialise ( )
overridevirtual

Reimplemented from G4VViewer.

Definition at line 42 of file G4VtkOffscreenViewer.cc.

43{
45 _renderWindow->SetOffScreenRendering(1);
46}
void Initialise() override

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