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
This commit is contained in:
parent
ce84d7d5af
commit
3a2b4cdaba
16 changed files with 174 additions and 164 deletions
|
@ -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
|
||||
|
|
|
@ -166,7 +166,7 @@ void CAttribWidget::changeUseScheme(int index)
|
|||
{
|
||||
if (index == 0)
|
||||
{
|
||||
if (!useScheme())
|
||||
if (useScheme())
|
||||
resetCstValue(); // change constant
|
||||
cstValueUpdate(); // update ui
|
||||
}
|
||||
|
|
|
@ -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<NLMISC::CVector> *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()
|
||||
|
|
|
@ -45,13 +45,22 @@ public:
|
|||
CDirectionWidget(QWidget *parent = 0);
|
||||
~CDirectionWidget();
|
||||
|
||||
void enableGlobalVariable();
|
||||
void setWrapper(IPSWrapper<NLMISC::CVector> *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<NLMISC::CVector> *_Wrapper ;
|
||||
NL3D::CPSDirection *_DirectionWrapper;
|
||||
NL3D::CPSDirection *_DirectionWrapper;
|
||||
NLMISC::CVector _value;
|
||||
QString _globalName;
|
||||
|
||||
Ui::CDirectionWidget _ui;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<NL3D::CPSDirection *>(_Emitter))
|
||||
{
|
||||
_DirectionWrapper.E = dynamic_cast<NL3D::CPSDirection *>(_Emitter);
|
||||
_ui.directionWidget->setDirectionWrapper(dynamic_cast<NL3D::CPSDirection *>(_Emitter));
|
||||
_ui.directionWidget->updateUi();
|
||||
_ui.directionWidget->show();
|
||||
_ui.directionWidget->setValue(dynamic_cast<NL3D::CPSDirection *>(_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<NL3D::CPSEmitterConic *>(_Emitter))
|
||||
{
|
||||
_ConicEmitterRadiusWrapper.E = dynamic_cast<NL3D::CPSEmitterConic *>(_Emitter);
|
||||
_ui.radiusWidget->updateUi();
|
||||
_ui.radiusWidget->setValue(dynamic_cast<NL3D::CPSEmitterConic *>(_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<NL3D::CPSEmitterConic *>(_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<NL3D::CPSDirection *>(_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 */
|
|
@ -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<NLMISC::CVector>
|
||||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue