Geant4
11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PlotterModel.cc
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
// Guy Barrand 25th September 2021
27
28
#include "
G4PlotterModel.hh
"
29
30
#include "
G4VGraphicsScene.hh
"
31
32
G4PlotterModel::G4PlotterModel
(
G4Plotter
& a_plotter,
const
G4String
& description,
const
G4Transform3D
& a_transform)
33
:fPlotter(a_plotter),fTransform(a_transform)
34
{
35
fType
=
"G4PlotterModel"
;
36
fGlobalTag
=
fType
;
37
fGlobalDescription
=
fType
+
": "
+ description;
38
// Have the extent so that the viewer will have an ortho camera
39
// with a height of 1 in order to map the tools::sg::plots height of 1:
40
// radius = sqrt(half_x*half_x+half_y*half_y+half_z*half_z);
41
// radius = sqrt(3*half*half)
42
// half = sqrt(radius*radius/3)
43
double
radius = 0.5;
44
double
half = ::sqrt(radius*radius/3.0);
45
fExtent
=
G4VisExtent
(-half,half,-half,half,-half,half);
//x,y,z min/max.
46
}
47
48
void
G4PlotterModel::DescribeYourselfTo
(
G4VGraphicsScene
& sceneHandler)
49
{
50
sceneHandler.
BeginPrimitives
(fTransform);
51
sceneHandler.
AddPrimitive
(fPlotter);
52
sceneHandler.
EndPrimitives
();
53
}
G4PlotterModel.hh
G4VGraphicsScene.hh
G4PlotterModel::DescribeYourselfTo
void DescribeYourselfTo(G4VGraphicsScene &) override
Definition
G4PlotterModel.cc:48
G4PlotterModel::G4PlotterModel
G4PlotterModel(G4Plotter &plotter, const G4String &global_description="", const G4Transform3D &transform=G4Transform3D())
Definition
G4PlotterModel.cc:32
G4Plotter
Definition
G4Plotter.hh:40
G4String
Definition
G4String.hh:62
G4VGraphicsScene
Definition
G4VGraphicsScene.hh:74
G4VGraphicsScene::BeginPrimitives
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())=0
G4VGraphicsScene::AddPrimitive
virtual void AddPrimitive(const G4Polyline &)=0
G4VGraphicsScene::EndPrimitives
virtual void EndPrimitives()=0
G4VModel::fExtent
G4VisExtent fExtent
Definition
G4VModel.hh:97
G4VModel::fGlobalDescription
G4String fGlobalDescription
Definition
G4VModel.hh:96
G4VModel::fType
G4String fType
Definition
G4VModel.hh:94
G4VModel::fGlobalTag
G4String fGlobalTag
Definition
G4VModel.hh:95
G4VisExtent
Definition
G4VisExtent.hh:55
HepGeom::Transform3D
Definition
Transform3D.h:170
geant4-v11.2.2
source
visualization
modeling
src
G4PlotterModel.cc
Generated by
1.12.0