|
ATLAS Offline Software
|
#include <VP1MaterialButton.h>
|
| VP1MaterialButton (QWidget *parent=0, int dim=25) |
|
virtual | ~VP1MaterialButton () |
|
bool | handleMaterial (SoMaterial *) |
|
bool | stopHandlingMaterial (SoMaterial *) |
|
void | clearHandledMaterials () |
|
void | copyValuesFromMaterial (SoMaterial *) |
|
bool | setMaterial (SoMaterial *) |
|
const QList< SoMaterial * > & | handledMaterials () const |
|
void | setText (const QString &) |
|
void | setDimension (int dim) |
|
QColor | lastAppliedDiffuseColour () const |
|
QColor | lastAppliedAmbientColour () const |
|
QColor | lastAppliedSpecularColour () const |
|
QColor | lastAppliedEmissiveColour () const |
|
double | lastAppliedTransparency () const |
|
double | lastAppliedShininess () const |
|
double | lastAppliedBrightness () const |
|
QWidget & | editWindow () |
|
QByteArray | saveState () const |
| fill out with the state of the object (used for drag and drop etc) More...
|
|
void | restoreFromState (const QByteArray &) |
|
void | setSystemBasePointer (IVP1System *sys) |
|
void | message (const QString &) const |
|
void | message (const QStringList &, const QString &addtoend="") const |
|
void | message (const QString &addtostart, const QStringList &, const QString &addtoend="") const |
|
void | messageDebug (const QString &) const |
|
void | messageDebug (const QStringList &, const QString &addtoend="") const |
|
void | messageDebug (const QString &addtostart, const QStringList &, const QString &addtoend="") const |
|
void | messageVerbose (const QString &) const |
|
void | messageVerbose (const QStringList &, const QString &addtoend="") const |
|
void | messageVerbose (const QString &addtostart, const QStringList &, const QString &addtoend="") const |
|
IVP1System * | systemBase () const |
|
const QString & | helperClassName () const |
|
|
static SoMaterial * | createMaterial (const QColor &, const double &brightness=0.0, const double &transp=0.0) |
|
static SoMaterial * | createMaterial (const double &r, const double &g, double b, const double &brightness=0.0, const double &transp=0.0) |
|
static void | setMaterialParameters (SoMaterial *m, const QColor &, const double &brightness=0.0, const double &transp=0.0) |
|
static void | setMaterialParameters (SoMaterial *m, const double &r, const double &g, const double &b, const double &brightness=0.0, const double &transp=0.0) |
|
static bool | verbose () |
|
static void | warnUndeletedInstances () |
|
static QString | str (const QString &s) |
|
static QString | str (const char *c) |
|
static QString | str (const bool b) |
|
static QString | str (const QColor &) |
|
static QString | str (const SbColor &) |
|
static QString | str (const VP1Interval &) |
|
static QString | str (const SbVec2d &) |
|
static QString | str (const SbVec2f &) |
|
static QString | str (const SbVec2s &) |
|
static QString | str (const SbVec3d &) |
|
static QString | str (const SbVec3f &) |
|
static QString | str (const SbVec3s &) |
|
static QString | str (const SbVec4d &) |
|
static QString | str (const SbVec4f &) |
|
static QString | str (short int n) |
|
static QString | str (unsigned short int n) |
|
static QString | str (long n) |
|
static QString | str (ulong n) |
|
static QString | str (int n) |
|
static QString | str (uint n) |
|
static QString | str (qlonglong n) |
|
static QString | str (qulonglong n) |
|
static QString | str (const double &d) |
|
static QString | str (const float &f) |
|
static QString | str (const void *) |
|
template<class T > |
static QString | str (const T *t) |
|
template<class T > |
static QString | str (const QFlags< T > &f) |
|
template<class T > |
static QString | str (const HepGeom::BasicVector3D< T > &t) |
|
static QString | str (const Amg::Vector3D &t) |
|
template<class T > |
static QString | str (const QList< T > &t) |
|
Definition at line 46 of file VP1MaterialButton.h.
◆ VP1MaterialButton()
VP1MaterialButton::VP1MaterialButton |
( |
QWidget * |
parent = 0 , |
|
|
int |
dim = 25 |
|
) |
| |
◆ ~VP1MaterialButton()
VP1MaterialButton::~VP1MaterialButton |
( |
| ) |
|
|
virtual |
◆ apply
void VP1MaterialButton::apply |
( |
| ) |
|
|
protectedslot |
◆ clearHandledMaterials()
void VP1MaterialButton::clearHandledMaterials |
( |
| ) |
|
◆ copyValuesFromMaterial()
void VP1MaterialButton::copyValuesFromMaterial |
( |
SoMaterial * |
m | ) |
|
|
virtual |
Implements VP1MaterialButtonBase.
Definition at line 243 of file VP1MaterialButton.cxx.
246 message(
"VP1MaterialButton::copyValuesFromMaterial Error: Passed material is null!!");
250 if (
m->ambientColor.getNum()!=1
251 ||
m->diffuseColor.getNum()!=1
252 ||
m->specularColor.getNum()!=1
253 ||
m->emissiveColor.getNum()!=1
254 ||
m->transparency.getNum()!=1
255 ||
m->shininess.getNum()!=1) {
256 message(
"VP1MaterialButton::copyValuesFromMaterial Error: Passed material must have exactly one value in each of the 6 fields!!");
261 int new_shininess =
std::min(
std::max(0,
static_cast<int>(
m->shininess[0]*100.0f+0.5f)),100);
262 int new_transparency =
std::min(
std::max(0,
static_cast<int>(
m->transparency[0]*100.0f+0.5f)),100);
◆ createMaterial() [1/2]
SoMaterial * VP1MaterialButton::createMaterial |
( |
const double & |
r, |
|
|
const double & |
g, |
|
|
double |
b, |
|
|
const double & |
brightness = 0.0 , |
|
|
const double & |
transp = 0.0 |
|
) |
| |
|
static |
◆ createMaterial() [2/2]
SoMaterial * VP1MaterialButton::createMaterial |
( |
const QColor & |
col, |
|
|
const double & |
brightness = 0.0 , |
|
|
const double & |
transp = 0.0 |
|
) |
| |
|
static |
◆ dragEnterEvent()
void VP1MaterialButton::dragEnterEvent |
( |
QDragEnterEvent * |
event | ) |
|
|
protected |
◆ dropEvent()
void VP1MaterialButton::dropEvent |
( |
QDropEvent * |
event | ) |
|
|
protected |
Definition at line 916 of file VP1MaterialButton.cxx.
918 QByteArray
data =
event->mimeData()->data(
"vp1/material");
919 event->acceptProposedAction();
922 buffer.open(QIODevice::ReadOnly);
923 QDataStream state(&
buffer);
◆ editWindow()
QWidget & VP1MaterialButton::editWindow |
( |
| ) |
|
◆ handledMaterials()
const QList< SoMaterial * > & VP1MaterialButton::handledMaterials |
( |
| ) |
const |
◆ handleMaterial()
bool VP1MaterialButton::handleMaterial |
( |
SoMaterial * |
m | ) |
|
◆ helperClassName()
const QString& VP1HelperClassBase::helperClassName |
( |
| ) |
const |
|
inlineinherited |
◆ lastAppliedAmbientColour()
QColor VP1MaterialButton::lastAppliedAmbientColour |
( |
| ) |
const |
◆ lastAppliedBrightness()
double VP1MaterialButton::lastAppliedBrightness |
( |
| ) |
const |
|
virtual |
◆ lastAppliedChanged
void VP1MaterialButton::lastAppliedChanged |
( |
| ) |
|
|
signal |
◆ lastAppliedDiffuseColour()
QColor VP1MaterialButton::lastAppliedDiffuseColour |
( |
| ) |
const |
◆ lastAppliedEmissiveColour()
QColor VP1MaterialButton::lastAppliedEmissiveColour |
( |
| ) |
const |
◆ lastAppliedShininess()
double VP1MaterialButton::lastAppliedShininess |
( |
| ) |
const |
|
virtual |
◆ lastAppliedSpecularColour()
QColor VP1MaterialButton::lastAppliedSpecularColour |
( |
| ) |
const |
◆ lastAppliedTransparency()
double VP1MaterialButton::lastAppliedTransparency |
( |
| ) |
const |
|
virtual |
◆ message() [1/3]
void VP1HelperClassBase::message |
( |
const QString & |
str | ) |
const |
|
inherited |
◆ message() [2/3]
void VP1HelperClassBase::message |
( |
const QString & |
addtostart, |
|
|
const QStringList & |
l, |
|
|
const QString & |
addtoend = "" |
|
) |
| const |
|
inherited |
Definition at line 131 of file VP1HelperClassBase.cxx.
133 if (addtostart.isEmpty()) {
137 if (addtoend.isEmpty()) {
138 for (
const QString&
s :
l)
141 for (
const QString&
s :
l)
◆ message() [3/3]
void VP1HelperClassBase::message |
( |
const QStringList & |
l, |
|
|
const QString & |
addtoend = "" |
|
) |
| const |
|
inherited |
Definition at line 91 of file VP1HelperClassBase.cxx.
93 if (addtoend.isEmpty()) {
94 for (
const QString&
s :
l)
97 for (
const QString&
s :
l)
◆ messageDebug() [1/3]
void VP1HelperClassBase::messageDebug |
( |
const QString & |
str | ) |
const |
|
inherited |
◆ messageDebug() [2/3]
void VP1HelperClassBase::messageDebug |
( |
const QString & |
addtostart, |
|
|
const QStringList & |
l, |
|
|
const QString & |
addtoend = "" |
|
) |
| const |
|
inherited |
Definition at line 147 of file VP1HelperClassBase.cxx.
151 if (addtostart.isEmpty()) {
155 if (addtoend.isEmpty()) {
156 for (
const QString&
s :
l)
159 for (
const QString&
s :
l)
◆ messageDebug() [3/3]
void VP1HelperClassBase::messageDebug |
( |
const QStringList & |
l, |
|
|
const QString & |
addtoend = "" |
|
) |
| const |
|
inherited |
Definition at line 103 of file VP1HelperClassBase.cxx.
107 if (addtoend.isEmpty()) {
108 for (
const QString&
s :
l)
111 for (
const QString&
s :
l)
◆ messageVerbose() [1/3]
void VP1HelperClassBase::messageVerbose |
( |
const QString & |
str | ) |
const |
|
inherited |
◆ messageVerbose() [2/3]
void VP1HelperClassBase::messageVerbose |
( |
const QString & |
addtostart, |
|
|
const QStringList & |
l, |
|
|
const QString & |
addtoend = "" |
|
) |
| const |
|
inherited |
Definition at line 165 of file VP1HelperClassBase.cxx.
169 if (addtostart.isEmpty()) {
173 if (addtoend.isEmpty()) {
174 for (
const QString&
s :
l)
177 for (
const QString&
s :
l)
◆ messageVerbose() [3/3]
void VP1HelperClassBase::messageVerbose |
( |
const QStringList & |
l, |
|
|
const QString & |
addtoend = "" |
|
) |
| const |
|
inherited |
Definition at line 117 of file VP1HelperClassBase.cxx.
121 if (addtoend.isEmpty()) {
122 for (
const QString&
s :
l)
125 for (
const QString&
s :
l)
◆ mouseMoveEvent()
void VP1MaterialButton::mouseMoveEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
Definition at line 848 of file VP1MaterialButton.cxx.
850 if (!(
event->buttons() & Qt::LeftButton))
853 < QApplication::startDragDistance())
856 QDrag *drag =
new QDrag(
this);
857 QMimeData *mimeData =
new QMimeData;
863 QByteArray byteArray;
864 QBuffer
buffer(&byteArray);
865 buffer.open(QIODevice::WriteOnly);
875 mimeData->setData(
"vp1/material", byteArray);
882 QString
s =
"SoMaterial * mat = new SoMaterial;\n";
884 if (str_ambient!=
"SbColor(0.2,0.2,0.2)")
885 s +=
"mat->ambientColor.setValue("+str_ambient+
");\n";
887 if (str_diffuse!=
"SbColor(0.8,0.8,0.8)")
888 s +=
"mat->diffuseColor.setValue("+str_diffuse+
");\n";
890 if (str_specular!=
"SbColor(0,0,0)")
891 s +=
"mat->specularColor.setValue("+str_specular+
");\n";
893 if (str_emissive!=
"SbColor(0,0,0)")
894 s +=
"mat->emissiveColor.setValue("+str_emissive+
");\n";
896 if (str_shininess!=
"0.2")
897 s +=
"mat->shininess.setValue("+str_shininess+
");\n";
899 if (str_transparency!=
"0")
900 s +=
"mat->transparency.setValue("+str_transparency+
");\n";
901 mimeData->setText(
s);
904 drag->setMimeData(mimeData);
905 drag->exec(Qt::CopyAction | Qt::MoveAction);
◆ mousePressEvent()
void VP1MaterialButton::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
◆ reset
void VP1MaterialButton::reset |
( |
| ) |
|
|
protectedslot |
◆ restoreFromState()
void VP1MaterialButton::restoreFromState |
( |
const QByteArray & |
ba | ) |
|
|
virtual |
◆ saveState()
QByteArray VP1MaterialButton::saveState |
( |
| ) |
const |
|
virtual |
◆ setDimension()
void VP1MaterialButton::setDimension |
( |
int |
dim | ) |
|
◆ setHelperClassName()
void VP1HelperClassBase::setHelperClassName |
( |
const QString & |
n | ) |
|
|
inlineprotectedinherited |
◆ setMaterial()
bool VP1MaterialButton::setMaterial |
( |
SoMaterial * |
m | ) |
|
|
virtual |
◆ setMaterialParameters() [1/2]
void VP1MaterialButton::setMaterialParameters |
( |
SoMaterial * |
m, |
|
|
const double & |
r, |
|
|
const double & |
g, |
|
|
const double & |
b, |
|
|
const double & |
brightness = 0.0 , |
|
|
const double & |
transp = 0.0 |
|
) |
| |
|
static |
Definition at line 808 of file VP1MaterialButton.cxx.
815 bool save =
m->enableNotify(
false);
823 m->diffuseColor.setValue(SbColor(
r,
g,
b));
827 m->transparency.setValue(std::max<float>(0.0
f,std::min<float>(1.0
f,in_transp)));
833 m->enableNotify(
true);
◆ setMaterialParameters() [2/2]
void VP1MaterialButton::setMaterialParameters |
( |
SoMaterial * |
m, |
|
|
const QColor & |
col, |
|
|
const double & |
brightness = 0.0 , |
|
|
const double & |
transp = 0.0 |
|
) |
| |
|
static |
◆ setMaterialText
void VP1MaterialButton::setMaterialText |
( |
const QString & |
t | ) |
|
|
slot |
◆ setSystemBasePointer()
void VP1HelperClassBase::setSystemBasePointer |
( |
IVP1System * |
sys | ) |
|
|
inherited |
◆ setText()
void VP1MaterialButton::setText |
( |
const QString & |
s | ) |
|
◆ showEditMaterialDialog
void VP1MaterialButton::showEditMaterialDialog |
( |
| ) |
|
|
slot |
◆ stopHandlingMaterial()
bool VP1MaterialButton::stopHandlingMaterial |
( |
SoMaterial * |
m | ) |
|
◆ str() [1/30]
◆ str() [2/30]
static QString VP1String::str |
( |
const bool |
b | ) |
|
|
inlinestaticinherited |
Definition at line 53 of file VP1String.h.
53 {
return b?
"True":
"False"; }
◆ str() [3/30]
static QString VP1String::str |
( |
const char * |
c | ) |
|
|
inlinestaticinherited |
◆ str() [4/30]
static QString VP1String::str |
( |
const double & |
d | ) |
|
|
inlinestaticinherited |
◆ str() [5/30]
static QString VP1String::str |
( |
const float & |
f | ) |
|
|
inlinestaticinherited |
◆ str() [6/30]
◆ str() [7/30]
QString VP1String::str |
( |
const QColor & |
c | ) |
|
|
staticinherited |
Definition at line 30 of file VP1String.cxx.
32 return c.isValid() ?
c.name() :
"Invalid";
◆ str() [8/30]
template<class T >
static QString VP1String::str |
( |
const QFlags< T > & |
f | ) |
|
|
inlinestaticinherited |
◆ str() [9/30]
template<class T >
static QString VP1String::str |
( |
const QList< T > & |
t | ) |
|
|
inlinestaticinherited |
◆ str() [10/30]
static QString VP1String::str |
( |
const QString & |
s | ) |
|
|
inlinestaticinherited |
◆ str() [11/30]
QString VP1String::str |
( |
const SbColor & |
c | ) |
|
|
staticinherited |
◆ str() [12/30]
QString VP1String::str |
( |
const SbVec2d & |
v | ) |
|
|
staticinherited |
◆ str() [13/30]
QString VP1String::str |
( |
const SbVec2f & |
v | ) |
|
|
staticinherited |
◆ str() [14/30]
QString VP1String::str |
( |
const SbVec2s & |
v | ) |
|
|
staticinherited |
◆ str() [15/30]
QString VP1String::str |
( |
const SbVec3d & |
v | ) |
|
|
staticinherited |
◆ str() [16/30]
QString VP1String::str |
( |
const SbVec3f & |
v | ) |
|
|
staticinherited |
◆ str() [17/30]
QString VP1String::str |
( |
const SbVec3s & |
v | ) |
|
|
staticinherited |
◆ str() [18/30]
QString VP1String::str |
( |
const SbVec4d & |
v | ) |
|
|
staticinherited |
◆ str() [19/30]
QString VP1String::str |
( |
const SbVec4f & |
v | ) |
|
|
staticinherited |
◆ str() [20/30]
template<class T >
static QString VP1String::str |
( |
const T * |
t | ) |
|
|
inlinestaticinherited |
Definition at line 87 of file VP1String.h.
87 {
return str(
static_cast<const void*
>(
t)); }
◆ str() [21/30]
QString VP1String::str |
( |
const void * |
p | ) |
|
|
staticinherited |
Definition at line 48 of file VP1String.cxx.
54 return QString (
s.str().c_str());
◆ str() [22/30]
◆ str() [23/30]
static QString VP1String::str |
( |
int |
n | ) |
|
|
inlinestaticinherited |
◆ str() [24/30]
static QString VP1String::str |
( |
long |
n | ) |
|
|
inlinestaticinherited |
◆ str() [25/30]
static QString VP1String::str |
( |
qlonglong |
n | ) |
|
|
inlinestaticinherited |
◆ str() [26/30]
static QString VP1String::str |
( |
qulonglong |
n | ) |
|
|
inlinestaticinherited |
◆ str() [27/30]
static QString VP1String::str |
( |
short int |
n | ) |
|
|
inlinestaticinherited |
◆ str() [28/30]
static QString VP1String::str |
( |
uint |
n | ) |
|
|
inlinestaticinherited |
◆ str() [29/30]
static QString VP1String::str |
( |
ulong |
n | ) |
|
|
inlinestaticinherited |
◆ str() [30/30]
static QString VP1String::str |
( |
unsigned short int |
n | ) |
|
|
inlinestaticinherited |
◆ switchMode
void VP1MaterialButton::switchMode |
( |
| ) |
|
|
protectedslot |
Definition at line 745 of file VP1MaterialButton.cxx.
756 if (new_simplemode) {
761 int brightness_i = std::max<int>(0,std::min<int>(100,
static_cast<int>(brightness*100+0.5)));
◆ systemBase()
IVP1System* VP1HelperClassBase::systemBase |
( |
| ) |
const |
|
inlineinherited |
◆ transparencyChanged
void VP1MaterialButton::transparencyChanged |
( |
| ) |
|
|
protectedslot |
Definition at line 682 of file VP1MaterialButton.cxx.
684 QSlider * slider1(0);
685 QSlider * slider2(0);
693 bool save = slider2->blockSignals(
true);
694 slider2->setValue(slider1->value());
695 slider2->blockSignals(
save);
◆ updateButton
void VP1MaterialButton::updateButton |
( |
| ) |
|
|
protectedslot |
Definition at line 661 of file VP1MaterialButton.cxx.
663 if (objectName().isEmpty()){
664 setObjectName(
"VP1MaterialButton");
◆ updatePreview
void VP1MaterialButton::updatePreview |
( |
| ) |
|
|
protectedslot |
◆ updatePreviewSceneAndBgd
void VP1MaterialButton::updatePreviewSceneAndBgd |
( |
| ) |
|
|
protectedslot |
◆ verbose()
static bool VP1HelperClassBase::verbose |
( |
| ) |
|
|
inlinestaticinherited |
◆ warnUndeletedInstances()
void VP1HelperClassBase::warnUndeletedInstances |
( |
| ) |
|
|
staticinherited |
Definition at line 183 of file VP1HelperClassBase.cxx.
185 if (vp1helperclassbase_instanceMap.empty())
187 std::cout <<
"WARNING: Detected "<<vp1helperclassbase_instanceMap.size()<<
" undeleted helper class instances:"<<std::endl;
190 for (
it = vp1helperclassbase_instanceMap.begin();
it!=
itE;++
it) {
191 std::cout <<
" ==> "<<
it->first<<
": "<<
it->first->m_helpername.toStdString()
192 << (
it->second.isEmpty()?QString(
""):
" (in system "+
it->
second+
")").toStdString()<<std::endl;
◆ m_d
Imp* VP1MaterialButton::m_d |
|
private |
◆ m_helpername
QString VP1HelperClassBase::m_helpername |
|
privateinherited |
◆ m_system
◆ s_vp1verbose
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
char data[hepevt_bytes_allocation_ATLAS]
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
void messageVerbose(const QString &) const
static const bool s_vp1verbose
static QString str(const QString &s)
void messageDebug(const QString &) const
def save(self, fileName="./columbo.out")
static const char * prefix_msg()
POOL::TEvent event(POOL::TEvent::kClassAccess)
const QString & name() const
static QColor sbcol2qcol(const SbColor &)
IVP1System * systemBase() const
static const char * prefix_debug()
static const char * prefix_verbose()
void message(const QString &) const
void message(const QString &) const