ATLAS Offline Software
Loading...
Searching...
No Matches
VP1AODChannel Class Reference

#include <VP1AODChannel.h>

Inheritance diagram for VP1AODChannel:
Collaboration diagram for VP1AODChannel:

Public Types

enum  Type {
  UNKNOWN = 0 , THREEDIMENSIONAL , TWODIMENSIONAL , HISTOGRAM ,
  NUMBERS
}

Signals

void message (QString)
void uniqueNameChanged (const QString &)
void systemRefreshInfoChanged (QString sysrefreshing, int nsysOn, int nsysOnRefreshed)
void systemAdded (IVP1System *)

Public Member Functions

 VP1AODChannel ()
void init ()
virtual ~VP1AODChannel ()
void create ()
virtual QPixmap getSnapshot (bool transp=false, int width=0, bool batch=false)
virtual void lastOfActiveSystemsRefreshed ()
virtual void systemRefreshed (IVP1System *)
virtual void systemErased (IVP1System *)
virtual QByteArray saveState ()
virtual void restoreFromState (QByteArray)
void launchStereoEditor ()
bool isAntiAliasing ()
bool setAntiAliasing (bool)
Type type () const
void setUpdatesEnabled (bool enable)
virtual void goingToNextEvent ()
virtual bool isAccumulator () const
void setRunEvtNumber (int runnumber, unsigned long long eventnumber)
const QString & name () const
const QString unique_name () const
const QString & information () const
const QString & contact_info () const

Static Public Member Functions

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)

Protected Types

enum  SystemOption {
  AllowAll = 0x0000 , DisallowExtraDisplayWidget = 0x0002 , DisallowSwitchable =0x0004 , DisallowController = 0x0008 ,
  StartDisabled = 0x0010 , DisallowCameraAccess = 0x0060
}

Protected Slots

void showControlsForSystem ()

Protected Member Functions

void addSystem (IVP13DSystem *, const SystemOptions &options=AllowAll)
void addSystem (IVP13DSystemSimple *, const SystemOptions &options=AllowAll)
void addSystemGroup (const QString &title, const QStringList &systemNames)
void addExtraSystemFactory (const QString &prefix, const QString &groupTitle, const QString &buttonText, std::function< IVP13DSystemSimple *(const QString &)> factory)
void dockResized ()
void stopSpinning ()
void registerRenderArea (VP1ExaminerViewer *)
virtual void uncreate ()
void turnOn (IVP1System *)
void turnOff (IVP1System *, const bool &immediateErase=true)
void getRunEvtNumber (int &runnumber, unsigned long long &eventnumber)
void setEvtTimestamp (unsigned timestamp)
void getEvtTimestamp (unsigned &timestamp)
void registerController (QWidget *)
void registerSystem (IVP1System *)

Private Types

enum  State { CONSTRUCTED =0 , READY , UNCREATED }

Private Slots

void toggleSystemActive ()
void updateSnapshotDim ()
void setImageFromPresets ()

Private Member Functions

unsigned cloneID () const
QWidget * controllerWidget ()
void emitRefreshInfoChanged ()
bool hasRefreshingSystem ()
void setCloneID (unsigned id)
const std::set< IVP1System * > & systems ()
void deleteControllers ()
State state () const
void setState (const State &)
void setCanRegister (const bool &controller, const bool &system)

Private Attributes

Imp * m_d

Detailed Description

Definition at line 10 of file VP1AODChannel.h.

Member Enumeration Documentation

◆ State

enum IVP1ChannelWidget::State
privateinherited
Enumerator
CONSTRUCTED 
READY 
UNCREATED 

Definition at line 131 of file IVP1ChannelWidget.h.

◆ SystemOption

Enumerator
AllowAll 
DisallowExtraDisplayWidget 
DisallowSwitchable 
DisallowController 
StartDisabled 
DisallowCameraAccess 

Definition at line 35 of file IVP13DStandardChannelWidget.h.

35 {
36 AllowAll = 0x0000,
37 DisallowExtraDisplayWidget = 0x0002,//Any extra display widget provided by this wont be present in the GUI
38 DisallowSwitchable=0x0004,//User can not turn 3d objects from this system on/off.
39 DisallowController = 0x0008,//Any custom controller provided by this wont be present in the GUI
40 StartDisabled = 0x0010,
42 };

◆ Type

enum IVP1ChannelWidget::Type
inherited
Enumerator
UNKNOWN 
THREEDIMENSIONAL 
TWODIMENSIONAL 
HISTOGRAM 
NUMBERS 

Definition at line 46 of file IVP1ChannelWidget.h.

Constructor & Destructor Documentation

◆ VP1AODChannel()

VP1AODChannel::VP1AODChannel ( )

Definition at line 8 of file VP1AODChannel.cxx.

10 "This channel displays various systems related to Analysis Objects (AOD).",
11 "Edward Moyse <edward.moyse@cern.ch>") {}
#define VP1CHANNELNAMEINPLUGIN(cls, nme)
IVP13DStandardChannelWidget(const QString &name, const QString &information, const QString &contact_info, bool detectorViewButtons=true)

◆ ~VP1AODChannel()

virtual VP1AODChannel::~VP1AODChannel ( )
inlinevirtual

Definition at line 18 of file VP1AODChannel.h.

18{}

Member Function Documentation

◆ addExtraSystemFactory()

void IVP13DStandardChannelWidget::addExtraSystemFactory ( const QString & prefix,
const QString & groupTitle,
const QString & buttonText,
std::function< IVP13DSystemSimple *(const QString &)> factory )
protectedinherited

Definition at line 160 of file IVP13DStandardChannelWidget.cxx.

163{
164 m_d->extraSystemFactories.append({prefix, groupTitle, buttonText, std::move(factory)});
165}

◆ addSystem() [1/2]

void IVP13DStandardChannelWidget::addSystem ( IVP13DSystem * system,
const SystemOptions & options = AllowAll )
protectedinherited

Definition at line 219 of file IVP13DStandardChannelWidget.cxx.

219 {
220
221
222 bool switchable = ! (options & DisallowSwitchable);
223 bool allowController = ! (options & DisallowController);
224 bool allowExtraDisplayWidget = ! (options & DisallowExtraDisplayWidget);
225 bool startDisabled = (options & StartDisabled);
226
227 registerSystem(system);
228 const bool runtime = m_d->viewer != nullptr;
229 if (!(options & DisallowCameraAccess)) {
230 m_d->systemsAllowedCameraList << system;
231 if (runtime)
232 system->registerViewer(m_d->viewer);
233 }
234
235 SoSeparator * sysroot = system->getSceneGraph();
236 assert(!m_d->system2rootNodes.contains(system));
237 m_d->system2rootNodes.insert(system,sysroot);
238 m_d->root->addChild(sysroot);
239
240 if (allowController) {
241 m_d->systemsAllowedControllers << system;
242 connect(system,SIGNAL(itemFromSystemSelected()),this,SLOT(showControlsForSystem()));
243 }
244
245 if (runtime) {
246 if (allowController) {
247 if (QWidget* controller = system->controllerWidget()) {
248 controller->setParent(m_d->tabwidget);
249 m_d->sys2tabpage.insert(system, controller);
250 if (!startDisabled)
251 m_d->tabwidget->addTab(controller, system->name());
252 }
253 }
254 QVBoxLayout* layout = m_d->checkBoxLayout(system->name());
255 auto* checkBox = VP1ControllerHelper::systemCheckBox(system, layout->parentWidget());
256 layout->addWidget(checkBox);
257 checkBox->setEnabled(switchable);
258 if (switchable) {
259 m_d->checkbox2system.insert(checkBox, system);
260 if (startDisabled) {
261 checkBox->setChecked(false);
262 m_d->updateSystemState(checkBox);
263 }
264 connect(checkBox, &QCheckBox::toggled, this, &IVP13DStandardChannelWidget::toggleSystemActive);
265 }
266 return;
267 }
268
269 m_d->system2switchable << QPair<IVP1System*,bool>(system,switchable);
270 m_d->system2startdisabled.insert(system,startDisabled);
271
272 if (allowExtraDisplayWidget)
273 m_d->systemsAllowedExtraDisplayWidgets << system;
274}
virtual SoSeparator * getSceneGraph() const =0
void registerViewer(SoQtViewer *viewer)
void registerSystem(IVP1System *)
const QString & name() const
QWidget * controllerWidget()
static QCheckBox * systemCheckBox(IVP1System *, QWidget *parent)
str layout
Definition TileTB.py:76

◆ addSystem() [2/2]

void IVP13DStandardChannelWidget::addSystem ( IVP13DSystemSimple * sys,
const SystemOptions & options = AllowAll )
protectedinherited

Definition at line 574 of file IVP13DStandardChannelWidget.cxx.

575{
576 addSystem((IVP13DSystem*)sys,options);
577}
void addSystem(IVP13DSystem *, const SystemOptions &options=AllowAll)

◆ addSystemGroup()

void IVP13DStandardChannelWidget::addSystemGroup ( const QString & title,
const QStringList & systemNames )
protectedinherited

Definition at line 155 of file IVP13DStandardChannelWidget.cxx.

156{
157 m_d->systemGroups.append({title, systemNames});
158}

◆ cloneID()

unsigned IVP1ChannelWidget::cloneID ( ) const
privateinherited

Definition at line 197 of file IVP1ChannelWidget.cxx.

198{
199 return m_d->cloneid;
200}

◆ contact_info()

const QString & IVP1ChannelWidget::contact_info ( ) const
inherited

Definition at line 191 of file IVP1ChannelWidget.cxx.

192{
193 return m_d->contact_info;
194}

◆ controllerWidget()

QWidget * IVP1ChannelWidget::controllerWidget ( )
privateinherited

Definition at line 77 of file IVP1ChannelWidget.cxx.

78{
79 return m_d->controller;
80}

◆ create()

void IVP13DStandardChannelWidget::create ( )
virtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 277 of file IVP13DStandardChannelWidget.cxx.

277 {
278
279 //Set up the controller.
280 QWidget * snapshotgroupbox = new QWidget();
281 m_d->uisnapshot.setupUi(snapshotgroupbox);
282
283 VP1ColorSelectButton * colorselectbutton_dummy;
284 QWidget* controller = VP1ControllerHelper::compositionController( m_d->systemsAllowedControllers,
285 m_d->sys2tabpage,m_d->tabwidget,
286 m_d->system2switchable,
287 m_d->checkbox2system,
288 colorselectbutton_dummy,
289 snapshotgroupbox,true );
290 registerController(controller);
291 QWidget* general = snapshotgroupbox->parentWidget();
292 m_d->systemCheckBoxes = general->findChild<QVBoxLayout*>("vp1SystemCheckBoxes");
293 if (!m_d->systemGroups.isEmpty() || !m_d->extraSystemFactories.isEmpty()) {
294 const auto addGroup = [this, general](const QString& title) {
295 auto* group = new QGroupBox(title, general);
296 auto* layout = new QVBoxLayout(group);
297 m_d->systemCheckBoxes->addWidget(group);
298 m_d->groupedCheckBoxes.insert(title, layout);
299 return layout;
300 };
301 for (const auto& group : m_d->systemGroups)
302 addGroup(group.first);
303 for (const auto& factory : m_d->extraSystemFactories) {
304 auto* layout = addGroup(factory.groupTitle);
305 auto* button = new QPushButton(factory.buttonText, layout->parentWidget());
306 layout->addWidget(button);
307 connect(button, &QPushButton::clicked, this, [this, factory] {
308 QString name = factory.prefix;
309 for (unsigned int number = 2; m_d->hasSystemNamed(name); ++number)
310 name = factory.prefix + QString::number(number);
311 addSystem(factory.create(name), DisallowExtraDisplayWidget);
312 });
313 }
314 for (const auto& [system, switchable] : m_d->system2switchable) {
315 if (!switchable)
316 continue;
317 QVBoxLayout* layout = m_d->checkBoxLayout(system->name());
318 if (layout != m_d->systemCheckBoxes) {
319 QCheckBox* checkBox = m_d->checkbox2system.key(system);
320 m_d->systemCheckBoxes->removeWidget(checkBox);
321 layout->addWidget(checkBox);
322 }
323 }
324 }
325 short x,y;
326 SoOffscreenRenderer::getMaximumResolution().getValue(x,y);
327
328 // now the range is set in the ui file.
329// m_d->uisnapshot.spinBox_width->setRange ( 1, x/4 - 10 );
330// m_d->uisnapshot.spinBox_height->setRange ( 1, y/4 - 10 );
331
332 connect(m_d->uisnapshot.checkBox_as_shown,SIGNAL(toggled(bool)),this,SLOT(updateSnapshotDim()));
333 connect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
334 connect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
335 connect(m_d->uisnapshot.radioButton_width,SIGNAL(toggled(bool)),this,SLOT(updateSnapshotDim()));
336 connect(m_d->uisnapshot.radioButton_height,SIGNAL(toggled(bool)),this,SLOT(updateSnapshotDim()));
337
338 connect(m_d->uisnapshot.groupBox_imagePresets,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets()));
339 connect(m_d->uisnapshot.radioButton_720p,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets()));
340 connect(m_d->uisnapshot.radioButton_1080p,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets()));
341 connect(m_d->uisnapshot.radioButton_4K,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets()));
342 connect(m_d->uisnapshot.radioButton_8K,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets()));
343
344
345 // m_d->systemsAllowedControllers.clear();
346 m_d->system2switchable.clear();
347
348 QMapIterator<QCheckBox*,IVP1System*> it(m_d->checkbox2system);
349 while (it.hasNext()) {
350 it.next();
351
352 assert(m_d->system2startdisabled.contains(it.value()));
353 if (m_d->system2startdisabled[it.value()]) {
354 it.key()->setChecked(false);
355 m_d->updateSystemState(it.key());
356 }
357
358 connect(it.key(),SIGNAL(toggled(bool)),this,SLOT(toggleSystemActive()));
359
360 }
361
362 QTimer::singleShot(0, this, SLOT(updateSnapshotDim()));
363
364
365 //Setup viewer (with possible splitter for extra widgets):
366 QList<QPair<QString,QWidget*> > sysname2extradisplay;
367 for (IVP13DSystem* sys : m_d->systemsAllowedExtraDisplayWidgets) {
368 QWidget * edwidget = sys->buildExtraDisplayWidget();
369 if (edwidget)
370 sysname2extradisplay << QPair<QString,QWidget*>(sys->name(),edwidget);
371 }
372
373 if (sysname2extradisplay.count()==0) {
374 m_d->viewer = new VP1ExaminerViewer(this,m_d->detectorViewButtons);
375 setMinimumSize(m_d->min3dx,m_d->min3dy);
376 } else if (sysname2extradisplay.count()==1) {
377 m_d->setupSplitter(sysname2extradisplay.front().second);
378 } else if (sysname2extradisplay.count()>1) {
379 VP1TabWidget * tabWidget = new VP1TabWidget();
380 for (int i = 0; i < sysname2extradisplay.count(); ++i) {
381 tabWidget->addTab(sysname2extradisplay.at(i).second,sysname2extradisplay.at(i).first);
382 }
383 tabWidget->setCurrentIndex(0);
384 m_d->setupSplitter(tabWidget);
385 }
386
387 registerRenderArea(m_d->viewer);//remember this...
388
389 m_d->viewer->setSceneGraph(m_d->root);
390 m_d->viewer->setGLRenderAction(new SoLineHighlightRenderAction());
391 //m_d->viewer->setGLRenderAction(new SoBoxHighlightRenderAction());
392
393 // Default Transparency Type
394 // m_d->viewer->setTransparencyType( SoGLRenderAction::DELAYED_BLEND ); // old
395 m_d->viewer->setTransparencyType( SoGLRenderAction::BLEND ); // this looks better for geometry volumes
396
397 //Setup camera info:
398 for (IVP13DSystem*sys : m_d->systemsAllowedCameraList)
399 sys->registerViewer(m_d->viewer);
400
401
402 /* We want to change the default value for the "As shown" option
403 * At the beginning the option was set to True by default, but
404 * the most used setting when creating event displays for ATLAS is
405 * False, because we want to save the full image as a snapshot,
406 * without the frame and buttons from VP1.
407 * So we now set it to False by default.
408 * (We do that with setChecked() in order to not having to change
409 * the whole logics behind.
410 */
411 m_d->uisnapshot.checkBox_as_shown->setChecked(false); // fixme: check if that works, or if it's still TRUE
412
413}
#define y
#define x
void registerRenderArea(VP1ExaminerViewer *)
void registerController(QWidget *)
const QString & name() const
static QWidget * compositionController(const QList< IVP1System * > &systemsWithControllersAllowed, QMap< IVP1System *, QWidget * > &sys2tabpage, VP1TabWidget *&tabwidget, const QList< QPair< IVP1System *, bool > > &system2switchable, QMap< QCheckBox *, IVP1System * > &checkbox2system, VP1ColorSelectButton *&colorselectbutton, QWidget *extrawidget=0, bool nobgdcolorsel=false)
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186

◆ deleteControllers()

void IVP1ChannelWidget::deleteControllers ( )
privateinherited

Definition at line 161 of file IVP1ChannelWidget.cxx.

162{
163 std::set<IVP1System *>::iterator it, itE = m_d->systems.end();
164 for (it=m_d->systems.begin();it!=itE;++it) {
165 // assert((*it)->state()==IVP1System::ERASED);
166 if (*it)
167 (*it)->deleteController();
168 }
169 if (m_d->controller)
170 m_d->controller->deleteLater();
171 m_d->controller = 0;
172}

◆ dockResized()

void IVP13DStandardChannelWidget::dockResized ( )
protectedvirtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 764 of file IVP13DStandardChannelWidget.cxx.

765{
766 VP1Msg::messageVerbose("IVP13DStandardChannelWidget::dockResized()");
767 QTimer::singleShot(0, this, SLOT(updateSnapshotDim()));
769}
virtual void dockResized()
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84

◆ emitRefreshInfoChanged()

void IVP1ChannelWidget::emitRefreshInfoChanged ( )
privateinherited

Definition at line 269 of file IVP1ChannelWidget.cxx.

270{
271 int nsysOn(0), nsysOnRefreshed(0);
272 QString sysrefreshing;
273 std::set<IVP1System *>::iterator it, itE = m_d->systems.end();
274 for (it=m_d->systems.begin();it!=itE;++it) {
275 if ((*it)->activeState()==IVP1System::ON) {
276 ++nsysOn;
277 if((*it)->state()==IVP1System::REFRESHED)
278 ++nsysOnRefreshed;
279 if ((*it)->isRefreshing()) {
280 assert(sysrefreshing.isEmpty());
281 sysrefreshing=(*it)->name();
282 }
283 }
284 }
285 //Fixme: Only emit if actually changed.
286 systemRefreshInfoChanged(sysrefreshing, nsysOn, nsysOnRefreshed);
287}
void systemRefreshInfoChanged(QString sysrefreshing, int nsysOn, int nsysOnRefreshed)

◆ getEvtTimestamp()

void IVP1ChannelWidget::getEvtTimestamp ( unsigned & timestamp)
protectedinherited

Definition at line 263 of file IVP1ChannelWidget.cxx.

264{
265 timestamp = m_d->timestamp;
266}

◆ getRunEvtNumber()

void IVP1ChannelWidget::getRunEvtNumber ( int & runnumber,
unsigned long long & eventnumber )
protectedinherited

Definition at line 256 of file IVP1ChannelWidget.cxx.

257{
258 runnumber = m_d->runnumber;
259 eventnumber = m_d->eventnumber;
260}
static std::vector< uint32_t > runnumber
Definition iLumiCalc.h:37

◆ getSnapshot()

QPixmap IVP13DStandardChannelWidget::getSnapshot ( bool transp = false,
int width = 0,
bool batch = false )
virtualinherited

Reimplemented from IVP13DChannelWidget.

Definition at line 587 of file IVP13DStandardChannelWidget.cxx.

588{
589 VP1Msg::messageDebug("IVP13DStandardChannelWidget::getSnapshot() - transparent bkg: "+QString::number(transp)+" , width: "+QString::number(width)+" , batch: "+QString::number(batch));
590 // SoToVRML2Action tovrml2;
591 // tovrml2.apply(m_d->selection);
592 // SoVRMLGroup *newroot = tovrml2.getVRML2SceneGraph();
593 // newroot->ref();
594 // SoOutput out;
595 // out.openFile("out.wrl");
596 // out.setHeaderString("#VRML V2.0 utf8");
597 // SoWriteAction wra(&out);
598 // wra.apply(newroot);
599 // out.closeFile();
600
601
602 VP1Msg::messageVerbose("checkBox_as_shown: " + QString::number(m_d->uisnapshot.checkBox_as_shown->isChecked()) );
603 VP1Msg::messageVerbose("spinBox_width: " + QString::number(m_d->uisnapshot.spinBox_width->value()) );
604 VP1Msg::messageVerbose("spinBox_height: " + QString::number(m_d->uisnapshot.spinBox_height->value()) );
605 VP1Msg::messageVerbose("checkBox_transp: " + QString::number(m_d->uisnapshot.checkBox_transp->isChecked()) );
606
607 if (m_d->uisnapshot.checkBox_as_shown->isChecked()) {
608 VP1Msg::messageVerbose("'As shown' option checked - using IVP13DChannelWidget::getSnapshot()");
610 }
611 VP1Msg::messageVerbose("'As shown' option NOT checked");
612
613 // if width is set programmatically, we set the new value in the GUI field
614 int original_width = 0;
615 if (width) {
616 VP1Msg::messageVerbose("'width' passed at function call. Setting the value of the GUI field to: " + QString::number(width));
617 original_width = m_d->uisnapshot.spinBox_width->value();
618 m_d->uisnapshot.spinBox_width->setValue( width );
619 }
620
621
622 // if transparent bkg is requested programmatically, we force it
623 if (transp) {
624 VP1Msg::messageVerbose("'transp' option set - using VP1QtInventorUtils::renderToPixmap() with transp set to 'true'");
626 m_d->uisnapshot.spinBox_width->value(),
627 m_d->uisnapshot.spinBox_height->value(),
628 true);
629 }
630
631 // if changed programatically, set the width back to the original value set by the user
632 if (width) m_d->uisnapshot.spinBox_width->setValue( original_width );
633
634 // default, with user's preferences from the GUI
635 VP1Msg::messageVerbose("save the screenshot with the default tool (with settings from GUI) - using VP1QtInventorUtils::renderToPixmap()");
637 m_d->uisnapshot.spinBox_width->value(),
638 m_d->uisnapshot.spinBox_height->value(),
639 m_d->uisnapshot.checkBox_transp->isChecked());
640
641 //return QPixmap(); // for DEBUG
642
643}
const double width
virtual QPixmap getSnapshot(bool transp=false, int width=0, bool batch=false)
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39
static QPixmap renderToPixmap(VP1ExaminerViewer *ra, int pixels_x, int pixels_y, bool transparent_background=false, double actualRenderedSizeFact=1.0)

◆ goingToNextEvent()

void IVP13DChannelWidget::goingToNextEvent ( )
virtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 115 of file IVP13DChannelWidget.cxx.

116{
117 //Stop spinning and abort any ongoing animations:
118 m_d->it = m_d->renderareas.begin();
119 for (;m_d->it!=m_d->itE;++(m_d->it)) {
120 VP1ExaminerViewer* ra = *(m_d->it);
121 if (ra->getTypeId().isDerivedFrom(SoQtViewer::getClassTypeId())) {
122 VP1CameraHelper::abortAnyCurrentZoom(static_cast<SoQtViewer*>(ra)->getCamera());
123 if (ra->getTypeId().isDerivedFrom(SoQtExaminerViewer::getClassTypeId())) {
124 if (static_cast<SoQtExaminerViewer*>(ra)->isAnimating())
125 static_cast<SoQtExaminerViewer*>(ra)->stopAnimating();
126 }
127 }
128 }
129}
static void abortAnyCurrentZoom(SoCamera *camera)

◆ hasRefreshingSystem()

bool IVP1ChannelWidget::hasRefreshingSystem ( )
privateinherited

Definition at line 290 of file IVP1ChannelWidget.cxx.

290 {
291 std::set<IVP1System *>::iterator it, itE = m_d->systems.end();
292 for (it=m_d->systems.begin();it!=itE;++it) {
293 if ((*it)->isRefreshing())
294 return true;
295 }
296 return false;
297}

◆ information()

const QString & IVP1ChannelWidget::information ( ) const
inherited

Definition at line 185 of file IVP1ChannelWidget.cxx.

186{
187 return m_d->information;
188}

◆ init()

void VP1AODChannel::init ( )
virtual

Implements IVP1ChannelWidget.

Definition at line 13 of file VP1AODChannel.cxx.

14{
15 VP1AODSystem * aodsys = new VP1AODSystem;
16 addSystem(aodsys);
17 VP1GuideLineSystem * guidelinesystem = new VP1GuideLineSystem;
18 addSystem(guidelinesystem);
19}

◆ isAccumulator()

bool IVP1ChannelWidget::isAccumulator ( ) const
virtualinherited

Definition at line 83 of file IVP1ChannelWidget.cxx.

84{
85 return false;
86}

◆ isAntiAliasing()

bool IVP13DStandardChannelWidget::isAntiAliasing ( )
virtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 116 of file IVP13DStandardChannelWidget.cxx.

117{
118 return m_d->viewer->isAntiAlias();
119}

◆ lastOfActiveSystemsRefreshed()

void IVP13DStandardChannelWidget::lastOfActiveSystemsRefreshed ( )
virtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 475 of file IVP13DStandardChannelWidget.cxx.

476{
477 VP1Msg::messageVerbose("IVP13DStandardChannelWidget::lastOfActiveSystemsRefreshed() called.");
478
479 if (m_d->need_initial_viewall) {
480 m_d->viewer->viewAll();
481 m_d->viewer->storeCameraParametersForReset();
482 m_d->need_initial_viewall=false;
483 }
484
485 if(VP1QtUtils::environmentVariableIsSet("VP1_SCREENSHOTS_DIR"))
486 m_d->autoSnapshot();
487
488 if (m_d->viewer->startTourEachEvent())
489 m_d->viewer->startTour();
490
491 // apparently this is the last method called when all systems have been drawn
492 // so we call here the renderPixmap() method is we are in "batch-mode"
493
494
495
496}
static bool environmentVariableIsSet(const QString &name)

◆ launchStereoEditor()

void IVP13DStandardChannelWidget::launchStereoEditor ( )
inherited

Definition at line 102 of file IVP13DStandardChannelWidget.cxx.

103{
104 m_d->viewer->launchStereoEditor();
105}

◆ message

void IVP1ChannelWidget::message ( QString )
signalinherited

◆ name()

const QString & IVP1ChannelWidget::name ( ) const
inherited

Definition at line 180 of file IVP1ChannelWidget.cxx.

181{
182 return m_d->name;
183}

◆ registerController()

void IVP1ChannelWidget::registerController ( QWidget * w)
protectedinherited

Definition at line 210 of file IVP1ChannelWidget.cxx.

211{
212 assert(m_d->canregistercontroller&&"Please only register controllers during create()");
213 assert(m_d->state==CONSTRUCTED);
214 assert(w&&"IVP1ChannelWidget::registerController(...) called with null pointer!!");
215 assert(!m_d->controller&&"IVP1ChannelWidget::registerController(...) called twice!!");
216 m_d->controller = w;
217 w->setParent(0);
218}

◆ registerRenderArea()

void IVP13DChannelWidget::registerRenderArea ( VP1ExaminerViewer * ra)
protectedinherited

Definition at line 95 of file IVP13DChannelWidget.cxx.

96{
97 if (!ra) {
98 message("Error - tried to register NULL render area!");
99 return;
100 }
101
103
104 m_d->renderareas.push_back(ra);
105 m_d->itE = m_d->renderareas.end();
106
107 //To make sure that it is the actual 3D widget that gets focus when
108 //we e.g. click anywhere else in the widget where the render area is
109 //placed within:
110 if (ra->getParentWidget()&&ra->getWidget())
111 ra->getParentWidget()->setFocusProxy(ra->getWidget());
112}
void message(QString)
static void ensureInitLineWidthAndPointSize(SoQtRenderArea *)

◆ registerSystem()

void IVP1ChannelWidget::registerSystem ( IVP1System * s)
protectedinherited

Definition at line 221 of file IVP1ChannelWidget.cxx.

222{
223 assert((m_d->state==CONSTRUCTED&&m_d->canregistersystem)||m_d->state==READY);
224 assert(m_d->systems.find(s)==m_d->systems.end()&&"IVP1ChannelWidget::registerSystem(...) called twice on the same system!!");
225 m_d->systems.insert(s);
226 s->setChannel(this);
227 if (m_d->state==READY)
228 emit systemAdded(s);
229}
void systemAdded(IVP1System *)

◆ restoreFromState()

void IVP13DStandardChannelWidget::restoreFromState ( QByteArray ba)
virtualinherited

Reimplemented from IVP13DChannelWidget.

Definition at line 915 of file IVP13DStandardChannelWidget.cxx.

916{
917 VP1Msg::messageVerbose("IVP13DStandardChannelWidget::restoreFromState");
918
919 // ===> Setup stream for getting the contents of the byteArray:
920 QBuffer buffer(&ba);
921 buffer.open(QIODevice::ReadOnly);
922 QDataStream state(&buffer);
923 // ===> Check version and pass on state info to base class:
924 qint32 version;
925 state >> version;
926
927 message("Configuration file version: " + QString::number(version) );
928
929 if (version<0||version>7) {
930 message("Warning: State data in .vp1 file is in wrong format - ignoring!");
931 return;
932 }
933
934 QByteArray basestate;
935 state >> basestate;
937
938
939 // ===> Decode the state info:
940
941 if (version == 7) {
942 m_d->restoreFromState_v7(state);
943 return;
944 }
945
946 if (version<=3) {
947 QColor bgdcol_dummy;
948 state >> bgdcol_dummy;
949 }
950
951 //Switch systems on/off:
952 QMap<QString, bool> sysname2turnedon;
953 state >> sysname2turnedon;
954 m_d->restoreExtraSystems(sysname2turnedon);
955 QMap<QCheckBox*,IVP1System*>::const_iterator it = m_d->checkbox2system.constBegin();
956 while (it != m_d->checkbox2system.constEnd()) {
957 if (sysname2turnedon.contains(it.key()->text())) {
958 if (sysname2turnedon[it.key()->text()]!=it.key()->isChecked())
959 it.key()->setChecked(sysname2turnedon[it.key()->text()]);
960 } else {
961 message("Warning: Config data does not contain information about switched state of subsystem '"+it.key()->text()+"'");
962 }
963 ++it;
964 }
965
966 if (version<=2) {
967 // We stop here to avoid too messy code.
968 buffer.close();
969 return;
970 }
971
972 //Splitter:
973 QByteArray splitstate;
974 state >> splitstate;
975 if (m_d->extradisplaywidget_splitter)
976 m_d->extradisplaywidget_splitter->restoreState(splitstate);
977
978 //Viewer settings:
979 QByteArray ba_viewer;
980 state >> ba_viewer;
981 m_d->viewer->restoreFromState(ba_viewer);//Fixme: reset camera???
982 m_d->need_initial_viewall = false;
983
984 //Snapshot parameters:
985 bool aa_dummy, transp, widthfixed, as_shown;
986 if (version<=3)
987 state >> aa_dummy;
988 state >> transp; state >> widthfixed; state >> as_shown;
989 m_d->uisnapshot.checkBox_transp->setChecked(transp);
990 m_d->uisnapshot.checkBox_as_shown->setChecked(as_shown);
991 if (widthfixed) {
992 m_d->uisnapshot.radioButton_width->setChecked(true);
993 m_d->uisnapshot.radioButton_height->setChecked(false);
994 } else {
995 m_d->uisnapshot.radioButton_width->setChecked(false);
996 m_d->uisnapshot.radioButton_height->setChecked(true);
997 }
998 if (!as_shown) {
999 qint32 fixval;
1000 state >> fixval;
1001 if (widthfixed)
1002 m_d->uisnapshot.spinBox_width->setValue(fixval);
1003 else
1004 m_d->uisnapshot.spinBox_height->setValue(fixval);
1005 }
1006
1007 QString tabname;
1008 state >> tabname;
1009 if (m_d->tabwidget) {
1010 for (int i = 0; i < m_d->tabwidget->count(); ++i) {
1011 if (m_d->tabwidget->tabText(i) == tabname) {
1012 m_d->tabwidget->setCurrentIndex(i);
1013 break;
1014 }
1015 }
1016 }
1017
1018 if (version==5) {
1019 bool b;
1020 state >> b;
1021 }
1022
1023
1024 // ===> Finish up:
1025 buffer.close();
1026}
virtual void restoreFromState(QByteArray)

◆ saveState()

QByteArray IVP13DStandardChannelWidget::saveState ( )
virtualinherited

Reimplemented from IVP13DChannelWidget.

Definition at line 772 of file IVP13DStandardChannelWidget.cxx.

773{
774 VP1Msg::messageVerbose("IVP13DStandardChannelWidget::saveState");
775
776
777 // NEW VERSION
778
779//
780// // ===> Setup stream writing to a byteArray:
781// QByteArray byteArray;
782// QBuffer buffer(&byteArray);
783// buffer.open(QIODevice::WriteOnly);
784// QDataStream out(&buffer);
785//
786// /*
787// * --- GET DATA TO BE SAVED ---
788// */
789//
790// //Systems turned on/off:
791// //Fixme: Make sure that if you have two copies of the same system,
792// //that the text in the checkbox gets appended some stuff like [1],
793// //[2], etc., so that the strings used here will be unique.
794// QMap<QString, bool> sysname2turnedon;
795// QMap<QCheckBox*,IVP1System*>::const_iterator it = m_d->checkbox2system.constBegin();
796// while (it != m_d->checkbox2system.constEnd()) {
797// sysname2turnedon.insert(it.key()->text(),it.key()->isChecked());
798// ++it;
799// }
800//
801//
802// // snapshot settings
803// bool transp_checked = m_d->uisnapshot.checkBox_transp->isChecked();
804// bool widthfixed = m_d->uisnapshot.radioButton_width->isChecked();
805// bool as_shown = m_d->uisnapshot.checkBox_as_shown->isChecked();
806//
807// bool locked_ratio = m_d->uisnapshot.checkBox_lockRatio->isChecked();
808//
809// qint32 width = (qint32)(m_d->uisnapshot.spinBox_width->value());
810// qint32 height = (qint32)(m_d->uisnapshot.spinBox_height->value());
811//
812// // image presets
813// bool isUsingPreset = m_d->uisnapshot.groupBox_imagePresets->isChecked();
814// bool is720p = m_d->uisnapshot.radioButton_720p->isChecked();
815// bool is1080p = m_d->uisnapshot.radioButton_1080p->isChecked();
816// bool is4K = m_d->uisnapshot.radioButton_4K->isChecked();
817// bool is8K = m_d->uisnapshot.radioButton_8K->isChecked();
818//
819// // active tab
820// QString tab_index = (m_d->tabwidget ? m_d->tabwidget->tabText(m_d->tabwidget->currentIndex()) : QString("") );
821//
822//
823// /*
824// * --- WRITE DATA ---
825// */
826//
827// // ------- SAVE -------
828// out << (qint32)7; //version
829// out << IVP13DChannelWidget::saveState();//Always include state info from the base class.
830// out << sysname2turnedon;
831// out << ( m_d->extradisplaywidget_splitter ? m_d->extradisplaywidget_splitter->saveState() : QByteArray() );
832// out << m_d->viewer->saveState();
833// out << transp_checked;
834// out << widthfixed;
835// out << as_shown;
836// out << locked_ratio; // new in v. 7
837// out << width; // new in v. 7
838// out << height; // new in v. 7
839// out << isUsingPreset; // new in v. 7
840// out << is720p; // new in v. 7
841// out << is1080p; // new in v. 7
842// out << is4K; // new in v. 7
843// out << is8K; // new in v. 7
844// out << tab_index;
845// // --------------------
846//
847// // ===> Finish up:
848// buffer.close();
849// return byteArray;
850//
851//
852
853
854
855 // OLD VERSION
856
857 // ===> Setup stream writing to a byteArray:
858 QByteArray byteArray;
859 QBuffer buffer(&byteArray);
860 buffer.open(QIODevice::WriteOnly);
861 QDataStream out(&buffer);
862
863 // ===> Write Data:
864
865 //Version & base state:
866 out << (qint32)6; //version
867 out << IVP13DChannelWidget::saveState();//Always include state info from the base class.
868
869 //version 3 had bgd color output here;
870
871 //Systems turned on/off:
872 //Fixme: Make sure that if you have two copies of the same system,
873 //that the text in the checkbox gets appended some stuff like [1],
874 //[2], etc., so that the strings used here will be unique.
875 QMap<QString, bool> sysname2turnedon;
876 QMap<QCheckBox*,IVP1System*>::const_iterator it = m_d->checkbox2system.constBegin();
877 while (it != m_d->checkbox2system.constEnd()) {
878 sysname2turnedon.insert(it.key()->text(),it.key()->isChecked());
879 ++it;
880 }
881
882 //Versions 3+ follow here.
883
884 out << sysname2turnedon;
885
886 out << ( m_d->extradisplaywidget_splitter ? m_d->extradisplaywidget_splitter->saveState() : QByteArray() );
887
888 out << m_d->viewer->saveState();
889
890 //version <=3 had bool here.
891
892 out << m_d->uisnapshot.checkBox_transp->isChecked();
893 bool widthfixed = m_d->uisnapshot.radioButton_width->isChecked();
894 bool as_shown = m_d->uisnapshot.checkBox_as_shown->isChecked();
895 out << widthfixed;
896 out << as_shown;
897 if (!as_shown)
898 out << (qint32)(widthfixed ? m_d->uisnapshot.spinBox_width->value() : m_d->uisnapshot.spinBox_height->value());
899
900 if (m_d->tabwidget)
901 out << m_d->tabwidget->tabText(m_d->tabwidget->currentIndex());
902 else
903 out << QString("");
904
905 //In version 5 we output a bool here.
906
907 // ===> Finish up:
908 buffer.close();
909 return byteArray;
910
911
912}
virtual QByteArray saveState()

◆ setAntiAliasing()

bool IVP13DStandardChannelWidget::setAntiAliasing ( bool aa)
virtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 109 of file IVP13DStandardChannelWidget.cxx.

110{
111 m_d->viewer->setAntiAlias(aa);
112 return true;
113}

◆ setCanRegister()

void IVP1ChannelWidget::setCanRegister ( const bool & controller,
const bool & system )
privateinherited

Definition at line 300 of file IVP1ChannelWidget.cxx.

301{
302 m_d->canregistercontroller=c;
303 m_d->canregistersystem=s;
304}

◆ setCloneID()

void IVP1ChannelWidget::setCloneID ( unsigned id)
privateinherited

Definition at line 203 of file IVP1ChannelWidget.cxx.

204{
205 m_d->cloneid=id;
207}
void uniqueNameChanged(const QString &)
const QString unique_name() const

◆ setEvtTimestamp()

void IVP1ChannelWidget::setEvtTimestamp ( unsigned timestamp)
protectedinherited

Definition at line 96 of file IVP1ChannelWidget.cxx.

97{
98 m_d->timestamp = timestamp;
99}

◆ setImageFromPresets

void IVP13DStandardChannelWidget::setImageFromPresets ( )
privateslotinherited

Definition at line 646 of file IVP13DStandardChannelWidget.cxx.

647{
648 VP1Msg::messageDebug("IVP13DStandardChannelWidget::setImageFromPresets()");
649
650 disconnect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
651 disconnect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
652
653 if (m_d->uisnapshot.radioButton_720p->isChecked()) {
654 m_d->uisnapshot.spinBox_width->setValue(1280);
655 m_d->uisnapshot.spinBox_height->setValue(720);
656 }
657 else if (m_d->uisnapshot.radioButton_1080p->isChecked()) {
658 m_d->uisnapshot.spinBox_width->setValue(1920);
659 m_d->uisnapshot.spinBox_height->setValue(1080);
660 }
661 else if (m_d->uisnapshot.radioButton_4K->isChecked()) {
662 m_d->uisnapshot.spinBox_width->setValue(4096);
663 m_d->uisnapshot.spinBox_height->setValue(2160);
664 }
665 else if (m_d->uisnapshot.radioButton_8K->isChecked()) {
666 m_d->uisnapshot.spinBox_width->setValue(8192);
667 m_d->uisnapshot.spinBox_height->setValue(4320);
668 }
669 else {
670 VP1Msg::messageDebug("ERROR! Sender unknown!!");
671 }
672
673 connect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
674 connect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
675
676 // update
678}

◆ setRunEvtNumber()

void IVP1ChannelWidget::setRunEvtNumber ( int runnumber,
unsigned long long eventnumber )
inherited

Definition at line 89 of file IVP1ChannelWidget.cxx.

90{
91 m_d->runnumber = runnumber;
92 m_d->eventnumber = eventnumber;
93}

◆ setState()

void IVP1ChannelWidget::setState ( const State & s)
privateinherited

Definition at line 108 of file IVP1ChannelWidget.cxx.

109{
110
111#ifndef NDEBUG
112 assert(s!=CONSTRUCTED);
113 if (s==READY) {
114 assert(m_d->state==CONSTRUCTED);
115 }
116 if (s==UNCREATED) {
117 assert(m_d->state==READY);
118 }
119#endif
120 m_d->state = s;
121}

◆ setUpdatesEnabled()

void IVP13DChannelWidget::setUpdatesEnabled ( bool enable)
inherited

Definition at line 84 of file IVP13DChannelWidget.cxx.

85{
86 m_d->it = m_d->renderareas.begin();
87 for (;m_d->it!=m_d->itE;++(m_d->it)) {
88 (*(m_d->it))->setAutoRedraw(enable);
89 }
90 IVP1ChannelWidget::setUpdatesEnabled(enable);
91}

◆ showControlsForSystem

void IVP13DStandardChannelWidget::showControlsForSystem ( )
protectedslotinherited

Definition at line 1029 of file IVP13DStandardChannelWidget.cxx.

1030{
1031 if (!m_d->tabwidget)
1032 return;
1033 IVP1System * sys = static_cast<IVP1System*>(sender());
1034 if (!sys) {
1035 message("showControlsForSystem Error: Unable to determine system identity.");
1036 return;
1037 }
1038 if (!m_d->sys2tabpage.contains(sys)) {
1039 //Dont send warning here. The system in question might simply not have a controller!
1040 return;
1041 }
1042
1043 int index = m_d->tabwidget->indexOf(m_d->sys2tabpage[sys]);
1044 if (index<0||!m_d->tabwidget->isTabEnabled(index)) {
1045 message("Warning: Asked to show controller for a disabled system. Surely you jest?");
1046 return;
1047 }
1048 m_d->tabwidget->setCurrentIndex(index);
1049}
str index
Definition DeMoScan.py:362

◆ state()

IVP1ChannelWidget::State IVP1ChannelWidget::state ( ) const
privateinherited

Definition at line 102 of file IVP1ChannelWidget.cxx.

103{
104 return m_d->state;
105}

◆ stopSpinning()

void IVP13DStandardChannelWidget::stopSpinning ( )
protectedinherited

Definition at line 580 of file IVP13DStandardChannelWidget.cxx.

581{
582 if (m_d->viewer->isAnimating())
583 m_d->viewer->stopAnimating();
584}

◆ str() [1/30]

QString VP1String::str ( const Amg::Vector3D & t)
inlinestaticinherited

Definition at line 98 of file VP1String.h.

98{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }
static QString str(const QString &s)
Definition VP1String.h:49

◆ str() [2/30]

QString VP1String::str ( const bool b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

53{ return b?"True":"False"; }

◆ str() [3/30]

QString VP1String::str ( const char * c)
inlinestaticinherited

Definition at line 50 of file VP1String.h.

50{ return c; }

◆ str() [4/30]

QString VP1String::str ( const double & d)
inlinestaticinherited

Definition at line 81 of file VP1String.h.

81{ return QString::number(d); }

◆ str() [5/30]

QString VP1String::str ( const float & f)
inlinestaticinherited

Definition at line 82 of file VP1String.h.

82{ return QString::number(f); }

◆ str() [6/30]

template<class T>
QString VP1String::str ( const HepGeom::BasicVector3D< T > & t)
inlinestaticinherited

Definition at line 95 of file VP1String.h.

95{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [7/30]

QString VP1String::str ( const QColor & c)
staticinherited

Definition at line 30 of file VP1String.cxx.

31{
32 return c.isValid() ? c.name() : "Invalid";
33}

◆ str() [8/30]

template<class T>
QString VP1String::str ( const QFlags< T > & f)
inlinestaticinherited

Definition at line 91 of file VP1String.h.

91{ return "0x"+QString::number(f, 16).toUpper().rightJustified(8,'0'); }

◆ str() [9/30]

template<class T>
QString VP1String::str ( const QList< T > & t)
inlinestaticinherited

Definition at line 102 of file VP1String.h.

102{ return "QList of size"+QString::number(t.size()); }

◆ str() [10/30]

QString VP1String::str ( const QString & s)
inlinestaticinherited

Definition at line 49 of file VP1String.h.

49{ return s; }

◆ str() [11/30]

QString VP1String::str ( const SbColor & c)
staticinherited

Definition at line 36 of file VP1String.cxx.

37{
39}
static QColor sbcol2qcol(const SbColor &)

◆ str() [12/30]

QString VP1String::str ( const SbVec2d & v)
staticinherited

Definition at line 61 of file VP1String.cxx.

61{ double x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [13/30]

QString VP1String::str ( const SbVec2f & v)
staticinherited

Definition at line 62 of file VP1String.cxx.

62{ float x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [14/30]

QString VP1String::str ( const SbVec2s & v)
staticinherited

Definition at line 63 of file VP1String.cxx.

63{ short x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [15/30]

QString VP1String::str ( const SbVec3d & v)
staticinherited

Definition at line 64 of file VP1String.cxx.

64{ double x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }
#define z

◆ str() [16/30]

QString VP1String::str ( const SbVec3f & v)
staticinherited

Definition at line 65 of file VP1String.cxx.

65{ float x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [17/30]

QString VP1String::str ( const SbVec3s & v)
staticinherited

Definition at line 66 of file VP1String.cxx.

66{ short x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [18/30]

QString VP1String::str ( const SbVec4d & v)
staticinherited

Definition at line 67 of file VP1String.cxx.

67{ double x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [19/30]

QString VP1String::str ( const SbVec4f & v)
staticinherited

Definition at line 68 of file VP1String.cxx.

68{ float x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [20/30]

template<class T>
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.

49{
50 if (p) {
51 std::ostringstream s;
52 s << p;
53 // Explicitly naming QString here avoids a cppcheck warning.
54 return QString (s.str().c_str());
55 } else {
56 return "NULL";
57 }
58}

◆ str() [22/30]

QString VP1String::str ( const VP1Interval & i)
staticinherited

Definition at line 42 of file VP1String.cxx.

43{
44 return i.toString();
45}

◆ str() [23/30]

QString VP1String::str ( int n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

77{ return QString::number(n); }

◆ str() [24/30]

QString VP1String::str ( long n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

75{ return QString::number(n); }

◆ str() [25/30]

QString VP1String::str ( qlonglong n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

79{ return QString::number(n); }

◆ str() [26/30]

QString VP1String::str ( qulonglong n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

80{ return QString::number(n); }

◆ str() [27/30]

QString VP1String::str ( short int n)
inlinestaticinherited

Definition at line 73 of file VP1String.h.

73{ return QString::number(n); }

◆ str() [28/30]

QString VP1String::str ( uint n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

78{ return QString::number(n); }

◆ str() [29/30]

QString VP1String::str ( ulong n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

76{ return QString::number(n); }

◆ str() [30/30]

QString VP1String::str ( unsigned short int n)
inlinestaticinherited

Definition at line 74 of file VP1String.h.

74{ return QString::number(n); }

◆ systemAdded

void IVP1ChannelWidget::systemAdded ( IVP1System * )
signalinherited

◆ systemErased()

void IVP13DStandardChannelWidget::systemErased ( IVP1System * sys)
virtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 504 of file IVP13DStandardChannelWidget.cxx.

505{
506 IVP13DSystem * sys3d = static_cast<IVP13DSystem*>(sys);
507 if (sys3d)
508 sys3d->deselectAll();
509}
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)

◆ systemRefreshed()

void IVP13DStandardChannelWidget::systemRefreshed ( IVP1System * )
virtualinherited

Reimplemented from IVP1ChannelWidget.

Definition at line 499 of file IVP13DStandardChannelWidget.cxx.

500{
501}

◆ systemRefreshInfoChanged

void IVP1ChannelWidget::systemRefreshInfoChanged ( QString sysrefreshing,
int nsysOn,
int nsysOnRefreshed )
signalinherited

◆ systems()

const std::set< IVP1System * > & IVP1ChannelWidget::systems ( )
privateinherited

Definition at line 232 of file IVP1ChannelWidget.cxx.

233{
234 return m_d->systems;
235}

◆ toggleSystemActive

void IVP13DStandardChannelWidget::toggleSystemActive ( )
privateslotinherited

Definition at line 512 of file IVP13DStandardChannelWidget.cxx.

513{
514 QCheckBox * cb = static_cast<QCheckBox*>(sender()); assert(cb);
515 m_d->updateSystemState(cb);
516}

◆ turnOff()

void IVP1ChannelWidget::turnOff ( IVP1System * s,
const bool & immediateErase = true )
protectedinherited

Definition at line 247 of file IVP1ChannelWidget.cxx.

248{
249 assert(s->channel()==this);
250 assert(m_d->systems.find(s)!=m_d->systems.end());
251 s->setActiveState(IVP1System::OFF,!immediateErase);
253}

◆ turnOn()

void IVP1ChannelWidget::turnOn ( IVP1System * s)
protectedinherited

Definition at line 238 of file IVP1ChannelWidget.cxx.

239{
240 assert(s->channel()==this);
241 assert(m_d->systems.find(s)!=m_d->systems.end());
242 s->setActiveState(IVP1System::ON);
244}

◆ type()

Type IVP13DChannelWidget::type ( ) const
inlinevirtualinherited

Implements IVP1ChannelWidget.

Definition at line 40 of file IVP13DChannelWidget.h.

40{ return THREEDIMENSIONAL; };

◆ uncreate()

void IVP1ChannelWidget::uncreate ( )
protectedvirtualinherited

Definition at line 155 of file IVP1ChannelWidget.cxx.

156{
157 assert(m_d->state==READY);
158}

◆ unique_name()

const QString IVP1ChannelWidget::unique_name ( ) const
inherited

Definition at line 175 of file IVP1ChannelWidget.cxx.

176{
177 return m_d->name+(m_d->cloneid?" ["+QString::number(m_d->cloneid)+"]":QString(""));//Fixme: make sure that it is forbidden to end a name with ' [.*]'!
178}

◆ uniqueNameChanged

void IVP1ChannelWidget::uniqueNameChanged ( const QString & )
signalinherited

◆ updateSnapshotDim

void IVP13DStandardChannelWidget::updateSnapshotDim ( )
privateslotinherited

Definition at line 682 of file IVP13DStandardChannelWidget.cxx.

683{
684 VP1Msg::messageDebug("IVP13DStandardChannelWidget::updateSnapshotDim()");
685
686 // if (!m_d->uisnapshot.checkBox_as_shown)
687// return;
688// if (sender()==m_d->uisnapshot.spinBox_width)
689// m_d->uisnapshot.radioButton_width->setChecked(true);
690// else if (sender()==m_d->uisnapshot.spinBox_height)
691// m_d->uisnapshot.radioButton_height->setChecked(true);
692
693 if (!m_d->uisnapshot.checkBox_as_shown)
694 return;
695
696 if (sender()==m_d->uisnapshot.spinBox_width)
697 m_d->uisnapshot.radioButton_width->setChecked(true);
698 else if (sender()==m_d->uisnapshot.spinBox_height)
699 m_d->uisnapshot.radioButton_height->setChecked(true);
700
701 /*
702 * Get widget width and height
703 * Note: the method "getNormalWidget" is from the "SoQtGLWidget" class
704 * and it returns a QWidget object
705 */
706 int onscreen_width = m_d->viewer->getNormalWidget()->geometry().width();
707 int onscreen_height = m_d->viewer->getNormalWidget()->geometry().height();
708
709 if ( m_d->uisnapshot.checkBox_as_shown->isChecked() ) {
710 disconnect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
711 disconnect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
712 m_d->uisnapshot.spinBox_width->setValue(onscreen_width);
713 m_d->uisnapshot.spinBox_height->setValue(onscreen_height);
714 connect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
715 connect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
716 } else {
717 if (m_d->uisnapshot.checkBox_lockRatio->isChecked()) {
718 VP1Msg::messageDebug("checkBox_lockRatio is checked - updating only rendering size");
719 if (m_d->uisnapshot.radioButton_width->isChecked()) {
720 disconnect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
721 m_d->uisnapshot.spinBox_height->setValue(static_cast<int>(m_d->uisnapshot.spinBox_width->value()*static_cast<double>(onscreen_height)/onscreen_width+0.5));
722 connect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
723 } else {
724 disconnect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
725 m_d->uisnapshot.spinBox_width->setValue(static_cast<int>(m_d->uisnapshot.spinBox_height->value()*static_cast<double>(onscreen_width)/onscreen_height+0.5));
726 connect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
727 }
728 }
729 else {
730 VP1Msg::messageDebug("checkBox_lockRatio is NOT checked - Updating the widget size as well");
731
732// if (m_d->uisnapshot.radioButton_width->isChecked() ) {
733// int newWidth = static_cast<int>(m_d->uisnapshot.spinBox_width->value() * static_cast<double>(onscreen_height) / m_d->uisnapshot.spinBox_height->value() + 0.5);
734// m_d->viewer->getNormalWidget()->resize(newWidth, onscreen_height);
735// } else if (m_d->uisnapshot.radioButton_height->isChecked()) {
736// int newHeight = static_cast<int>( onscreen_width * static_cast<double>(m_d->uisnapshot.spinBox_height->value()) / m_d->uisnapshot.spinBox_width->value() + 0.5);
737// m_d->viewer->resize(onscreen_width, newHeight);
738// }
739
740 }
741 }
742
743 //Finally, ensure that we are within the ranges:
744 if (m_d->uisnapshot.spinBox_width->value()>=m_d->uisnapshot.spinBox_width->maximum()) {
745 disconnect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
746 disconnect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
747 m_d->uisnapshot.spinBox_width->setValue(m_d->uisnapshot.spinBox_width->maximum());
748 m_d->uisnapshot.spinBox_height->setValue(static_cast<int>(m_d->uisnapshot.spinBox_width->value()*static_cast<double>(onscreen_height)/onscreen_width+0.5));
749 connect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
750 connect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
751 }
752 if (m_d->uisnapshot.spinBox_height->value()>=m_d->uisnapshot.spinBox_height->maximum()) {
753 disconnect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
754 disconnect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
755 m_d->uisnapshot.spinBox_height->setValue(m_d->uisnapshot.spinBox_height->maximum());
756 m_d->uisnapshot.spinBox_width->setValue(static_cast<int>(m_d->uisnapshot.spinBox_height->value()*static_cast<double>(onscreen_width)/onscreen_width+0.5));
757 connect(m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
758 connect(m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim()));
759 }
760
761}

Member Data Documentation

◆ m_d

Imp* IVP13DStandardChannelWidget::m_d
privateinherited

Definition at line 78 of file IVP13DStandardChannelWidget.h.


The documentation for this class was generated from the following files: