mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2025-01-07 08:25:22 +00:00
Changed: #1193 Code cleanup.
This commit is contained in:
parent
623ec55753
commit
5dc9ff7b51
84 changed files with 510 additions and 453 deletions
|
@ -88,7 +88,7 @@ void CAnimationSetDialog::updateListObject()
|
||||||
std::vector<std::string> listObjects;
|
std::vector<std::string> listObjects;
|
||||||
Modules::objView().getListObjects(listObjects);
|
Modules::objView().getListObjects(listObjects);
|
||||||
|
|
||||||
for (size_t i = 0; i < listObjects.size(); i++)
|
for (size_t i = 0; i < listObjects.size(); ++i)
|
||||||
ui.objectsComboBox->addItem(QString(listObjects[i].c_str()));
|
ui.objectsComboBox->addItem(QString(listObjects[i].c_str()));
|
||||||
|
|
||||||
if (listObjects.empty())
|
if (listObjects.empty())
|
||||||
|
|
|
@ -49,7 +49,8 @@ CAttribWidget::CAttribWidget(QWidget *parent)
|
||||||
_EnableConstantValue(true),
|
_EnableConstantValue(true),
|
||||||
_DisableMemoryScheme(false),
|
_DisableMemoryScheme(false),
|
||||||
_NbCycleEnabled(true),
|
_NbCycleEnabled(true),
|
||||||
_Node(NULL), _SchemeWidget(NULL)
|
_Node(NULL),
|
||||||
|
_SchemeWidget(NULL)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
_ui.constRangeUIntWidget->hide();
|
_ui.constRangeUIntWidget->hide();
|
||||||
|
|
|
@ -32,30 +32,25 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CAutoLODDialog::CAutoLODDialog(CWorkspaceNode *ownerNode, NL3D::CParticleSystem *ps, QWidget *parent)
|
CAutoLODDialog::CAutoLODDialog(CWorkspaceNode *ownerNode, NL3D::CParticleSystem *ps, QWidget *parent)
|
||||||
: QDialog(parent), _Node(ownerNode), _PS(ps)
|
: QDialog(parent),
|
||||||
|
_Node(ownerNode),
|
||||||
|
_PS(ps)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
setFixedHeight(sizeHint().height());
|
setFixedHeight(sizeHint().height());
|
||||||
|
|
||||||
_DistRatioWrapper.PS = _PS;
|
|
||||||
_MaxDistLODBiasWrapper.PS = _PS;
|
|
||||||
_DistRatioWrapper.OwnerNode = _Node;
|
|
||||||
_MaxDistLODBiasWrapper.OwnerNode = _Node;
|
|
||||||
|
|
||||||
// Edit the distance at which LOD starts
|
// Edit the distance at which LOD starts
|
||||||
_ui.startPercentDistWidget->setRange(0.f, 0.99f);
|
_ui.startPercentDistWidget->setRange(0.f, 0.99f);
|
||||||
_ui.startPercentDistWidget->enableUpperBound(1.f, true);
|
_ui.startPercentDistWidget->enableUpperBound(1.f, true);
|
||||||
_ui.startPercentDistWidget->enableLowerBound(0.f, false);
|
_ui.startPercentDistWidget->enableLowerBound(0.f, false);
|
||||||
_ui.startPercentDistWidget->setWrapper(&_DistRatioWrapper);
|
_ui.startPercentDistWidget->setValue(_PS->getAutoLODStartDistPercent());
|
||||||
_ui.startPercentDistWidget->updateUi();
|
|
||||||
|
|
||||||
// For non-shared systems only : Set the LOD bias at the max distance, so that some particles are still displayed
|
// For non-shared systems only : Set the LOD bias at the max distance, so that some particles are still displayed
|
||||||
_ui.maxDistBiasWidget->setRange(0.f, 1.0f);
|
_ui.maxDistBiasWidget->setRange(0.f, 1.0f);
|
||||||
_ui.maxDistBiasWidget->enableUpperBound(1.f, false);
|
_ui.maxDistBiasWidget->enableUpperBound(1.f, false);
|
||||||
_ui.maxDistBiasWidget->enableLowerBound(0.f, false);
|
_ui.maxDistBiasWidget->enableLowerBound(0.f, false);
|
||||||
_ui.maxDistBiasWidget->setWrapper(&_MaxDistLODBiasWrapper);
|
_ui.maxDistBiasWidget->setValue(_PS->getMaxDistLODBias());
|
||||||
_ui.maxDistBiasWidget->updateUi();
|
|
||||||
|
|
||||||
if (_PS->isSharingEnabled())
|
if (_PS->isSharingEnabled())
|
||||||
{
|
{
|
||||||
|
@ -86,4 +81,16 @@ void CAutoLODDialog::setSkipParticles(bool state)
|
||||||
_PS->setAutoLODMode(state);
|
_PS->setAutoLODMode(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAutoLODDialog::setDistRatio(float value)
|
||||||
|
{
|
||||||
|
_PS->setupAutoLOD(value, _PS->getAutoLODDegradationExponent());
|
||||||
|
_Node->setModified(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoLODDialog::setMaxDistLODBias(float value)
|
||||||
|
{
|
||||||
|
_PS->setMaxDistLODBias(value);
|
||||||
|
_Node->setModified(true);
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace NLQT */
|
} /* namespace NLQT */
|
|
@ -47,37 +47,13 @@ private Q_SLOTS:
|
||||||
void setDegradationExponent(int value);
|
void setDegradationExponent(int value);
|
||||||
void setSkipParticles(bool state);
|
void setSkipParticles(bool state);
|
||||||
|
|
||||||
|
void setDistRatio(float value);
|
||||||
|
void setMaxDistLODBias(float value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CWorkspaceNode *_Node;
|
CWorkspaceNode *_Node;
|
||||||
|
|
||||||
NL3D::CParticleSystem *_PS;
|
NL3D::CParticleSystem *_PS;
|
||||||
|
|
||||||
struct CDistRatioWrapper : IPSWrapperFloat
|
|
||||||
{
|
|
||||||
NL3D::CParticleSystem *PS;
|
|
||||||
virtual float get() const
|
|
||||||
{
|
|
||||||
return PS->getAutoLODStartDistPercent();
|
|
||||||
}
|
|
||||||
virtual void set(const float &v)
|
|
||||||
{
|
|
||||||
PS->setupAutoLOD(v, PS->getAutoLODDegradationExponent());
|
|
||||||
}
|
|
||||||
} _DistRatioWrapper;
|
|
||||||
|
|
||||||
struct CMaxDistLODBiasWrapper : IPSWrapperFloat
|
|
||||||
{
|
|
||||||
NL3D::CParticleSystem *PS;
|
|
||||||
virtual float get() const
|
|
||||||
{
|
|
||||||
return PS->getMaxDistLODBias();
|
|
||||||
}
|
|
||||||
virtual void set(const float &v)
|
|
||||||
{
|
|
||||||
PS->setMaxDistLODBias(v);
|
|
||||||
}
|
|
||||||
} _MaxDistLODBiasWrapper;
|
|
||||||
|
|
||||||
Ui::CAutoLODDialog _ui;
|
Ui::CAutoLODDialog _ui;
|
||||||
}; /* class CAutoLODDialog */
|
}; /* class CAutoLODDialog */
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,10 @@ namespace NLQT
|
||||||
NLMISC::CMatrix BuildEulerMatrix(float psi, float theta, float phi)
|
NLMISC::CMatrix BuildEulerMatrix(float psi, float theta, float phi)
|
||||||
{
|
{
|
||||||
float ca = cosf(psi), sa = sinf(psi)
|
float ca = cosf(psi), sa = sinf(psi)
|
||||||
, cb = cosf(theta), sb = sinf(theta)
|
, cb = cosf(theta)
|
||||||
, cc = cosf(phi), sc = sinf(phi);
|
, sb = sinf(theta)
|
||||||
|
, cc = cosf(phi)
|
||||||
|
, sc = sinf(phi);
|
||||||
NLMISC::CMatrix m;
|
NLMISC::CMatrix m;
|
||||||
m.identity();
|
m.identity();
|
||||||
m.setRot(NLMISC::CVector(ca * cb * cc - sa * sc, -cc * sa - ca * cb *sc, ca * sb)
|
m.setRot(NLMISC::CVector(ca * cb * cc - sa * sc, -cc * sa - ca * cb *sc, ca * sb)
|
||||||
|
@ -113,8 +115,10 @@ NLMISC::CVector GetEulerAngles(const NLMISC::CMatrix &mat)
|
||||||
for (uint k = 0; k < 8; ++k)
|
for (uint k = 0; k < 8; ++k)
|
||||||
{
|
{
|
||||||
float ca = cosf(sol[k].x), sa = sinf(sol[k].x)
|
float ca = cosf(sol[k].x), sa = sinf(sol[k].x)
|
||||||
, cb = cosf(sol[k].y), sb = sinf(sol[k].y)
|
, cb = cosf(sol[k].y)
|
||||||
, cc = cosf(sol[k].z), sc = sinf(sol[k].z);
|
, sb = sinf(sol[k].y)
|
||||||
|
, cc = cosf(sol[k].z)
|
||||||
|
, sc = sinf(sol[k].z);
|
||||||
|
|
||||||
float gap = fabsf(m[0][0] - ca * cb * cc + sa * sc);
|
float gap = fabsf(m[0][0] - ca * cb * cc + sa * sc);
|
||||||
gap += fabsf(m[1][0] + cc * sa + ca * cb *sc);
|
gap += fabsf(m[1][0] + cc * sa + ca * cb *sc);
|
||||||
|
@ -135,7 +139,8 @@ NLMISC::CVector GetEulerAngles(const NLMISC::CMatrix &mat)
|
||||||
}
|
}
|
||||||
|
|
||||||
CBasicEditWidget::CBasicEditWidget(QWidget *parent)
|
CBasicEditWidget::CBasicEditWidget(QWidget *parent)
|
||||||
: QWidget(parent), _Wrapper(NULL)
|
: QWidget(parent),
|
||||||
|
_Wrapper(NULL)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
@ -155,7 +160,8 @@ void CBasicEditWidget::setWrapper(IPSWrapper<NL3D::CPlaneBasis> *wrapper)
|
||||||
|
|
||||||
void CBasicEditWidget::updateUi()
|
void CBasicEditWidget::updateUi()
|
||||||
{
|
{
|
||||||
if (_Wrapper == NULL) return;
|
if (_Wrapper == NULL)
|
||||||
|
return;
|
||||||
NL3D::CPlaneBasis pb = _Wrapper->get();
|
NL3D::CPlaneBasis pb = _Wrapper->get();
|
||||||
NLMISC::CMatrix mat;
|
NLMISC::CMatrix mat;
|
||||||
mat.setRot(pb.X, pb.Y, pb.X ^ pb.Y);
|
mat.setRot(pb.X, pb.Y, pb.X ^ pb.Y);
|
||||||
|
@ -178,7 +184,8 @@ void CBasicEditWidget::updateUi()
|
||||||
|
|
||||||
void CBasicEditWidget::updateGraphics()
|
void CBasicEditWidget::updateGraphics()
|
||||||
{
|
{
|
||||||
if (_Wrapper == NULL) return;
|
if (_Wrapper == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
NLMISC::CVector angles(2.f * (float) NLMISC::Pi * _ui.psiSpinBox->value() / 360.f
|
NLMISC::CVector angles(2.f * (float) NLMISC::Pi * _ui.psiSpinBox->value() / 360.f
|
||||||
, 2.f * (float) NLMISC::Pi * _ui.thetaSpinBox->value() / 360.f
|
, 2.f * (float) NLMISC::Pi * _ui.thetaSpinBox->value() / 360.f
|
||||||
|
|
|
@ -31,7 +31,9 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CColorEditWidget::CColorEditWidget(QWidget *parent)
|
CColorEditWidget::CColorEditWidget(QWidget *parent)
|
||||||
: QWidget(parent), _Wrapper(NULL), _emit(true)
|
: QWidget(parent),
|
||||||
|
_Wrapper(NULL),
|
||||||
|
_emit(true)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
@ -77,15 +79,23 @@ void CColorEditWidget::updateUi()
|
||||||
_ui.gSpinBox->setValue(_Wrapper->get().G);
|
_ui.gSpinBox->setValue(_Wrapper->get().G);
|
||||||
_ui.bSpinBox->setValue(_Wrapper->get().B);
|
_ui.bSpinBox->setValue(_Wrapper->get().B);
|
||||||
_ui.aSpinBox->setValue(_Wrapper->get().A);
|
_ui.aSpinBox->setValue(_Wrapper->get().A);
|
||||||
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(), _ui.gSpinBox->value(), _ui.bSpinBox->value(), _ui.aSpinBox->value()));
|
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(),
|
||||||
|
_ui.gSpinBox->value(),
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
_ui.aSpinBox->value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CColorEditWidget::setRed(int r)
|
void CColorEditWidget::setRed(int r)
|
||||||
{
|
{
|
||||||
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(), _ui.gSpinBox->value(), _ui.bSpinBox->value(), _ui.aSpinBox->value()));
|
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(),
|
||||||
|
_ui.gSpinBox->value(),
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
_ui.aSpinBox->value()));
|
||||||
|
|
||||||
if (_emit)
|
if (_emit)
|
||||||
Q_EMIT colorChanged(NLMISC::CRGBA(r, _ui.gSpinBox->value(), _ui.bSpinBox->value(), _ui.aSpinBox->value()));
|
Q_EMIT colorChanged(NLMISC::CRGBA(r, _ui.gSpinBox->value(),
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
_ui.aSpinBox->value()));
|
||||||
|
|
||||||
if (_Wrapper == NULL)
|
if (_Wrapper == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -102,10 +112,16 @@ void CColorEditWidget::setRed(int r)
|
||||||
|
|
||||||
void CColorEditWidget::setGreen(int g)
|
void CColorEditWidget::setGreen(int g)
|
||||||
{
|
{
|
||||||
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(), _ui.gSpinBox->value(), _ui.bSpinBox->value(), _ui.aSpinBox->value()));
|
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(),
|
||||||
|
_ui.gSpinBox->value(),
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
_ui.aSpinBox->value()));
|
||||||
|
|
||||||
if (_emit)
|
if (_emit)
|
||||||
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(), g, _ui.bSpinBox->value(), _ui.aSpinBox->value()));
|
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(),
|
||||||
|
g,
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
_ui.aSpinBox->value()));
|
||||||
|
|
||||||
if (_Wrapper == NULL) return;
|
if (_Wrapper == NULL) return;
|
||||||
|
|
||||||
|
@ -120,10 +136,16 @@ void CColorEditWidget::setGreen(int g)
|
||||||
|
|
||||||
void CColorEditWidget::setBlue(int b)
|
void CColorEditWidget::setBlue(int b)
|
||||||
{
|
{
|
||||||
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(), _ui.gSpinBox->value(), _ui.bSpinBox->value(), _ui.aSpinBox->value()));
|
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(),
|
||||||
|
_ui.gSpinBox->value(),
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
_ui.aSpinBox->value()));
|
||||||
|
|
||||||
if (_emit)
|
if (_emit)
|
||||||
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(), _ui.gSpinBox->value(), b, _ui.aSpinBox->value()));
|
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(),
|
||||||
|
_ui.gSpinBox->value(),
|
||||||
|
b,
|
||||||
|
_ui.aSpinBox->value()));
|
||||||
|
|
||||||
if (_Wrapper == NULL) return;
|
if (_Wrapper == NULL) return;
|
||||||
|
|
||||||
|
@ -138,10 +160,16 @@ void CColorEditWidget::setBlue(int b)
|
||||||
|
|
||||||
void CColorEditWidget::setAlpha(int a)
|
void CColorEditWidget::setAlpha(int a)
|
||||||
{
|
{
|
||||||
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(), _ui.gSpinBox->value(), _ui.bSpinBox->value(), a));
|
_ui.graphicsWidget->setColor(QColor(_ui.rSpinBox->value(),
|
||||||
|
_ui.gSpinBox->value(),
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
a));
|
||||||
|
|
||||||
if (_emit)
|
if (_emit)
|
||||||
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(), _ui.gSpinBox->value(), _ui.bSpinBox->value(), a));
|
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(),
|
||||||
|
_ui.gSpinBox->value(),
|
||||||
|
_ui.bSpinBox->value(),
|
||||||
|
a));
|
||||||
|
|
||||||
if (_Wrapper == NULL) return;
|
if (_Wrapper == NULL) return;
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,8 @@ CRGBA CConfiguration::getValue(const CConfigFile::CVar &var, const CRGBA &defaul
|
||||||
{
|
{
|
||||||
if (var.size() >= 3)
|
if (var.size() >= 3)
|
||||||
{
|
{
|
||||||
if (var.size() > 4) nlwarning("RGBA value in config value '%s' is too long, ignoring unused values");
|
if (var.size() > 4)
|
||||||
|
nlwarning("RGBA value in config value '%s' is too long, ignoring unused values");
|
||||||
return CRGBA((uint8)var.asInt(0), (uint8)var.asInt(1), (uint8)var.asInt(2), var.size() >= 4 ? (uint8)var.asInt(3) : 255);
|
return CRGBA((uint8)var.asInt(0), (uint8)var.asInt(1), (uint8)var.asInt(2), var.size() >= 4 ? (uint8)var.asInt(3) : 255);
|
||||||
}
|
}
|
||||||
nlwarning("Invalid RGBA value in config value '%s', reverting to default { %i, %i, %i, %i }", var.Name.c_str(), (sint)defaultValue.R, (sint)defaultValue.G, (sint)defaultValue.B, (sint)defaultValue.A);
|
nlwarning("Invalid RGBA value in config value '%s', reverting to default { %i, %i, %i, %i }", var.Name.c_str(), (sint)defaultValue.R, (sint)defaultValue.G, (sint)defaultValue.B, (sint)defaultValue.A);
|
||||||
|
|
|
@ -27,7 +27,11 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CurveEditDialog::CurveEditDialog(NL3D::CPSFloatCurveFunctor *curve, CWorkspaceNode *ownerNode, QWidget *parent)
|
CurveEditDialog::CurveEditDialog(NL3D::CPSFloatCurveFunctor *curve, CWorkspaceNode *ownerNode, QWidget *parent)
|
||||||
: QDialog(parent) , _Curve(curve), _scale(1.0), _pos(0.0), _Node(ownerNode)
|
: QDialog(parent),
|
||||||
|
_scale(1.0),
|
||||||
|
_pos(0.0),
|
||||||
|
_Node(ownerNode),
|
||||||
|
_Curve(curve)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
@ -90,7 +94,7 @@ void CurveEditDialog::curveChanged(const QPolygonF &points)
|
||||||
_Curve->removeCtrlPoint(0);
|
_Curve->removeCtrlPoint(0);
|
||||||
else if (_Curve->getNumCtrlPoints() < uint(points.size()))
|
else if (_Curve->getNumCtrlPoints() < uint(points.size()))
|
||||||
_Curve->addControlPoint(NL3D::CPSFloatCurveFunctor::CCtrlPoint(1, 0.5f));
|
_Curve->addControlPoint(NL3D::CPSFloatCurveFunctor::CCtrlPoint(1, 0.5f));
|
||||||
for (int i = 0; i < points.size(); i++)
|
for (int i = 0; i < points.size(); ++i)
|
||||||
_Curve->setCtrlPoint(uint(i), NL3D::CPSFloatCurveFunctor::CCtrlPoint(points.at(i).x() / _ui.curveWidget->width(),
|
_Curve->setCtrlPoint(uint(i), NL3D::CPSFloatCurveFunctor::CCtrlPoint(points.at(i).x() / _ui.curveWidget->width(),
|
||||||
(_ui.curveWidget->height() - points.at(i).y() + _pos) / (_ui.curveWidget->height() * _scale)));
|
(_ui.curveWidget->height() - points.at(i).y() + _pos) / (_ui.curveWidget->height() * _scale)));
|
||||||
}
|
}
|
||||||
|
@ -146,7 +150,7 @@ void CurveEditDialog::setNumSamples(uint32 value)
|
||||||
void CurveEditDialog::buildPoints()
|
void CurveEditDialog::buildPoints()
|
||||||
{
|
{
|
||||||
QPolygonF points;
|
QPolygonF points;
|
||||||
for (uint i = 0; i < _Curve->getNumCtrlPoints(); i++)
|
for (uint i = 0; i < _Curve->getNumCtrlPoints(); ++i)
|
||||||
points << QPointF((_Curve->getControlPoint(i).Date * _ui.curveWidget->width()),
|
points << QPointF((_Curve->getControlPoint(i).Date * _ui.curveWidget->width()),
|
||||||
_pos + _ui.curveWidget->height() - (_scale * _Curve->getControlPoint(i).Value * _ui.curveWidget->height()));
|
_pos + _ui.curveWidget->height() - (_scale * _Curve->getControlPoint(i).Value * _ui.curveWidget->height()));
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,6 @@ public:
|
||||||
CurveEditDialog(NL3D::CPSFloatCurveFunctor *curve, CWorkspaceNode *ownerNode, QWidget *parent = 0);
|
CurveEditDialog(NL3D::CPSFloatCurveFunctor *curve, CWorkspaceNode *ownerNode, QWidget *parent = 0);
|
||||||
~CurveEditDialog();
|
~CurveEditDialog();
|
||||||
|
|
||||||
/// the scheme being edited
|
|
||||||
NL3D::CPSFloatCurveFunctor *_Curve;
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void setSmoothing(bool state);
|
void setSmoothing(bool state);
|
||||||
void setDisplayInterpolation(bool state);
|
void setDisplayInterpolation(bool state);
|
||||||
|
@ -74,8 +71,10 @@ protected:
|
||||||
|
|
||||||
CWorkspaceNode *_Node;
|
CWorkspaceNode *_Node;
|
||||||
|
|
||||||
HoverPoints *_hoverPoints;
|
/// the scheme being edited
|
||||||
|
NL3D::CPSFloatCurveFunctor *_Curve;
|
||||||
|
|
||||||
|
HoverPoints *_hoverPoints;
|
||||||
Ui::CurveEditDialog _ui;
|
Ui::CurveEditDialog _ui;
|
||||||
}; /* CurveEditDialog */
|
}; /* CurveEditDialog */
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,9 @@ namespace NLQT
|
||||||
const int max_range = 9999;
|
const int max_range = 9999;
|
||||||
|
|
||||||
CEditRangeUIntWidget::CEditRangeUIntWidget(QWidget *parent)
|
CEditRangeUIntWidget::CEditRangeUIntWidget(QWidget *parent)
|
||||||
: QWidget(parent), _Wrapper(NULL), _emit(true)
|
: QWidget(parent),
|
||||||
|
_Wrapper(NULL),
|
||||||
|
_emit(true)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ CEmitterPage::CEmitterPage(QWidget *parent)
|
||||||
|
|
||||||
// SPEED_INHERITANCE_FACTOR
|
// SPEED_INHERITANCE_FACTOR
|
||||||
_ui.speedInherFactorWidget->setRange(-1.f, 1.f);
|
_ui.speedInherFactorWidget->setRange(-1.f, 1.f);
|
||||||
//_ui.speedInherFactorWidget->setWrapper(&_SpeedInheritanceFactorWrapper);
|
|
||||||
|
|
||||||
// DELAYED_EMISSION
|
// DELAYED_EMISSION
|
||||||
_ui.delayedEmissionWidget->setRange(0.f, 10.f);
|
_ui.delayedEmissionWidget->setRange(0.f, 10.f);
|
||||||
|
|
|
@ -43,6 +43,22 @@ using namespace NL3D;
|
||||||
namespace NLQT
|
namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
|
CSlotInfo::CSlotInfo()
|
||||||
|
: Animation("empty"),
|
||||||
|
Skeleton("empty"),
|
||||||
|
Offset(0),
|
||||||
|
StartTime(0),
|
||||||
|
EndTime(0),
|
||||||
|
StartBlend(1),
|
||||||
|
EndBlend (1),
|
||||||
|
Smoothness(1),
|
||||||
|
SpeedFactor(1),
|
||||||
|
ClampMode(0),
|
||||||
|
SkeletonInverted(false),
|
||||||
|
Enable(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
CSlotInfo &CSlotInfo::operator=(const CSlotInfo &slotInfo)
|
CSlotInfo &CSlotInfo::operator=(const CSlotInfo &slotInfo)
|
||||||
{
|
{
|
||||||
if ( this != &slotInfo)
|
if ( this != &slotInfo)
|
||||||
|
@ -63,11 +79,16 @@ CSlotInfo& CSlotInfo::operator=(const CSlotInfo & slotInfo)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
CEntity::CEntity(void):
|
CEntity::CEntity(void)
|
||||||
_Name("<Unknown>"), _FileNameShape(""),
|
: _Name("<Unknown>"),
|
||||||
_FileNameSkeleton(""), _inPlace(false), _incPos(false),
|
_FileNameShape(""),
|
||||||
_Instance(NULL), _Skeleton(NULL),
|
_FileNameSkeleton(""),
|
||||||
_PlayList(NULL), _AnimationSet(NULL)
|
_inPlace(false),
|
||||||
|
_incPos(false),
|
||||||
|
_Instance(NULL),
|
||||||
|
_Skeleton(NULL),
|
||||||
|
_PlayList(NULL),
|
||||||
|
_AnimationSet(NULL)
|
||||||
{
|
{
|
||||||
_CharacterScalePos = 1;
|
_CharacterScalePos = 1;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +209,7 @@ void CEntity::update(NL3D::TAnimationTime time)
|
||||||
|
|
||||||
void CEntity::resetChannel()
|
void CEntity::resetChannel()
|
||||||
{
|
{
|
||||||
for(uint i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; i++)
|
for(uint i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; ++i)
|
||||||
_PlayList->setAnimation(i, UPlayList::empty);
|
_PlayList->setAnimation(i, UPlayList::empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +407,7 @@ void CEntity::animatePlayList(NL3D::TAnimationTime time)
|
||||||
|
|
||||||
void CEntity::animateChannelMixer()
|
void CEntity::animateChannelMixer()
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; i++)
|
for (uint i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; ++i)
|
||||||
{
|
{
|
||||||
if (_SlotInfo[i].Enable)
|
if (_SlotInfo[i].Enable)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,13 +48,7 @@ namespace NLQT
|
||||||
class CSlotInfo
|
class CSlotInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CSlotInfo ():
|
CSlotInfo();
|
||||||
Animation("empty"), Skeleton("empty"),
|
|
||||||
Offset(0), StartTime(0), EndTime(0),
|
|
||||||
StartBlend(1), EndBlend (1), Smoothness(1),
|
|
||||||
SpeedFactor(1), ClampMode(0),
|
|
||||||
SkeletonInverted(false),
|
|
||||||
Enable(true) {} ;
|
|
||||||
|
|
||||||
std::string Animation;
|
std::string Animation;
|
||||||
std::string Skeleton;
|
std::string Skeleton;
|
||||||
|
@ -104,8 +98,8 @@ public:
|
||||||
float SpeedAnim;
|
float SpeedAnim;
|
||||||
int Mode;
|
int Mode;
|
||||||
|
|
||||||
SAnimationStatus():
|
SAnimationStatus()
|
||||||
LoopAnim(false), PlayAnim(false),
|
: LoopAnim(false), PlayAnim(false),
|
||||||
CurrentTimeAnim(0), StartAnim(0),
|
CurrentTimeAnim(0), StartAnim(0),
|
||||||
EndAnim(0), SpeedAnim(1), Mode(Mode::PlayList) {}
|
EndAnim(0), SpeedAnim(1), Mode(Mode::PlayList) {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,7 +30,9 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CFollowPathDialog::CFollowPathDialog(NL3D::CPSPlaneBasisFollowSpeed *pbfs, CWorkspaceNode *ownerNode, QWidget *parent)
|
CFollowPathDialog::CFollowPathDialog(NL3D::CPSPlaneBasisFollowSpeed *pbfs, CWorkspaceNode *ownerNode, QWidget *parent)
|
||||||
: QDialog(parent), _FollowPath(pbfs), _Node(ownerNode)
|
: QDialog(parent),
|
||||||
|
_FollowPath(pbfs),
|
||||||
|
_Node(ownerNode)
|
||||||
{
|
{
|
||||||
resize(270, 90);
|
resize(270, 90);
|
||||||
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||||
|
|
|
@ -32,8 +32,6 @@ CGlobalWindDialog::CGlobalWindDialog(QWidget *parent)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
//_ui.directionWidget->setWrapper(&_DirectionWrapper);
|
|
||||||
|
|
||||||
connect(_ui.horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(setWndPower(int)));
|
connect(_ui.horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(setWndPower(int)));
|
||||||
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(updateWnd(bool)));
|
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(updateWnd(bool)));
|
||||||
}
|
}
|
||||||
|
@ -55,17 +53,6 @@ void CGlobalWindDialog::updateWnd(bool visible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_ui.horizontalSlider->setValue(int(Modules::objView().getScene()->getGlobalWindPower() * _ui.horizontalSlider->maximum()));
|
_ui.horizontalSlider->setValue(int(Modules::objView().getScene()->getGlobalWindPower() * _ui.horizontalSlider->maximum()));
|
||||||
// _ui.directionWidget->updateUi();
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
NLMISC::CVector CGlobalWindDialog::CDirectionWrapper::get(void) const
|
|
||||||
{
|
|
||||||
return Modules::objView().getScene()->getGlobalWindDirection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGlobalWindDialog::CDirectionWrapper::set(const NLMISC::CVector &d)
|
|
||||||
{
|
|
||||||
Modules::objView().getScene()->setGlobalWindDirection(d);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
} /* namespace NLQT */
|
} /* namespace NLQT */
|
|
@ -44,12 +44,6 @@ private Q_SLOTS:
|
||||||
void updateWnd(bool visible);
|
void updateWnd(bool visible);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// wrappers to tune the direction of wind
|
|
||||||
/* struct CDirectionWrapper : public IPSWrapper<NLMISC::CVector>
|
|
||||||
{
|
|
||||||
NLMISC::CVector get(void) const;
|
|
||||||
void set(const NLMISC::CVector &d);
|
|
||||||
} _DirectionWrapper;*/
|
|
||||||
|
|
||||||
Ui::CGlobalWindDialog _ui;
|
Ui::CGlobalWindDialog _ui;
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ void CGraphicsInfoWidget::paintEvent(QPaintEvent *event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for(uint k = 1; k < _verts.size(); k++)
|
for(uint k = 1; k < _verts.size(); ++k)
|
||||||
{
|
{
|
||||||
painter.drawLine(int((width() / 2.0) * (1 + _verts[k - 1].x)),
|
painter.drawLine(int((width() / 2.0) * (1 + _verts[k - 1].x)),
|
||||||
int((height() / 2.0) * (1 - _verts[k - 1].y)),
|
int((height() / 2.0) * (1 - _verts[k - 1].y)),
|
||||||
|
|
|
@ -13,9 +13,10 @@
|
||||||
#include <nel/misc/file.h>
|
#include <nel/misc/file.h>
|
||||||
#include <nel/misc/path.h>
|
#include <nel/misc/path.h>
|
||||||
#include <nel/misc/command.h>
|
#include <nel/misc/command.h>
|
||||||
#include "extension_system/iplugin_spec.h"
|
|
||||||
// Project includes
|
// Project includes
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
|
#include "extension_system/iplugin_spec.h"
|
||||||
|
|
||||||
// nel_qt log file name
|
// nel_qt log file name
|
||||||
#define NLQT_LOG_FILE "nel_qt.log"
|
#define NLQT_LOG_FILE "nel_qt.log"
|
||||||
|
@ -65,7 +66,7 @@ sint main(int argc, char **argv)
|
||||||
// use log.log if NEL_LOG_IN_FILE and NLQT_USE_LOG_LOG defined as 1
|
// use log.log if NEL_LOG_IN_FILE and NLQT_USE_LOG_LOG defined as 1
|
||||||
createDebug(NULL, NLQT_USE_LOG_LOG, false);
|
createDebug(NULL, NLQT_USE_LOG_LOG, false);
|
||||||
#if NLQT_USE_LOG
|
#if NLQT_USE_LOG
|
||||||
// create toverhex_client.log
|
// create NLQT_LOG_FILE
|
||||||
// filedisplayer only deletes the 001 etc
|
// filedisplayer only deletes the 001 etc
|
||||||
if (NLQT_ERASE_LOG && CFile::isExists(NLQT_LOG_FILE))
|
if (NLQT_ERASE_LOG && CFile::isExists(NLQT_LOG_FILE))
|
||||||
CFile::deleteFile(NLQT_LOG_FILE);
|
CFile::deleteFile(NLQT_LOG_FILE);
|
||||||
|
@ -79,7 +80,7 @@ sint main(int argc, char **argv)
|
||||||
ErrorLog->addDisplayer(NLQT::s_FileDisplayer);
|
ErrorLog->addDisplayer(NLQT::s_FileDisplayer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nlinfo("Welcome to NeL!");
|
nlinfo("Welcome to NeL Object Viewer Qt!");
|
||||||
|
|
||||||
NLMISC::CPath::remapExtension("tga", "png", true);
|
NLMISC::CPath::remapExtension("tga", "png", true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,10 +56,14 @@ namespace NLQT
|
||||||
|
|
||||||
CMainWindow::CMainWindow(QWidget *parent)
|
CMainWindow::CMainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent),
|
: QMainWindow(parent),
|
||||||
_isGraphicsInitialized(false), _isGraphicsEnabled(false),
|
_isGraphicsInitialized(false),
|
||||||
_isSoundInitialized(false), _isSoundEnabled(false),
|
_isGraphicsEnabled(false),
|
||||||
_isLandscapeInitialized(false), _isLandscapeEnabled(false),
|
_isSoundInitialized(false),
|
||||||
_GraphicsViewport(NULL), _lastDir(".")
|
_isSoundEnabled(false),
|
||||||
|
_isLandscapeInitialized(false),
|
||||||
|
_isLandscapeEnabled(false),
|
||||||
|
_GraphicsViewport(NULL),
|
||||||
|
_lastDir(".")
|
||||||
{
|
{
|
||||||
nldebug("CMainWindow::CMainWindow:");
|
nldebug("CMainWindow::CMainWindow:");
|
||||||
setObjectName("CMainWindow");
|
setObjectName("CMainWindow");
|
||||||
|
|
|
@ -34,7 +34,9 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CMorphMeshDialog::CMorphMeshDialog(CWorkspaceNode *ownerNode, NL3D::CPSConstraintMesh *cm, QWidget *parent)
|
CMorphMeshDialog::CMorphMeshDialog(CWorkspaceNode *ownerNode, NL3D::CPSConstraintMesh *cm, QWidget *parent)
|
||||||
: QDialog(parent), _Node(ownerNode), _CM(cm)
|
: QDialog(parent),
|
||||||
|
_Node(ownerNode),
|
||||||
|
_CM(cm)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,9 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CMultiTexDialog::CMultiTexDialog(CWorkspaceNode *ownerNode, NL3D::CPSMultiTexturedParticle *mtp, QWidget *parent)
|
CMultiTexDialog::CMultiTexDialog(CWorkspaceNode *ownerNode, NL3D::CPSMultiTexturedParticle *mtp, QWidget *parent)
|
||||||
: QDialog(parent), _Node(ownerNode), _MTP(mtp)
|
: QDialog(parent),
|
||||||
|
_Node(ownerNode),
|
||||||
|
_MTP(mtp)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#include "ui_multi_tex_form.h"
|
#include "ui_multi_tex_form.h"
|
||||||
|
|
||||||
|
|
||||||
// STL includes
|
// STL includes
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
|
|
|
@ -54,11 +54,13 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CObjectViewer::CObjectViewer()
|
CObjectViewer::CObjectViewer()
|
||||||
: _Driver(NULL), _TextContext(NULL),
|
: _Driver(NULL),
|
||||||
|
_TextContext(NULL),
|
||||||
_phi(0), _psi(0),_dist(20),
|
_phi(0), _psi(0),_dist(20),
|
||||||
_CameraFocal(75),
|
_CameraFocal(75),
|
||||||
_CurrentInstance(""),
|
_CurrentInstance(""),
|
||||||
_BloomEffect(false), _Scene(0)
|
_BloomEffect(false),
|
||||||
|
_Scene(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ public:
|
||||||
|
|
||||||
/// Get current instance from the scene
|
/// Get current instance from the scene
|
||||||
/// @return name current instance, "" if no instance edited
|
/// @return name current instance, "" if no instance edited
|
||||||
const std::string& getCurrentObject()
|
std::string getCurrentObject() const
|
||||||
{
|
{
|
||||||
return _CurrentInstance;
|
return _CurrentInstance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,20 @@
|
||||||
namespace NLQT
|
namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CParticleEditor::CParticleEditor(void):
|
CParticleEditor::CParticleEditor(void)
|
||||||
_ActiveNode(NULL), _State(State::Stopped), _Speed(1.0f),
|
: _ActiveNode(NULL),
|
||||||
_AutoRepeat(false), _DisplayBBox(false),
|
_State(State::Stopped),
|
||||||
_DisplayHelpers(false), _AutoUpdateBBox(false),
|
_Speed(1.0f),
|
||||||
_EmptyBBox(true), _PW(NULL),
|
_AutoRepeat(false),
|
||||||
_Driver(NULL), _Scene(NULL),
|
_DisplayBBox(false),
|
||||||
_FontManager(NULL), _FontGen(NULL)
|
_DisplayHelpers(false),
|
||||||
|
_AutoUpdateBBox(false),
|
||||||
|
_EmptyBBox(true),
|
||||||
|
_PW(NULL),
|
||||||
|
_Driver(NULL),
|
||||||
|
_Scene(NULL),
|
||||||
|
_FontManager(NULL),
|
||||||
|
_FontGen(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +132,7 @@ void CParticleEditor::loadWorkspace(const std::string &fullPath)
|
||||||
}
|
}
|
||||||
if (node->isLoaded() && !firstLoadedNode)
|
if (node->isLoaded() && !firstLoadedNode)
|
||||||
firstLoadedNode = node;
|
firstLoadedNode = node;
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
closeWorkspace();
|
closeWorkspace();
|
||||||
_PW = newPW.release();
|
_PW = newPW.release();
|
||||||
|
@ -172,7 +179,7 @@ void CParticleEditor::saveWorkspaceContent()
|
||||||
if (node->isModified())
|
if (node->isModified())
|
||||||
node->savePS();
|
node->savePS();
|
||||||
node->setModified(false);
|
node->setModified(false);
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +249,7 @@ void CParticleEditor::startMultiple()
|
||||||
CWorkspaceNode *node = (*itr);
|
CWorkspaceNode *node = (*itr);
|
||||||
if (node->isLoaded())
|
if (node->isLoaded())
|
||||||
if (checkHasLoop(*node)) return;
|
if (checkHasLoop(*node)) return;
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
|
|
||||||
itr = _PW->getNodeList().begin();
|
itr = _PW->getNodeList().begin();
|
||||||
|
@ -257,7 +264,7 @@ void CParticleEditor::startMultiple()
|
||||||
|
|
||||||
_PlayingNodes.push_back(node);
|
_PlayingNodes.push_back(node);
|
||||||
}
|
}
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -405,7 +412,7 @@ void CParticleEditor::update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
if (fxStarted && allFXFinished)
|
if (fxStarted && allFXFinished)
|
||||||
restartAllFX();
|
restartAllFX();
|
||||||
|
@ -440,7 +447,7 @@ void CParticleEditor::update()
|
||||||
node->getPSModel()->hide();
|
node->getPSModel()->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,7 +488,7 @@ void CParticleEditor::setSpeed(float value)
|
||||||
CWorkspaceNode *node = (*itr);
|
CWorkspaceNode *node = (*itr);
|
||||||
if (node->isLoaded())
|
if (node->isLoaded())
|
||||||
node->getPSModel()->setEllapsedTimeRatio(value);
|
node->getPSModel()->setEllapsedTimeRatio(value);
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,14 +56,16 @@ CWorkspaceNode::~CWorkspaceNode()
|
||||||
void CWorkspaceNode::memorizeState()
|
void CWorkspaceNode::memorizeState()
|
||||||
{
|
{
|
||||||
nlassert(_WS);
|
nlassert(_WS);
|
||||||
if (!_PS) return;
|
if (!_PS)
|
||||||
|
return;
|
||||||
_InitialPos.copySystemInitialPos(_PS);
|
_InitialPos.copySystemInitialPos(_PS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWorkspaceNode::restoreState()
|
void CWorkspaceNode::restoreState()
|
||||||
{
|
{
|
||||||
nlassert(_WS);
|
nlassert(_WS);
|
||||||
if (!_PS) return;
|
if (!_PS)
|
||||||
|
return;
|
||||||
_InitialPos.restoreSystem();
|
_InitialPos.restoreSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +80,8 @@ void CWorkspaceNode::stickPSToSkeleton(NL3D::CSkeletonModel *skel,
|
||||||
const std::string &parentBoneName)
|
const std::string &parentBoneName)
|
||||||
{
|
{
|
||||||
nlassert(_WS);
|
nlassert(_WS);
|
||||||
if (!_PSM) return;
|
if (!_PSM)
|
||||||
|
return;
|
||||||
unstickPSFromSkeleton();
|
unstickPSFromSkeleton();
|
||||||
_ParentSkelName = parentSkelName;
|
_ParentSkelName = parentSkelName;
|
||||||
_ParentBoneName = parentBoneName;
|
_ParentBoneName = parentBoneName;
|
||||||
|
@ -308,7 +311,7 @@ CParticleWorkspace::CParticleWorkspace()
|
||||||
|
|
||||||
CParticleWorkspace::~CParticleWorkspace()
|
CParticleWorkspace::~CParticleWorkspace()
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < _Nodes.size(); i++)
|
for (size_t i = 0; i < _Nodes.size(); ++i)
|
||||||
delete _Nodes[i];
|
delete _Nodes[i];
|
||||||
_Nodes.clear();
|
_Nodes.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -373,7 +373,7 @@ bool CParticleTreeModel::insertRows(CWorkspaceNode *node, int position, const QM
|
||||||
if (node->isLoaded())
|
if (node->isLoaded())
|
||||||
{
|
{
|
||||||
QModelIndex indexPS = index(item->childCount() - 1, 0, parent);
|
QModelIndex indexPS = index(item->childCount() - 1, 0, parent);
|
||||||
for (uint k = 0; k < node->getPSPointer()->getNbProcess(); k++)
|
for (uint k = 0; k < node->getPSPointer()->getNbProcess(); ++k)
|
||||||
{
|
{
|
||||||
NL3D::CPSLocated *loc = dynamic_cast<NL3D::CPSLocated *>(node->getPSPointer()->getProcess(k));
|
NL3D::CPSLocated *loc = dynamic_cast<NL3D::CPSLocated *>(node->getPSPointer()->getProcess(k));
|
||||||
insertRows(loc, k, indexPS);
|
insertRows(loc, k, indexPS);
|
||||||
|
@ -456,12 +456,12 @@ void CParticleTreeModel::rebuildLocatedInstance(const QModelIndex &parent)
|
||||||
{
|
{
|
||||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(parent.internalPointer());
|
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(parent.internalPointer());
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for (int i = 0; i < item->childCount(); i++)
|
for (int i = 0; i < item->childCount(); ++i)
|
||||||
{
|
{
|
||||||
if (item->child(i)->itemType() == ItemType::LocatedInstance)
|
if (item->child(i)->itemType() == ItemType::LocatedInstance)
|
||||||
{
|
{
|
||||||
item->child(i)->setLocatedInstanceIndex(k);
|
item->child(i)->setLocatedInstanceIndex(k);
|
||||||
k++;
|
++k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -491,7 +491,7 @@ void CParticleTreeModel::setupModelFromWorkSpace()
|
||||||
|
|
||||||
QModelIndex rootIndex = index(0, 0);
|
QModelIndex rootIndex = index(0, 0);
|
||||||
uint numNode = workspace->getNumNode();
|
uint numNode = workspace->getNumNode();
|
||||||
for (uint i = 0; i < numNode; i++)
|
for (uint i = 0; i < numNode; ++i)
|
||||||
insertRows(workspace->getNode(i), i, rootIndex);
|
insertRows(workspace->getNode(i), i, rootIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,8 @@ struct Action
|
||||||
static std::map<std::string, uint> _PSElementIdentifiers;
|
static std::map<std::string, uint> _PSElementIdentifiers;
|
||||||
|
|
||||||
CParticleWorkspaceDialog::CParticleWorkspaceDialog(QWidget *parent)
|
CParticleWorkspaceDialog::CParticleWorkspaceDialog(QWidget *parent)
|
||||||
: QDockWidget(parent), _currentItem(NULL)
|
: QDockWidget(parent),
|
||||||
|
_currentItem(NULL)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,8 @@ namespace NLQT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class CWorkspacePage
|
@class CWorkspacePage
|
||||||
@brief Page for QStackWidget, to particles workspace operation (new/load/save workspace, create/insert/remove all particles system to workspace)
|
@brief Page for QStackWidget, to particles workspace operation (new/load/save workspace,
|
||||||
|
create/insert/remove all particles system to workspace)
|
||||||
*/
|
*/
|
||||||
class CWorkspacePage: public QWidget
|
class CWorkspacePage: public QWidget
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,8 @@ bool MyPlugin::initialize(NLQT::IPluginManager *pluginManager, QString *errorStr
|
||||||
void MyPlugin::extensionsInitialized()
|
void MyPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
QMenu *helpMenu = qobject_cast<QMenu *>(objectByName("ovqt.Menu.Help"));
|
QMenu *helpMenu = qobject_cast<QMenu *>(objectByName("ovqt.Menu.Help"));
|
||||||
|
nlassert(helpMenu);
|
||||||
|
|
||||||
helpMenu->addSeparator();
|
helpMenu->addSeparator();
|
||||||
QAction *newAction = helpMenu->addAction("MyPlugin");
|
QAction *newAction = helpMenu->addAction("MyPlugin");
|
||||||
|
|
||||||
|
@ -41,6 +43,8 @@ void MyPlugin::extensionsInitialized()
|
||||||
void MyPlugin::execMessageBox()
|
void MyPlugin::execMessageBox()
|
||||||
{
|
{
|
||||||
QMainWindow *wnd = qobject_cast<QMainWindow *>(objectByName("CMainWindow"));
|
QMainWindow *wnd = qobject_cast<QMainWindow *>(objectByName("CMainWindow"));
|
||||||
|
nlassert(wnd);
|
||||||
|
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setText(wnd->objectName() + QString(": width=%1,height=%2").arg(wnd->width()).arg(wnd->height()));
|
msgBox.setText(wnd->objectName() + QString(": width=%1,height=%2").arg(wnd->width()).arg(wnd->height()));
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef PS_MOVER_PAGE_H
|
#ifndef PS_MOVER_PAGE_H
|
||||||
#define PS_MOVER_PAGE_H
|
#define PS_MOVER_PAGE_H
|
||||||
|
|
||||||
|
|
||||||
#include <nel/misc/types_nl.h>
|
#include <nel/misc/types_nl.h>
|
||||||
#include "ui_ps_mover_form.h"
|
#include "ui_ps_mover_form.h"
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
// STL includes
|
// STL includes
|
||||||
|
|
||||||
// NeL includes
|
// NeL includes
|
||||||
#include <nel/misc/config_file.h>
|
|
||||||
#include <nel/misc/rgba.h>
|
#include <nel/misc/rgba.h>
|
||||||
|
|
||||||
// Project includes
|
// Project includes
|
||||||
|
@ -49,6 +48,7 @@ public:
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void apply();
|
void apply();
|
||||||
void setColor();
|
void setColor();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NLMISC::CRGBA colorFog;
|
NLMISC::CRGBA colorFog;
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ void CSkeletonScaleDialog::clickMirrorSelected()
|
||||||
|
|
||||||
// for each bone selected
|
// for each bone selected
|
||||||
bool change= false;
|
bool change= false;
|
||||||
for(uint i=0; i<_Bones.size(); i++)
|
for(uint i=0; i < _Bones.size(); ++i)
|
||||||
{
|
{
|
||||||
CBoneMirror &bone= _Bones[i];
|
CBoneMirror &bone= _Bones[i];
|
||||||
if(bone.Selected)
|
if(bone.Selected)
|
||||||
|
@ -468,7 +468,7 @@ void CSkeletonScaleDialog::applyMirrorToSkeleton()
|
||||||
if(!_Skeleton.empty())
|
if(!_Skeleton.empty())
|
||||||
{
|
{
|
||||||
nlassert(_Skeleton.getNumBones() == _Bones.size());
|
nlassert(_Skeleton.getNumBones() == _Bones.size());
|
||||||
for(uint i = 0; i < _Bones.size(); i++)
|
for(uint i = 0; i < _Bones.size(); ++i)
|
||||||
{
|
{
|
||||||
// unmul from precision
|
// unmul from precision
|
||||||
NLMISC::CVector boneScale = _Bones[i].BoneScale / ssd_scale_precision;
|
NLMISC::CVector boneScale = _Bones[i].BoneScale / ssd_scale_precision;
|
||||||
|
@ -484,7 +484,7 @@ void CSkeletonScaleDialog::applySkeletonToMirror()
|
||||||
if(!_Skeleton.empty())
|
if(!_Skeleton.empty())
|
||||||
{
|
{
|
||||||
nlassert(_Skeleton.getNumBones() == _Bones.size());
|
nlassert(_Skeleton.getNumBones() == _Bones.size());
|
||||||
for(uint i = 0; i < _Skeleton.getNumBones(); i++)
|
for(uint i = 0; i < _Skeleton.getNumBones(); ++i)
|
||||||
{
|
{
|
||||||
// mul by precision, and round
|
// mul by precision, and round
|
||||||
_Bones[i].SkinScale = _Skeleton.getBone(i).getSkinScale() * ssd_scale_precision;
|
_Bones[i].SkinScale = _Skeleton.getBone(i).getSkinScale() * ssd_scale_precision;
|
||||||
|
@ -517,7 +517,7 @@ void CSkeletonScaleDialog::applySelectionToView()
|
||||||
{
|
{
|
||||||
_ui.treeView->blockSignals(true);
|
_ui.treeView->blockSignals(true);
|
||||||
CSkeletonTreeModel *model = Modules::mainWin().getSkeletonModel();
|
CSkeletonTreeModel *model = Modules::mainWin().getSkeletonModel();
|
||||||
for(uint i = 0; i < _Bones.size(); i++)
|
for(uint i = 0; i < _Bones.size(); ++i)
|
||||||
{
|
{
|
||||||
if (_Bones[i].Selected)
|
if (_Bones[i].Selected)
|
||||||
_ui.treeView->setCurrentIndex(model->getIndexFromId(i, model->index(0, 0)));
|
_ui.treeView->setCurrentIndex(model->getIndexFromId(i, model->index(0, 0)));
|
||||||
|
@ -615,7 +615,7 @@ bool CSkeletonScaleDialog::saveSkelScaleInStream(NLMISC::IStream &f)
|
||||||
// Copies bone scales from the model
|
// Copies bone scales from the model
|
||||||
std::vector<CBoneScaleInfo> boneScales;
|
std::vector<CBoneScaleInfo> boneScales;
|
||||||
boneScales.resize(_Skeleton.getNumBones());
|
boneScales.resize(_Skeleton.getNumBones());
|
||||||
for(uint i = 0; i < boneScales.size(); i++)
|
for(uint i = 0; i < boneScales.size(); ++i)
|
||||||
{
|
{
|
||||||
NL3D::CBone *bone= _Skeleton.getBone(i).getObjectPtr();
|
NL3D::CBone *bone= _Skeleton.getBone(i).getObjectPtr();
|
||||||
CBoneScaleInfo &boneScale= boneScales[i];
|
CBoneScaleInfo &boneScale= boneScales[i];
|
||||||
|
@ -651,7 +651,7 @@ bool CSkeletonScaleDialog::loadSkelScaleFromStream(NLMISC::IStream &f)
|
||||||
f.serialCont(boneScales);
|
f.serialCont(boneScales);
|
||||||
|
|
||||||
// apply to the current skeleton
|
// apply to the current skeleton
|
||||||
for(uint i = 0; i < boneScales.size(); i++)
|
for(uint i = 0; i < boneScales.size(); ++i)
|
||||||
{
|
{
|
||||||
sint32 boneId = _Skeleton.getBoneIdByName(boneScales[i].Name);
|
sint32 boneId = _Skeleton.getBoneIdByName(boneScales[i].Name);
|
||||||
if(boneId >= 0 && boneId < (sint32)_Skeleton.getNumBones())
|
if(boneId >= 0 && boneId < (sint32)_Skeleton.getNumBones())
|
||||||
|
@ -689,7 +689,7 @@ void CSkeletonScaleDialog::pushUndoState(const TBoneMirrorArray &precState, bool
|
||||||
// test if real change
|
// test if real change
|
||||||
nlassert(precState.size() == _Bones.size());
|
nlassert(precState.size() == _Bones.size());
|
||||||
bool change = false;
|
bool change = false;
|
||||||
for(uint i = 0; i < _Bones.size(); i++)
|
for(uint i = 0; i < _Bones.size(); ++i)
|
||||||
{
|
{
|
||||||
if( _Bones[i].BoneScale!=precState[i].BoneScale ||
|
if( _Bones[i].BoneScale!=precState[i].BoneScale ||
|
||||||
_Bones[i].SkinScale!=precState[i].SkinScale ||
|
_Bones[i].SkinScale!=precState[i].SkinScale ||
|
||||||
|
|
|
@ -151,7 +151,7 @@ void CSkeletonTreeModel::rebuildModel()
|
||||||
|
|
||||||
CSkeletonTreeItem *parentItem = _rootItem;
|
CSkeletonTreeItem *parentItem = _rootItem;
|
||||||
|
|
||||||
for (uint i = 0; i < skel.getNumBones(); i++)
|
for (uint i = 0; i < skel.getNumBones(); ++i)
|
||||||
{
|
{
|
||||||
NL3D::UBone bone = skel.getBone(i);
|
NL3D::UBone bone = skel.getBone(i);
|
||||||
sint32 parentId = bone.getObjectPtr()->getFatherId();
|
sint32 parentId = bone.getObjectPtr()->getFatherId();
|
||||||
|
@ -184,7 +184,7 @@ QModelIndex CSkeletonTreeModel::getIndexFromId(sint id, const QModelIndex &paren
|
||||||
QModelIndex currentIndex = parent;
|
QModelIndex currentIndex = parent;
|
||||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(parent.internalPointer());
|
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(parent.internalPointer());
|
||||||
if (item->getId() != id)
|
if (item->getId() != id)
|
||||||
for (int i = 0; i < item->childCount(); i++)
|
for (int i = 0; i < item->childCount(); ++i)
|
||||||
{
|
{
|
||||||
currentIndex = getIndexFromId(id, index(i, 0, parent));
|
currentIndex = getIndexFromId(id, index(i, 0, parent));
|
||||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(currentIndex.internalPointer());
|
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(currentIndex.internalPointer());
|
||||||
|
|
|
@ -33,7 +33,9 @@ namespace NLQT
|
||||||
|
|
||||||
CSlotGroupBox::CSlotGroupBox(QWidget *parent)
|
CSlotGroupBox::CSlotGroupBox(QWidget *parent)
|
||||||
: QGroupBox(parent),
|
: QGroupBox(parent),
|
||||||
_animName("empty"), _skelName("empty"), _numSlot(0)
|
_animName("empty"),
|
||||||
|
_skelName("empty"),
|
||||||
|
_numSlot(0)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
@ -239,7 +241,7 @@ CSlotManagerDialog::CSlotManagerDialog(QWidget *parent)
|
||||||
_tabWidget->setObjectName(QString::fromUtf8("_tabWidget"));
|
_tabWidget->setObjectName(QString::fromUtf8("_tabWidget"));
|
||||||
_tabWidget->setTabPosition(QTabWidget::East);
|
_tabWidget->setTabPosition(QTabWidget::East);
|
||||||
|
|
||||||
for (int i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; i++)
|
for (int i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; ++i)
|
||||||
{
|
{
|
||||||
_tabs[i] = new QWidget();
|
_tabs[i] = new QWidget();
|
||||||
_tabs[i]->setObjectName(QString::fromUtf8("_tab%1").arg(i));
|
_tabs[i]->setObjectName(QString::fromUtf8("_tab%1").arg(i));
|
||||||
|
@ -276,7 +278,7 @@ CSlotManagerDialog::~CSlotManagerDialog()
|
||||||
|
|
||||||
void CSlotManagerDialog::updateUiSlots()
|
void CSlotManagerDialog::updateUiSlots()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; i++)
|
for (int i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; ++i)
|
||||||
{
|
{
|
||||||
_slotGroupBoxs[i]->updateUi();
|
_slotGroupBoxs[i]->updateUi();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,9 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CSpinnerDialog::CSpinnerDialog(NL3D::CPSBasisSpinner *sf, CWorkspaceNode *ownerNode, QWidget *parent)
|
CSpinnerDialog::CSpinnerDialog(NL3D::CPSBasisSpinner *sf, CWorkspaceNode *ownerNode, QWidget *parent)
|
||||||
: QDialog(parent), _Node(ownerNode), _BasicSpinner(sf)
|
: QDialog(parent),
|
||||||
|
_Node(ownerNode),
|
||||||
|
_BasicSpinner(sf)
|
||||||
{
|
{
|
||||||
nlassert(_BasicSpinner);
|
nlassert(_BasicSpinner);
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ CGradientDialog::CGradientDialog(CWorkspaceNode *ownerNode,
|
||||||
sizePolicy.setHeightForWidth(_listWidget->sizePolicy().hasHeightForWidth());
|
sizePolicy.setHeightForWidth(_listWidget->sizePolicy().hasHeightForWidth());
|
||||||
_listWidget->setSizePolicy(sizePolicy);
|
_listWidget->setSizePolicy(sizePolicy);
|
||||||
//_listWidget->setIconSize(QSize(16, 16));
|
//_listWidget->setIconSize(QSize(16, 16));
|
||||||
_listWidget->setMaximumSize(QSize(175, 16777215));
|
_listWidget->setMaximumSize(QSize(185, 16777215));
|
||||||
_gridLayout->addWidget(_listWidget, 0, 0, 9, 1);
|
_gridLayout->addWidget(_listWidget, 0, 0, 9, 1);
|
||||||
|
|
||||||
_horizontalLayout = new QHBoxLayout();
|
_horizontalLayout = new QHBoxLayout();
|
||||||
|
|
|
@ -208,7 +208,7 @@ void CVegetableApperancePage::getFromListColors()
|
||||||
{
|
{
|
||||||
int i = items.indexOf(item);
|
int i = items.indexOf(item);
|
||||||
|
|
||||||
NL3D::CVegetable *otherVegetable = Modules::veget().getVegetable(i)->Vegetable;
|
NL3D::CVegetable *otherVegetable = Modules::veget().getVegetable(i)->_vegetable;
|
||||||
|
|
||||||
_Vegetable->Color.Gradients = otherVegetable->Color.Gradients;
|
_Vegetable->Color.Gradients = otherVegetable->Color.Gradients;
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ CVegetableDensityPage::CVegetableDensityPage(QWidget *parent)
|
||||||
_ui.maxDensityWidget->setRange(0, NL_VEGETABLE_EDIT_DEFAULT_MAX_DENSITY);
|
_ui.maxDensityWidget->setRange(0, NL_VEGETABLE_EDIT_DEFAULT_MAX_DENSITY);
|
||||||
_ui.maxDensityWidget->enableLowerBound(0, false);
|
_ui.maxDensityWidget->enableLowerBound(0, false);
|
||||||
|
|
||||||
|
|
||||||
connect(_ui.browseShapePushButton, SIGNAL(clicked()), this, SLOT(browseShapeVeget()));
|
connect(_ui.browseShapePushButton, SIGNAL(clicked()), this, SLOT(browseShapeVeget()));
|
||||||
connect(_ui.distanceSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setDistanceOfCreat(int)));
|
connect(_ui.distanceSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setDistanceOfCreat(int)));
|
||||||
connect(_ui.densityGroupBox, SIGNAL(noiseValueChanged(NLMISC::CNoiseValue)), this, SLOT(setDensity(NLMISC::CNoiseValue)));
|
connect(_ui.densityGroupBox, SIGNAL(noiseValueChanged(NLMISC::CNoiseValue)), this, SLOT(setDensity(NLMISC::CNoiseValue)));
|
||||||
|
|
|
@ -151,7 +151,7 @@ void CVegetableDialog::addVegetList()
|
||||||
|
|
||||||
// update view
|
// update view
|
||||||
QListWidgetItem *item = new QListWidgetItem(_ui.listWidget);
|
QListWidgetItem *item = new QListWidgetItem(_ui.listWidget);
|
||||||
item->setText(QString(Modules::veget().getVegetable(id)->VegetableName.c_str()));
|
item->setText(QString(Modules::veget().getVegetable(id)->_vegetableName.c_str()));
|
||||||
|
|
||||||
// update 3D view
|
// update 3D view
|
||||||
Modules::veget().refreshVegetableDisplay();
|
Modules::veget().refreshVegetableDisplay();
|
||||||
|
@ -167,7 +167,7 @@ void CVegetableDialog::removeVegetList()
|
||||||
QListWidgetItem *item = _ui.listWidget->takeItem(id);
|
QListWidgetItem *item = _ui.listWidget->takeItem(id);
|
||||||
delete item;
|
delete item;
|
||||||
|
|
||||||
id--;
|
--id;
|
||||||
|
|
||||||
_ui.listWidget->setCurrentRow(id);
|
_ui.listWidget->setCurrentRow(id);
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ void CVegetableDialog::insVegetList()
|
||||||
|
|
||||||
// update view
|
// update view
|
||||||
QListWidgetItem *item = new QListWidgetItem();
|
QListWidgetItem *item = new QListWidgetItem();
|
||||||
item->setText(QString(Modules::veget().getVegetable(id)->VegetableName.c_str()));
|
item->setText(QString(Modules::veget().getVegetable(id)->_vegetableName.c_str()));
|
||||||
_ui.listWidget->insertItem(id, item);
|
_ui.listWidget->insertItem(id, item);
|
||||||
|
|
||||||
// update 3D view
|
// update 3D view
|
||||||
|
@ -239,7 +239,7 @@ void CVegetableDialog::loadVegetdesc()
|
||||||
|
|
||||||
// update view
|
// update view
|
||||||
QListWidgetItem *item = new QListWidgetItem(_ui.listWidget);
|
QListWidgetItem *item = new QListWidgetItem(_ui.listWidget);
|
||||||
item->setText(QString(Modules::veget().getVegetable(id)->VegetableName.c_str()));
|
item->setText(QString(Modules::veget().getVegetable(id)->_vegetableName.c_str()));
|
||||||
|
|
||||||
// update 3D view
|
// update 3D view
|
||||||
Modules::veget().refreshVegetableDisplay();
|
Modules::veget().refreshVegetableDisplay();
|
||||||
|
@ -261,7 +261,7 @@ void CVegetableDialog::saveVegetdesc()
|
||||||
|
|
||||||
CVegetableNode *vegetNode = Modules::veget().getVegetable(id);
|
CVegetableNode *vegetNode = Modules::veget().getVegetable(id);
|
||||||
|
|
||||||
QString oldFileName = QString(vegetNode->VegetableName.c_str()) + ".vegetdesc";
|
QString oldFileName = QString(vegetNode->_vegetableName.c_str()) + ".vegetdesc";
|
||||||
|
|
||||||
// Then try to save it.
|
// Then try to save it.
|
||||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save Vegetable Descriptor"),
|
QString fileName = QFileDialog::getSaveFileName(this, tr("Save Vegetable Descriptor"),
|
||||||
|
@ -277,7 +277,7 @@ void CVegetableDialog::saveVegetdesc()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// save the vegetable
|
// save the vegetable
|
||||||
f.serial(*vegetNode->Vegetable);
|
f.serial(*vegetNode->_vegetable);
|
||||||
}
|
}
|
||||||
catch(NLMISC::EStream &e)
|
catch(NLMISC::EStream &e)
|
||||||
{
|
{
|
||||||
|
@ -299,7 +299,7 @@ void CVegetableDialog::setCurrentItem(int row)
|
||||||
{
|
{
|
||||||
NL3D::CVegetable *veget = NULL;
|
NL3D::CVegetable *veget = NULL;
|
||||||
if (row != -1)
|
if (row != -1)
|
||||||
veget = Modules::veget().getVegetable(row)->Vegetable;
|
veget = Modules::veget().getVegetable(row)->_vegetable;
|
||||||
_ui.densityPage->setVegetableToEdit(veget);
|
_ui.densityPage->setVegetableToEdit(veget);
|
||||||
_ui.appearancePage->setVegetableToEdit(veget);
|
_ui.appearancePage->setVegetableToEdit(veget);
|
||||||
_ui.scalePage->setVegetableToEdit(veget);
|
_ui.scalePage->setVegetableToEdit(veget);
|
||||||
|
|
|
@ -143,7 +143,7 @@ bool CVegetableEditor::createVegetableLandscape()
|
||||||
// count nbText to load.
|
// count nbText to load.
|
||||||
sint ts;
|
sint ts;
|
||||||
sint nbTextTotal = 0;
|
sint nbTextTotal = 0;
|
||||||
for (ts=0; ts < _VegetableLandscape->Landscape.TileBank.getTileSetCount (); ts++)
|
for (ts=0; ts < _VegetableLandscape->Landscape.TileBank.getTileSetCount (); ++ts)
|
||||||
{
|
{
|
||||||
NL3D::CTileSet *tileSet =_VegetableLandscape->Landscape.TileBank.getTileSet (ts);
|
NL3D::CTileSet *tileSet =_VegetableLandscape->Landscape.TileBank.getTileSet (ts);
|
||||||
nbTextTotal += tileSet->getNumTile128();
|
nbTextTotal += tileSet->getNumTile128();
|
||||||
|
@ -153,7 +153,7 @@ bool CVegetableEditor::createVegetableLandscape()
|
||||||
|
|
||||||
// load.
|
// load.
|
||||||
sint nbTextDone= 0;
|
sint nbTextDone= 0;
|
||||||
for (ts=0; ts < _VegetableLandscape->Landscape.TileBank.getTileSetCount (); ts++)
|
for (ts=0; ts < _VegetableLandscape->Landscape.TileBank.getTileSetCount (); ++ts)
|
||||||
{
|
{
|
||||||
NL3D::CTileSet *tileSet=_VegetableLandscape->Landscape.TileBank.getTileSet (ts);
|
NL3D::CTileSet *tileSet=_VegetableLandscape->Landscape.TileBank.getTileSet (ts);
|
||||||
sint tl;
|
sint tl;
|
||||||
|
@ -299,7 +299,7 @@ void CVegetableEditor::refreshVegetableLandscape(const NL3D::CTileVegetableDesc
|
||||||
_VegetableLandscape->Landscape.enableVegetable(false);
|
_VegetableLandscape->Landscape.enableVegetable(false);
|
||||||
|
|
||||||
// Then change all the tileSet of all the TileBanks.
|
// Then change all the tileSet of all the TileBanks.
|
||||||
for (sint ts=0; ts<_VegetableLandscape->Landscape.TileBank.getTileSetCount (); ts++)
|
for (sint ts=0; ts<_VegetableLandscape->Landscape.TileBank.getTileSetCount (); ++ts)
|
||||||
{
|
{
|
||||||
NL3D::CTileSet *tileSet=_VegetableLandscape->Landscape.TileBank.getTileSet (ts);
|
NL3D::CTileSet *tileSet=_VegetableLandscape->Landscape.TileBank.getTileSet (ts);
|
||||||
// change the vegetableTileDesc of this tileSet.
|
// change the vegetableTileDesc of this tileSet.
|
||||||
|
@ -315,21 +315,30 @@ void CVegetableEditor::setVegetableWindPower(float w)
|
||||||
{
|
{
|
||||||
_VegetableWindPower= w;
|
_VegetableWindPower= w;
|
||||||
if(_VegetableLandscape)
|
if(_VegetableLandscape)
|
||||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, _VegetableWindFreq, _VegetableWindPower, _VegetableWindBendMin);
|
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||||
|
_VegetableWindFreq,
|
||||||
|
_VegetableWindPower,
|
||||||
|
_VegetableWindBendMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVegetableEditor::setVegetableWindBendStart(float w)
|
void CVegetableEditor::setVegetableWindBendStart(float w)
|
||||||
{
|
{
|
||||||
_VegetableWindBendMin= w;
|
_VegetableWindBendMin= w;
|
||||||
if(_VegetableLandscape)
|
if(_VegetableLandscape)
|
||||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, _VegetableWindFreq, _VegetableWindPower, _VegetableWindBendMin);
|
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||||
|
_VegetableWindFreq,
|
||||||
|
_VegetableWindPower,
|
||||||
|
_VegetableWindBendMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVegetableEditor::setVegetableWindFrequency(float w)
|
void CVegetableEditor::setVegetableWindFrequency(float w)
|
||||||
{
|
{
|
||||||
_VegetableWindFreq= w;
|
_VegetableWindFreq= w;
|
||||||
if(_VegetableLandscape)
|
if(_VegetableLandscape)
|
||||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, _VegetableWindFreq, _VegetableWindPower, _VegetableWindBendMin);
|
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||||
|
_VegetableWindFreq,
|
||||||
|
_VegetableWindPower,
|
||||||
|
_VegetableWindBendMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVegetableEditor::snapToGroundVegetableLandscape(bool enable)
|
void CVegetableEditor::snapToGroundVegetableLandscape(bool enable)
|
||||||
|
@ -379,7 +388,7 @@ void CVegetableEditor::getListVegetables(std::vector<std::string> &listVeget)
|
||||||
{
|
{
|
||||||
listVeget.clear();
|
listVeget.clear();
|
||||||
for (size_t i = 0; i < _Vegetables.size(); i++)
|
for (size_t i = 0; i < _Vegetables.size(); i++)
|
||||||
listVeget.push_back(_Vegetables[i].VegetableName);
|
listVeget.push_back(_Vegetables[i]._vegetableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CVegetableEditor::loadVegetableSet(NL3D::CTileVegetableDesc &vegetSet, std::string fileName)
|
bool CVegetableEditor::loadVegetableSet(NL3D::CTileVegetableDesc &vegetSet, std::string fileName)
|
||||||
|
@ -416,16 +425,16 @@ void CVegetableEditor::buildVegetableSet(NL3D::CTileVegetableDesc &vegetSet, boo
|
||||||
|
|
||||||
// build the list.
|
// build the list.
|
||||||
std::vector<NL3D::CVegetable> vegetables;
|
std::vector<NL3D::CVegetable> vegetables;
|
||||||
for(uint i = 0; i < _Vegetables.size(); i++)
|
for(uint i = 0; i < _Vegetables.size(); ++i)
|
||||||
{
|
{
|
||||||
// if don't want to keep <default> ShapeNames, skip them.
|
// if don't want to keep <default> ShapeNames, skip them.
|
||||||
if(!keepDefaultShapeName && _Vegetables[i].Vegetable->ShapeName == "")
|
if(!keepDefaultShapeName && _Vegetables[i]._vegetable->ShapeName == "")
|
||||||
continue;
|
continue;
|
||||||
// if don't want to keep hiden vegetables, skip them.
|
// if don't want to keep hiden vegetables, skip them.
|
||||||
if(!keepHiden && !_Vegetables[i].Visible)
|
if(!keepHiden && !_Vegetables[i]._visible)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
vegetables.push_back(*_Vegetables[i].Vegetable);
|
vegetables.push_back(*_Vegetables[i]._vegetable);
|
||||||
// get dst index.
|
// get dst index.
|
||||||
uint dstId= (uint)vegetables.size()-1;
|
uint dstId= (uint)vegetables.size()-1;
|
||||||
// transform degrees in radians.
|
// transform degrees in radians.
|
||||||
|
@ -446,13 +455,13 @@ void CVegetableEditor::appendVegetableSet(NL3D::CTileVegetableDesc &vegetSet)
|
||||||
float radToDeg = (float)(180.f / NLMISC::Pi);
|
float radToDeg = (float)(180.f / NLMISC::Pi);
|
||||||
|
|
||||||
// for all distances Types.
|
// for all distances Types.
|
||||||
for(uint distType = 0; distType < NL3D_VEGETABLE_BLOCK_NUMDIST; distType++)
|
for(uint distType = 0; distType < NL3D_VEGETABLE_BLOCK_NUMDIST; ++distType)
|
||||||
{
|
{
|
||||||
// retrieve list of vegetable
|
// retrieve list of vegetable
|
||||||
const std::vector<NL3D::CVegetable> &vegetList = vegetSet.getVegetableList(distType);
|
const std::vector<NL3D::CVegetable> &vegetList = vegetSet.getVegetableList(distType);
|
||||||
|
|
||||||
// for all of them
|
// for all of them
|
||||||
for(uint i = 0; i < vegetList.size(); i++)
|
for(uint i = 0; i < vegetList.size(); ++i)
|
||||||
{
|
{
|
||||||
// append the vegetable to the list.
|
// append the vegetable to the list.
|
||||||
NL3D::CVegetable veget = vegetList[i];
|
NL3D::CVegetable veget = vegetList[i];
|
||||||
|
|
|
@ -113,7 +113,6 @@ public:
|
||||||
~CVegetableEditor(void);
|
~CVegetableEditor(void);
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
void release();
|
void release();
|
||||||
|
|
||||||
/// @name Landscape control
|
/// @name Landscape control
|
||||||
|
@ -228,9 +227,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
|
|
||||||
void loadLandscapeSetup();
|
void loadLandscapeSetup();
|
||||||
|
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
|
|
||||||
NL3D::CLandscapeModel *_VegetableLandscape;
|
NL3D::CLandscapeModel *_VegetableLandscape;
|
||||||
|
|
|
@ -54,7 +54,6 @@ private Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Ui::CVegetableLandscapePage _ui;
|
Ui::CVegetableLandscapePage _ui;
|
||||||
|
|
||||||
}; /* class CVegetableLandscapePage */
|
}; /* class CVegetableLandscapePage */
|
||||||
|
|
||||||
} /* namespace NLQT */
|
} /* namespace NLQT */
|
||||||
|
|
|
@ -29,14 +29,14 @@ static const char *NL_DefaultVegetName= "<default>";
|
||||||
|
|
||||||
CVegetableNode::CVegetableNode(void)
|
CVegetableNode::CVegetableNode(void)
|
||||||
{
|
{
|
||||||
Vegetable = NULL;
|
_vegetable = NULL;
|
||||||
VegetableName = NL_DefaultVegetName;
|
_vegetableName = NL_DefaultVegetName;
|
||||||
Visible = true;
|
_visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVegetableNode::initDefaultVegetable()
|
void CVegetableNode::initDefaultVegetable()
|
||||||
{
|
{
|
||||||
Vegetable= new NL3D::CVegetable;
|
_vegetable = new NL3D::CVegetable;
|
||||||
// update vegetableName according to Vegetable
|
// update vegetableName according to Vegetable
|
||||||
updateVegetableName();
|
updateVegetableName();
|
||||||
|
|
||||||
|
@ -44,59 +44,59 @@ void CVegetableNode::initDefaultVegetable()
|
||||||
|
|
||||||
// General/Density.
|
// General/Density.
|
||||||
// Density.
|
// Density.
|
||||||
Vegetable->Density.Abs = NL_VEGETABLE_DENSITY_ABS_DEFAULT;
|
_vegetable->Density.Abs = NL_VEGETABLE_DENSITY_ABS_DEFAULT;
|
||||||
Vegetable->Density.Rand = NL_VEGETABLE_DENSITY_RAND_DEFAULT;
|
_vegetable->Density.Rand = NL_VEGETABLE_DENSITY_RAND_DEFAULT;
|
||||||
Vegetable->Density.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->Density.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
// disable MaxDensity
|
// disable MaxDensity
|
||||||
Vegetable->MaxDensity = -1;
|
_vegetable->MaxDensity = -1;
|
||||||
// Leave ShapeName to ""
|
// Leave ShapeName to ""
|
||||||
// Default DistType is always 0.
|
// Default DistType is always 0.
|
||||||
Vegetable->DistType = 0;
|
_vegetable->DistType = 0;
|
||||||
|
|
||||||
|
|
||||||
// Apperance
|
// Apperance
|
||||||
// BendPhase
|
// BendPhase
|
||||||
Vegetable->BendPhase.Abs = NL_VEGETABLE_BENDPHASE_ABS_DEFAULT;
|
_vegetable->BendPhase.Abs = NL_VEGETABLE_BENDPHASE_ABS_DEFAULT;
|
||||||
Vegetable->BendPhase.Rand = NL_VEGETABLE_BENDPHASE_RAND_DEFAULT;
|
_vegetable->BendPhase.Rand = NL_VEGETABLE_BENDPHASE_RAND_DEFAULT;
|
||||||
Vegetable->BendPhase.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->BendPhase.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
// BendFactor
|
// BendFactor
|
||||||
Vegetable->BendFactor.Abs = NL_VEGETABLE_BENDFACTOR_ABS_DEFAULT;
|
_vegetable->BendFactor.Abs = NL_VEGETABLE_BENDFACTOR_ABS_DEFAULT;
|
||||||
Vegetable->BendFactor.Rand = NL_VEGETABLE_BENDFACTOR_RAND_DEFAULT;
|
_vegetable->BendFactor.Rand = NL_VEGETABLE_BENDFACTOR_RAND_DEFAULT;
|
||||||
Vegetable->BendFactor.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->BendFactor.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
// Color
|
// Color
|
||||||
Vegetable->Color.NoiseValue.Abs = NL_VEGETABLE_COLOR_ABS_DEFAULT;
|
_vegetable->Color.NoiseValue.Abs = NL_VEGETABLE_COLOR_ABS_DEFAULT;
|
||||||
Vegetable->Color.NoiseValue.Rand = NL_VEGETABLE_COLOR_RAND_DEFAULT;
|
_vegetable->Color.NoiseValue.Rand = NL_VEGETABLE_COLOR_RAND_DEFAULT;
|
||||||
Vegetable->Color.NoiseValue.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->Color.NoiseValue.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
|
|
||||||
// Scale
|
// Scale
|
||||||
// ScaleXY
|
// ScaleXY
|
||||||
Vegetable->Sxy.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
_vegetable->Sxy.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
||||||
Vegetable->Sxy.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
_vegetable->Sxy.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
||||||
Vegetable->Sxy.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->Sxy.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
// ScaleZ.
|
// ScaleZ.
|
||||||
Vegetable->Sz.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
_vegetable->Sz.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
||||||
Vegetable->Sz.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
_vegetable->Sz.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
||||||
Vegetable->Sz.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->Sz.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
|
|
||||||
// Rotate
|
// Rotate
|
||||||
// RotateX
|
// RotateX
|
||||||
Vegetable->Rx.Abs = NL_VEGETABLE_ROTATEX_ABS_DEFAULT;
|
_vegetable->Rx.Abs = NL_VEGETABLE_ROTATEX_ABS_DEFAULT;
|
||||||
Vegetable->Rx.Rand = NL_VEGETABLE_ROTATEX_RAND_DEFAULT;
|
_vegetable->Rx.Rand = NL_VEGETABLE_ROTATEX_RAND_DEFAULT;
|
||||||
Vegetable->Rx.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->Rx.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
// RotateY
|
// RotateY
|
||||||
Vegetable->Ry.Abs = NL_VEGETABLE_ROTATEY_ABS_DEFAULT;
|
_vegetable->Ry.Abs = NL_VEGETABLE_ROTATEY_ABS_DEFAULT;
|
||||||
Vegetable->Ry.Rand = NL_VEGETABLE_ROTATEY_RAND_DEFAULT;
|
_vegetable->Ry.Rand = NL_VEGETABLE_ROTATEY_RAND_DEFAULT;
|
||||||
Vegetable->Ry.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
_vegetable->Ry.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||||
// RotateZ
|
// RotateZ
|
||||||
Vegetable->Rz.Abs = NL_VEGETABLE_ROTATEZ_ABS_DEFAULT;
|
_vegetable->Rz.Abs = NL_VEGETABLE_ROTATEZ_ABS_DEFAULT;
|
||||||
Vegetable->Rz.Rand = NL_VEGETABLE_ROTATEZ_RAND_DEFAULT;
|
_vegetable->Rz.Rand = NL_VEGETABLE_ROTATEZ_RAND_DEFAULT;
|
||||||
Vegetable->Rz.Frequency = NL_VEGETABLE_ROTATEZ_FREQ_DEFAULT;
|
_vegetable->Rz.Frequency = NL_VEGETABLE_ROTATEZ_FREQ_DEFAULT;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVegetableNode::initVegetable(const NL3D::CVegetable &vegetable)
|
void CVegetableNode::initVegetable(const NL3D::CVegetable &vegetable)
|
||||||
{
|
{
|
||||||
Vegetable = new NL3D::CVegetable(vegetable);
|
_vegetable = new NL3D::CVegetable(vegetable);
|
||||||
// update vegetableName according to Vegetable
|
// update vegetableName according to Vegetable
|
||||||
updateVegetableName();
|
updateVegetableName();
|
||||||
}
|
}
|
||||||
|
@ -105,27 +105,27 @@ void CVegetableNode::initVegetable(const NL3D::CVegetable &vegetable)
|
||||||
void CVegetableNode::updateVegetableName()
|
void CVegetableNode::updateVegetableName()
|
||||||
{
|
{
|
||||||
// Build the vegetable Name according to the ShapeName
|
// Build the vegetable Name according to the ShapeName
|
||||||
if(Vegetable->ShapeName == "")
|
if(_vegetable->ShapeName == "")
|
||||||
{
|
{
|
||||||
VegetableName = NL_DefaultVegetName;
|
_vegetableName = NL_DefaultVegetName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string::size_type pos = Vegetable->ShapeName.find(".veget");
|
std::string::size_type pos = _vegetable->ShapeName.find(".veget");
|
||||||
VegetableName= Vegetable->ShapeName.substr(0, pos);
|
_vegetableName = _vegetable->ShapeName.substr(0, pos);
|
||||||
// And (to be clearer) append distance of creation.
|
// And (to be clearer) append distance of creation.
|
||||||
char str[256];
|
char str[256];
|
||||||
sprintf(str, " - %dm", (Vegetable->DistType + 1) * 10);
|
sprintf(str, " - %dm", (_vegetable->DistType + 1) * 10);
|
||||||
VegetableName += str;
|
_vegetableName += str;
|
||||||
// NB: if you add info with other parameters, you must use updateCurSelVegetableName() if they change
|
// NB: if you add info with other parameters, you must use updateCurSelVegetableName() if they change
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVegetableNode::deleteVegetable()
|
void CVegetableNode::deleteVegetable()
|
||||||
{
|
{
|
||||||
delete Vegetable;
|
delete _vegetable;
|
||||||
Vegetable = NULL;
|
_vegetable = NULL;
|
||||||
VegetableName = NL_DefaultVegetName;
|
_vegetableName = NL_DefaultVegetName;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace NLQT */
|
} /* namespace NLQT */
|
|
@ -47,13 +47,13 @@ public:
|
||||||
void deleteVegetable();
|
void deleteVegetable();
|
||||||
|
|
||||||
// The vegetable
|
// The vegetable
|
||||||
NL3D::CVegetable *Vegetable;
|
NL3D::CVegetable *_vegetable;
|
||||||
|
|
||||||
// The name of this vegetable.
|
// The name of this vegetable.
|
||||||
std::string VegetableName;
|
std::string _vegetableName;
|
||||||
|
|
||||||
// Visibility. Editor feature only
|
// Visibility. Editor feature only
|
||||||
bool Visible;
|
bool _visible;
|
||||||
|
|
||||||
}; /* class CVegetableNode */
|
}; /* class CVegetableNode */
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@ namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
CVegetNoiseValueWidget::CVegetNoiseValueWidget(QWidget *parent)
|
CVegetNoiseValueWidget::CVegetNoiseValueWidget(QWidget *parent)
|
||||||
: QGroupBox(parent), _emit(true)
|
: QGroupBox(parent),
|
||||||
|
_emit(true)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,6 @@ public:
|
||||||
CVegetNoiseValueWidget(QWidget *parent = 0);
|
CVegetNoiseValueWidget(QWidget *parent = 0);
|
||||||
~CVegetNoiseValueWidget();
|
~CVegetNoiseValueWidget();
|
||||||
|
|
||||||
void setNoiseValue(const NLMISC::CNoiseValue &value, bool emit = true);
|
|
||||||
|
|
||||||
void setDefaultRangeAbs(float defRangeMin, float defRangeMax);
|
void setDefaultRangeAbs(float defRangeMin, float defRangeMax);
|
||||||
void setDefaultRangeRand(float defRangeMin, float defRangeMax);
|
void setDefaultRangeRand(float defRangeMin, float defRangeMax);
|
||||||
void setDefaultRangeFreq(float defRangeMin, float defRangeMax);
|
void setDefaultRangeFreq(float defRangeMin, float defRangeMax);
|
||||||
|
@ -49,6 +47,9 @@ public:
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void noiseValueChanged(const NLMISC::CNoiseValue &value);
|
void noiseValueChanged(const NLMISC::CNoiseValue &value);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void setNoiseValue(const NLMISC::CNoiseValue &value, bool emit = true);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void setSlider(int value);
|
void setSlider(int value);
|
||||||
void sliderReleased();
|
void sliderReleased();
|
||||||
|
|
Loading…
Reference in a new issue