From acd96ae72b7a657dc17203fd41877c2228b88cd5 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Mon, 15 Nov 2010 16:58:27 +0200 Subject: [PATCH] Changed: #1193 If switch between the emmiter properties in a workspace erroneously marked that the particle system has been changed. Added some source groups to cmake for better file structuring --- .../3d/object_viewer_qt/src/CMakeLists.txt | 4 + .../3d/object_viewer_qt/src/attrib_widget.cpp | 2 +- .../object_viewer_qt/src/direction_widget.cpp | 95 +++++++++++------- .../object_viewer_qt/src/direction_widget.h | 15 ++- .../object_viewer_qt/src/edit_range_widget.h | 37 +++---- .../3d/object_viewer_qt/src/emitter_page.cpp | 96 +++++++++---------- .../3d/object_viewer_qt/src/emitter_page.h | 51 ++-------- .../src/vegetable_appearance_page.cpp | 6 +- .../src/vegetable_appearance_page.h | 6 +- .../src/vegetable_density_page.cpp | 2 +- .../src/vegetable_density_page.h | 2 +- .../src/vegetable_noise_value_widget.h | 2 +- .../src/vegetable_rotate_page.cpp | 6 +- .../src/vegetable_rotate_page.h | 6 +- .../src/vegetable_scale_page.cpp | 4 +- .../src/vegetable_scale_page.h | 4 +- 16 files changed, 174 insertions(+), 164 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt index 3cf65baa0..406121a14 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt @@ -40,6 +40,10 @@ QT4_ADD_RESOURCES( OBJECT_VIEWER_RC_SRCS ${OBJECT_VIEWER_RCS} ) QT4_WRAP_CPP( OBJECT_VIEWER_MOC_SRCS ${OBJECT_VIEWER_HDR} ) QT4_WRAP_UI( OBJECT_VIEWER_UI_HDRS ${OBJECT_VIEWER_UIS} ) +SOURCE_GROUP(QtResources FILES ${OBJECT_VIEWER_UIS} ${OBJECT_VIEWER_RCS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OBJECT_VIEWER_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OBJECT_VIEWER_MOC_SRCS}) + ADD_EXECUTABLE(object_viewer_qt WIN32 MACOSX_BUNDLE ${OBJECT_VIEWER_SRC} ${OBJECT_VIEWER_MOC_SRCS} ${OBJECT_VIEWER_RC_SRCS} ${OBJECT_VIEWER_UI_HDRS}) TARGET_LINK_LIBRARIES(object_viewer_qt diff --git a/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp index bd8d6c7c0..74c3f8269 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp @@ -166,7 +166,7 @@ void CAttribWidget::changeUseScheme(int index) { if (index == 0) { - if (!useScheme()) + if (useScheme()) resetCstValue(); // change constant cstValueUpdate(); // update ui } diff --git a/code/nel/tools/3d/object_viewer_qt/src/direction_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/direction_widget.cpp index 49521fb15..79af10959 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/direction_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/direction_widget.cpp @@ -30,7 +30,7 @@ namespace NLQT { CDirectionWidget::CDirectionWidget(QWidget *parent) - : QWidget(parent), _Wrapper(NULL), _DirectionWrapper(NULL) + : QWidget(parent), _Wrapper(NULL), _DirectionWrapper(NULL), _globalName("") { _ui.setupUi(this); @@ -50,12 +50,20 @@ CDirectionWidget::CDirectionWidget(QWidget *parent) connect(_ui.xzWidget, SIGNAL(applyNewVector(float,float)), this, SLOT(setNewVecXZ(float,float))); connect(_ui.yzWidget, SIGNAL(applyNewVector(float,float)), this, SLOT(setNewVecYZ(float,float))); + + // Set default value +K + setValue(NLMISC::CVector::K); } CDirectionWidget::~CDirectionWidget() { } +void CDirectionWidget::enableGlobalVariable() +{ + _ui.globalPushButton->setVisible(true); + _globalName = ""; +} void CDirectionWidget::setWrapper(IPSWrapper *wrapper) { @@ -74,12 +82,42 @@ void CDirectionWidget::setDirectionWrapper(NL3D::CPSDirection *wrapper) void CDirectionWidget::updateUi() { - _ui.xzWidget->setVector(_Wrapper->get().x, _Wrapper->get().z); - _ui.yzWidget->setVector(_Wrapper->get().y, _Wrapper->get().z); + setValue(_Wrapper->get(), false); + checkEnabledGlobalDirection(); +} + +void CDirectionWidget::setValue(const NLMISC::CVector &value, bool emit) +{ + _value = value; + _ui.xzWidget->setVector(_value.x, _value.z); + _ui.yzWidget->setVector(_value.y, _value.z); _ui.xzWidget->repaint(); _ui.yzWidget->repaint(); + + if (emit) + { + Q_EMIT valueChanged(_value); + if (_Wrapper) + _Wrapper->setAndUpdateModifiedFlag(_value); + } +} + +void CDirectionWidget::setGlobalName(const QString &globalName, bool emit) +{ + _globalName = globalName; - checkEnabledGlobalDirection(); + _ui.xzWidget->setVisible(_globalName.isEmpty()); + _ui.yzWidget->setVisible(_globalName.isEmpty()); + + _ui.incVecIPushButton->setEnabled(_globalName.isEmpty()); + _ui.incVecJPushButton->setEnabled(_globalName.isEmpty()); + _ui.incVecKPushButton->setEnabled(_globalName.isEmpty()); + _ui.decVecIPushButton->setEnabled(_globalName.isEmpty()); + _ui.decVecJPushButton->setEnabled(_globalName.isEmpty()); + _ui.decVecKPushButton->setEnabled(_globalName.isEmpty()); + + if (emit) + globalNameChanged(_globalName); } void CDirectionWidget::setGlobalDirection() @@ -93,62 +131,55 @@ void CDirectionWidget::setGlobalDirection() if (ok) { + setGlobalName(text); + _DirectionWrapper->enableGlobalVectorValue(text.toStdString()); - if (!text.isEmpty()) + if (!_globalName.isEmpty()) { // take a non NULL value for the direction NL3D::CParticleSystem::setGlobalVectorValue(text.toStdString(), NLMISC::CVector::I); } - checkEnabledGlobalDirection(); } } void CDirectionWidget::incVecI() { - _Wrapper->setAndUpdateModifiedFlag(NLMISC::CVector::I); - _ui.xzWidget->setVector(NLMISC::CVector::I.x, NLMISC::CVector::I.z); - _ui.yzWidget->setVector(NLMISC::CVector::I.y, NLMISC::CVector::I.z); + setValue(NLMISC::CVector::I); } void CDirectionWidget::incVecJ() { - _Wrapper->setAndUpdateModifiedFlag(NLMISC::CVector::J); - _ui.xzWidget->setVector(NLMISC::CVector::J.x, NLMISC::CVector::J.z); - _ui.yzWidget->setVector(NLMISC::CVector::J.y, NLMISC::CVector::J.z); + setValue(NLMISC::CVector::J); } void CDirectionWidget::incVecK() { - _Wrapper->setAndUpdateModifiedFlag(NLMISC::CVector::K); - _ui.xzWidget->setVector(NLMISC::CVector::K.x, NLMISC::CVector::K.z); - _ui.yzWidget->setVector(NLMISC::CVector::K.y, NLMISC::CVector::K.z); + setValue(NLMISC::CVector::K); } void CDirectionWidget::decVecI() { - _Wrapper->setAndUpdateModifiedFlag( - NLMISC::CVector::I); - _ui.xzWidget->setVector((-NLMISC::CVector::I).x, (-NLMISC::CVector::I).z); - _ui.yzWidget->setVector((-NLMISC::CVector::I).y, (-NLMISC::CVector::I).z); + setValue( - NLMISC::CVector::I); } void CDirectionWidget::decVecJ() { - _Wrapper->setAndUpdateModifiedFlag( - NLMISC::CVector::J); - _ui.xzWidget->setVector((-NLMISC::CVector::J).x, (-NLMISC::CVector::J).z); - _ui.yzWidget->setVector((-NLMISC::CVector::J).y, (-NLMISC::CVector::J).z); + setValue( - NLMISC::CVector::J); } void CDirectionWidget::decVecK() { - _Wrapper->setAndUpdateModifiedFlag( - NLMISC::CVector::K); - _ui.xzWidget->setVector((-NLMISC::CVector::K).x, (-NLMISC::CVector::K).z); - _ui.yzWidget->setVector((-NLMISC::CVector::K).y, (-NLMISC::CVector::K).z); + setValue( - NLMISC::CVector::K); } void CDirectionWidget::setNewVecXZ(float x, float y) { const float epsilon = 10E-3f; - NLMISC::CVector v = _Wrapper->get(); + NLMISC::CVector v; + if (_Wrapper) + v = _Wrapper->get(); + else + v = _value; v.x = x; v.z = y; @@ -165,15 +196,17 @@ void CDirectionWidget::setNewVecXZ(float x, float y) v.normalize(); - _Wrapper->setAndUpdateModifiedFlag(v); - _ui.xzWidget->setVector(_Wrapper->get().x, _Wrapper->get().z); - _ui.yzWidget->setVector(_Wrapper->get().y, _Wrapper->get().z); + setValue(v); } void CDirectionWidget::setNewVecYZ(float x, float y) { const float epsilon = 10E-3f; - NLMISC::CVector v = _Wrapper->get(); + NLMISC::CVector v; + if (_Wrapper) + v = _Wrapper->get(); + else + v = _value; v.y = x; v.z = y; @@ -190,9 +223,7 @@ void CDirectionWidget::setNewVecYZ(float x, float y) v.normalize(); - _Wrapper->setAndUpdateModifiedFlag(v); - _ui.xzWidget->setVector(_Wrapper->get().x, _Wrapper->get().z); - _ui.yzWidget->setVector(_Wrapper->get().y, _Wrapper->get().z); + setValue(v); } void CDirectionWidget::checkEnabledGlobalDirection() diff --git a/code/nel/tools/3d/object_viewer_qt/src/direction_widget.h b/code/nel/tools/3d/object_viewer_qt/src/direction_widget.h index 3125bfe38..5f0093da1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/direction_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/direction_widget.h @@ -45,13 +45,22 @@ public: CDirectionWidget(QWidget *parent = 0); ~CDirectionWidget(); + void enableGlobalVariable(); void setWrapper(IPSWrapper *wrapper); /// The CPSDirection object is used to see if a global variable can be bound to the direction. /// When set to NULL it has no effect (the default) void setDirectionWrapper(NL3D::CPSDirection *wrapper); void updateUi(); - + +Q_SIGNALS: + void valueChanged(const NLMISC::CVector &value); + void globalNameChanged(const QString &globalName); + +public Q_SLOTS: + void setValue(const NLMISC::CVector &value, bool emit = true); + void setGlobalName(const QString &globalName, bool emit = true); + private Q_SLOTS: void setGlobalDirection(); void incVecI(); @@ -67,7 +76,9 @@ private: void checkEnabledGlobalDirection(); IPSWrapper *_Wrapper ; - NL3D::CPSDirection *_DirectionWrapper; + NL3D::CPSDirection *_DirectionWrapper; + NLMISC::CVector _value; + QString _globalName; Ui::CDirectionWidget _ui; diff --git a/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.h b/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.h index 72204b245..c6c1f23a4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.h @@ -67,11 +67,6 @@ public: /// NB : The 'OwnerNode' field of the wrapper void setWrapper(IPSWrapperUInt *wrapper); - /// Set current value - /// @param value - current value - /// @param emit - will emit valueChanged() if the new value is different from the old one and param emit = true - void setValue(uint32 value, bool emit = true); - /// Convenience function to set the minimum, and maximum values with a single function call void setRange(uint32 minValue, uint32 maxValue); @@ -102,7 +97,13 @@ public: Q_SIGNALS: void valueChanged(uint32 value); - + +public Q_SLOTS: + /// Set current value + /// @param value - current value + /// @param emit - will emit valueChanged() if the new value is different from the old one and param emit = true + void setValue(uint32 value, bool emit = true); + private Q_SLOTS: void setMaximum(int value); void setMinimum(int value); @@ -153,11 +154,6 @@ public: /// NB : The 'OwnerNode' field of the wrapper void setWrapper(IPSWrapperInt *wrapper); - /// Set current value - /// @param value - current value - /// @param emit - will emit valueChanged() if the new value is different from the old one and param emit = true - void setValue(sint32 value, bool emit = true); - /// Convenience function to set the minimum, and maximum values with a single function call void setRange(sint32 minValue, sint32 maxValue); @@ -188,7 +184,13 @@ public: Q_SIGNALS: void valueChanged(sint32 value); - + +public Q_SLOTS: + /// Set current value + /// @param value - current value + /// @param emit - will emit valueChanged() if the new value is different from the old one and param emit = true + void setValue(sint32 value, bool emit = true); + private Q_SLOTS: void setMaximum(int value); void setMinimum(int value); @@ -238,11 +240,6 @@ public: /// NB : The 'OwnerNode' field of the wrapper void setWrapper(IPSWrapperFloat *wrapper); - /// Set current value - /// @param value - current value - /// @param emit - will emit valueChanged() if the new value is different from the old one and param emit = true - void setValue(float value, bool emit = true); - /// Convenience function to set the minimum, and maximum values with a single function call void setRange(float minValue, float maxValue); @@ -274,6 +271,12 @@ public: Q_SIGNALS: void valueChanged(float value); +public Q_SLOTS: + /// Set current value + /// @param value - current value + /// @param emit - will emit valueChanged() if the new value is different from the old one and param emit = true + void setValue(float value, bool emit = true); + private Q_SLOTS: void changeRange(); void changeSlider(int value); diff --git a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp index 9a8d3191f..5c3021277 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp @@ -57,31 +57,30 @@ CEmitterPage::CEmitterPage(QWidget *parent) // SPEED_INHERITANCE_FACTOR _ui.speedInherFactorWidget->setRange(-1.f, 1.f); - _ui.speedInherFactorWidget->setWrapper(&_SpeedInheritanceFactorWrapper); + //_ui.speedInherFactorWidget->setWrapper(&_SpeedInheritanceFactorWrapper); // DELAYED_EMISSION _ui.delayedEmissionWidget->setRange(0.f, 10.f); _ui.delayedEmissionWidget->enableLowerBound(0.f, false); - _ui.delayedEmissionWidget->setWrapper(&_DelayedEmissionWrapper); // MAX_EMISSION_COUNT _ui.maxEmissionCountWidget->setRange(0, 100); _ui.maxEmissionCountWidget->enableUpperBound(256, false); - _ui.maxEmissionCountWidget->setWrapper(&_MaxEmissionCountWrapper); - _MaxEmissionCountWrapper.widget = _ui.maxEmissionCountWidget; - _MaxEmissionCountWrapper.parent = this; // radius for conic emitter _ui.radiusWidget->setRange(0.1f, 2.1f); - _ui.radiusWidget->setWrapper(&_ConicEmitterRadiusWrapper); - - _ui.directionWidget->setWrapper(&_DirectionWrapper); connect(_ui.emittedTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setEmittedType(int))); connect(_ui.typeEmissionComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setTypeOfEmission(int))); connect(_ui.directionComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setDirectionMode(int))); connect(_ui.bypassAutoLODCheckBox, SIGNAL(toggled(bool)), this, SLOT(setBypassAutoLOD(bool))); connect(_ui.forceConsistentCheckBox, SIGNAL(toggled(bool)), this, SLOT(setConsistentEmission(bool))); + + connect(_ui.speedInherFactorWidget, SIGNAL(valueChanged(float)), this, SLOT(setSpeedInheritanceFactor(float))); + connect(_ui.delayedEmissionWidget, SIGNAL(valueChanged(float)), this, SLOT(setEmitDelay(float))); + connect(_ui.radiusWidget, SIGNAL(valueChanged(float)), this, SLOT(setConicEmitterRadius(float))); + connect(_ui.maxEmissionCountWidget, SIGNAL(valueChanged(uint32)), this, SLOT(setMaxEmissionCount(uint32))); + connect(_ui.directionWidget, SIGNAL(valueChanged(NLMISC::CVector)), this, SLOT(setDir(NLMISC::CVector))); } CEmitterPage::~CEmitterPage() @@ -95,19 +94,9 @@ void CEmitterPage::setEditedItem(CWorkspaceNode *ownerNode, NL3D::CPSLocatedBind updateEmittedType(); - _SpeedInheritanceFactorWrapper.OwnerNode = _Node; - _SpeedInheritanceFactorWrapper.E = _Emitter; - _ui.speedInherFactorWidget->updateUi(); - - _DelayedEmissionWrapper.Node = _Node; - _DelayedEmissionWrapper.OwnerNode = _Node; - _DelayedEmissionWrapper.E = _Emitter; - _ui.delayedEmissionWidget->updateUi(); - - _MaxEmissionCountWrapper.Node = _Node; - _MaxEmissionCountWrapper.OwnerNode = _Node; - _MaxEmissionCountWrapper.E = _Emitter; - _ui.maxEmissionCountWidget->updateUi(); + _ui.speedInherFactorWidget->setValue(_Emitter->getSpeedInheritanceFactor(), false); + _ui.delayedEmissionWidget->setValue(_Emitter->getEmitDelay(), false); + _ui.maxEmissionCountWidget->setValue(_Emitter->getMaxEmissionCount(), false); _PeriodWrapper.Node = _Node; _PeriodWrapper.E = _Emitter; @@ -133,10 +122,8 @@ void CEmitterPage::setEditedItem(CWorkspaceNode *ownerNode, NL3D::CPSLocatedBind // deals with emitters that have a direction if (dynamic_cast(_Emitter)) { - _DirectionWrapper.E = dynamic_cast(_Emitter); - _ui.directionWidget->setDirectionWrapper(dynamic_cast(_Emitter)); - _ui.directionWidget->updateUi(); _ui.directionWidget->show(); + _ui.directionWidget->setValue(dynamic_cast(_Emitter)->getDir(), false); } else _ui.directionWidget->hide(); @@ -145,8 +132,7 @@ void CEmitterPage::setEditedItem(CWorkspaceNode *ownerNode, NL3D::CPSLocatedBind // radius for conic emitter if (dynamic_cast(_Emitter)) { - _ConicEmitterRadiusWrapper.E = dynamic_cast(_Emitter); - _ui.radiusWidget->updateUi(); + _ui.radiusWidget->setValue(dynamic_cast(_Emitter)->getRadius(),false); _ui.radiusWidget->show(); _ui.radiusLabel->show(); } @@ -291,6 +277,42 @@ void CEmitterPage::setDirectionMode(int index) updateModifiedFlag(); } +void CEmitterPage::setSpeedInheritanceFactor(float value) +{ + _Emitter->setSpeedInheritanceFactor(value); +} + +void CEmitterPage::setConicEmitterRadius(float value) +{ + dynamic_cast(_Emitter)->setRadius(value); +} + +void CEmitterPage::setEmitDelay(float value) +{ + _Emitter->setEmitDelay(value); + Modules::psEdit().resetAutoCount(_Node); +} + +void CEmitterPage::setMaxEmissionCount(uint32 value) +{ + if (!_Emitter->setMaxEmissionCount((uint8)value)) + { + + QMessageBox::critical(this, tr("NeL Particle Editor"), + tr("Can't perform operation : the system is flagged with 'No max nb steps' or uses the preset 'Spell FX', " + "and thus, should have a finite duration. Please remove that flag first."), + QMessageBox::Ok); + + _ui.maxEmissionCountWidget->setValue((uint32)_Emitter->getMaxEmissionCount(), false); + } + Modules::psEdit().resetAutoCount(_Node); +} + +void CEmitterPage::setDir(const NLMISC::CVector &value) +{ + dynamic_cast(_Emitter)->setDir(value); +} + void CEmitterPage::updatePeriodWidget() { bool bEnable = _Emitter->getEmissionType() == NL3D::CPSEmitter::regular; @@ -349,26 +371,4 @@ void CEmitterPage::CGenNbWrapper::setScheme(scheme_type *s) Modules::psEdit().resetAutoCount(Node); } - -void CEmitterPage::CDelayedEmissionWrapper::set(const float &f) -{ - E->setEmitDelay(f); - Modules::psEdit().resetAutoCount(Node); -} - -void CEmitterPage::CMaxEmissionCountWrapper::set(const uint32 &count) -{ - if (!E->setMaxEmissionCount((uint8) count)) - { - - QMessageBox::critical(parent, tr("NeL Particle Editor"), - tr("Can't perform operation : the system is flagged with 'No max nb steps' or uses the preset 'Spell FX', " - "and thus, should have a finite duration. Please remove that flag first."), - QMessageBox::Ok); - - widget->updateUi(); - } - Modules::psEdit().resetAutoCount(Node); -} - } /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h index 855eec324..cfb7afc39 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h @@ -66,6 +66,12 @@ private Q_SLOTS: void setConsistentEmission(bool state); void setBypassAutoLOD(bool state); void setDirectionMode(int index); + + void setSpeedInheritanceFactor(float value); + void setConicEmitterRadius(float value); + void setEmitDelay(float value); + void setMaxEmissionCount(uint32 value); + void setDir(const NLMISC::CVector &value); private: @@ -101,51 +107,6 @@ private: void setScheme(scheme_type *s) { E->setEmitteeSpeedScheme(s); } } _ModulatedStrenghtWrapper; - /// wrappers to set the speed inheritance factor - struct CSpeedInheritanceFactorWrapper : public IPSWrapperFloat - { - NL3D::CPSEmitter *E; - float get(void) const { return E->getSpeedInheritanceFactor(); } - void set(const float &f) { E->setSpeedInheritanceFactor(f); } - } _SpeedInheritanceFactorWrapper; - - /// wrappers to tune the direction of emitters - struct CDirectionWrapper : public IPSWrapper - { - NL3D::CPSDirection *E; - NLMISC::CVector get(void) const { return E->getDir(); } - void set(const NLMISC::CVector &d){ E->setDir(d); } - } _DirectionWrapper; - - /// wrapper to tune the radius of an emitter - struct CConicEmitterRadiusWrapper : public IPSWrapperFloat - { - NL3D::CPSEmitterConic *E; - float get(void) const { return E->getRadius(); } - void set(const float &f) { E->setRadius(f); } - } _ConicEmitterRadiusWrapper; - - /// wrapper to tune delayed emission - struct CDelayedEmissionWrapper : public IPSWrapperFloat - { - CWorkspaceNode *Node; - NL3D::CPSEmitter *E; - float get(void) const { return E->getEmitDelay(); } - void set(const float &f); - } _DelayedEmissionWrapper; - - /// wrapper to tune max number of emissions - struct CMaxEmissionCountWrapper : public IPSWrapperUInt - { - CWorkspaceNode *Node; - CEditRangeUIntWidget *widget; - QWidget *parent; - NL3D::CPSEmitter *E; - uint32 get(void) const { return E->getMaxEmissionCount(); } - void set(const uint32 &count); - } _MaxEmissionCountWrapper; - - // the emitter being edited NL3D::CPSEmitter *_Emitter; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp index dfa8d3e92..3d465c71f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp @@ -95,19 +95,19 @@ void CVegetableApperancePage::setVegetableToEdit(NL3D::CVegetable *vegetable) setEnabled(false); } -void CVegetableApperancePage::setNoiseValueBendPhase(NLMISC::CNoiseValue value) +void CVegetableApperancePage::setNoiseValueBendPhase(const NLMISC::CNoiseValue &value) { _Vegetable->BendPhase = value; Modules::veget().refreshVegetableDisplay(); } -void CVegetableApperancePage::setNoiseValueBendFactor(NLMISC::CNoiseValue value) +void CVegetableApperancePage::setNoiseValueBendFactor(const NLMISC::CNoiseValue &value) { _Vegetable->BendFactor = value; Modules::veget().refreshVegetableDisplay(); } -void CVegetableApperancePage::setNoiseValueColor(NLMISC::CNoiseValue value) +void CVegetableApperancePage::setNoiseValueColor(const NLMISC::CNoiseValue &value) { _Vegetable->Color.NoiseValue = value; Modules::veget().refreshVegetableDisplay(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h index e68e1e904..d417ff133 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h @@ -47,9 +47,9 @@ public: void setVegetableToEdit(NL3D::CVegetable *vegetable); private Q_SLOTS: - void setNoiseValueBendPhase(NLMISC::CNoiseValue value); - void setNoiseValueBendFactor(NLMISC::CNoiseValue value); - void setNoiseValueColor(NLMISC::CNoiseValue value); + void setNoiseValueBendPhase(const NLMISC::CNoiseValue &value); + void setNoiseValueBendFactor(const NLMISC::CNoiseValue &value); + void setNoiseValueColor(const NLMISC::CNoiseValue &value); void browseColor(QListWidgetItem * item); void addNewColor(); void insNewColor(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp index c49ba9111..0b5acfb03 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp @@ -225,7 +225,7 @@ void CVegetableDensityPage::updateAngleMode() Modules::veget().refreshVegetableDisplay(); } -void CVegetableDensityPage::setDensity(NLMISC::CNoiseValue value) +void CVegetableDensityPage::setDensity(const NLMISC::CNoiseValue &value) { _Vegetable->Density = value; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h index 6700941fd..a0e57beaa 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h @@ -54,7 +54,7 @@ private Q_SLOTS: void setDistanceOfCreat(int value); void setEnabledMaxDensity(bool state); void updateAngleMode(); - void setDensity(NLMISC::CNoiseValue value); + void setDensity(const NLMISC::CNoiseValue &value); void setMaxDensity(float value); void setAngleMinSlider(int pos); void setAngleMaxSlider(int pos); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h index 8f715851b..b2f5ccf7b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h @@ -46,7 +46,7 @@ public: void setDefaultRangeFreq(float defRangeMin, float defRangeMax); Q_SIGNALS: - void noiseValueChanged(NLMISC::CNoiseValue value); + void noiseValueChanged(const NLMISC::CNoiseValue &value); private Q_SLOTS: void setSlider(int value); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.cpp index 73a49597d..17ba15c2d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.cpp @@ -72,19 +72,19 @@ void CVegetableRotatePage::setVegetableToEdit(NL3D::CVegetable *vegetable) setEnabled(false); } -void CVegetableRotatePage::setNoiseValueRotateX(NLMISC::CNoiseValue value) +void CVegetableRotatePage::setNoiseValueRotateX(const NLMISC::CNoiseValue &value) { _Vegetable->Rx = value; Modules::veget().refreshVegetableDisplay(); } -void CVegetableRotatePage::setNoiseValueRotateY(NLMISC::CNoiseValue value) +void CVegetableRotatePage::setNoiseValueRotateY(const NLMISC::CNoiseValue &value) { _Vegetable->Ry = value; Modules::veget().refreshVegetableDisplay(); } -void CVegetableRotatePage::setNoiseValueRotateZ(NLMISC::CNoiseValue value) +void CVegetableRotatePage::setNoiseValueRotateZ(const NLMISC::CNoiseValue &value) { _Vegetable->Rz = value; Modules::veget().refreshVegetableDisplay(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h index 21f1e7414..54797623b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h @@ -47,9 +47,9 @@ public: void setVegetableToEdit(NL3D::CVegetable *vegetable); private Q_SLOTS: - void setNoiseValueRotateX(NLMISC::CNoiseValue value); - void setNoiseValueRotateY(NLMISC::CNoiseValue value); - void setNoiseValueRotateZ(NLMISC::CNoiseValue value); + void setNoiseValueRotateX(const NLMISC::CNoiseValue &value); + void setNoiseValueRotateY(const NLMISC::CNoiseValue &value); + void setNoiseValueRotateZ(const NLMISC::CNoiseValue &value); private: diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.cpp index 5d429e631..cd19ec2ae 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.cpp @@ -71,13 +71,13 @@ void CVegetableScalePage::setVegetableToEdit(NL3D::CVegetable *vegetable) setEnabled(false); } -void CVegetableScalePage::setNoiseValueXYSize(NLMISC::CNoiseValue value) +void CVegetableScalePage::setNoiseValueXYSize(const NLMISC::CNoiseValue &value) { _Vegetable->Sxy = value; Modules::veget().refreshVegetableDisplay(); } -void CVegetableScalePage::setNoiseValueZSize(NLMISC::CNoiseValue value) +void CVegetableScalePage::setNoiseValueZSize(const NLMISC::CNoiseValue &value) { _Vegetable->Sz = value; Modules::veget().refreshVegetableDisplay(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h index 4181f0e41..941bcd061 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h @@ -47,8 +47,8 @@ public: void setVegetableToEdit(NL3D::CVegetable *vegetable); private Q_SLOTS: - void setNoiseValueXYSize(NLMISC::CNoiseValue value); - void setNoiseValueZSize(NLMISC::CNoiseValue value); + void setNoiseValueXYSize(const NLMISC::CNoiseValue &value); + void setNoiseValueZSize(const NLMISC::CNoiseValue &value); void setFreqFactor(float value); private: