Geant4-11
Public Types | Public Member Functions | Private Attributes
G4VisCommandSceneAddScale::Scale Struct Reference

Public Types

enum  Direction { x , y , z }
 

Public Member Functions

void operator() (G4VGraphicsScene &, const G4ModelingParameters *)
 
 Scale (const G4VisAttributes &visAttribs, G4double length, const G4Transform3D &, const G4String &annotation, G4double annotationSize, const G4Colour &annotationColour)
 
 ~Scale ()
 

Private Attributes

G4Polyline fScaleLine
 
G4Text fText
 
G4Polyline fTick11
 
G4Polyline fTick12
 
G4Polyline fTick21
 
G4Polyline fTick22
 
G4VisAttributes fVisAtts
 

Detailed Description

Definition at line 389 of file G4VisCommandsSceneAdd.hh.

Member Enumeration Documentation

◆ Direction

Constructor & Destructor Documentation

◆ Scale()

G4VisCommandSceneAddScale::Scale::Scale ( const G4VisAttributes visAttribs,
G4double  length,
const G4Transform3D transform,
const G4String annotation,
G4double  annotationSize,
const G4Colour annotationColour 
)

Definition at line 2493 of file G4VisCommandsSceneAdd.cc.

2497 :
2498fVisAtts(visAtts)
2499{
2500 // Useful constants...
2501 const G4double halfLength(length / 2.);
2502 const G4double tickLength(length / 20.);
2503
2504 // Create (empty) polylines having the same vis attributes...
2505 // (OK to pass address since fVisAtts is long lived.)
2511
2512 // Add points to the polylines to represent a scale parallel to the
2513 // x-axis centred on the origin...
2514 G4Point3D r1(G4Point3D(-halfLength, 0., 0.));
2515 G4Point3D r2(G4Point3D( halfLength, 0., 0.));
2516 fScaleLine.push_back(r1);
2517 fScaleLine.push_back(r2);
2518 G4Point3D ticky(0., tickLength, 0.);
2519 G4Point3D tickz(0., 0., tickLength);
2520 fTick11.push_back(r1 + ticky);
2521 fTick11.push_back(r1 - ticky);
2522 fTick12.push_back(r1 + tickz);
2523 fTick12.push_back(r1 - tickz);
2524 fTick21.push_back(r2 + ticky);
2525 fTick21.push_back(r2 - ticky);
2526 fTick22.push_back(r2 + tickz);
2527 fTick22.push_back(r2 - tickz);
2528 // ...and transform to chosen position and orientation
2534 // Similarly for annotation
2535 G4Point3D textPosition(0., tickLength, 0.);
2536 textPosition.transform(transform);
2537 fText = G4Text(annotation,textPosition);
2538 fText.SetVisAttributes(annotationColour);
2539 fText.SetScreenSize(annotationSize);
2540}
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:34
double G4double
Definition: G4Types.hh:83
G4Polyline & transform(const G4Transform3D &)
Definition: G4Polyline.cc:37
Definition: G4Text.hh:72
void SetScreenSize(G4double)
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:96
G4bool transform(G4String &input, const G4String &type)

References fScaleLine, fText, fTick11, fTick12, fTick21, fTick22, fVisAtts, G4VMarker::SetScreenSize(), G4Visible::SetVisAttributes(), G4Polyline::transform(), and G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform().

◆ ~Scale()

G4VisCommandSceneAddScale::Scale::~Scale ( )

Member Function Documentation

◆ operator()()

void G4VisCommandSceneAddScale::Scale::operator() ( G4VGraphicsScene sceneHandler,
const G4ModelingParameters  
)

Definition at line 2542 of file G4VisCommandsSceneAdd.cc.

2544{
2545 // Draw...
2546 sceneHandler.BeginPrimitives();
2547 sceneHandler.AddPrimitive(fScaleLine);
2548 sceneHandler.AddPrimitive(fTick11);
2549 sceneHandler.AddPrimitive(fTick12);
2550 sceneHandler.AddPrimitive(fTick21);
2551 sceneHandler.AddPrimitive(fTick22);
2552 sceneHandler.AddPrimitive(fText);
2553 sceneHandler.EndPrimitives();
2554}
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual void AddPrimitive(const G4Polyline &)=0
virtual void EndPrimitives()=0

Field Documentation

◆ fScaleLine

G4Polyline G4VisCommandSceneAddScale::Scale::fScaleLine
private

Definition at line 415 of file G4VisCommandsSceneAdd.hh.

Referenced by Scale().

◆ fText

G4Text G4VisCommandSceneAddScale::Scale::fText
private

Definition at line 416 of file G4VisCommandsSceneAdd.hh.

Referenced by Scale().

◆ fTick11

G4Polyline G4VisCommandSceneAddScale::Scale::fTick11
private

Definition at line 415 of file G4VisCommandsSceneAdd.hh.

Referenced by Scale().

◆ fTick12

G4Polyline G4VisCommandSceneAddScale::Scale::fTick12
private

Definition at line 415 of file G4VisCommandsSceneAdd.hh.

Referenced by Scale().

◆ fTick21

G4Polyline G4VisCommandSceneAddScale::Scale::fTick21
private

Definition at line 415 of file G4VisCommandsSceneAdd.hh.

Referenced by Scale().

◆ fTick22

G4Polyline G4VisCommandSceneAddScale::Scale::fTick22
private

Definition at line 415 of file G4VisCommandsSceneAdd.hh.

Referenced by Scale().

◆ fVisAtts

G4VisAttributes G4VisCommandSceneAddScale::Scale::fVisAtts
private

Definition at line 414 of file G4VisCommandsSceneAdd.hh.

Referenced by Scale().


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