File indexing completed on 2025-01-18 09:59:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 #ifndef __G4VISATTRIBUTES_HH__
0053 #define __G4VISATTRIBUTES_HH__
0054
0055 #include "globals.hh"
0056 #include <vector>
0057 #include <map>
0058
0059 #include "graphics_reps_defs.hh"
0060
0061 #include "G4Colour.hh"
0062 #include "G4Color.hh"
0063
0064 class G4AttValue;
0065 class G4AttDef;
0066
0067 #include <CLHEP/Units/SystemOfUnits.h>
0068
0069 class G4VisAttributes {
0070
0071 friend std::ostream& operator << (std::ostream& os, const G4VisAttributes& a);
0072
0073 public:
0074
0075 enum LineStyle {unbroken, dashed, dotted};
0076 enum ForcedDrawingStyle {wireframe, solid, cloud};
0077
0078 G4VisAttributes ();
0079 G4VisAttributes (G4bool visibility);
0080 G4VisAttributes (const G4Colour& colour);
0081 G4VisAttributes (G4bool visibility, const G4Colour& colour);
0082 G4VisAttributes (const G4VisAttributes&) = default;
0083 ~G4VisAttributes () = default;
0084 G4VisAttributes& operator= (const G4VisAttributes&);
0085
0086 static const G4VisAttributes& GetInvisible();
0087
0088 G4bool operator != (const G4VisAttributes& a) const;
0089 G4bool operator == (const G4VisAttributes& a) const;
0090
0091 void SetVisibility (G4bool = true);
0092 void SetDaughtersInvisible (G4bool = true);
0093 void SetColour (const G4Colour&);
0094 void SetColor (const G4Color&);
0095 void SetColour (G4double red, G4double green, G4double blue,
0096 G4double alpha = 1.);
0097 void SetColor (G4double red, G4double green, G4double blue,
0098 G4double alpha = 1.);
0099 void SetLineStyle (LineStyle);
0100 void SetLineWidth (G4double);
0101 void SetForceWireframe (G4bool = true);
0102 void SetForceSolid (G4bool = true);
0103 void SetForceCloud (G4bool = true);
0104 void SetForceNumberOfCloudPoints (G4int nPoints);
0105
0106 void SetForceAuxEdgeVisible (G4bool = true);
0107 void SetForceLineSegmentsPerCircle (G4int nSegments);
0108
0109
0110
0111
0112 void SetStartTime (G4double);
0113 void SetEndTime (G4double);
0114 void SetAttValues (const std::vector<G4AttValue>*);
0115 void SetAttDefs (const std::map<G4String,G4AttDef>*);
0116
0117 G4bool IsVisible () const;
0118 G4bool IsDaughtersInvisible () const;
0119 const G4Colour& GetColour () const;
0120 const G4Color& GetColor () const;
0121 LineStyle GetLineStyle () const;
0122 G4double GetLineWidth () const;
0123 G4bool IsForceDrawingStyle () const;
0124 ForcedDrawingStyle GetForcedDrawingStyle () const;
0125 G4int GetForcedNumberOfCloudPoints () const;
0126 G4bool IsForceAuxEdgeVisible () const;
0127 G4bool IsForcedAuxEdgeVisible () const;
0128 G4bool IsForceLineSegmentsPerCircle () const;
0129 G4int GetForcedLineSegmentsPerCircle () const;
0130 G4double GetStartTime () const;
0131 G4double GetEndTime () const;
0132 static G4int GetMinLineSegmentsPerCircle ();
0133
0134 const std::vector<G4AttValue>* CreateAttValues () const;
0135
0136 const std::map<G4String,G4AttDef>* GetAttDefs () const;
0137
0138 static constexpr G4int fMinLineSegmentsPerCircle = 3;
0139
0140
0141 static constexpr G4double fVeryLongTime = 1.e100 * CLHEP::ns;
0142
0143
0144 private:
0145
0146 G4bool fVisible;
0147 G4bool fDaughtersInvisible;
0148 G4Colour fColour;
0149 LineStyle fLineStyle;
0150 G4double fLineWidth;
0151
0152 G4bool fForceDrawingStyle;
0153 ForcedDrawingStyle fForcedStyle;
0154 G4int fForcedNumberOfCloudPoints;
0155
0156 G4bool fForceAuxEdgeVisible;
0157 G4bool fForcedAuxEdgeVisible;
0158 G4int fForcedLineSegmentsPerCircle;
0159
0160 G4double fStartTime, fEndTime;
0161 const std::vector<G4AttValue>* fAttValues;
0162 const std::map<G4String,G4AttDef>* fAttDefs;
0163 };
0164
0165 #include "G4VisAttributes.icc"
0166
0167 #endif