Skip to content
Snippets Groups Projects
Commit 2c673aa9 authored by Edward Moyse's avatar Edward Moyse
Browse files

Add missing people colour and transparency functions

parent cd3719ed
No related branches found
No related tags found
2 merge requests!691662024-02-23: merge of 24.0 into main,!69096VP1: fix some missing signal/slot errors #2
......@@ -77,6 +77,7 @@ public:
//People:
bool showPeople() const;
SbColor4f peopleColourAndTransp() const;
double peopleZPos() const;
double peopleVerticalPos() const;
......@@ -138,6 +139,7 @@ signals:
void floorHeightChanged(const double&);
void showLettersChanged(bool);
void showPeopleChanged(bool);
void peopleColourAndTranspChanged( const SbColor4f& );
void lettersZPosChanged(const double&);
void lettersVerticalPosChanged(const double&);
void peopleVerticalPosChanged(const double&);
......@@ -186,6 +188,7 @@ private Q_SLOTS:
void possibleChange_floorHeight();
void possibleChange_showLetters();
void possibleChange_showPeople();
void possibleChange_peopleColourAndTransp();
void possibleChange_lettersZPos();
void possibleChange_lettersVerticalPos();
void possibleChange_peopleVerticalPos();
......
......@@ -19,6 +19,7 @@
#include "VP1Base/VP1HelperClassBase.h"
#include <QObject>
#include <Inventor/SbColor4f.h>
class SoMaterial;
class SoSeparator;
......@@ -38,6 +39,7 @@ public Q_SLOTS:
void setShown(bool);//will attach/detach itself from attachsep depending on this
void setZPos(const double&);
void setVerticalPosition(const double&);
void setColourAndTransp(const SbColor4f&);
private:
class Imp;
......
......@@ -176,6 +176,8 @@ void VP1GuideLineSystem::buildPermanentSceneGraph(StoreGateSvc* /*detstore*/, So
m_d->people->setVerticalPosition(m_d->controller->peopleVerticalPos());
connect(m_d->controller,SIGNAL(showPeopleChanged(bool)),m_d->people,SLOT(setShown(bool)));
m_d->people->setShown(m_d->controller->showPeople());
connect(m_d->controller,SIGNAL(peopleColourAndTranspChanged( const SbColor4f&)),m_d->people,SLOT(setColourAndTransp(const SbColor4f&)));
m_d->people->setColourAndTransp(m_d->controller->peopleColourAndTransp());
//Coordinate axes:
m_d->coordinateaxes = new VP1CoordinateAxes(m_d->controller->xAxisMaterial(),
......
......@@ -66,6 +66,7 @@ public:
double getScaleFactor(SoNode* node, double desiredHeight);
bool shown;
SbColor4f colourAndTransp;
double zpos;
double vertpos;
......@@ -76,6 +77,8 @@ public:
void updateFields();
void ensureInit3DObjects();
void updateColour();
};
//____________________________________________________________________
......@@ -345,6 +348,20 @@ void VP1People::Imp::updateFields()
trans3->translation.setValue(8*SYSTEM_OF_UNITS::m, vertpos, zpos-10*SYSTEM_OF_UNITS::m); // x,y,z
}
//____________________________________________________________________
void VP1People::Imp::updateColour()
{
theclass->messageVerbose("Updating packed colour");
if (!sep||sep->getNumChildren()<1)
return;
SoNode * n = sep->getChild(0);
if (!n||n->getTypeId()!=SoVRMLMaterial::getClassTypeId())
return;
SoVRMLMaterial* matVRML = static_cast<SoVRMLMaterial*>(n);
matVRML->diffuseColor.setValue( colourAndTransp.getValue() );
}
//____________________________________________________________________
void VP1People::setShown(bool b)
{
......@@ -362,6 +379,17 @@ void VP1People::setShown(bool b)
}
}
//____________________________________________________________________
void VP1People::setColourAndTransp(const SbColor4f&ct)
{
messageVerbose("Signal received in setColourAndTransp slot.");
if (m_d->colourAndTransp==ct)
return;
m_d->colourAndTransp=ct;
if (m_d->shown)
m_d->updateColour();
}
//____________________________________________________________________
void VP1People::setZPos(const double&p)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment