Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisAttributes.hh
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//
27// $Id$
28//
29//
30// John Allison 23rd October 1996
31
32// Class Description:
33// Visualization attributes are a set of information associated with the
34// visualizable objects. This information is necessary only for
35// visualization, and is not included in geometrical information such
36// as shapes, position, and orientation.
37// A typical example of a visualization attribute is "colour".
38// For example, in visualizing a box, the Visualization Manager must know
39// its colour. If an object to be visualized has not been assigned a set of
40// visualization attributes, then a proper default set is used
41// automatically. A set of visualization attributes is held by an
42// instance of class G4VisAttributes defined in the graphics_reps
43// category. The followings are commonly-used attributes:
44// - visibility
45// - visibility of daughters
46// - force wireframe style, force solid style
47// - force auxiliary edge visibility, force line segments pe circle
48// - colour
49// Class Description - End:
50
51
52#ifndef __G4VISATTRIBUTES_HH__
53#define __G4VISATTRIBUTES_HH__
54
55#include "globals.hh"
56#include <vector>
57#include <map>
58
59#include "G4Colour.hh"
60#include "G4Color.hh"
61
62class G4AttValue;
63class G4AttDef;
64
66
67 friend std::ostream& operator << (std::ostream& os, const G4VisAttributes& a);
68
69public: // With description
70
73
76 G4VisAttributes (G4bool visibility);
77 G4VisAttributes (const G4Colour& colour);
78 G4VisAttributes (G4bool visibility, const G4Colour& colour);
81
83
85
86 G4bool operator != (const G4VisAttributes& a) const;
87 G4bool operator == (const G4VisAttributes& a) const;
88
91 void SetColour (const G4Colour&);
92 void SetColor (const G4Color&);
93 void SetColour (G4double red, G4double green, G4double blue,
94 G4double alpha = 1.);
95 void SetColor (G4double red, G4double green, G4double blue,
96 G4double alpha = 1.);
102 void SetForceLineSegmentsPerCircle (G4int nSegments);
103 // Allows choice of circle approximation. A circle of 360 degrees
104 // will be composed of nSegments line segments. If your solid has
105 // curves of D degrees that you need to divide into N segments,
106 // specify nSegments = N * 360 / D.
109 void SetAttValues (const std::vector<G4AttValue>*);
110 void SetAttDefs (const std::map<G4String,G4AttDef>*);
111
114 const G4Colour& GetColour () const;
115 const G4Color& GetColor () const;
125 // Returns an expendable copy of the G4AttValues...
126 const std::vector<G4AttValue>* CreateAttValues () const;
127 // Returns the orginal long life G4AttDefs...
128 const std::map<G4String,G4AttDef>* GetAttDefs () const;
129
130private:
131
132 G4bool fVisible; // Visibility flag
133 G4bool fDaughtersInvisible; // Make daughters invsibile.
134 G4Colour fColour;
135 LineStyle fLineStyle;
136 G4double fLineWidth; // Units of "normal" device linewidth, e.g.,
137 // pixels for screen, 0.1 mm for paper.
138 G4bool fForceDrawingStyle; // To switch on forced drawing style.
139 ForcedDrawingStyle fForcedStyle; // Value of forced drawing style.
140 G4bool fForceAuxEdgeVisible; // Force drawing of auxilary edges.
141 G4int fForcedLineSegmentsPerCircle; // Forced lines segments per
142 // circle. <=0 means not forced.
143 G4double fStartTime, fEndTime; // Time range.
144 const std::vector<G4AttValue>* fAttValues; // For picking, etc.
145 const std::map<G4String,G4AttDef>* fAttDefs; // Corresponding definitions.
146};
147
148#include "G4VisAttributes.icc"
149
150#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
void SetForceAuxEdgeVisible(G4bool)
const std::map< G4String, G4AttDef > * GetAttDefs() const
G4bool IsForceLineSegmentsPerCircle() const
G4double GetLineWidth() const
const G4Color & GetColor() const
void SetVisibility(G4bool)
G4double GetStartTime() const
G4bool IsDaughtersInvisible() const
void SetColour(const G4Colour &)
void SetColour(G4double red, G4double green, G4double blue, G4double alpha=1.)
friend std::ostream & operator<<(std::ostream &os, const G4VisAttributes &a)
void SetDaughtersInvisible(G4bool)
void SetForceWireframe(G4bool)
G4int GetForcedLineSegmentsPerCircle() const
static const G4VisAttributes & GetInvisible()
void SetLineWidth(G4double)
void SetAttValues(const std::vector< G4AttValue > *)
LineStyle GetLineStyle() const
const std::vector< G4AttValue > * CreateAttValues() const
void SetAttDefs(const std::map< G4String, G4AttDef > *)
const G4Colour & GetColour() const
void SetForceSolid(G4bool)
G4bool IsVisible() const
G4bool IsForceAuxEdgeVisible() const
G4bool operator!=(const G4VisAttributes &a) const
ForcedDrawingStyle GetForcedDrawingStyle() const
void SetEndTime(G4double)
void SetColor(G4double red, G4double green, G4double blue, G4double alpha=1.)
void SetLineStyle(LineStyle)
void SetForceLineSegmentsPerCircle(G4int nSegments)
G4VisAttributes & operator=(const G4VisAttributes &)
static const G4VisAttributes Invisible
G4bool operator==(const G4VisAttributes &a) const
void SetStartTime(G4double)
G4double GetEndTime() const
G4bool IsForceDrawingStyle() const
void SetColor(const G4Color &)