63 #include "SplatCloudRenderingControlPlugin.hh"
75 SplatCloudRenderingControlPlugin::SplatCloudRenderingControlPlugin() :
76 toolboxPointsizeScale_ ( 0 ),
77 toolboxDefaultColorR_ ( 0 ),
78 toolboxDefaultColorG_ ( 0 ),
79 toolboxDefaultColorB_ ( 0 ),
80 toolboxDefaultNormalX_ ( 0 ),
81 toolboxDefaultNormalY_ ( 0 ),
82 toolboxDefaultNormalZ_ ( 0 ),
83 toolboxDefaultPointsize_( 0 ),
84 contextScaleAction_ ( 0 ),
85 contextCullingAction_ ( 0 ),
86 contextDefaultsAction_ ( 0 ),
87 contextReloadShadersAction_( 0 ),
88 contextRebuildVBOAction_ ( 0 ),
89 contextScaleWidget_ ( 0 ),
90 contextScaleWidgetPointsizeScale_( 0 ),
91 contextDefaultsWidget_ ( 0 ),
92 contextDefaultsWidgetDefaultColorR_ ( 0 ),
93 contextDefaultsWidgetDefaultColorG_ ( 0 ),
94 contextDefaultsWidgetDefaultColorB_ ( 0 ),
95 contextDefaultsWidgetDefaultNormalX_ ( 0 ),
96 contextDefaultsWidgetDefaultNormalY_ ( 0 ),
97 contextDefaultsWidgetDefaultNormalZ_ ( 0 ),
98 contextDefaultsWidgetDefaultPointsize_( 0 )
106 void SplatCloudRenderingControlPlugin::initializePlugin()
115 toolboxPointsizeScale_ =
new QDoubleSpinBox();
116 toolboxPointsizeScale_->setRange( 0.0, 100.0 );
117 toolboxPointsizeScale_->setDecimals( 4 );
118 toolboxPointsizeScale_->setSingleStep( 0.1 );
119 toolboxPointsizeScale_->setValue( 1.0 );
120 toolboxPointsizeScale_->setToolTip(
"The scaling factor of the pointsizes used during the rendering of objects" );
123 QHBoxLayout *toolboxPointsizeScaleLayout =
new QHBoxLayout();
124 toolboxPointsizeScaleLayout->setSpacing( 6 );
125 toolboxPointsizeScaleLayout->addWidget(
new QLabel(
"Pointsize Scaling Factor:" ) );
126 toolboxPointsizeScaleLayout->addWidget( toolboxPointsizeScale_ );
129 QPushButton *toolboxEnableBackfaceCullingButton =
new QPushButton(
"Enable Backface Culling" );
130 QPushButton *toolboxDisableBackfaceCullingButton =
new QPushButton(
"Disable Backface Culling" );
131 QPushButton *toolboxReloadShadersButton =
new QPushButton(
"Reload Shaders" );
132 QPushButton *toolboxRebuildVBOsButton =
new QPushButton(
"Rebuild VBOs" );
133 toolboxEnableBackfaceCullingButton->setToolTip (
"Enable the culling of backfaces" );
134 toolboxDisableBackfaceCullingButton->setToolTip(
"Disable the culling of backfaces" );
135 toolboxReloadShadersButton->setToolTip (
"Reload all shader files" );
136 toolboxRebuildVBOsButton->setToolTip (
"Rebuild all vertex-buffer-objects" );
139 QHBoxLayout *toolboxButtonsALayout =
new QHBoxLayout();
140 toolboxButtonsALayout->setSpacing( 6 );
141 toolboxButtonsALayout->addWidget( toolboxEnableBackfaceCullingButton );
142 toolboxButtonsALayout->addWidget( toolboxDisableBackfaceCullingButton );
145 QFrame *toolboxSeparatorFrame =
new QFrame();
146 toolboxSeparatorFrame->setFrameShape( QFrame::HLine );
147 toolboxSeparatorFrame->setFrameShadow( QFrame::Sunken );
150 QHBoxLayout *toolboxButtonsBLayout =
new QHBoxLayout();
151 toolboxButtonsBLayout->setSpacing( 6 );
152 toolboxButtonsBLayout->addWidget( toolboxReloadShadersButton );
153 toolboxButtonsBLayout->addWidget( toolboxRebuildVBOsButton );
156 QVBoxLayout *toolboxOptionsLayout =
new QVBoxLayout();
157 toolboxOptionsLayout->setAlignment( Qt::AlignTop );
158 toolboxOptionsLayout->setSpacing( 6 );
159 toolboxOptionsLayout->addItem ( toolboxPointsizeScaleLayout );
160 toolboxOptionsLayout->addItem ( toolboxButtonsALayout );
161 toolboxOptionsLayout->addItem (
new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
162 toolboxOptionsLayout->addWidget( toolboxSeparatorFrame );
163 toolboxOptionsLayout->addItem ( toolboxButtonsBLayout );
166 QWidget *toolboxOptionsWidget =
new QWidget();
167 toolboxOptionsWidget->setLayout( toolboxOptionsLayout );
168 toolboxOptionsWidget->setToolTip(
"Rendering options" );
173 toolboxDefaultColorR_ =
new QSpinBox();
174 toolboxDefaultColorG_ =
new QSpinBox();
175 toolboxDefaultColorB_ =
new QSpinBox();
176 toolboxDefaultColorR_->setRange( 0, 255 );
177 toolboxDefaultColorG_->setRange( 0, 255 );
178 toolboxDefaultColorB_->setRange( 0, 255 );
179 toolboxDefaultColorR_->setSingleStep( 1 );
180 toolboxDefaultColorG_->setSingleStep( 1 );
181 toolboxDefaultColorB_->setSingleStep( 1 );
182 toolboxDefaultColorR_->setValue( 255 );
183 toolboxDefaultColorG_->setValue( 255 );
184 toolboxDefaultColorB_->setValue( 255 );
185 toolboxDefaultColorR_->setToolTip(
"The default red-component of the color used when an object has no colors" );
186 toolboxDefaultColorG_->setToolTip(
"The default green-component of the color used when an object has no colors" );
187 toolboxDefaultColorB_->setToolTip(
"The default blue-component of the color used when an object has no colors" );
190 toolboxDefaultNormalX_ =
new QDoubleSpinBox();
191 toolboxDefaultNormalY_ =
new QDoubleSpinBox();
192 toolboxDefaultNormalZ_ =
new QDoubleSpinBox();
193 toolboxDefaultNormalX_->setRange( -1.0, 1.0 );
194 toolboxDefaultNormalY_->setRange( -1.0, 1.0 );
195 toolboxDefaultNormalZ_->setRange( -1.0, 1.0 );
196 toolboxDefaultNormalX_->setDecimals( 2 );
197 toolboxDefaultNormalY_->setDecimals( 2 );
198 toolboxDefaultNormalZ_->setDecimals( 2 );
199 toolboxDefaultNormalX_->setSingleStep( 0.1 );
200 toolboxDefaultNormalY_->setSingleStep( 0.1 );
201 toolboxDefaultNormalZ_->setSingleStep( 0.1 );
202 toolboxDefaultNormalX_->setValue( 0.0 );
203 toolboxDefaultNormalY_->setValue( 0.0 );
204 toolboxDefaultNormalZ_->setValue( 1.0 );
205 toolboxDefaultNormalX_->setToolTip(
"The default x-component of the normal used when an object has no normals" );
206 toolboxDefaultNormalY_->setToolTip(
"The default y-component of the normal used when an object has no normals" );
207 toolboxDefaultNormalZ_->setToolTip(
"The default z-component of the normal used when an object has no normals" );
210 toolboxDefaultPointsize_ =
new QDoubleSpinBox();
211 toolboxDefaultPointsize_->setRange( 0.0, 1000.0 );
212 toolboxDefaultPointsize_->setDecimals( 3 );
213 toolboxDefaultPointsize_->setSingleStep( 0.01 );
214 toolboxDefaultPointsize_->setValue( 0.1 );
215 toolboxDefaultPointsize_->setToolTip(
"The default pointsize used when an object has no pointsizes" );
218 QHBoxLayout *toolboxDefaultColorLayout =
new QHBoxLayout();
219 toolboxDefaultColorLayout->setSpacing( 6 );
220 toolboxDefaultColorLayout->addWidget( toolboxDefaultColorR_ );
221 toolboxDefaultColorLayout->addWidget( toolboxDefaultColorG_ );
222 toolboxDefaultColorLayout->addWidget( toolboxDefaultColorB_ );
225 QHBoxLayout *toolboxDefaultNormalLayout =
new QHBoxLayout();
226 toolboxDefaultNormalLayout->setSpacing( 6 );
227 toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalX_ );
228 toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalY_ );
229 toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalZ_ );
232 QHBoxLayout *toolboxDefaultPointsizeLayout =
new QHBoxLayout();
233 toolboxDefaultPointsizeLayout->setSpacing( 6 );
234 toolboxDefaultPointsizeLayout->addWidget( toolboxDefaultPointsize_ );
237 QGridLayout *toolboxDefaultsLayout =
new QGridLayout();
238 toolboxDefaultsLayout->setSpacing( 6 );
239 toolboxDefaultsLayout->addWidget(
new QLabel(
"Default Color:" ), 0, 0 );
240 toolboxDefaultsLayout->addWidget(
new QLabel(
"Default Normal:" ), 1, 0 );
241 toolboxDefaultsLayout->addWidget(
new QLabel(
"Default Pointsize:" ), 2, 0 );
242 toolboxDefaultsLayout->addItem ( toolboxDefaultColorLayout, 0, 1 );
243 toolboxDefaultsLayout->addItem ( toolboxDefaultNormalLayout, 1, 1 );
244 toolboxDefaultsLayout->addItem ( toolboxDefaultPointsizeLayout, 2, 1 );
247 QWidget *toolboxDefaultsWidget =
new QWidget();
248 toolboxDefaultsWidget->setLayout( toolboxDefaultsLayout );
249 toolboxDefaultsWidget->setToolTip(
"Default values" );
254 QTabWidget *toolboxTabWidget =
new QTabWidget();
255 toolboxTabWidget->addTab( toolboxOptionsWidget,
"Options" );
256 toolboxTabWidget->addTab( toolboxDefaultsWidget,
"Defaults" );
259 QVBoxLayout *toolboxLayout =
new QVBoxLayout();
260 toolboxLayout->setSpacing( 6 );
261 toolboxLayout->addWidget( toolboxTabWidget );
264 QWidget *toolbox =
new QWidget();
265 toolbox->setLayout( toolboxLayout );
268 QIcon *toolboxIcon =
new QIcon( OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() +
"SplatCloudRenderingControl.png" );
273 connect( toolboxPointsizeScale_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotToolboxPointsizeScaleValueChanged() ) );
274 connect( toolboxDefaultColorR_, SIGNAL( valueChanged(
int) ),
this, SLOT( slotToolboxDefaultColorValueChanged() ) );
275 connect( toolboxDefaultColorG_, SIGNAL( valueChanged(
int) ),
this, SLOT( slotToolboxDefaultColorValueChanged() ) );
276 connect( toolboxDefaultColorB_, SIGNAL( valueChanged(
int) ),
this, SLOT( slotToolboxDefaultColorValueChanged() ) );
277 connect( toolboxDefaultNormalX_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotToolboxDefaultNormalValueChanged() ) );
278 connect( toolboxDefaultNormalY_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotToolboxDefaultNormalValueChanged() ) );
279 connect( toolboxDefaultNormalZ_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotToolboxDefaultNormalValueChanged() ) );
280 connect( toolboxDefaultPointsize_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotToolboxDefaultPointsizeValueChanged() ) );
282 connect( toolboxEnableBackfaceCullingButton, SIGNAL( clicked() ),
this, SLOT( slotToolboxEnableBackfaceCullingButtonClicked() ) );
283 connect( toolboxDisableBackfaceCullingButton, SIGNAL( clicked() ),
this, SLOT( slotToolboxDisableBackfaceCullingButtonClicked() ) );
284 connect( toolboxReloadShadersButton, SIGNAL( clicked() ),
this, SLOT( slotToolboxReloadShadersButtonClicked() ) );
285 connect( toolboxRebuildVBOsButton, SIGNAL( clicked() ),
this, SLOT( slotToolboxRebuildVBOsButtonClicked() ) );
288 emit addToolbox( tr(
"SplatCloud Rendering Control") , toolbox , toolboxIcon );
295 contextScaleAction_ =
new QAction( tr(
"Pointsize Scaling Factor..."),
this );
296 contextCullingAction_ =
new QAction( tr(
"Backface Culling" ),
this );
297 contextDefaultsAction_ =
new QAction( tr(
"Defaults..." ),
this );
298 contextReloadShadersAction_ =
new QAction( tr(
"Reload Shaders" ),
this );
299 contextRebuildVBOAction_ =
new QAction( tr(
"Rebuild VBO" ),
this );
300 contextCullingAction_->setCheckable(
true );
303 QMenu *contextMenu =
new QMenu(
"SplatCloud Rendering Control" );
304 contextMenu->setIcon( QIcon( OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() +
"SplatCloudRenderingControl.png" ) );
305 contextMenu->addAction( contextScaleAction_ );
306 contextMenu->addAction( contextCullingAction_ );
307 contextMenu->addSeparator();
308 contextMenu->addAction( contextDefaultsAction_ );
309 contextMenu->addSeparator();
310 contextMenu->addAction( contextReloadShadersAction_ );
311 contextMenu->addAction( contextRebuildVBOAction_ );
316 connect( contextScaleAction_, SIGNAL( triggered() ),
this, SLOT( slotContextScaleActionTriggered() ) );
317 connect( contextCullingAction_, SIGNAL( triggered() ),
this, SLOT( slotContextCullingActionTriggered() ) );
318 connect( contextDefaultsAction_, SIGNAL( triggered() ),
this, SLOT( slotContextDefaultsActionTriggered() ) );
319 connect( contextReloadShadersAction_, SIGNAL( triggered() ),
this, SLOT( slotContextReloadShadersActionTriggered() ) );
320 connect( contextRebuildVBOAction_, SIGNAL( triggered() ),
this, SLOT( slotContextRebuildVBOActionTriggered() ) );
330 contextScaleWidgetPointsizeScale_ =
new QDoubleSpinBox();
331 contextScaleWidgetPointsizeScale_->setRange( 0.0, 100.0 );
332 contextScaleWidgetPointsizeScale_->setDecimals( 4 );
333 contextScaleWidgetPointsizeScale_->setSingleStep( 0.1 );
334 contextScaleWidgetPointsizeScale_->setToolTip(
"The scaling factor of the pointsizes used during the rendering of the picked object" );
337 QHBoxLayout *contextScaleWidgetPointsizeScaleLayout =
new QHBoxLayout();
338 contextScaleWidgetPointsizeScaleLayout->setSpacing( 6 );
339 contextScaleWidgetPointsizeScaleLayout->addWidget(
new QLabel(
"Pointsize Scaling Factor:" ) );
340 contextScaleWidgetPointsizeScaleLayout->addWidget( contextScaleWidgetPointsizeScale_ );
343 QVBoxLayout *contextScaleWidgetLayout =
new QVBoxLayout();
344 contextScaleWidgetLayout->setAlignment( Qt::AlignTop );
345 contextScaleWidgetLayout->setSpacing( 6 );
346 contextScaleWidgetLayout->addItem( contextScaleWidgetPointsizeScaleLayout );
349 contextScaleWidget_ =
new QWidget();
350 contextScaleWidget_->setWindowTitle(
"Pointsize Scaling Factor" );
351 contextScaleWidget_->setLayout( contextScaleWidgetLayout );
356 connect( contextScaleWidgetPointsizeScale_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotContextScaleWidgetPointsizeScaleValueChanged() ) );
363 contextDefaultsWidgetDefaultColorR_ =
new QSpinBox();
364 contextDefaultsWidgetDefaultColorG_ =
new QSpinBox();
365 contextDefaultsWidgetDefaultColorB_ =
new QSpinBox();
366 contextDefaultsWidgetDefaultColorR_->setRange( 0, 255 );
367 contextDefaultsWidgetDefaultColorG_->setRange( 0, 255 );
368 contextDefaultsWidgetDefaultColorB_->setRange( 0, 255 );
369 contextDefaultsWidgetDefaultColorR_->setSingleStep( 1 );
370 contextDefaultsWidgetDefaultColorG_->setSingleStep( 1 );
371 contextDefaultsWidgetDefaultColorB_->setSingleStep( 1 );
372 contextDefaultsWidgetDefaultColorR_->setToolTip(
"The default red-component of the color used when the picked object has no colors" );
373 contextDefaultsWidgetDefaultColorG_->setToolTip(
"The default green-component of the color used when the picked object has no colors" );
374 contextDefaultsWidgetDefaultColorB_->setToolTip(
"The default blue-component of the color used when the picked object has no colors" );
377 contextDefaultsWidgetDefaultNormalX_ =
new QDoubleSpinBox();
378 contextDefaultsWidgetDefaultNormalY_ =
new QDoubleSpinBox();
379 contextDefaultsWidgetDefaultNormalZ_ =
new QDoubleSpinBox();
380 contextDefaultsWidgetDefaultNormalX_->setRange( -1.0, 1.0 );
381 contextDefaultsWidgetDefaultNormalY_->setRange( -1.0, 1.0 );
382 contextDefaultsWidgetDefaultNormalZ_->setRange( -1.0, 1.0 );
383 contextDefaultsWidgetDefaultNormalX_->setDecimals( 2 );
384 contextDefaultsWidgetDefaultNormalY_->setDecimals( 2 );
385 contextDefaultsWidgetDefaultNormalZ_->setDecimals( 2 );
386 contextDefaultsWidgetDefaultNormalX_->setSingleStep( 0.1 );
387 contextDefaultsWidgetDefaultNormalY_->setSingleStep( 0.1 );
388 contextDefaultsWidgetDefaultNormalZ_->setSingleStep( 0.1 );
389 contextDefaultsWidgetDefaultNormalX_->setToolTip(
"The default x-component of the normal used when the picked object has no normals" );
390 contextDefaultsWidgetDefaultNormalY_->setToolTip(
"The default y-component of the normal used when the picked object has no normals" );
391 contextDefaultsWidgetDefaultNormalZ_->setToolTip(
"The default z-component of the normal used when the picked object has no normals" );
394 contextDefaultsWidgetDefaultPointsize_ =
new QDoubleSpinBox();
395 contextDefaultsWidgetDefaultPointsize_->setRange( 0.0, 1000.0 );
396 contextDefaultsWidgetDefaultPointsize_->setDecimals( 3 );
397 contextDefaultsWidgetDefaultPointsize_->setSingleStep( 0.01 );
398 contextDefaultsWidgetDefaultPointsize_->setToolTip(
"The default pointsize used when the picked object has no pointsizes" );
401 QHBoxLayout *contextDefaultsWidgetDefaultColorLayout =
new QHBoxLayout();
402 contextDefaultsWidgetDefaultColorLayout->setSpacing( 6 );
403 contextDefaultsWidgetDefaultColorLayout->addWidget( contextDefaultsWidgetDefaultColorR_ );
404 contextDefaultsWidgetDefaultColorLayout->addWidget( contextDefaultsWidgetDefaultColorG_ );
405 contextDefaultsWidgetDefaultColorLayout->addWidget( contextDefaultsWidgetDefaultColorB_ );
408 QHBoxLayout *contextDefaultsWidgetDefaultNormalLayout =
new QHBoxLayout();
409 contextDefaultsWidgetDefaultNormalLayout->setSpacing( 6 );
410 contextDefaultsWidgetDefaultNormalLayout->addWidget( contextDefaultsWidgetDefaultNormalX_ );
411 contextDefaultsWidgetDefaultNormalLayout->addWidget( contextDefaultsWidgetDefaultNormalY_ );
412 contextDefaultsWidgetDefaultNormalLayout->addWidget( contextDefaultsWidgetDefaultNormalZ_ );
415 QHBoxLayout *contextDefaultsWidgetDefaultPointsizeLayout =
new QHBoxLayout();
416 contextDefaultsWidgetDefaultPointsizeLayout->setSpacing( 6 );
417 contextDefaultsWidgetDefaultPointsizeLayout->addWidget( contextDefaultsWidgetDefaultPointsize_ );
420 QGridLayout *contextDefaultsWidgetDefaultOptionsLayout =
new QGridLayout();
421 contextDefaultsWidgetDefaultOptionsLayout->setSpacing( 6 );
422 contextDefaultsWidgetDefaultOptionsLayout->addWidget(
new QLabel(
"Default Color:" ), 0, 0 );
423 contextDefaultsWidgetDefaultOptionsLayout->addWidget(
new QLabel(
"Default Normal:" ), 1, 0 );
424 contextDefaultsWidgetDefaultOptionsLayout->addWidget(
new QLabel(
"Default Pointsize:" ), 2, 0 );
425 contextDefaultsWidgetDefaultOptionsLayout->addItem ( contextDefaultsWidgetDefaultColorLayout, 0, 1 );
426 contextDefaultsWidgetDefaultOptionsLayout->addItem ( contextDefaultsWidgetDefaultNormalLayout, 1, 1 );
427 contextDefaultsWidgetDefaultOptionsLayout->addItem ( contextDefaultsWidgetDefaultPointsizeLayout, 2, 1 );
430 QVBoxLayout *contextDefaultsWidgetLayout =
new QVBoxLayout();
431 contextDefaultsWidgetLayout->setAlignment( Qt::AlignTop );
432 contextDefaultsWidgetLayout->setSpacing( 6 );
433 contextDefaultsWidgetLayout->addItem( contextDefaultsWidgetDefaultOptionsLayout );
436 contextDefaultsWidget_ =
new QWidget();
437 contextDefaultsWidget_->setWindowTitle(
"Defaults" );
438 contextDefaultsWidget_->setLayout( contextDefaultsWidgetLayout );
443 connect( contextDefaultsWidgetDefaultColorR_, SIGNAL( valueChanged(
int) ),
this, SLOT( slotContextDefaultsWidgetDefaultColorValueChanged() ) );
444 connect( contextDefaultsWidgetDefaultColorG_, SIGNAL( valueChanged(
int) ),
this, SLOT( slotContextDefaultsWidgetDefaultColorValueChanged() ) );
445 connect( contextDefaultsWidgetDefaultColorB_, SIGNAL( valueChanged(
int) ),
this, SLOT( slotContextDefaultsWidgetDefaultColorValueChanged() ) );
446 connect( contextDefaultsWidgetDefaultNormalX_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotContextDefaultsWidgetDefaultNormalValueChanged() ) );
447 connect( contextDefaultsWidgetDefaultNormalY_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotContextDefaultsWidgetDefaultNormalValueChanged() ) );
448 connect( contextDefaultsWidgetDefaultNormalZ_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotContextDefaultsWidgetDefaultNormalValueChanged() ) );
449 connect( contextDefaultsWidgetDefaultPointsize_, SIGNAL( valueChanged(
double) ),
this, SLOT( slotContextDefaultsWidgetDefaultPointsizeValueChanged() ) );
456 QStringList viewModeToolboxes;
457 viewModeToolboxes +=
"Data Control";
458 viewModeToolboxes +=
"Selections";
459 viewModeToolboxes +=
"SplatCloud Estimator";
460 viewModeToolboxes +=
"SplatCloud Rendering Control";
463 QStringList viewModeToolbars;
464 viewModeToolbars +=
"Main Toolbar";
465 viewModeToolbars +=
"Viewer Toolbar";
466 viewModeToolbars +=
"Color Toolbar";
467 viewModeToolbars +=
"Viewing Directions";
468 viewModeToolbars +=
"Selection Base";
469 viewModeToolbars +=
"Backup Toolbar";
472 QStringList viewModeContextMenus;
473 viewModeContextMenus +=
"DataControl->Material Properties";
474 viewModeContextMenus +=
"DataControl->Object";
475 viewModeContextMenus +=
"SplatCloudEstimatorPlugin->SplatCloud Estimator";
476 viewModeContextMenus +=
"SplatCloudRenderingControlPlugin->SplatCloud Rendering Control";
477 viewModeContextMenus +=
"ViewControl->Visualization";
478 viewModeContextMenus +=
"Backup->&Redo";
479 viewModeContextMenus +=
"Backup->&Undo";
482 emit defineViewModeToolboxes (
"SplatCloud", viewModeToolboxes );
483 emit defineViewModeToolbars (
"SplatCloud", viewModeToolbars );
484 emit defineViewModeContextMenus(
"SplatCloud", viewModeContextMenus );
485 emit defineViewModeIcon (
"SplatCloud",
"SplatCloudType.png" );
492 void SplatCloudRenderingControlPlugin::addedEmptyObject(
int _objectId )
494 if( _objectId == -1 )
506 if( splatCloudObject )
517 toolboxDefaultColorG_-> value(),
518 toolboxDefaultColorB_-> value() ) );
520 toolboxDefaultNormalY_-> value(),
521 toolboxDefaultNormalZ_-> value() ) );
522 splatCloudNode->setDefaultPointsize( SplatCloudNode::Pointsize( toolboxDefaultPointsize_->value() ) );
531 void SplatCloudRenderingControlPlugin::slotUpdateContextMenu(
int _objectId )
533 if( _objectId == -1 )
545 if( splatCloudObject )
548 contextCullingAction_->setChecked( splatCloudObject->isBackfaceCullingEnabled() );
556 void SplatCloudRenderingControlPlugin::slotToolboxPointsizeScaleValueChanged()
559 double scale = toolboxPointsizeScale_->value();
572 emit updatedObject( objIter->id(),
UPDATE_ALL );
580 void SplatCloudRenderingControlPlugin::slotToolboxDefaultColorValueChanged()
591 toolboxDefaultColorG_->value(),
592 toolboxDefaultColorB_->value() ) );
595 emit updatedObject( objIter->id(),
UPDATE_ALL );
603 void SplatCloudRenderingControlPlugin::slotToolboxDefaultNormalValueChanged()
614 toolboxDefaultNormalY_->value(),
615 toolboxDefaultNormalZ_->value() ) );
618 emit updatedObject( objIter->id(),
UPDATE_ALL );
626 void SplatCloudRenderingControlPlugin::slotToolboxDefaultPointsizeValueChanged()
636 splatCloudNode->setDefaultPointsize( SplatCloudNode::Pointsize( toolboxDefaultPointsize_->value() ) );
639 emit updatedObject( objIter->id(),
UPDATE_ALL );
647 void SplatCloudRenderingControlPlugin::slotToolboxEnableBackfaceCullingButtonClicked()
660 emit updatedObject( objIter->id(),
UPDATE_ALL );
668 void SplatCloudRenderingControlPlugin::slotToolboxDisableBackfaceCullingButtonClicked()
681 emit updatedObject( objIter->id(),
UPDATE_ALL );
689 void SplatCloudRenderingControlPlugin::slotToolboxReloadShadersButtonClicked()
704 emit updatedObject( objIter->id(),
UPDATE_ALL );
712 void SplatCloudRenderingControlPlugin::slotToolboxRebuildVBOsButtonClicked()
722 splatCloudNode->modifiedAll();
725 emit updatedObject( objIter->id(),
UPDATE_ALL );
733 void SplatCloudRenderingControlPlugin::slotContextScaleActionTriggered()
736 int objectId = contextScaleAction_->data().toInt();
748 if( splatCloudObject )
751 double ps = splatCloudObject->pointsizeScale();
754 contextScaleWidgetPointsizeScale_->setValue( ps );
757 contextScaleWidget_->move( contextScaleAction_->associatedWidgets()[0]->mapToGlobal( QPoint() ) );
760 contextScaleWidget_->show();
768 void SplatCloudRenderingControlPlugin::slotContextScaleWidgetPointsizeScaleValueChanged()
771 int objectId = contextScaleAction_->data().toInt();
783 if( splatCloudObject )
786 double scale = contextScaleWidgetPointsizeScale_->value();
800 void SplatCloudRenderingControlPlugin::slotContextDefaultsActionTriggered()
803 int objectId = contextDefaultsAction_->data().toInt();
818 int cr = splatCloudNode->defaultColor()[0];
819 int cg = splatCloudNode->defaultColor()[1];
820 int cb = splatCloudNode->defaultColor()[2];
821 double nx = splatCloudNode->defaultNormal()[0];
822 double ny = splatCloudNode->defaultNormal()[1];
823 double nz = splatCloudNode->defaultNormal()[2];
824 double ps = splatCloudNode->defaultPointsize();
827 contextDefaultsWidgetDefaultColorR_-> setValue( cr );
828 contextDefaultsWidgetDefaultColorG_-> setValue( cg );
829 contextDefaultsWidgetDefaultColorB_-> setValue( cb );
830 contextDefaultsWidgetDefaultNormalX_-> setValue( nx );
831 contextDefaultsWidgetDefaultNormalY_-> setValue( ny );
832 contextDefaultsWidgetDefaultNormalZ_-> setValue( nz );
833 contextDefaultsWidgetDefaultPointsize_->setValue( ps );
836 contextDefaultsWidget_->move( contextDefaultsAction_->associatedWidgets()[0]->mapToGlobal( QPoint() ) );
839 contextDefaultsWidget_->show();
847 void SplatCloudRenderingControlPlugin::slotContextDefaultsWidgetDefaultColorValueChanged()
850 int objectId = contextDefaultsAction_->data().toInt();
865 splatCloudNode->setDefaultColor(
SplatCloudNode::Color( contextDefaultsWidgetDefaultColorR_->value(),
866 contextDefaultsWidgetDefaultColorG_->value(),
867 contextDefaultsWidgetDefaultColorB_->value() ) );
878 void SplatCloudRenderingControlPlugin::slotContextDefaultsWidgetDefaultNormalValueChanged()
881 int objectId = contextDefaultsAction_->data().toInt();
897 contextDefaultsWidgetDefaultNormalY_->value(),
898 contextDefaultsWidgetDefaultNormalZ_->value() ) );
909 void SplatCloudRenderingControlPlugin::slotContextDefaultsWidgetDefaultPointsizeValueChanged()
912 int objectId = contextDefaultsAction_->data().toInt();
927 splatCloudNode->setDefaultPointsize( SplatCloudNode::Pointsize( contextDefaultsWidgetDefaultPointsize_->value() ) );
938 void SplatCloudRenderingControlPlugin::slotContextCullingActionTriggered()
941 int objectId = contextCullingAction_->data().toInt();
953 if( splatCloudObject )
956 bool enable = contextCullingAction_->isChecked();
970 void SplatCloudRenderingControlPlugin::slotContextReloadShadersActionTriggered()
973 int objectId = contextReloadShadersAction_->data().toInt();
985 if( splatCloudObject )
1001 void SplatCloudRenderingControlPlugin::slotContextRebuildVBOActionTriggered()
1004 int objectId = contextRebuildVBOAction_->data().toInt();
1005 if( objectId == -1 )
1016 if( splatCloudNode )
1019 splatCloudNode->modifiedAll();
1030 #if QT_VERSION < 0x050000
const QStringList ALL_OBJECTS
Iterable object range.
SplatCloudNode * splatCloudNode(BaseObjectData *_object)
Get a SplatCloudNode from an object.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
bool getObject(int _identifier, BSplineCurveObject *&_object)
SplatCloudNode * splatCloudNode()
Get SplatCloud's scenegraph Node.
void enableBackfaceCulling(bool _enable)
Enable or disable backface culling for all Shaders.
void reloadShaders()
Reload standard and picking Shaders from file.
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
SplatCloudObject * splatCloudObject(BaseObjectData *_object)
Cast an SplatCloudObject to a SplatCloudObject if possible.
The Menu will be shown when an object was picked.
void setPointsizeScale(float _scale)
Set the scaling factor for pointsizes for all Shaders.