ATLAS Offline Software
Loading...
Searching...
No Matches
VisAttributes.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef VP1GEOMETRYSYSTEMS_GEOVISATTRIBUTES_H
6#define VP1GEOMETRYSYSTEMS_GEOVISATTRIBUTES_H
7
8#include <string>
9#include <optional>
10#include <Inventor/SbColor.h>
11#include <QByteArray>
12#include <QMap>
13#include <QString>
14class SoMaterial;
15
17
18 public:
19
20 // Constructor:
22 //delete copy
23 VisAttributes(const VisAttributes &) = delete;
24 //delete assignment
26 void init();//Call at end of constructor in derived classes.
27 // Destructor:
28 virtual ~VisAttributes();
29
30 // Fetch a material
31 SoMaterial *get(const std::string & name) const;
32
33 // Optional outline colour; absence preserves the inherited material colour.
34 std::optional<SbColor> outlineColour(const std::string& name) const;
35
36 //Override transparencies of materials (will multiply current transparencies):
37 void overrideTransparencies(float transpfact);
38
39 QByteArray getState(bool onlyChangedMaterials=true);
40 void applyState(QByteArray);
41
42 protected:
43
44 // Add a material
45 void add(const std::string & name, SoMaterial *);
46
47 void setOutlineColour(const std::string& name, const SbColor&);
48
49 // set SoMaterial color from RGB values
50 void setColorFromRGB(SoMaterial* mat, const std::string& type, const int r, const int g, const int b);
51
52 private:
53
54 class Imp;
56
57 // convert the usual range RGB [0,255] to Coin [0,1]
58 float getValFromRGB(const int rgb);
59
60};
61
62
63// A list of Vis attributes for Detectors:
65 public:
67};
68
69
70// A list of Vis attributes for Materials:
72 public:
74};
75
76
77// A list of Vis attributes for Volumes:
79 public:
81};
82
83#endif
virtual ~VisAttributes()
float getValFromRGB(const int rgb)
VisAttributes & operator=(const VisAttributes &)=delete
std::optional< SbColor > outlineColour(const std::string &name) const
void add(const std::string &name, SoMaterial *)
QByteArray getState(bool onlyChangedMaterials=true)
SoMaterial * get(const std::string &name) const
void setColorFromRGB(SoMaterial *mat, const std::string &type, const int r, const int g, const int b)
void setOutlineColour(const std::string &name, const SbColor &)
void applyState(QByteArray)
VisAttributes(const VisAttributes &)=delete
void overrideTransparencies(float transpfact)
int r
Definition globals.cxx:22