Geant4-11
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4AxesModel Class Reference

#include <G4AxesModel.hh>

Inheritance diagram for G4AxesModel:
G4VModel

Public Member Functions

void Construct (G4double x0, G4double y0, G4double z0, G4double length, G4double arrowWidth, const G4String &colourString, const G4String &description, G4bool withAnnotation, G4double textSize, const G4Transform3D &transform)
 
void DescribeYourselfTo (G4VGraphicsScene &) override
 
 G4AxesModel (G4double x0, G4double y0, G4double z0, G4double length, const G4Transform3D &transform=G4Transform3D())
 
 G4AxesModel (G4double x0, G4double y0, G4double z0, G4double length, G4double arrowWidth=1., const G4String &colourString="auto", const G4String &description="", G4bool withAnnotation=true, G4double textSize=10., const G4Transform3D &transform=G4Transform3D())
 
virtual G4String GetCurrentDescription () const
 
virtual G4String GetCurrentTag () const
 
const G4VisExtent & GetExtent () const
 
const G4String & GetGlobalDescription () const
 
const G4String & GetGlobalTag () const
 
const G4ModelingParameters * GetModelingParameters () const
 
const G4String & GetType () const
 
void SetExtent (const G4VisExtent &)
 
void SetGlobalDescription (const G4String &)
 
void SetGlobalTag (const G4String &)
 
void SetModelingParameters (const G4ModelingParameters *)
 
void SetType (const G4String &)
 
virtual G4bool Validate (G4bool warn=true)
 
virtual ~G4AxesModel ()
 

Protected Attributes

G4VisExtent fExtent
 
G4String fGlobalDescription
 
G4String fGlobalTag
 
const G4ModelingParameters * fpMP
 
G4String fType
 

Private Member Functions

 G4AxesModel (const G4AxesModel &)
 
G4AxesModel & operator= (const G4AxesModel &)
 

Private Attributes

G4Transform3D fTransform
 
G4VModel * fXAnnotationModel
 
G4VModel * fXAxisModel
 
G4VModel * fXLabelModel
 
G4VModel * fYAnnotationModel
 
G4VModel * fYAxisModel
 
G4VModel * fYLabelModel
 
G4VModel * fZAnnotationModel
 
G4VModel * fZAxisModel
 
G4VModel * fZLabelModel
 

Detailed Description

Definition at line 44 of file G4AxesModel.hh.

Constructor & Destructor Documentation

◆ G4AxesModel() [1/3]

G4AxesModel::G4AxesModel ( G4double  x0,
G4double  y0,
G4double  z0,
G4double  length,
G4double  arrowWidth = 1.,
const G4String &  colourString = "auto",
const G4String &  description = "",
G4bool  withAnnotation = true,
G4double  textSize = 10.,
const G4Transform3D &  transform = G4Transform3D() 
)

Definition at line 56 of file G4AxesModel.cc.

63{
65 (x0,y0,z0,length,arrowWidth,
66 colourString,description,withAnnotation,textSize,
67 transform);
68}
void Construct(G4double x0, G4double y0, G4double z0, G4double length, G4double arrowWidth, const G4String &colourString, const G4String &description, G4bool withAnnotation, G4double textSize, const G4Transform3D &transform)
Definition: G4AxesModel.cc:87
G4bool transform(G4String &input, const G4String &type)

References Construct(), G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform(), and G4InuclParticleNames::z0.

◆ G4AxesModel() [2/3]

G4AxesModel::G4AxesModel ( G4double  x0,
G4double  y0,
G4double  z0,
G4double  length,
const G4Transform3D &  transform = G4Transform3D() 
)

Definition at line 71 of file G4AxesModel.cc.

74{
75 G4double arrowWidth = 1.;
76 const G4String& colourString = "auto";
77 const G4String& description = "";
78 G4bool withAnnotation = true;
79 G4double textSize = 10.;
81 (x0,y0,z0,length,arrowWidth,
82 colourString,description,withAnnotation,textSize,
83 transform);
84}
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86

References Construct(), G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform(), and G4InuclParticleNames::z0.

◆ ~G4AxesModel()

G4AxesModel::~G4AxesModel ( )
virtual

Definition at line 43 of file G4AxesModel.cc.

44{
45 delete fZAnnotationModel;
46 delete fZLabelModel;
47 delete fZAxisModel;
48 delete fYAnnotationModel;
49 delete fYLabelModel;
50 delete fYAxisModel;
51 delete fXAnnotationModel;
52 delete fXLabelModel;
53 delete fXAxisModel;
54}
G4VModel * fZAnnotationModel
Definition: G4AxesModel.hh:86
G4VModel * fZLabelModel
Definition: G4AxesModel.hh:86
G4VModel * fXLabelModel
Definition: G4AxesModel.hh:84
G4VModel * fYLabelModel
Definition: G4AxesModel.hh:85
G4VModel * fZAxisModel
Definition: G4AxesModel.hh:86
G4VModel * fYAxisModel
Definition: G4AxesModel.hh:85
G4VModel * fYAnnotationModel
Definition: G4AxesModel.hh:85
G4VModel * fXAxisModel
Definition: G4AxesModel.hh:84
G4VModel * fXAnnotationModel
Definition: G4AxesModel.hh:84

References fXAnnotationModel, fXAxisModel, fXLabelModel, fYAnnotationModel, fYAxisModel, fYLabelModel, fZAnnotationModel, fZAxisModel, and fZLabelModel.

◆ G4AxesModel() [3/3]

G4AxesModel::G4AxesModel ( const G4AxesModel &  )
private

Member Function Documentation

◆ Construct()

void G4AxesModel::Construct ( G4double  x0,
G4double  y0,
G4double  z0,
G4double  length,
G4double  arrowWidth,
const G4String &  colourString,
const G4String &  description,
G4bool  withAnnotation,
G4double  textSize,
const G4Transform3D &  transform 
)

Definition at line 86 of file G4AxesModel.cc.

93{
94 fXAxisModel = nullptr;
95 fXLabelModel = nullptr;
96 fXAnnotationModel = nullptr;
97 fYAxisModel = nullptr;
98 fYLabelModel = nullptr;
99 fYAnnotationModel = nullptr;
100 fZAxisModel = nullptr;
101 fZLabelModel = nullptr;
102 fZAnnotationModel = nullptr;
103
105
106 fType = "Axes";
108 fGlobalDescription = fType + ": " + description;
110 (x0, x0+length, y0, y0+length, z0, z0+length);
111
112 G4Colour colour(1,1,1,1); // Default white and opaque (unless "auto").
113 G4bool autoColour = false;
114 if (colourString == "auto") autoColour = true;
115 else {
116 if (!G4Colour::GetColour(colourString, colour)) {
118 ed << "Colour \"" << colourString
119 << "\" not found. Defaulting to white and opaque.";
121 ("G4AxesModel::G4AxesModel",
122 "modeling0011", JustWarning, ed);
123 }
124 }
125
126 G4String annotation = G4BestUnit(length,"Length");
127
128 G4Text* text = 0;
129 G4VisAttributes* va = 0;
130 G4int lineSegmentsPerCircle = 6;
131
132 G4Colour xColour(colour);
133 if (autoColour) xColour = G4Colour::Red();
135 (x0, y0, z0, x0+length, y0, z0, arrowWidth,
136 xColour, "x-axis: " + description,
137 lineSegmentsPerCircle, fTransform);
138 if (withAnnotation) {
139 text = new G4Text("x",G4Point3D(x0+1.05*length, y0, z0));
140 text->SetScreenSize(textSize);
141 text->SetOffset(0.5*textSize,0.5*textSize);
143 va = new G4VisAttributes(xColour);
144 text->SetVisAttributes(va);
146 delete text;
147 text = new G4Text(annotation,G4Point3D(x0+0.8*length, y0, z0));
148 text->SetScreenSize(textSize);
149 text->SetOffset(-1.5*textSize,-1.5*textSize);
151 va = new G4VisAttributes(xColour);
152 text->SetVisAttributes(va);
154 delete text;
155 }
156
157 G4Colour yColour(colour);
158 if (autoColour) yColour = G4Colour::Green();
160 (x0, y0, z0, x0, y0+length, z0, arrowWidth,
161 yColour, "y-axis: " + description,
162 lineSegmentsPerCircle, fTransform);
163 if (withAnnotation) {
164 text = new G4Text("y",G4Point3D(x0, y0+1.05*length, z0));
165 text->SetScreenSize(textSize);
166 text->SetOffset(0.5*textSize,0.5*textSize);
168 va = new G4VisAttributes(yColour);
169 text->SetVisAttributes(va);
171 delete text;
172 text = new G4Text(annotation,G4Point3D(x0, y0+0.8*length, z0));
173 text->SetScreenSize(textSize);
174 text->SetOffset(-1.5*textSize,-1.5*textSize);
176 va = new G4VisAttributes(yColour);
177 text->SetVisAttributes(va);
179 delete text;
180 }
181
182 G4Colour zColour(colour);
183 if (autoColour) zColour = G4Colour::Blue();
185 (x0, y0, z0, x0, y0, z0+length, arrowWidth,
186 zColour, "z-axis: " + description,
187 lineSegmentsPerCircle, fTransform);
188 if (withAnnotation) {
189 text = new G4Text("z",G4Point3D(x0, y0, z0+1.05*length));
190 text->SetScreenSize(textSize);
191 text->SetOffset(0.5*textSize,0.5*textSize);
193 va = new G4VisAttributes(zColour);
194 text->SetVisAttributes(va);
196 delete text;
197 text = new G4Text(annotation,G4Point3D(x0, y0, z0+0.8*length));
198 text->SetScreenSize(textSize);
199 text->SetOffset(-1.5*textSize,-1.5*textSize);
201 va = new G4VisAttributes(zColour);
202 text->SetVisAttributes(va);
204 delete text;
205 }
206}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:34
#define G4BestUnit(a, b)
int G4int
Definition: G4Types.hh:85
G4Transform3D fTransform
Definition: G4AxesModel.hh:87
static G4bool GetColour(const G4String &key, G4Colour &result)
Definition: G4Colour.cc:161
static G4Colour Green()
Definition: G4Colour.hh:162
static G4Colour Red()
Definition: G4Colour.hh:161
static G4Colour Blue()
Definition: G4Colour.hh:163
Definition: G4Text.hh:72
void SetLayout(Layout)
void SetOffset(double dx, double dy)
@ centre
Definition: G4Text.hh:76
void SetScreenSize(G4double)
G4VisExtent fExtent
Definition: G4VModel.hh:101
G4String fGlobalDescription
Definition: G4VModel.hh:100
G4String fType
Definition: G4VModel.hh:98
G4String fGlobalTag
Definition: G4VModel.hh:99
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:96

References G4Colour::Blue(), G4Text::centre, G4VModel::fExtent, G4VModel::fGlobalDescription, G4VModel::fGlobalTag, fTransform, G4VModel::fType, fXAnnotationModel, fXAxisModel, fXLabelModel, fYAnnotationModel, fYAxisModel, fYLabelModel, fZAnnotationModel, fZAxisModel, fZLabelModel, G4BestUnit, G4Exception(), G4Colour::GetColour(), G4Colour::Green(), JustWarning, G4Colour::Red(), G4Text::SetLayout(), G4Text::SetOffset(), G4VMarker::SetScreenSize(), G4Visible::SetVisAttributes(), G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform(), and G4InuclParticleNames::z0.

Referenced by G4AxesModel().

◆ DescribeYourselfTo()

void G4AxesModel::DescribeYourselfTo ( G4VGraphicsScene &  sceneHandler)
overridevirtual

Implements G4VModel.

Definition at line 208 of file G4AxesModel.cc.

209{
210 if (fXAxisModel) fXAxisModel-> DescribeYourselfTo(sceneHandler);
211 if (fXLabelModel) fXLabelModel-> DescribeYourselfTo(sceneHandler);
213
214 if (fYAxisModel) fYAxisModel-> DescribeYourselfTo(sceneHandler);
215 if (fYLabelModel) fYLabelModel-> DescribeYourselfTo(sceneHandler);
217
218 if (fZAxisModel) fZAxisModel-> DescribeYourselfTo(sceneHandler);
219 if (fZLabelModel) fZLabelModel-> DescribeYourselfTo(sceneHandler);
221}
void DescribeYourselfTo(G4VGraphicsScene &) override
Definition: G4AxesModel.cc:208
virtual void DescribeYourselfTo(G4VGraphicsScene &)=0

References DescribeYourselfTo(), G4VModel::DescribeYourselfTo(), fXAnnotationModel, fXAxisModel, fXLabelModel, fYAnnotationModel, fYAxisModel, fYLabelModel, fZAnnotationModel, fZAxisModel, and fZLabelModel.

Referenced by DescribeYourselfTo(), and G4VisCommandsTouchable::SetNewValue().

◆ GetCurrentDescription()

G4String G4VModel::GetCurrentDescription ( ) const
virtualinherited

Reimplemented in G4GPSModel, and G4PhysicalVolumeModel.

Definition at line 51 of file G4VModel.cc.

51 {
52 // Override in concrete class if concept of "current" is meaningful.
53 return fGlobalDescription;
54}

References G4VModel::fGlobalDescription.

Referenced by G4OpenGLStoredQtSceneHandler::ExtraPOProcessing().

◆ GetCurrentTag()

G4String G4VModel::GetCurrentTag ( ) const
virtualinherited

Reimplemented in G4GPSModel, and G4PhysicalVolumeModel.

Definition at line 46 of file G4VModel.cc.

46 {
47 // Override in concrete class if concept of "current" is meaningful.
48 return fGlobalTag;
49}

References G4VModel::fGlobalTag.

Referenced by G4Qt3DSceneHandler::AddPrimitive(), and G4ToolsSGSceneHandler::AddPrimitive().

◆ GetExtent()

const G4VisExtent & G4VModel::GetExtent ( ) const
inherited

◆ GetGlobalDescription()

const G4String & G4VModel::GetGlobalDescription ( ) const
inherited

◆ GetGlobalTag()

const G4String & G4VModel::GetGlobalTag ( ) const
inherited

◆ GetModelingParameters()

const G4ModelingParameters * G4VModel::GetModelingParameters ( ) const
inherited

◆ GetType()

const G4String & G4VModel::GetType ( ) const
inherited

◆ operator=()

G4AxesModel & G4AxesModel::operator= ( const G4AxesModel &  )
private

◆ SetExtent()

void G4VModel::SetExtent ( const G4VisExtent &  )
inherited

◆ SetGlobalDescription()

void G4VModel::SetGlobalDescription ( const G4String &  )
inherited

◆ SetGlobalTag()

void G4VModel::SetGlobalTag ( const G4String &  )
inherited

◆ SetModelingParameters()

void G4VModel::SetModelingParameters ( const G4ModelingParameters *  )
inherited

◆ SetType()

void G4VModel::SetType ( const G4String &  )
inherited

◆ Validate()

G4bool G4VModel::Validate ( G4bool  warn = true)
virtualinherited

Reimplemented in G4PhysicalVolumeModel, and G4LogicalVolumeModel.

Definition at line 56 of file G4VModel.cc.

56 {
57 return true;
58}

Field Documentation

◆ fExtent

G4VisExtent G4VModel::fExtent
protectedinherited

◆ fGlobalDescription

G4String G4VModel::fGlobalDescription
protectedinherited

◆ fGlobalTag

G4String G4VModel::fGlobalTag
protectedinherited

◆ fpMP

const G4ModelingParameters* G4VModel::fpMP
protectedinherited

◆ fTransform

G4Transform3D G4AxesModel::fTransform
private

Definition at line 87 of file G4AxesModel.hh.

Referenced by Construct().

◆ fType

G4String G4VModel::fType
protectedinherited

◆ fXAnnotationModel

G4VModel * G4AxesModel::fXAnnotationModel
private

Definition at line 84 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fXAxisModel

G4VModel* G4AxesModel::fXAxisModel
private

Definition at line 84 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fXLabelModel

G4VModel * G4AxesModel::fXLabelModel
private

Definition at line 84 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fYAnnotationModel

G4VModel * G4AxesModel::fYAnnotationModel
private

Definition at line 85 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fYAxisModel

G4VModel * G4AxesModel::fYAxisModel
private

Definition at line 85 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fYLabelModel

G4VModel * G4AxesModel::fYLabelModel
private

Definition at line 85 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fZAnnotationModel

G4VModel * G4AxesModel::fZAnnotationModel
private

Definition at line 86 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fZAxisModel

G4VModel * G4AxesModel::fZAxisModel
private

Definition at line 86 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().

◆ fZLabelModel

G4VModel * G4AxesModel::fZLabelModel
private

Definition at line 86 of file G4AxesModel.hh.

Referenced by Construct(), DescribeYourselfTo(), and ~G4AxesModel().


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