mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-29 12:20:53 +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;
|
||||
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()));
|
||||
|
||||
if (listObjects.empty())
|
||||
|
@ -118,22 +118,22 @@ void CAnimationSetDialog::updateListAnim()
|
|||
return;
|
||||
CEntity &entity = Modules::objView().getEntity(curObj);
|
||||
|
||||
std::vector<std::string>& animationList = entity.getAnimationList();
|
||||
std::vector<std::string>& swtList = entity.getSWTList();
|
||||
std::vector<std::string>& playListAnimation = entity.getPlayListAnimation();
|
||||
std::vector<std::string> &animationList = entity.getAnimationList();
|
||||
std::vector<std::string> &swtList = entity.getSWTList();
|
||||
std::vector<std::string> &playListAnimation = entity.getPlayListAnimation();
|
||||
|
||||
// update animation list widget
|
||||
for(size_t i = 0; i < animationList.size(); ++i)
|
||||
{
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(ui.animTreeWidget);
|
||||
item->setText(0,QString(animationList[i].c_str()));
|
||||
item->setText(0, QString(animationList[i].c_str()));
|
||||
}
|
||||
|
||||
// update skeleton weight template list widget
|
||||
for(size_t i = 0; i < swtList.size(); ++i)
|
||||
{
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(ui.skeletonTreeWidget);
|
||||
item->setText(0,QString(swtList[i].c_str()));
|
||||
item->setText(0, QString(swtList[i].c_str()));
|
||||
}
|
||||
|
||||
// update PlayList animation widget
|
||||
|
@ -224,9 +224,9 @@ void CAnimationSetDialog::resetAnim()
|
|||
void CAnimationSetDialog::addAnim()
|
||||
{
|
||||
CEntity &entity = Modules::objView().getEntity(Modules::objView().getCurrentObject());
|
||||
QList<QTreeWidgetItem*> list = ui.animTreeWidget->selectedItems();
|
||||
QList<QTreeWidgetItem *> list = ui.animTreeWidget->selectedItems();
|
||||
|
||||
Q_FOREACH(QTreeWidgetItem* item, list)
|
||||
Q_FOREACH(QTreeWidgetItem *item, list)
|
||||
{
|
||||
std::string animName = item->text(0).toStdString();
|
||||
entity.addAnimToPlayList(animName);
|
||||
|
@ -237,9 +237,9 @@ void CAnimationSetDialog::addAnim()
|
|||
void CAnimationSetDialog::removeAnim()
|
||||
{
|
||||
CEntity &entity = Modules::objView().getEntity(Modules::objView().getCurrentObject());
|
||||
QList<QListWidgetItem*> list = ui.animPlaylistWidget->selectedItems();
|
||||
QList<QListWidgetItem *> list = ui.animPlaylistWidget->selectedItems();
|
||||
|
||||
Q_FOREACH(QListWidgetItem* item, list)
|
||||
Q_FOREACH(QListWidgetItem *item, list)
|
||||
{
|
||||
int row = ui.animPlaylistWidget->row(item);
|
||||
QListWidgetItem *removeItem = ui.animPlaylistWidget->takeItem(row);
|
||||
|
@ -252,7 +252,7 @@ void CAnimationSetDialog::removeAnim()
|
|||
void CAnimationSetDialog::upAnim()
|
||||
{
|
||||
CEntity &entity = Modules::objView().getEntity(Modules::objView().getCurrentObject());
|
||||
QList<QListWidgetItem*> list = ui.animPlaylistWidget->selectedItems();
|
||||
QList<QListWidgetItem *> list = ui.animPlaylistWidget->selectedItems();
|
||||
|
||||
if (list.empty())
|
||||
return;
|
||||
|
@ -273,7 +273,7 @@ void CAnimationSetDialog::upAnim()
|
|||
void CAnimationSetDialog::downAnim()
|
||||
{
|
||||
CEntity &entity = Modules::objView().getEntity(Modules::objView().getCurrentObject());
|
||||
QList<QListWidgetItem*> list = ui.animPlaylistWidget->selectedItems();
|
||||
QList<QListWidgetItem *> list = ui.animPlaylistWidget->selectedItems();
|
||||
|
||||
if (list.empty())
|
||||
return;
|
||||
|
|
|
@ -45,11 +45,12 @@ namespace NLQT
|
|||
|
||||
CAttribWidget::CAttribWidget(QWidget *parent)
|
||||
: QGroupBox(parent),
|
||||
_SrcInputEnabled(true),
|
||||
_EnableConstantValue(true),
|
||||
_DisableMemoryScheme(false),
|
||||
_NbCycleEnabled(true),
|
||||
_Node(NULL), _SchemeWidget(NULL)
|
||||
_SrcInputEnabled(true),
|
||||
_EnableConstantValue(true),
|
||||
_DisableMemoryScheme(false),
|
||||
_NbCycleEnabled(true),
|
||||
_Node(NULL),
|
||||
_SchemeWidget(NULL)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
_ui.constRangeUIntWidget->hide();
|
||||
|
|
|
@ -32,30 +32,25 @@ namespace NLQT
|
|||
{
|
||||
|
||||
CAutoLODDialog::CAutoLODDialog(CWorkspaceNode *ownerNode, NL3D::CParticleSystem *ps, QWidget *parent)
|
||||
: QDialog(parent), _Node(ownerNode), _PS(ps)
|
||||
: QDialog(parent),
|
||||
_Node(ownerNode),
|
||||
_PS(ps)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
setFixedHeight(sizeHint().height());
|
||||
|
||||
_DistRatioWrapper.PS = _PS;
|
||||
_MaxDistLODBiasWrapper.PS = _PS;
|
||||
_DistRatioWrapper.OwnerNode = _Node;
|
||||
_MaxDistLODBiasWrapper.OwnerNode = _Node;
|
||||
|
||||
// Edit the distance at which LOD starts
|
||||
_ui.startPercentDistWidget->setRange(0.f, 0.99f);
|
||||
_ui.startPercentDistWidget->enableUpperBound(1.f, true);
|
||||
_ui.startPercentDistWidget->enableLowerBound(0.f, false);
|
||||
_ui.startPercentDistWidget->setWrapper(&_DistRatioWrapper);
|
||||
_ui.startPercentDistWidget->updateUi();
|
||||
_ui.startPercentDistWidget->setValue(_PS->getAutoLODStartDistPercent());
|
||||
|
||||
// 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->enableUpperBound(1.f, false);
|
||||
_ui.maxDistBiasWidget->enableLowerBound(0.f, false);
|
||||
_ui.maxDistBiasWidget->setWrapper(&_MaxDistLODBiasWrapper);
|
||||
_ui.maxDistBiasWidget->updateUi();
|
||||
_ui.maxDistBiasWidget->setValue(_PS->getMaxDistLODBias());
|
||||
|
||||
if (_PS->isSharingEnabled())
|
||||
{
|
||||
|
@ -86,4 +81,16 @@ void CAutoLODDialog::setSkipParticles(bool 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 */
|
|
@ -46,37 +46,13 @@ public:
|
|||
private Q_SLOTS:
|
||||
void setDegradationExponent(int value);
|
||||
void setSkipParticles(bool state);
|
||||
|
||||
void setDistRatio(float value);
|
||||
void setMaxDistLODBias(float value);
|
||||
|
||||
private:
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
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;
|
||||
NL3D::CParticleSystem *_PS;
|
||||
|
||||
Ui::CAutoLODDialog _ui;
|
||||
}; /* class CAutoLODDialog */
|
||||
|
|
|
@ -34,8 +34,10 @@ namespace NLQT
|
|||
NLMISC::CMatrix BuildEulerMatrix(float psi, float theta, float phi)
|
||||
{
|
||||
float ca = cosf(psi), sa = sinf(psi)
|
||||
, cb = cosf(theta), sb = sinf(theta)
|
||||
, cc = cosf(phi), sc = sinf(phi);
|
||||
, cb = cosf(theta)
|
||||
, sb = sinf(theta)
|
||||
, cc = cosf(phi)
|
||||
, sc = sinf(phi);
|
||||
NLMISC::CMatrix m;
|
||||
m.identity();
|
||||
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)
|
||||
{
|
||||
float ca = cosf(sol[k].x), sa = sinf(sol[k].x)
|
||||
, cb = cosf(sol[k].y), sb = sinf(sol[k].y)
|
||||
, cc = cosf(sol[k].z), sc = sinf(sol[k].z);
|
||||
, cb = cosf(sol[k].y)
|
||||
, 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);
|
||||
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)
|
||||
: QWidget(parent), _Wrapper(NULL)
|
||||
: QWidget(parent),
|
||||
_Wrapper(NULL)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
@ -155,7 +160,8 @@ void CBasicEditWidget::setWrapper(IPSWrapper<NL3D::CPlaneBasis> *wrapper)
|
|||
|
||||
void CBasicEditWidget::updateUi()
|
||||
{
|
||||
if (_Wrapper == NULL) return;
|
||||
if (_Wrapper == NULL)
|
||||
return;
|
||||
NL3D::CPlaneBasis pb = _Wrapper->get();
|
||||
NLMISC::CMatrix mat;
|
||||
mat.setRot(pb.X, pb.Y, pb.X ^ pb.Y);
|
||||
|
@ -178,7 +184,8 @@ void CBasicEditWidget::updateUi()
|
|||
|
||||
void CBasicEditWidget::updateGraphics()
|
||||
{
|
||||
if (_Wrapper == NULL) return;
|
||||
if (_Wrapper == NULL)
|
||||
return;
|
||||
|
||||
NLMISC::CVector angles(2.f * (float) NLMISC::Pi * _ui.psiSpinBox->value() / 360.f
|
||||
, 2.f * (float) NLMISC::Pi * _ui.thetaSpinBox->value() / 360.f
|
||||
|
|
|
@ -41,8 +41,8 @@ CBinOpDialog::CBinOpDialog(QWidget *widget1, QWidget *widget2, QWidget *parent)
|
|||
setWindowTitle(tr("Bin operator"));
|
||||
_comboBox->clear();
|
||||
|
||||
qobject_cast<QGroupBox*>(widget1)->setTitle(tr("Arg1"));
|
||||
qobject_cast<QGroupBox*>(widget2)->setTitle(tr("Arg2"));
|
||||
qobject_cast<QGroupBox *>(widget1)->setTitle(tr("Arg1"));
|
||||
qobject_cast<QGroupBox *>(widget2)->setTitle(tr("Arg2"));
|
||||
connect(_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setNewOp(int)));
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,9 @@ namespace NLQT
|
|||
{
|
||||
|
||||
CColorEditWidget::CColorEditWidget(QWidget *parent)
|
||||
: QWidget(parent), _Wrapper(NULL), _emit(true)
|
||||
: QWidget(parent),
|
||||
_Wrapper(NULL),
|
||||
_emit(true)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
@ -77,15 +79,23 @@ void CColorEditWidget::updateUi()
|
|||
_ui.gSpinBox->setValue(_Wrapper->get().G);
|
||||
_ui.bSpinBox->setValue(_Wrapper->get().B);
|
||||
_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)
|
||||
{
|
||||
_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)
|
||||
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)
|
||||
return;
|
||||
|
@ -102,10 +112,16 @@ void CColorEditWidget::setRed(int r)
|
|||
|
||||
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)
|
||||
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;
|
||||
|
||||
|
@ -120,10 +136,16 @@ void CColorEditWidget::setGreen(int g)
|
|||
|
||||
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)
|
||||
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;
|
||||
|
||||
|
@ -138,10 +160,16 @@ void CColorEditWidget::setBlue(int b)
|
|||
|
||||
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)
|
||||
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;
|
||||
|
||||
|
|
|
@ -201,7 +201,8 @@ CRGBA CConfiguration::getValue(const CConfigFile::CVar &var, const CRGBA &defaul
|
|||
{
|
||||
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);
|
||||
}
|
||||
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);
|
||||
|
|
|
@ -70,9 +70,9 @@ private:
|
|||
void disconnectGlobalTexAnim();
|
||||
void updateGlobalTexAnim(int value);
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
NL3D::CPSConstraintMesh *_CM;
|
||||
NL3D::CPSConstraintMesh *_CM;
|
||||
|
||||
Ui::CConstraintMeshWidget _ui;
|
||||
}; /* class CConstraintMeshWidget */
|
||||
|
|
|
@ -27,7 +27,11 @@ namespace NLQT
|
|||
{
|
||||
|
||||
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);
|
||||
|
||||
|
@ -90,7 +94,7 @@ void CurveEditDialog::curveChanged(const QPolygonF &points)
|
|||
_Curve->removeCtrlPoint(0);
|
||||
else if (_Curve->getNumCtrlPoints() < uint(points.size()))
|
||||
_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(),
|
||||
(_ui.curveWidget->height() - points.at(i).y() + _pos) / (_ui.curveWidget->height() * _scale)));
|
||||
}
|
||||
|
@ -146,7 +150,7 @@ void CurveEditDialog::setNumSamples(uint32 value)
|
|||
void CurveEditDialog::buildPoints()
|
||||
{
|
||||
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()),
|
||||
_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();
|
||||
|
||||
/// the scheme being edited
|
||||
NL3D::CPSFloatCurveFunctor *_Curve;
|
||||
|
||||
private Q_SLOTS:
|
||||
void setSmoothing(bool state);
|
||||
void setDisplayInterpolation(bool state);
|
||||
|
@ -73,9 +70,11 @@ protected:
|
|||
float _pos;
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
/// the scheme being edited
|
||||
NL3D::CPSFloatCurveFunctor *_Curve;
|
||||
|
||||
HoverPoints *_hoverPoints;
|
||||
|
||||
Ui::CurveEditDialog _ui;
|
||||
}; /* CurveEditDialog */
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@ namespace NLQT
|
|||
const int max_range = 9999;
|
||||
|
||||
CEditRangeUIntWidget::CEditRangeUIntWidget(QWidget *parent)
|
||||
: QWidget(parent), _Wrapper(NULL), _emit(true)
|
||||
: QWidget(parent),
|
||||
_Wrapper(NULL),
|
||||
_emit(true)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ CEmitterPage::CEmitterPage(QWidget *parent)
|
|||
|
||||
// SPEED_INHERITANCE_FACTOR
|
||||
_ui.speedInherFactorWidget->setRange(-1.f, 1.f);
|
||||
//_ui.speedInherFactorWidget->setWrapper(&_SpeedInheritanceFactorWrapper);
|
||||
|
||||
// DELAYED_EMISSION
|
||||
_ui.delayedEmissionWidget->setRange(0.f, 10.f);
|
||||
|
|
|
@ -133,7 +133,7 @@ private:
|
|||
} _ModulatedStrenghtWrapper;
|
||||
|
||||
// the emitter being edited
|
||||
NL3D::CPSEmitter *_Emitter;
|
||||
NL3D::CPSEmitter *_Emitter;
|
||||
|
||||
// contains pointers to the located
|
||||
std::vector<NL3D::CPSLocated *> _LocatedList;
|
||||
|
|
|
@ -43,7 +43,23 @@ using namespace NL3D;
|
|||
namespace NLQT
|
||||
{
|
||||
|
||||
CSlotInfo& CSlotInfo::operator=(const CSlotInfo & slotInfo)
|
||||
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)
|
||||
{
|
||||
if ( this != &slotInfo)
|
||||
{
|
||||
|
@ -63,11 +79,16 @@ CSlotInfo& CSlotInfo::operator=(const CSlotInfo & slotInfo)
|
|||
return *this;
|
||||
}
|
||||
|
||||
CEntity::CEntity(void):
|
||||
_Name("<Unknown>"), _FileNameShape(""),
|
||||
_FileNameSkeleton(""), _inPlace(false), _incPos(false),
|
||||
_Instance(NULL), _Skeleton(NULL),
|
||||
_PlayList(NULL), _AnimationSet(NULL)
|
||||
CEntity::CEntity(void)
|
||||
: _Name("<Unknown>"),
|
||||
_FileNameShape(""),
|
||||
_FileNameSkeleton(""),
|
||||
_inPlace(false),
|
||||
_incPos(false),
|
||||
_Instance(NULL),
|
||||
_Skeleton(NULL),
|
||||
_PlayList(NULL),
|
||||
_AnimationSet(NULL)
|
||||
{
|
||||
_CharacterScalePos = 1;
|
||||
}
|
||||
|
@ -188,7 +209,7 @@ void CEntity::update(NL3D::TAnimationTime time)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -386,7 +407,7 @@ void CEntity::animatePlayList(NL3D::TAnimationTime time)
|
|||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -48,13 +48,7 @@ namespace NLQT
|
|||
class CSlotInfo
|
||||
{
|
||||
public:
|
||||
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();
|
||||
|
||||
std::string Animation;
|
||||
std::string Skeleton;
|
||||
|
@ -104,8 +98,8 @@ public:
|
|||
float SpeedAnim;
|
||||
int Mode;
|
||||
|
||||
SAnimationStatus():
|
||||
LoopAnim(false), PlayAnim(false),
|
||||
SAnimationStatus()
|
||||
: LoopAnim(false), PlayAnim(false),
|
||||
CurrentTimeAnim(0), StartAnim(0),
|
||||
EndAnim(0), SpeedAnim(1), Mode(Mode::PlayList) {}
|
||||
};
|
||||
|
@ -262,44 +256,44 @@ private:
|
|||
bool removeLast);
|
||||
|
||||
// The name of the entity
|
||||
std::string _Name;
|
||||
std::string _FileNameShape;
|
||||
std::string _FileNameSkeleton;
|
||||
std::string _Name;
|
||||
std::string _FileNameShape;
|
||||
std::string _FileNameSkeleton;
|
||||
|
||||
SAnimationStatus _AnimationStatus;
|
||||
SAnimationStatus _AnimationStatus;
|
||||
|
||||
bool _inPlace;
|
||||
bool _incPos;
|
||||
bool _inPlace;
|
||||
bool _incPos;
|
||||
|
||||
float _CharacterScalePos;
|
||||
float _CharacterScalePos;
|
||||
|
||||
// The mesh instance associated to this entity
|
||||
NL3D::UInstance _Instance;
|
||||
NL3D::UInstance _Instance;
|
||||
|
||||
// The skeleton binded to the instance
|
||||
NL3D::USkeleton _Skeleton;
|
||||
NL3D::USkeleton _Skeleton;
|
||||
|
||||
NL3D::UPlayList *_PlayList;
|
||||
NL3D::UPlayList *_PlayList;
|
||||
|
||||
NL3D::UAnimationSet *_AnimationSet;
|
||||
NL3D::UAnimationSet *_AnimationSet;
|
||||
|
||||
// Animation input file
|
||||
std::vector<std::string> _AnimationList;
|
||||
std::vector<std::string> _AnimationList;
|
||||
|
||||
// Skeleton weight input file
|
||||
std::vector<std::string> _SWTList;
|
||||
std::vector<std::string> _SWTList;
|
||||
|
||||
// Play list animation
|
||||
std::vector<std::string > _PlayListAnimation;
|
||||
std::vector<std::string> _PlayListAnimation;
|
||||
|
||||
// Slot info for this object
|
||||
CSlotInfo _SlotInfo[NL3D::CChannelMixer::NumAnimationSlot];
|
||||
CSlotInfo _SlotInfo[NL3D::CChannelMixer::NumAnimationSlot];
|
||||
|
||||
friend class CObjectViewer;
|
||||
}; /* class CEntity */
|
||||
|
||||
typedef std::map<std::string, CEntity> CEntities;
|
||||
typedef CEntities::iterator EIT;
|
||||
typedef std::map<std::string, CEntity> CEntities;
|
||||
typedef CEntities::iterator EIT;
|
||||
|
||||
} /* namespace NLQT */
|
||||
|
||||
|
|
|
@ -176,10 +176,10 @@ void CPluginManager::setPluginState(CPluginSpec *spec, int destState)
|
|||
|
||||
void CPluginManager::stopAll()
|
||||
{
|
||||
Q_FOREACH (CPluginSpec *spec, _pluginSpecs)
|
||||
Q_FOREACH (CPluginSpec *spec, _pluginSpecs)
|
||||
setPluginState(spec, State::Stopped);
|
||||
|
||||
Q_FOREACH (CPluginSpec *spec, _pluginSpecs)
|
||||
Q_FOREACH (CPluginSpec *spec, _pluginSpecs)
|
||||
setPluginState(spec, State::Deleted);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ QString CPluginSpec::errorString() const
|
|||
bool CPluginSpec::setFileName(const QString &fileName)
|
||||
{
|
||||
_name = _version
|
||||
= _vendor
|
||||
= _vendor
|
||||
= _description
|
||||
= _location
|
||||
= _filePath
|
||||
|
@ -138,7 +138,7 @@ bool CPluginSpec::loadLibrary()
|
|||
if (!loader.load())
|
||||
return reportError(loader.errorString());
|
||||
|
||||
IPlugin *pluginObject = qobject_cast<IPlugin*>(loader.instance());
|
||||
IPlugin *pluginObject = qobject_cast<IPlugin *>(loader.instance());
|
||||
if (!pluginObject)
|
||||
{
|
||||
loader.unload();
|
||||
|
|
|
@ -30,7 +30,9 @@ namespace NLQT
|
|||
{
|
||||
|
||||
CFollowPathDialog::CFollowPathDialog(NL3D::CPSPlaneBasisFollowSpeed *pbfs, CWorkspaceNode *ownerNode, QWidget *parent)
|
||||
: QDialog(parent), _FollowPath(pbfs), _Node(ownerNode)
|
||||
: QDialog(parent),
|
||||
_FollowPath(pbfs),
|
||||
_Node(ownerNode)
|
||||
{
|
||||
resize(270, 90);
|
||||
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
|
|
|
@ -56,7 +56,7 @@ protected:
|
|||
QPushButton *pushButton;
|
||||
|
||||
NL3D::CPSPlaneBasisFollowSpeed *_FollowPath;
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
}; /* class CFollowPathDialog */
|
||||
|
||||
} /* namespace NLQT */
|
||||
|
|
|
@ -32,8 +32,6 @@ CGlobalWindDialog::CGlobalWindDialog(QWidget *parent)
|
|||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
//_ui.directionWidget->setWrapper(&_DirectionWrapper);
|
||||
|
||||
connect(_ui.horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(setWndPower(int)));
|
||||
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(updateWnd(bool)));
|
||||
}
|
||||
|
@ -55,17 +53,6 @@ void CGlobalWindDialog::updateWnd(bool visible)
|
|||
return;
|
||||
|
||||
_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 */
|
|
@ -44,12 +44,6 @@ private Q_SLOTS:
|
|||
void updateWnd(bool visible);
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ void CGraphicsInfoWidget::paintEvent(QPaintEvent *event)
|
|||
}
|
||||
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)),
|
||||
int((height() / 2.0) * (1 - _verts[k - 1].y)),
|
||||
|
|
|
@ -120,11 +120,11 @@ void CGraphicsViewport::resizeEvent(QResizeEvent *resizeEvent)
|
|||
|
||||
typedef bool (*winProc)(NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
bool CGraphicsViewport::winEvent(MSG * message, long * result)
|
||||
bool CGraphicsViewport::winEvent(MSG *message, long *result)
|
||||
{
|
||||
if (Modules::objView().getDriver() && Modules::objView().getDriver()->isActive())
|
||||
{
|
||||
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser*>(Modules::objView().getDriver())->getDriver();
|
||||
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser *>(Modules::objView().getDriver())->getDriver();
|
||||
if (driver)
|
||||
{
|
||||
winProc proc = (winProc)driver->getWindowProc();
|
||||
|
@ -137,7 +137,7 @@ bool CGraphicsViewport::winEvent(MSG * message, long * result)
|
|||
|
||||
#elif defined(NL_OS_MAC)
|
||||
|
||||
typedef bool (*cocoaProc)(NL3D::IDriver*, const void* e);
|
||||
typedef bool (*cocoaProc)(NL3D::IDriver *, const void *e);
|
||||
|
||||
bool CGraphicsViewport::macEvent(EventHandlerCallRef caller, EventRef event)
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ bool CGraphicsViewport::macEvent(EventHandlerCallRef caller, EventRef event)
|
|||
|
||||
if (Modules::objView().getDriver() && Modules::objView().getDriver()->isActive())
|
||||
{
|
||||
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser*>(Modules::objView().getDriver())->getDriver();
|
||||
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser *>(Modules::objView().getDriver())->getDriver();
|
||||
if (driver)
|
||||
{
|
||||
cocoaProc proc = (cocoaProc)driver->getWindowProc();
|
||||
|
@ -165,7 +165,7 @@ bool CGraphicsViewport::x11Event(XEvent *event)
|
|||
{
|
||||
if (Modules::objView().getDriver() && Modules::objView().getDriver()->isActive())
|
||||
{
|
||||
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser*>(Modules::objView().getDriver())->getDriver();
|
||||
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser *>(Modules::objView().getDriver())->getDriver();
|
||||
if (driver)
|
||||
{
|
||||
x11Proc proc = (x11Proc)driver->getWindowProc();
|
||||
|
|
|
@ -81,7 +81,7 @@ protected:
|
|||
virtual void resizeEvent(QResizeEvent *resizeEvent);
|
||||
|
||||
#if defined(NL_OS_WINDOWS)
|
||||
virtual bool winEvent(MSG * message, long * result);
|
||||
virtual bool winEvent(MSG *message, long *result);
|
||||
#elif defined(NL_OS_MAC)
|
||||
virtual bool macEvent(EventHandlerCallRef caller, EventRef event);
|
||||
#elif defined(NL_OS_UNIX)
|
||||
|
|
|
@ -393,7 +393,7 @@ private:
|
|||
|
||||
void touchPSState();
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
/// The bindable being edited
|
||||
NL3D::CPSLocatedBindable *_Bindable;
|
||||
|
|
|
@ -13,9 +13,10 @@
|
|||
#include <nel/misc/file.h>
|
||||
#include <nel/misc/path.h>
|
||||
#include <nel/misc/command.h>
|
||||
#include "extension_system/iplugin_spec.h"
|
||||
|
||||
// Project includes
|
||||
#include "modules.h"
|
||||
#include "extension_system/iplugin_spec.h"
|
||||
|
||||
// nel_qt log file name
|
||||
#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
|
||||
createDebug(NULL, NLQT_USE_LOG_LOG, false);
|
||||
#if NLQT_USE_LOG
|
||||
// create toverhex_client.log
|
||||
// create NLQT_LOG_FILE
|
||||
// filedisplayer only deletes the 001 etc
|
||||
if (NLQT_ERASE_LOG && CFile::isExists(NLQT_LOG_FILE))
|
||||
CFile::deleteFile(NLQT_LOG_FILE);
|
||||
|
@ -79,7 +80,7 @@ sint main(int argc, char **argv)
|
|||
ErrorLog->addDisplayer(NLQT::s_FileDisplayer);
|
||||
#endif
|
||||
|
||||
nlinfo("Welcome to NeL!");
|
||||
nlinfo("Welcome to NeL Object Viewer Qt!");
|
||||
|
||||
NLMISC::CPath::remapExtension("tga", "png", true);
|
||||
}
|
||||
|
|
|
@ -56,10 +56,14 @@ namespace NLQT
|
|||
|
||||
CMainWindow::CMainWindow(QWidget *parent)
|
||||
: QMainWindow(parent),
|
||||
_isGraphicsInitialized(false), _isGraphicsEnabled(false),
|
||||
_isSoundInitialized(false), _isSoundEnabled(false),
|
||||
_isLandscapeInitialized(false), _isLandscapeEnabled(false),
|
||||
_GraphicsViewport(NULL), _lastDir(".")
|
||||
_isGraphicsInitialized(false),
|
||||
_isGraphicsEnabled(false),
|
||||
_isSoundInitialized(false),
|
||||
_isSoundEnabled(false),
|
||||
_isLandscapeInitialized(false),
|
||||
_isLandscapeEnabled(false),
|
||||
_GraphicsViewport(NULL),
|
||||
_lastDir(".")
|
||||
{
|
||||
nldebug("CMainWindow::CMainWindow:");
|
||||
setObjectName("CMainWindow");
|
||||
|
|
|
@ -57,9 +57,9 @@ private Q_SLOTS:
|
|||
void editMorph();
|
||||
|
||||
private:
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
NL3D::CPSShapeParticle *_ShapeParticle;
|
||||
NL3D::CPSShapeParticle *_ShapeParticle;
|
||||
|
||||
void updateForMorph();
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@ namespace NLQT
|
|||
{
|
||||
|
||||
CMorphMeshDialog::CMorphMeshDialog(CWorkspaceNode *ownerNode, NL3D::CPSConstraintMesh *cm, QWidget *parent)
|
||||
: QDialog(parent), _Node(ownerNode), _CM(cm)
|
||||
: QDialog(parent),
|
||||
_Node(ownerNode),
|
||||
_CM(cm)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ private:
|
|||
CWorkspaceNode *_Node;
|
||||
|
||||
// the constraint mesh being edited
|
||||
NL3D::CPSConstraintMesh *_CM;
|
||||
NL3D::CPSConstraintMesh *_CM;
|
||||
|
||||
Ui::CMorphMeshDialog _ui;
|
||||
}; /* class CMorphMeshDialog */
|
||||
|
|
|
@ -31,7 +31,9 @@ namespace NLQT
|
|||
{
|
||||
|
||||
CMultiTexDialog::CMultiTexDialog(CWorkspaceNode *ownerNode, NL3D::CPSMultiTexturedParticle *mtp, QWidget *parent)
|
||||
: QDialog(parent), _Node(ownerNode), _MTP(mtp)
|
||||
: QDialog(parent),
|
||||
_Node(ownerNode),
|
||||
_MTP(mtp)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "ui_multi_tex_form.h"
|
||||
|
||||
|
||||
// STL includes
|
||||
|
||||
// Qt includes
|
||||
|
@ -75,7 +74,7 @@ private:
|
|||
virtual void set(NL3D::ITexture *);
|
||||
} _AlternateTexWrapper;
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
NL3D::CPSMultiTexturedParticle *_MTP;
|
||||
|
||||
|
|
|
@ -54,11 +54,13 @@ namespace NLQT
|
|||
{
|
||||
|
||||
CObjectViewer::CObjectViewer()
|
||||
: _Driver(NULL), _TextContext(NULL),
|
||||
_phi(0), _psi(0),_dist(20),
|
||||
_CameraFocal(75),
|
||||
_CurrentInstance(""),
|
||||
_BloomEffect(false), _Scene(0)
|
||||
: _Driver(NULL),
|
||||
_TextContext(NULL),
|
||||
_phi(0), _psi(0),_dist(20),
|
||||
_CameraFocal(75),
|
||||
_CurrentInstance(""),
|
||||
_BloomEffect(false),
|
||||
_Scene(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -243,7 +245,7 @@ void CObjectViewer::saveScreenshot(const std::string &nameFile, bool jpg, bool p
|
|||
bool CObjectViewer::loadMesh(const std::string &meshFileName, const std::string &skelFileName)
|
||||
{
|
||||
std::string fileName = CFile::getFilenameWithoutExtension(meshFileName);
|
||||
if ( _Entities.count(fileName) != 0)
|
||||
if (_Entities.count(fileName) != 0)
|
||||
return false;
|
||||
|
||||
CPath::addSearchPath(CFile::getPath(meshFileName), false, false);
|
||||
|
|
|
@ -145,7 +145,7 @@ public:
|
|||
|
||||
/// Get current instance from the scene
|
||||
/// @return name current instance, "" if no instance edited
|
||||
const std::string& getCurrentObject()
|
||||
std::string getCurrentObject() const
|
||||
{
|
||||
return _CurrentInstance;
|
||||
}
|
||||
|
|
|
@ -34,13 +34,20 @@
|
|||
namespace NLQT
|
||||
{
|
||||
|
||||
CParticleEditor::CParticleEditor(void):
|
||||
_ActiveNode(NULL), _State(State::Stopped), _Speed(1.0f),
|
||||
_AutoRepeat(false), _DisplayBBox(false),
|
||||
_DisplayHelpers(false), _AutoUpdateBBox(false),
|
||||
_EmptyBBox(true), _PW(NULL),
|
||||
_Driver(NULL), _Scene(NULL),
|
||||
_FontManager(NULL), _FontGen(NULL)
|
||||
CParticleEditor::CParticleEditor(void)
|
||||
: _ActiveNode(NULL),
|
||||
_State(State::Stopped),
|
||||
_Speed(1.0f),
|
||||
_AutoRepeat(false),
|
||||
_DisplayBBox(false),
|
||||
_DisplayHelpers(false),
|
||||
_AutoUpdateBBox(false),
|
||||
_EmptyBBox(true),
|
||||
_PW(NULL),
|
||||
_Driver(NULL),
|
||||
_Scene(NULL),
|
||||
_FontManager(NULL),
|
||||
_FontGen(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -50,13 +57,13 @@ CParticleEditor::~CParticleEditor(void)
|
|||
|
||||
void CParticleEditor::init()
|
||||
{
|
||||
NL3D::CDriverUser *driver = dynamic_cast<NL3D::CDriverUser*>(Modules::objView().getDriver());
|
||||
NL3D::CDriverUser *driver = dynamic_cast<NL3D::CDriverUser *>(Modules::objView().getDriver());
|
||||
_Driver = driver->getDriver();
|
||||
|
||||
NL3D::CSceneUser *scene = dynamic_cast<NL3D::CSceneUser*>(Modules::objView().getScene());
|
||||
NL3D::CSceneUser *scene = dynamic_cast<NL3D::CSceneUser *>(Modules::objView().getScene());
|
||||
_Scene = &scene->getScene();
|
||||
|
||||
NL3D::CTextContextUser *textContext = dynamic_cast<NL3D::CTextContextUser*>(Modules::objView().getTextContext());
|
||||
NL3D::CTextContextUser *textContext = dynamic_cast<NL3D::CTextContextUser *>(Modules::objView().getTextContext());
|
||||
_FontManager = textContext->getTextContext().getFontManager();
|
||||
_FontGen = textContext->getTextContext().getFontGenerator();
|
||||
NL3D::CParticleSystem::setSerializeIdentifierFlag(true);
|
||||
|
@ -125,7 +132,7 @@ void CParticleEditor::loadWorkspace(const std::string &fullPath)
|
|||
}
|
||||
if (node->isLoaded() && !firstLoadedNode)
|
||||
firstLoadedNode = node;
|
||||
itr++;
|
||||
++itr;
|
||||
}
|
||||
closeWorkspace();
|
||||
_PW = newPW.release();
|
||||
|
@ -172,7 +179,7 @@ void CParticleEditor::saveWorkspaceContent()
|
|||
if (node->isModified())
|
||||
node->savePS();
|
||||
node->setModified(false);
|
||||
itr++;
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,7 +249,7 @@ void CParticleEditor::startMultiple()
|
|||
CWorkspaceNode *node = (*itr);
|
||||
if (node->isLoaded())
|
||||
if (checkHasLoop(*node)) return;
|
||||
itr++;
|
||||
++itr;
|
||||
}
|
||||
|
||||
itr = _PW->getNodeList().begin();
|
||||
|
@ -257,7 +264,7 @@ void CParticleEditor::startMultiple()
|
|||
|
||||
_PlayingNodes.push_back(node);
|
||||
}
|
||||
itr++;
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -405,7 +412,7 @@ void CParticleEditor::update()
|
|||
}
|
||||
}
|
||||
}
|
||||
itr++;
|
||||
++itr;
|
||||
}
|
||||
if (fxStarted && allFXFinished)
|
||||
restartAllFX();
|
||||
|
@ -440,7 +447,7 @@ void CParticleEditor::update()
|
|||
node->getPSModel()->hide();
|
||||
}
|
||||
}
|
||||
itr++;
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -481,7 +488,7 @@ void CParticleEditor::setSpeed(float value)
|
|||
CWorkspaceNode *node = (*itr);
|
||||
if (node->isLoaded())
|
||||
node->getPSModel()->setEllapsedTimeRatio(value);
|
||||
itr++;
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -234,25 +234,25 @@ private:
|
|||
|
||||
// Current state
|
||||
int _State;
|
||||
float _Speed;
|
||||
bool _AutoRepeat;
|
||||
bool _DisplayBBox;
|
||||
bool _DisplayHelpers;
|
||||
float _Speed;
|
||||
bool _AutoRepeat;
|
||||
bool _DisplayBBox;
|
||||
bool _DisplayHelpers;
|
||||
|
||||
// The system bbox must be updated automatically
|
||||
bool _AutoUpdateBBox;
|
||||
bool _AutoUpdateBBox;
|
||||
|
||||
// The last computed bbox for the system
|
||||
bool _EmptyBBox;
|
||||
NLMISC::CAABBox _CurrBBox;
|
||||
bool _EmptyBBox;
|
||||
NLMISC::CAABBox _CurrBBox;
|
||||
|
||||
|
||||
CParticleWorkspace *_PW;
|
||||
NL3D::IDriver *_Driver;
|
||||
NL3D::CScene *_Scene;
|
||||
CParticleWorkspace *_PW;
|
||||
NL3D::IDriver *_Driver;
|
||||
NL3D::CScene *_Scene;
|
||||
|
||||
// Font manager
|
||||
NL3D::CFontManager *_FontManager;
|
||||
NL3D::CFontManager *_FontManager;
|
||||
|
||||
// Font generator
|
||||
NL3D::CFontGenerator *_FontGen;
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace NLQT
|
|||
class CLocatedItem: public QListWidgetItem
|
||||
{
|
||||
public:
|
||||
CLocatedItem ( const QString & text, QListWidget * parent = 0, int type = UserType ):
|
||||
CLocatedItem ( const QString & text, QListWidget *parent = 0, int type = UserType ):
|
||||
QListWidgetItem(text, parent, type), _loc(NULL) {}
|
||||
|
||||
void setUserData(NL3D::CPSLocated *loc)
|
||||
|
|
|
@ -35,7 +35,7 @@ CParticleLinkDialog::CParticleLinkDialog(CSkeletonTreeModel *model, QWidget *par
|
|||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
qobject_cast< QMainWindow* >(parent)->addDockWidget(Qt::RightDockWidgetArea, this);
|
||||
qobject_cast<QMainWindow *>(parent)->addDockWidget(Qt::RightDockWidgetArea, this);
|
||||
|
||||
_ui.treeView->setModel(model);
|
||||
|
||||
|
@ -59,7 +59,7 @@ void CParticleLinkDialog::setLink()
|
|||
if (curObj.empty())
|
||||
return;
|
||||
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem*>(_ui.treeView->currentIndex().internalPointer());
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(_ui.treeView->currentIndex().internalPointer());
|
||||
|
||||
NL3D::CSkeletonModel *skel = Modules::objView().getEntity(curObj).getSkeleton().getObjectPtr();
|
||||
uint boneIndex = item->getId();
|
||||
|
@ -85,7 +85,7 @@ void CParticleLinkDialog::resetModel()
|
|||
_ui.unlinkPushButton->setEnabled(false);
|
||||
}
|
||||
|
||||
void CParticleLinkDialog::clickedItem(const QModelIndex & index)
|
||||
void CParticleLinkDialog::clickedItem(const QModelIndex &index)
|
||||
{
|
||||
_ui.linkPushButton->setEnabled(true);
|
||||
_ui.unlinkPushButton->setEnabled(true);
|
||||
|
|
|
@ -44,7 +44,7 @@ private Q_SLOTS:
|
|||
void setLink();
|
||||
void setUnlink();
|
||||
void resetModel();
|
||||
void clickedItem(const QModelIndex & index);
|
||||
void clickedItem(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -56,14 +56,16 @@ CWorkspaceNode::~CWorkspaceNode()
|
|||
void CWorkspaceNode::memorizeState()
|
||||
{
|
||||
nlassert(_WS);
|
||||
if (!_PS) return;
|
||||
if (!_PS)
|
||||
return;
|
||||
_InitialPos.copySystemInitialPos(_PS);
|
||||
}
|
||||
|
||||
void CWorkspaceNode::restoreState()
|
||||
{
|
||||
nlassert(_WS);
|
||||
if (!_PS) return;
|
||||
if (!_PS)
|
||||
return;
|
||||
_InitialPos.restoreSystem();
|
||||
}
|
||||
|
||||
|
@ -78,7 +80,8 @@ void CWorkspaceNode::stickPSToSkeleton(NL3D::CSkeletonModel *skel,
|
|||
const std::string &parentBoneName)
|
||||
{
|
||||
nlassert(_WS);
|
||||
if (!_PSM) return;
|
||||
if (!_PSM)
|
||||
return;
|
||||
unstickPSFromSkeleton();
|
||||
_ParentSkelName = parentSkelName;
|
||||
_ParentBoneName = parentBoneName;
|
||||
|
@ -308,7 +311,7 @@ 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];
|
||||
_Nodes.clear();
|
||||
}
|
||||
|
|
|
@ -163,27 +163,27 @@ public:
|
|||
void setTriggerAnim(const std::string &anim);
|
||||
|
||||
private:
|
||||
std::string _TriggerAnim;
|
||||
NL3D::CParticleSystem *_PS;
|
||||
NL3D::CParticleSystemModel *_PSM;
|
||||
std::string _TriggerAnim;
|
||||
NL3D::CParticleSystem *_PS;
|
||||
NL3D::CParticleSystemModel *_PSM;
|
||||
|
||||
// Keep a shape bank per node because we want the whole path to identify the ps, not just its filename
|
||||
// (shape bank keeps the filename only)
|
||||
NL3D::CShapeBank *_ShapeBank;
|
||||
NL3D::CShapeBank *_ShapeBank;
|
||||
|
||||
// Relative path from which the ps was inserted
|
||||
// relative path is also a unique identifier for this ps in the workspace
|
||||
std::string _RelativePath;
|
||||
std::string _RelativePath;
|
||||
|
||||
// initial pos of system. Allow to restore the initial instances of the system when doing start / stop
|
||||
CPSInitialPos _InitialPos;
|
||||
bool _Modified;
|
||||
CParticleWorkspace *_WS;
|
||||
CPSInitialPos _InitialPos;
|
||||
bool _Modified;
|
||||
CParticleWorkspace *_WS;
|
||||
NLMISC::CRefPtr<NL3D::CSkeletonModel> _ParentSkel;
|
||||
bool _ResetAutoCount;
|
||||
bool _ResetAutoCount;
|
||||
//
|
||||
std::string _ParentSkelName;
|
||||
std::string _ParentBoneName;
|
||||
std::string _ParentSkelName;
|
||||
std::string _ParentBoneName;
|
||||
private:
|
||||
void setup(NL3D::CParticleSystemModel &psm);
|
||||
public:
|
||||
|
@ -339,13 +339,13 @@ public:
|
|||
|
||||
private:
|
||||
// use smart ptr to avoir prb wih resize
|
||||
TNodeVect _Nodes;
|
||||
TNodeVect _Nodes;
|
||||
// path + name of workspace
|
||||
std::string _Filename;
|
||||
bool _Modified;
|
||||
IModificationCallback *_ModificationCallback;
|
||||
std::string _Filename;
|
||||
bool _Modified;
|
||||
IModificationCallback *_ModificationCallback;
|
||||
// workspace user name
|
||||
std::string _Name;
|
||||
std::string _Name;
|
||||
|
||||
/// serial the object
|
||||
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
|
||||
|
|
|
@ -68,25 +68,25 @@ public:
|
|||
private:
|
||||
void setupUi();
|
||||
|
||||
QWidget *_dockWidgetContents;
|
||||
QGridLayout *_gridLayout;
|
||||
QGridLayout *_pagesGridLayout;
|
||||
QScrollArea *_scrollArea;
|
||||
QWidget *_scrollAreaWidgetContents;
|
||||
QWidget *_dockWidgetContents;
|
||||
QGridLayout *_gridLayout;
|
||||
QGridLayout *_pagesGridLayout;
|
||||
QScrollArea *_scrollArea;
|
||||
QWidget *_scrollAreaWidgetContents;
|
||||
|
||||
QStackedWidget *_stackedWidget;
|
||||
CWorkspacePage *_wpPage;
|
||||
CParticleSystemPage *_psPage;
|
||||
CLocatedBindablePage *_locatedBindablePage;
|
||||
CLocatedPage *_locatedPage;
|
||||
CForcePage *_forcePage;
|
||||
CLightPage *_lightPage;
|
||||
CZonePage *_zonePage;
|
||||
CSoundPage *_soundPage;
|
||||
CEmitterPage *_emitterPage;
|
||||
CPSMoverPage *_psMoverPage;
|
||||
QStackedWidget *_stackedWidget;
|
||||
CWorkspacePage *_wpPage;
|
||||
CParticleSystemPage *_psPage;
|
||||
CLocatedBindablePage *_locatedBindablePage;
|
||||
CLocatedPage *_locatedPage;
|
||||
CForcePage *_forcePage;
|
||||
CLightPage *_lightPage;
|
||||
CZonePage *_zonePage;
|
||||
CSoundPage *_soundPage;
|
||||
CEmitterPage *_emitterPage;
|
||||
CPSMoverPage *_psMoverPage;
|
||||
|
||||
CParticleTreeModel *_treeModel;
|
||||
CParticleTreeModel *_treeModel;
|
||||
|
||||
friend class CParticleWorkspaceDialog;
|
||||
}; /* class CPropertyDialog */
|
||||
|
|
|
@ -117,7 +117,7 @@ private:
|
|||
}
|
||||
|
||||
/// the sound being edited
|
||||
NL3D::CPSSound *_Sound;
|
||||
NL3D::CPSSound *_Sound;
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ private:
|
|||
if ((_Node) && (enabledModifiedFlag)) _Node->setModified(true);
|
||||
}
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
struct CGlobalColorWrapper : public IPSSchemeWrapperRGBA
|
||||
{
|
||||
|
|
|
@ -68,10 +68,10 @@ private Q_SLOTS:
|
|||
private:
|
||||
void updateTexture();
|
||||
|
||||
IPSWrapperTexture *_Wrapper ;
|
||||
IPSWrapperTexture *_Wrapper;
|
||||
|
||||
// the current texture
|
||||
NLMISC::CSmartPtr<NL3D::ITexture> _Texture ;
|
||||
NLMISC::CSmartPtr<NL3D::ITexture> _Texture;
|
||||
|
||||
Ui::CParticleTextureWidget _ui;
|
||||
}; /* class CParticleTextureWidget */
|
||||
|
|
|
@ -114,7 +114,7 @@ CParticleTreeItem *CParticleTreeItem::parent()
|
|||
int CParticleTreeItem::row() const
|
||||
{
|
||||
if (_parentItem)
|
||||
return _parentItem->_childItems.indexOf(const_cast<CParticleTreeItem*>(this));
|
||||
return _parentItem->_childItems.indexOf(const_cast<CParticleTreeItem *>(this));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ QVariant CParticleTreeModel::data(const QModelIndex &index, int role) const
|
|||
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
if (item->itemType() == ItemType::ParticleSystem)
|
||||
{
|
||||
if (item->getNode()->isModified())
|
||||
|
@ -203,7 +203,7 @@ QVariant CParticleTreeModel::data(const QModelIndex &index, int role) const
|
|||
}
|
||||
if (role == Qt::FontRole)
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
if (Modules::psEdit().getActiveNode() != NULL)
|
||||
{
|
||||
if (item->data(0) == QString(Modules::psEdit().getActiveNode()->getFilename().c_str()))
|
||||
|
@ -224,7 +224,7 @@ Qt::ItemFlags CParticleTreeModel::flags(const QModelIndex &index) const
|
|||
if (!index.isValid())
|
||||
return itmFlags;
|
||||
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
switch (item->itemType())
|
||||
{
|
||||
case ItemType::Particle:
|
||||
|
@ -247,7 +247,7 @@ Qt::ItemFlags CParticleTreeModel::flags(const QModelIndex &index) const
|
|||
break;
|
||||
}
|
||||
|
||||
//CParticleWorkspaceDialog *pwsd = qobject_cast<CParticleWorkspaceDialog*>(QObject::parent());
|
||||
//CParticleWorkspaceDialog *pwsd = qobject_cast<CParticleWorkspaceDialog *>(QObject::parent());
|
||||
//pwsd->updateTreeView();
|
||||
|
||||
return itmFlags;
|
||||
|
@ -273,7 +273,7 @@ const
|
|||
if (!parent.isValid())
|
||||
parentItem = _rootItem;
|
||||
else
|
||||
parentItem = static_cast<CParticleTreeItem*>(parent.internalPointer());
|
||||
parentItem = static_cast<CParticleTreeItem *>(parent.internalPointer());
|
||||
|
||||
CParticleTreeItem *childItem = parentItem->child(row);
|
||||
if (childItem)
|
||||
|
@ -287,7 +287,7 @@ QModelIndex CParticleTreeModel::parent(const QModelIndex &index) const
|
|||
if (!index.isValid())
|
||||
return QModelIndex();
|
||||
|
||||
CParticleTreeItem *childItem = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *childItem = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
CParticleTreeItem *parentItem = childItem->parent();
|
||||
|
||||
if (parentItem == _rootItem)
|
||||
|
@ -305,7 +305,7 @@ int CParticleTreeModel::rowCount(const QModelIndex &parent) const
|
|||
if (!parent.isValid())
|
||||
parentItem = _rootItem;
|
||||
else
|
||||
parentItem = static_cast<CParticleTreeItem*>(parent.internalPointer());
|
||||
parentItem = static_cast<CParticleTreeItem *>(parent.internalPointer());
|
||||
|
||||
return parentItem->childCount();
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ bool CParticleTreeModel::setData(const QModelIndex &index, const QVariant &value
|
|||
{
|
||||
if (index.isValid() && role == Qt::EditRole)
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
QList<QVariant> listData;
|
||||
listData << value;
|
||||
item->replace(listData);
|
||||
|
@ -331,7 +331,7 @@ bool CParticleTreeModel::setData(const QModelIndex &index, const QVariant &value
|
|||
|
||||
QIcon CParticleTreeModel::getIcon(const QModelIndex &index) const
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
switch (item->itemType())
|
||||
{
|
||||
case ItemType::Root:
|
||||
|
@ -364,7 +364,7 @@ QIcon CParticleTreeModel::getIcon(const QModelIndex &index) const
|
|||
|
||||
bool CParticleTreeModel::insertRows(CWorkspaceNode *node, int position, const QModelIndex &parent)
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(parent.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(parent.internalPointer());
|
||||
|
||||
beginInsertRows(parent, position, position);
|
||||
setupModelFromPS(node, item);
|
||||
|
@ -373,7 +373,7 @@ bool CParticleTreeModel::insertRows(CWorkspaceNode *node, int position, const QM
|
|||
if (node->isLoaded())
|
||||
{
|
||||
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));
|
||||
insertRows(loc, k, indexPS);
|
||||
|
@ -384,7 +384,7 @@ bool CParticleTreeModel::insertRows(CWorkspaceNode *node, int position, const QM
|
|||
|
||||
bool CParticleTreeModel::insertRows(NL3D::CPSLocated *loc, int position, const QModelIndex &parent)
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(parent.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(parent.internalPointer());
|
||||
|
||||
beginInsertRows(parent, position, position);
|
||||
createItemFromLocated(loc, item);
|
||||
|
@ -403,7 +403,7 @@ bool CParticleTreeModel::insertRows(NL3D::CPSLocated *loc, int position, const Q
|
|||
bool CParticleTreeModel::insertRow(NL3D::CPSLocated *loc, uint32 index, int position, const QModelIndex &parent)
|
||||
{
|
||||
beginInsertRows(parent, position, position);
|
||||
createItemFromLocatedInstance(loc, index, static_cast<CParticleTreeItem*>(parent.internalPointer()));
|
||||
createItemFromLocatedInstance(loc, index, static_cast<CParticleTreeItem *>(parent.internalPointer()));
|
||||
endInsertRows();
|
||||
return true;
|
||||
}
|
||||
|
@ -411,14 +411,14 @@ bool CParticleTreeModel::insertRow(NL3D::CPSLocated *loc, uint32 index, int posi
|
|||
bool CParticleTreeModel::insertRow(NL3D::CPSLocatedBindable *lb, int position, const QModelIndex &parent)
|
||||
{
|
||||
beginInsertRows(parent, position, position);
|
||||
createItemFromLocatedBindable(lb, static_cast<CParticleTreeItem*>(parent.internalPointer()));
|
||||
createItemFromLocatedBindable(lb, static_cast<CParticleTreeItem *>(parent.internalPointer()));
|
||||
endInsertRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParticleTreeModel::removeRows(int position, const QModelIndex &parent)
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(parent.internalPointer())->child(position);
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(parent.internalPointer())->child(position);
|
||||
while (item->childCount() != 0)
|
||||
removeRows(0, parent.child(position, 0));
|
||||
|
||||
|
@ -454,14 +454,14 @@ CWorkspaceNode *CParticleTreeModel::getOwnerNode(CParticleTreeItem *item) const
|
|||
|
||||
void CParticleTreeModel::rebuildLocatedInstance(const QModelIndex &parent)
|
||||
{
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(parent.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(parent.internalPointer());
|
||||
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)
|
||||
{
|
||||
item->child(i)->setLocatedInstanceIndex(k);
|
||||
k++;
|
||||
++k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ void CParticleTreeModel::setupModelFromWorkSpace()
|
|||
|
||||
QModelIndex rootIndex = index(0, 0);
|
||||
uint numNode = workspace->getNumNode();
|
||||
for (uint i = 0; i < numNode; i++)
|
||||
for (uint i = 0; i < numNode; ++i)
|
||||
insertRows(workspace->getNode(i), i, rootIndex);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,16 +99,16 @@ public:
|
|||
private:
|
||||
union
|
||||
{
|
||||
CParticleWorkspace *_WS;
|
||||
NL3D::CPSLocated *_Loc;
|
||||
NL3D::CPSLocatedBindable *_Bind;
|
||||
CWorkspaceNode *_PS;
|
||||
CParticleWorkspace *_WS;
|
||||
NL3D::CPSLocated *_Loc;
|
||||
NL3D::CPSLocatedBindable *_Bind;
|
||||
CWorkspaceNode *_PS;
|
||||
};
|
||||
|
||||
// for the located instance type, this is the index of the instance
|
||||
uint32 _LocatedInstanceIndex;
|
||||
|
||||
QList<CParticleTreeItem*> _childItems;
|
||||
QList<CParticleTreeItem *> _childItems;
|
||||
QList<QVariant> _itemData;
|
||||
int _itemIconType;
|
||||
CParticleTreeItem *_parentItem;
|
||||
|
|
|
@ -123,7 +123,8 @@ struct Action
|
|||
static std::map<std::string, uint> _PSElementIdentifiers;
|
||||
|
||||
CParticleWorkspaceDialog::CParticleWorkspaceDialog(QWidget *parent)
|
||||
: QDockWidget(parent), _currentItem(NULL)
|
||||
: QDockWidget(parent),
|
||||
_currentItem(NULL)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
@ -218,7 +219,7 @@ void CParticleWorkspaceDialog::clickedItem(const QModelIndex & index)
|
|||
if (_currentItem != NULL)
|
||||
_treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL);
|
||||
|
||||
_currentItem = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
_currentItem = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
|
||||
if (index.flags() != Qt::NoItemFlags)
|
||||
_PropertyDialog->setCurrentEditedElement(_currentItem);
|
||||
|
@ -303,7 +304,7 @@ void CParticleWorkspaceDialog::customContextMenu()
|
|||
void CParticleWorkspaceDialog::setActiveNode()
|
||||
{
|
||||
QModelIndex index = _ui.treeView->currentIndex();
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
nlassert(item->getNode());
|
||||
Modules::psEdit().setActiveNode(item->getNode());
|
||||
Q_EMIT changeActiveNode();
|
||||
|
@ -365,7 +366,7 @@ void CParticleWorkspaceDialog::removePS()
|
|||
QModelIndex index = _ui.treeView->currentIndex();
|
||||
_ui.treeView->setCurrentIndex(index.parent());
|
||||
clickedItem(index.parent());
|
||||
Modules::psEdit().getParticleWorkspace()->removeNode(static_cast<CParticleTreeItem*>(index.internalPointer())->getNode());
|
||||
Modules::psEdit().getParticleWorkspace()->removeNode(static_cast<CParticleTreeItem *>(index.internalPointer())->getNode());
|
||||
_treeModel->removeRows(index.row(), index.parent());
|
||||
}
|
||||
|
||||
|
@ -605,7 +606,7 @@ void CParticleWorkspaceDialog::deleteItem()
|
|||
{
|
||||
_treeModel->getOwnerNode(_currentItem)->setModified(true);
|
||||
QModelIndex index = _ui.treeView->currentIndex();
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem*>(index.internalPointer());
|
||||
CParticleTreeItem *item = static_cast<CParticleTreeItem *>(index.internalPointer());
|
||||
CWorkspaceNode *ownerNode = _treeModel->getOwnerNode(item);
|
||||
nlassert(ownerNode);
|
||||
_ui.treeView->setCurrentIndex(index.parent());
|
||||
|
|
|
@ -123,7 +123,7 @@ private:
|
|||
QAction *_lod2Action;
|
||||
QAction *_externIDAction;
|
||||
|
||||
std::auto_ptr<NL3D::CPSLocated> _LocatedCopy;
|
||||
std::auto_ptr<NL3D::CPSLocated> _LocatedCopy;
|
||||
std::auto_ptr<NL3D::CPSLocatedBindable> _LocatedBindableCopy;
|
||||
|
||||
CParticleTreeItem *_currentItem;
|
||||
|
|
|
@ -141,7 +141,7 @@ void CWorkspacePage::insertPS()
|
|||
else
|
||||
{
|
||||
QModelIndex index = _treeModel->index(0, 0);
|
||||
_treeModel->insertRows(node, static_cast<CParticleTreeItem*>(index.internalPointer())->childCount(), index);
|
||||
_treeModel->insertRows(node, static_cast<CParticleTreeItem *>(index.internalPointer())->childCount(), index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ void CWorkspacePage::createPS()
|
|||
return;
|
||||
}
|
||||
QModelIndex index = _treeModel->index(0, 0);
|
||||
_treeModel->insertRows(node, static_cast<CParticleTreeItem*>(index.internalPointer())->childCount(), index);
|
||||
_treeModel->insertRows(node, static_cast<CParticleTreeItem *>(index.internalPointer())->childCount(), index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ namespace NLQT
|
|||
|
||||
/**
|
||||
@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
|
||||
{
|
||||
|
|
|
@ -130,7 +130,7 @@ void CZonePage::updateTargets()
|
|||
};
|
||||
|
||||
// fill abox with the available targets
|
||||
NL3D::CParticleSystem *ps = _LBTarget->getOwner()->getOwner();
|
||||
NL3D::CParticleSystem *ps = _LBTarget->getOwner()->getOwner();
|
||||
|
||||
uint nbLocated = ps->getNbProcess();
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
NL3D::CPSTargetLocatedBindable *_LBTarget;
|
||||
|
||||
/// the collision zone being edited
|
||||
NL3D::CPSZone *_Zone ;
|
||||
NL3D::CPSZone *_Zone ;
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ bool MyPlugin::initialize(NLQT::IPluginManager *pluginManager, QString *errorStr
|
|||
_plugMan = pluginManager;
|
||||
QString str;
|
||||
|
||||
QList<NLQT::IPluginSpec *> listPlug = pluginManager->plugins();
|
||||
QList<NLQT::IPluginSpec *> listPlug = pluginManager->plugins();
|
||||
|
||||
Q_FOREACH (NLQT::IPluginSpec *plugSpec, listPlug)
|
||||
str += plugSpec->name();
|
||||
|
@ -32,6 +32,8 @@ bool MyPlugin::initialize(NLQT::IPluginManager *pluginManager, QString *errorStr
|
|||
void MyPlugin::extensionsInitialized()
|
||||
{
|
||||
QMenu *helpMenu = qobject_cast<QMenu *>(objectByName("ovqt.Menu.Help"));
|
||||
nlassert(helpMenu);
|
||||
|
||||
helpMenu->addSeparator();
|
||||
QAction *newAction = helpMenu->addAction("MyPlugin");
|
||||
|
||||
|
@ -41,6 +43,8 @@ void MyPlugin::extensionsInitialized()
|
|||
void MyPlugin::execMessageBox()
|
||||
{
|
||||
QMainWindow *wnd = qobject_cast<QMainWindow *>(objectByName("CMainWindow"));
|
||||
nlassert(wnd);
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(wnd->objectName() + QString(": width=%1,height=%2").arg(wnd->width()).arg(wnd->height()));
|
||||
msgBox.exec();
|
||||
|
|
|
@ -57,7 +57,7 @@ CPSMoverPage::CPSMoverPage(QWidget *parent)
|
|||
|
||||
connect(_ui.directionWidget, SIGNAL(valueChanged(NLMISC::CVector)), this, SLOT(setDir(NLMISC::CVector)));
|
||||
|
||||
connect(_ui.listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
|
||||
connect(_ui.listWidget, SIGNAL(currentItemChanged(QListWidgetItem *,QListWidgetItem *)),
|
||||
this, SLOT(changeSubComponent()));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#ifndef PS_MOVER_PAGE_H
|
||||
#define PS_MOVER_PAGE_H
|
||||
|
||||
|
||||
#include <nel/misc/types_nl.h>
|
||||
#include "ui_ps_mover_form.h"
|
||||
|
||||
|
@ -81,7 +80,7 @@ public:
|
|||
void updatePosition(void) ;
|
||||
|
||||
/// get the current moving interface, or NULL, if the selected object has no IPSMover interface
|
||||
NL3D::IPSMover *getMoverInterface(void) ;
|
||||
NL3D::IPSMover *getMoverInterface(void);
|
||||
|
||||
/// get the located being edited
|
||||
NL3D::CPSLocated *getLocated(void)
|
||||
|
@ -90,17 +89,17 @@ public:
|
|||
}
|
||||
const NL3D::CPSLocated *getLocated(void) const
|
||||
{
|
||||
return _EditedLocated ;
|
||||
return _EditedLocated;
|
||||
}
|
||||
|
||||
/// get the index of the current edited item
|
||||
uint32 getLocatedIndex(void) const
|
||||
{
|
||||
return _EditedLocatedIndex ;
|
||||
return _EditedLocatedIndex;
|
||||
}
|
||||
|
||||
/// ghet the current located bindable being edited, or null
|
||||
NL3D::CPSLocatedBindable *getLocatedBindable(void) ;
|
||||
NL3D::CPSLocatedBindable *getLocatedBindable(void);
|
||||
|
||||
private Q_SLOTS:
|
||||
void setXPosition(double value);
|
||||
|
@ -185,11 +184,11 @@ private:
|
|||
/// update the mouse listener position when the user entered a value with the keyboard
|
||||
void updateListener(void) ;
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
NL3D::CPSLocated *_EditedLocated ;
|
||||
NL3D::CPSLocated *_EditedLocated ;
|
||||
|
||||
uint32 _EditedLocatedIndex ;
|
||||
uint32 _EditedLocatedIndex ;
|
||||
|
||||
Ui::CPSMoverPage _ui;
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
// STL includes
|
||||
|
||||
// NeL includes
|
||||
#include <nel/misc/config_file.h>
|
||||
#include <nel/misc/rgba.h>
|
||||
|
||||
// Project includes
|
||||
|
@ -49,6 +48,7 @@ public:
|
|||
private Q_SLOTS:
|
||||
void apply();
|
||||
void setColor();
|
||||
|
||||
private:
|
||||
NLMISC::CRGBA colorFog;
|
||||
|
||||
|
|
|
@ -128,9 +128,9 @@ void CSkeletonScaleDialog::setCurrentShape(const QString &name)
|
|||
_BkupBones = _Bones;
|
||||
}
|
||||
|
||||
void CSkeletonScaleDialog::setCurrentBone(const QModelIndex & index)
|
||||
void CSkeletonScaleDialog::setCurrentBone(const QModelIndex &index)
|
||||
{
|
||||
CSkeletonTreeItem *currentItem = static_cast<CSkeletonTreeItem*>(index.internalPointer());
|
||||
CSkeletonTreeItem *currentItem = static_cast<CSkeletonTreeItem *>(index.internalPointer());
|
||||
|
||||
// bkup for undo
|
||||
static TBoneMirrorArray precState;
|
||||
|
@ -208,7 +208,7 @@ void CSkeletonScaleDialog::clickMirrorSelected()
|
|||
|
||||
// for each bone selected
|
||||
bool change= false;
|
||||
for(uint i=0; i<_Bones.size(); i++)
|
||||
for(uint i=0; i < _Bones.size(); ++i)
|
||||
{
|
||||
CBoneMirror &bone= _Bones[i];
|
||||
if(bone.Selected)
|
||||
|
@ -468,7 +468,7 @@ void CSkeletonScaleDialog::applyMirrorToSkeleton()
|
|||
if(!_Skeleton.empty())
|
||||
{
|
||||
nlassert(_Skeleton.getNumBones() == _Bones.size());
|
||||
for(uint i = 0; i < _Bones.size(); i++)
|
||||
for(uint i = 0; i < _Bones.size(); ++i)
|
||||
{
|
||||
// unmul from precision
|
||||
NLMISC::CVector boneScale = _Bones[i].BoneScale / ssd_scale_precision;
|
||||
|
@ -484,7 +484,7 @@ void CSkeletonScaleDialog::applySkeletonToMirror()
|
|||
if(!_Skeleton.empty())
|
||||
{
|
||||
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
|
||||
_Bones[i].SkinScale = _Skeleton.getBone(i).getSkinScale() * ssd_scale_precision;
|
||||
|
@ -517,7 +517,7 @@ void CSkeletonScaleDialog::applySelectionToView()
|
|||
{
|
||||
_ui.treeView->blockSignals(true);
|
||||
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)
|
||||
_ui.treeView->setCurrentIndex(model->getIndexFromId(i, model->index(0, 0)));
|
||||
|
@ -527,7 +527,7 @@ void CSkeletonScaleDialog::applySelectionToView()
|
|||
|
||||
sint CSkeletonScaleDialog::getBoneForMirror(uint boneId, std::string &mirrorName)
|
||||
{
|
||||
sint side= 0;
|
||||
sint side= 0;
|
||||
std::string::size_type pos;
|
||||
nlassert(!_Skeleton.empty() && (boneId < _Skeleton.getNumBones()));
|
||||
mirrorName= _Skeleton.getBone(boneId).getObjectPtr()->getBoneName();
|
||||
|
@ -561,7 +561,7 @@ bool CSkeletonScaleDialog::saveCurrentInStream(NLMISC::IStream &f)
|
|||
|
||||
// Retrieve boneBase definition from the current skeleton
|
||||
std::vector<NL3D::CBoneBase> boneBases;
|
||||
(NLMISC::safe_cast<NL3D::CSkeletonShape*>((NL3D::IShape*)_Skeleton.getObjectPtr()->Shape))->retrieve(boneBases);
|
||||
(NLMISC::safe_cast<NL3D::CSkeletonShape *>((NL3D::IShape *)_Skeleton.getObjectPtr()->Shape))->retrieve(boneBases);
|
||||
|
||||
// Copies bone scales from the model
|
||||
nlassert(boneBases.size() == _Skeleton.getNumBones());
|
||||
|
@ -615,7 +615,7 @@ bool CSkeletonScaleDialog::saveSkelScaleInStream(NLMISC::IStream &f)
|
|||
// Copies bone scales from the model
|
||||
std::vector<CBoneScaleInfo> boneScales;
|
||||
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();
|
||||
CBoneScaleInfo &boneScale= boneScales[i];
|
||||
|
@ -651,7 +651,7 @@ bool CSkeletonScaleDialog::loadSkelScaleFromStream(NLMISC::IStream &f)
|
|||
f.serialCont(boneScales);
|
||||
|
||||
// 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);
|
||||
if(boneId >= 0 && boneId < (sint32)_Skeleton.getNumBones())
|
||||
|
@ -689,7 +689,7 @@ void CSkeletonScaleDialog::pushUndoState(const TBoneMirrorArray &precState, bool
|
|||
// test if real change
|
||||
nlassert(precState.size() == _Bones.size());
|
||||
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 ||
|
||||
_Bones[i].SkinScale!=precState[i].SkinScale ||
|
||||
|
|
|
@ -76,7 +76,7 @@ public Q_SLOTS:
|
|||
void setCurrentShape(const QString &name);
|
||||
|
||||
private Q_SLOTS:
|
||||
void setCurrentBone(const QModelIndex & index);
|
||||
void setCurrentBone(const QModelIndex &index);
|
||||
void setBoneSliderX(int value);
|
||||
void setBoneSliderY(int value);
|
||||
void setBoneSliderZ(int value);
|
||||
|
|
|
@ -46,7 +46,7 @@ CSkeletonTreeModel::~CSkeletonTreeModel()
|
|||
int CSkeletonTreeModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
if (parent.isValid())
|
||||
return static_cast<CSkeletonTreeItem*>(parent.internalPointer())->columnCount();
|
||||
return static_cast<CSkeletonTreeItem *>(parent.internalPointer())->columnCount();
|
||||
else
|
||||
return _rootItem->columnCount();
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ QVariant CSkeletonTreeModel::data(const QModelIndex &index, int role) const
|
|||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem*>(index.internalPointer());
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(index.internalPointer());
|
||||
|
||||
return item->data(index.column());
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ const
|
|||
if (!parent.isValid())
|
||||
parentItem = _rootItem;
|
||||
else
|
||||
parentItem = static_cast<CSkeletonTreeItem*>(parent.internalPointer());
|
||||
parentItem = static_cast<CSkeletonTreeItem *>(parent.internalPointer());
|
||||
|
||||
CSkeletonTreeItem *childItem = parentItem->child(row);
|
||||
if (childItem)
|
||||
|
@ -106,7 +106,7 @@ QModelIndex CSkeletonTreeModel::parent(const QModelIndex &index) const
|
|||
if (!index.isValid())
|
||||
return QModelIndex();
|
||||
|
||||
CSkeletonTreeItem *childItem = static_cast<CSkeletonTreeItem*>(index.internalPointer());
|
||||
CSkeletonTreeItem *childItem = static_cast<CSkeletonTreeItem *>(index.internalPointer());
|
||||
CSkeletonTreeItem *parentItem = childItem->parent();
|
||||
|
||||
if (parentItem == _rootItem)
|
||||
|
@ -124,7 +124,7 @@ int CSkeletonTreeModel::rowCount(const QModelIndex &parent) const
|
|||
if (!parent.isValid())
|
||||
parentItem = _rootItem;
|
||||
else
|
||||
parentItem = static_cast<CSkeletonTreeItem*>(parent.internalPointer());
|
||||
parentItem = static_cast<CSkeletonTreeItem *>(parent.internalPointer());
|
||||
|
||||
return parentItem->childCount();
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ void CSkeletonTreeModel::rebuildModel()
|
|||
|
||||
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);
|
||||
sint32 parentId = bone.getObjectPtr()->getFatherId();
|
||||
|
@ -182,12 +182,12 @@ void CSkeletonTreeModel::resetTreeModel()
|
|||
QModelIndex CSkeletonTreeModel::getIndexFromId(sint id, const QModelIndex &parent)
|
||||
{
|
||||
QModelIndex currentIndex = parent;
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem*>(parent.internalPointer());
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(parent.internalPointer());
|
||||
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));
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem*>(currentIndex.internalPointer());
|
||||
CSkeletonTreeItem *item = static_cast<CSkeletonTreeItem *>(currentIndex.internalPointer());
|
||||
if (item->getId() == id)
|
||||
return currentIndex;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
int row() const
|
||||
{
|
||||
if (_parentItem)
|
||||
return _parentItem->_childItems.indexOf(const_cast<CSkeletonTreeItem*>(this));
|
||||
return _parentItem->_childItems.indexOf(const_cast<CSkeletonTreeItem *>(this));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
QList<CSkeletonTreeItem*> _childItems;
|
||||
QList<CSkeletonTreeItem *> _childItems;
|
||||
QList<QVariant> _itemData;
|
||||
sint32 _id;
|
||||
CSkeletonTreeItem *_parentItem;
|
||||
|
|
|
@ -33,7 +33,9 @@ namespace NLQT
|
|||
|
||||
CSlotGroupBox::CSlotGroupBox(QWidget *parent)
|
||||
: QGroupBox(parent),
|
||||
_animName("empty"), _skelName("empty"), _numSlot(0)
|
||||
_animName("empty"),
|
||||
_skelName("empty"),
|
||||
_numSlot(0)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
@ -239,7 +241,7 @@ CSlotManagerDialog::CSlotManagerDialog(QWidget *parent)
|
|||
_tabWidget->setObjectName(QString::fromUtf8("_tabWidget"));
|
||||
_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]->setObjectName(QString::fromUtf8("_tab%1").arg(i));
|
||||
|
@ -276,7 +278,7 @@ CSlotManagerDialog::~CSlotManagerDialog()
|
|||
|
||||
void CSlotManagerDialog::updateUiSlots()
|
||||
{
|
||||
for (int i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; i++)
|
||||
for (int i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; ++i)
|
||||
{
|
||||
_slotGroupBoxs[i]->updateUi();
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ namespace NLQT
|
|||
|
||||
CSoundSystem::CSoundSystem()
|
||||
:_AudioMixer(NULL),
|
||||
_AnimManager(NULL),
|
||||
_Zero(NLMISC::CVector::Null)
|
||||
_AnimManager(NULL),
|
||||
_Zero(NLMISC::CVector::Null)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public:
|
|||
}
|
||||
|
||||
/// Returns a reference to the animation manager
|
||||
NLSOUND::CSoundAnimManager* getSoundAnimManager()
|
||||
NLSOUND::CSoundAnimManager *getSoundAnimManager()
|
||||
{
|
||||
return _AnimManager;
|
||||
}
|
||||
|
@ -121,13 +121,13 @@ public:
|
|||
void update();
|
||||
|
||||
private:
|
||||
NLSOUND::UAudioMixer *_AudioMixer;
|
||||
std::set<std::string> _SampleBanksFileName;
|
||||
NLSOUND::CSoundAnimManager *_AnimManager;
|
||||
NLMISC::CVector _Zero;
|
||||
std::string _SamplePath;
|
||||
std::string _PackedSheetPath;
|
||||
NLMISC::CMatrix oldMatrix;
|
||||
NLSOUND::UAudioMixer *_AudioMixer;
|
||||
std::set<std::string> _SampleBanksFileName;
|
||||
NLSOUND::CSoundAnimManager *_AnimManager;
|
||||
NLMISC::CVector _Zero;
|
||||
std::string _SamplePath;
|
||||
std::string _PackedSheetPath;
|
||||
NLMISC::CMatrix oldMatrix;
|
||||
}; /* class CSoundSystem */
|
||||
|
||||
} /* namespace NLQT */
|
||||
|
|
|
@ -24,7 +24,9 @@ namespace NLQT
|
|||
{
|
||||
|
||||
CSpinnerDialog::CSpinnerDialog(NL3D::CPSBasisSpinner *sf, CWorkspaceNode *ownerNode, QWidget *parent)
|
||||
: QDialog(parent), _Node(ownerNode), _BasicSpinner(sf)
|
||||
: QDialog(parent),
|
||||
_Node(ownerNode),
|
||||
_BasicSpinner(sf)
|
||||
{
|
||||
nlassert(_BasicSpinner);
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ private Q_SLOTS:
|
|||
private:
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
NL3D::CPSTailParticle *_TailParticle;
|
||||
NL3D::CPSTailParticle *_TailParticle;
|
||||
|
||||
Ui::CTailParticleWidget _ui;
|
||||
}; /* class CTailParticleWidget */
|
||||
|
|
|
@ -58,7 +58,7 @@ CGradientDialog::CGradientDialog(CWorkspaceNode *ownerNode,
|
|||
sizePolicy.setHeightForWidth(_listWidget->sizePolicy().hasHeightForWidth());
|
||||
_listWidget->setSizePolicy(sizePolicy);
|
||||
//_listWidget->setIconSize(QSize(16, 16));
|
||||
_listWidget->setMaximumSize(QSize(175, 16777215));
|
||||
_listWidget->setMaximumSize(QSize(185, 16777215));
|
||||
_gridLayout->addWidget(_listWidget, 0, 0, 9, 1);
|
||||
|
||||
_horizontalLayout = new QHBoxLayout();
|
||||
|
|
|
@ -114,19 +114,19 @@ private Q_SLOTS:
|
|||
protected:
|
||||
|
||||
// the minimum number of element in the gradient
|
||||
uint _MinSize;
|
||||
uint _MinSize;
|
||||
|
||||
// false to disable the dialog that control the number of stages between each value
|
||||
bool _CanTuneNbStages;
|
||||
bool _CanTuneNbStages;
|
||||
|
||||
IValueGradientClient *_ClientInterface;
|
||||
|
||||
bool _DestroyClientInterface;
|
||||
bool _DestroyClientInterface;
|
||||
|
||||
// the current size of the gradient
|
||||
uint _Size;
|
||||
uint _Size;
|
||||
|
||||
CWorkspaceNode *_Node;
|
||||
CWorkspaceNode *_Node;
|
||||
|
||||
// a wrapper to tune the number of step
|
||||
struct CNbStepWrapper :public IPSWrapperUInt
|
||||
|
|
|
@ -114,7 +114,7 @@ void CVegetableApperancePage::setNoiseValueColor(const NLMISC::CNoiseValue &valu
|
|||
Modules::veget().refreshVegetableDisplay();
|
||||
}
|
||||
|
||||
void CVegetableApperancePage::browseColor(QListWidgetItem * item)
|
||||
void CVegetableApperancePage::browseColor(QListWidgetItem *item)
|
||||
{
|
||||
sint row = _ui.listWidget->currentRow();
|
||||
|
||||
|
@ -208,7 +208,7 @@ void CVegetableApperancePage::getFromListColors()
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ private Q_SLOTS:
|
|||
void setNoiseValueBendPhase(const NLMISC::CNoiseValue &value);
|
||||
void setNoiseValueBendFactor(const NLMISC::CNoiseValue &value);
|
||||
void setNoiseValueColor(const NLMISC::CNoiseValue &value);
|
||||
void browseColor(QListWidgetItem * item);
|
||||
void browseColor(QListWidgetItem *item);
|
||||
void addNewColor();
|
||||
void insNewColor();
|
||||
void removeColor();
|
||||
|
@ -61,7 +61,7 @@ private:
|
|||
void updateColorList();
|
||||
|
||||
// The vegetable to edit.
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
|
||||
Ui::CVegetableApperancePage _ui;
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ CVegetableDensityPage::CVegetableDensityPage(QWidget *parent)
|
|||
_ui.maxDensityWidget->setRange(0, NL_VEGETABLE_EDIT_DEFAULT_MAX_DENSITY);
|
||||
_ui.maxDensityWidget->enableLowerBound(0, false);
|
||||
|
||||
|
||||
connect(_ui.browseShapePushButton, SIGNAL(clicked()), this, SLOT(browseShapeVeget()));
|
||||
connect(_ui.distanceSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setDistanceOfCreat(int)));
|
||||
connect(_ui.densityGroupBox, SIGNAL(noiseValueChanged(NLMISC::CNoiseValue)), this, SLOT(setDensity(NLMISC::CNoiseValue)));
|
||||
|
|
|
@ -65,7 +65,7 @@ private:
|
|||
void updateAngleMax();
|
||||
|
||||
// The vegetable to edit.
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
|
||||
float _PrecMaxDensityValue;
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ void CVegetableDialog::addVegetList()
|
|||
|
||||
// update view
|
||||
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
|
||||
Modules::veget().refreshVegetableDisplay();
|
||||
|
@ -167,7 +167,7 @@ void CVegetableDialog::removeVegetList()
|
|||
QListWidgetItem *item = _ui.listWidget->takeItem(id);
|
||||
delete item;
|
||||
|
||||
id--;
|
||||
--id;
|
||||
|
||||
_ui.listWidget->setCurrentRow(id);
|
||||
|
||||
|
@ -185,7 +185,7 @@ void CVegetableDialog::insVegetList()
|
|||
|
||||
// update view
|
||||
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);
|
||||
|
||||
// update 3D view
|
||||
|
@ -239,7 +239,7 @@ void CVegetableDialog::loadVegetdesc()
|
|||
|
||||
// update view
|
||||
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
|
||||
Modules::veget().refreshVegetableDisplay();
|
||||
|
@ -261,7 +261,7 @@ void CVegetableDialog::saveVegetdesc()
|
|||
|
||||
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.
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save Vegetable Descriptor"),
|
||||
|
@ -277,7 +277,7 @@ void CVegetableDialog::saveVegetdesc()
|
|||
try
|
||||
{
|
||||
// save the vegetable
|
||||
f.serial(*vegetNode->Vegetable);
|
||||
f.serial(*vegetNode->_vegetable);
|
||||
}
|
||||
catch(NLMISC::EStream &e)
|
||||
{
|
||||
|
@ -299,7 +299,7 @@ void CVegetableDialog::setCurrentItem(int row)
|
|||
{
|
||||
NL3D::CVegetable *veget = NULL;
|
||||
if (row != -1)
|
||||
veget = Modules::veget().getVegetable(row)->Vegetable;
|
||||
veget = Modules::veget().getVegetable(row)->_vegetable;
|
||||
_ui.densityPage->setVegetableToEdit(veget);
|
||||
_ui.appearancePage->setVegetableToEdit(veget);
|
||||
_ui.scalePage->setVegetableToEdit(veget);
|
||||
|
|
|
@ -60,10 +60,10 @@ void CVegetableEditor::init()
|
|||
//H_AUTO2
|
||||
nldebug("CVegetableEditor::init");
|
||||
|
||||
NL3D::CDriverUser *driver = dynamic_cast<NL3D::CDriverUser*>(Modules::objView().getDriver());
|
||||
NL3D::CDriverUser *driver = dynamic_cast<NL3D::CDriverUser *>(Modules::objView().getDriver());
|
||||
_Driver = driver->getDriver();
|
||||
|
||||
NL3D::CSceneUser *scene = dynamic_cast<NL3D::CSceneUser*>(Modules::objView().getScene());
|
||||
NL3D::CSceneUser *scene = dynamic_cast<NL3D::CSceneUser *>(Modules::objView().getScene());
|
||||
_Scene = &scene->getScene();
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ bool CVegetableEditor::createVegetableLandscape()
|
|||
loadLandscapeSetup();
|
||||
|
||||
// create the landscape.
|
||||
_VegetableLandscape= static_cast<NL3D::CLandscapeModel*>(Modules::veget().getScene()->createModel(NL3D::LandscapeModelId));
|
||||
_VegetableLandscape= static_cast<NL3D::CLandscapeModel *>(Modules::veget().getScene()->createModel(NL3D::LandscapeModelId));
|
||||
|
||||
// create progress dialog
|
||||
QProgressDialog progress("Loading TileBanks....", "Cancel", 0, 100);
|
||||
|
@ -143,7 +143,7 @@ bool CVegetableEditor::createVegetableLandscape()
|
|||
// count nbText to load.
|
||||
sint ts;
|
||||
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);
|
||||
nbTextTotal += tileSet->getNumTile128();
|
||||
|
@ -153,7 +153,7 @@ bool CVegetableEditor::createVegetableLandscape()
|
|||
|
||||
// load.
|
||||
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);
|
||||
sint tl;
|
||||
|
@ -299,7 +299,7 @@ void CVegetableEditor::refreshVegetableLandscape(const NL3D::CTileVegetableDesc
|
|||
_VegetableLandscape->Landscape.enableVegetable(false);
|
||||
|
||||
// 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);
|
||||
// change the vegetableTileDesc of this tileSet.
|
||||
|
@ -315,21 +315,30 @@ void CVegetableEditor::setVegetableWindPower(float w)
|
|||
{
|
||||
_VegetableWindPower= w;
|
||||
if(_VegetableLandscape)
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, _VegetableWindFreq, _VegetableWindPower, _VegetableWindBendMin);
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
}
|
||||
|
||||
void CVegetableEditor::setVegetableWindBendStart(float w)
|
||||
{
|
||||
_VegetableWindBendMin= w;
|
||||
if(_VegetableLandscape)
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, _VegetableWindFreq, _VegetableWindPower, _VegetableWindBendMin);
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
}
|
||||
|
||||
void CVegetableEditor::setVegetableWindFrequency(float w)
|
||||
{
|
||||
_VegetableWindFreq= w;
|
||||
if(_VegetableLandscape)
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, _VegetableWindFreq, _VegetableWindPower, _VegetableWindBendMin);
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
}
|
||||
|
||||
void CVegetableEditor::snapToGroundVegetableLandscape(bool enable)
|
||||
|
@ -379,7 +388,7 @@ void CVegetableEditor::getListVegetables(std::vector<std::string> &listVeget)
|
|||
{
|
||||
listVeget.clear();
|
||||
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)
|
||||
|
@ -416,16 +425,16 @@ void CVegetableEditor::buildVegetableSet(NL3D::CTileVegetableDesc &vegetSet, boo
|
|||
|
||||
// build the list.
|
||||
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(!keepDefaultShapeName && _Vegetables[i].Vegetable->ShapeName == "")
|
||||
if(!keepDefaultShapeName && _Vegetables[i]._vegetable->ShapeName == "")
|
||||
continue;
|
||||
// if don't want to keep hiden vegetables, skip them.
|
||||
if(!keepHiden && !_Vegetables[i].Visible)
|
||||
if(!keepHiden && !_Vegetables[i]._visible)
|
||||
continue;
|
||||
|
||||
vegetables.push_back(*_Vegetables[i].Vegetable);
|
||||
vegetables.push_back(*_Vegetables[i]._vegetable);
|
||||
// get dst index.
|
||||
uint dstId= (uint)vegetables.size()-1;
|
||||
// transform degrees in radians.
|
||||
|
@ -446,13 +455,13 @@ void CVegetableEditor::appendVegetableSet(NL3D::CTileVegetableDesc &vegetSet)
|
|||
float radToDeg = (float)(180.f / NLMISC::Pi);
|
||||
|
||||
// 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
|
||||
const std::vector<NL3D::CVegetable> &vegetList = vegetSet.getVegetableList(distType);
|
||||
|
||||
// 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.
|
||||
NL3D::CVegetable veget = vegetList[i];
|
||||
|
|
|
@ -113,7 +113,6 @@ public:
|
|||
~CVegetableEditor(void);
|
||||
|
||||
void init();
|
||||
|
||||
void release();
|
||||
|
||||
/// @name Landscape control
|
||||
|
@ -228,47 +227,45 @@ public:
|
|||
|
||||
private:
|
||||
void loadConfig();
|
||||
|
||||
void loadLandscapeSetup();
|
||||
|
||||
void saveConfig();
|
||||
|
||||
NL3D::CLandscapeModel *_VegetableLandscape;
|
||||
NL3D::CLandscapeModel *_VegetableLandscape;
|
||||
|
||||
// File info to build it
|
||||
std::string _VegetableLandscapeTileBank;
|
||||
std::string _VegetableLandscapeTileFarBank;
|
||||
std::vector<std::string> _VegetableLandscapeZoneNames;
|
||||
std::string _VegetableLandscapeTileBank;
|
||||
std::string _VegetableLandscapeTileFarBank;
|
||||
std::vector<std::string> _VegetableLandscapeZoneNames;
|
||||
|
||||
// Misc.
|
||||
float _VegetableLandscapeThreshold;
|
||||
float _VegetableLandscapeTileNear;
|
||||
float _VegetableLandscapeMultiply;
|
||||
NLMISC::CRGBA _VegetableLandscapeAmbient;
|
||||
NLMISC::CRGBA _VegetableLandscapeDiffuse;
|
||||
std::string _VegetableTexture;
|
||||
NLMISC::CRGBA _VegetableAmbient;
|
||||
NLMISC::CRGBA _VegetableDiffuse;
|
||||
NLMISC::CVector _VegetableLightDir;
|
||||
float _VegetableLandscapeThreshold;
|
||||
float _VegetableLandscapeTileNear;
|
||||
float _VegetableLandscapeMultiply;
|
||||
NLMISC::CRGBA _VegetableLandscapeAmbient;
|
||||
NLMISC::CRGBA _VegetableLandscapeDiffuse;
|
||||
std::string _VegetableTexture;
|
||||
NLMISC::CRGBA _VegetableAmbient;
|
||||
NLMISC::CRGBA _VegetableDiffuse;
|
||||
NLMISC::CVector _VegetableLightDir;
|
||||
// Vegetable wind.
|
||||
NLMISC::CVector _VegetableWindDir;
|
||||
float _VegetableWindFreq;
|
||||
float _VegetableWindPower;
|
||||
float _VegetableWindBendMin;
|
||||
NLMISC::CVector _VegetableWindDir;
|
||||
float _VegetableWindFreq;
|
||||
float _VegetableWindPower;
|
||||
float _VegetableWindBendMin;
|
||||
|
||||
bool _VegetableEnabled;
|
||||
bool _VegetableEnabled;
|
||||
|
||||
// Collision
|
||||
bool _VegetableSnapToGround;
|
||||
float _VegetableSnapHeight;
|
||||
NL3D::CVisualCollisionManager *_VegetableCollisionManager;
|
||||
NL3D::CVisualCollisionEntity *_VegetableCollisionEntity;
|
||||
bool _VegetableSnapToGround;
|
||||
float _VegetableSnapHeight;
|
||||
NL3D::CVisualCollisionManager *_VegetableCollisionManager;
|
||||
NL3D::CVisualCollisionEntity *_VegetableCollisionEntity;
|
||||
|
||||
// The vegetable List.
|
||||
std::vector<CVegetableNode> _Vegetables;
|
||||
|
||||
NL3D::IDriver *_Driver;
|
||||
NL3D::CScene *_Scene;
|
||||
NL3D::IDriver *_Driver;
|
||||
NL3D::CScene *_Scene;
|
||||
|
||||
}; /* class CVegetableEditor */
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// Project includes
|
||||
#include "modules.h"
|
||||
|
||||
#define NL_VEGETABLE_EDIT_WIND_MAX_POWER 10.f
|
||||
#define NL_VEGETABLE_EDIT_WIND_MAX_FREQUENCY 10.f
|
||||
#define NL_VEGETABLE_EDIT_WIND_MAX_BENDSTART 1.f
|
||||
#define NL_VEGETABLE_EDIT_WIND_MAX_POWER 10.f
|
||||
#define NL_VEGETABLE_EDIT_WIND_MAX_FREQUENCY 10.f
|
||||
#define NL_VEGETABLE_EDIT_WIND_MAX_BENDSTART 1.f
|
||||
|
||||
namespace NLQT
|
||||
{
|
||||
|
|
|
@ -54,7 +54,6 @@ private Q_SLOTS:
|
|||
private:
|
||||
|
||||
Ui::CVegetableLandscapePage _ui;
|
||||
|
||||
}; /* class CVegetableLandscapePage */
|
||||
|
||||
} /* namespace NLQT */
|
||||
|
|
|
@ -29,14 +29,14 @@ static const char *NL_DefaultVegetName= "<default>";
|
|||
|
||||
CVegetableNode::CVegetableNode(void)
|
||||
{
|
||||
Vegetable = NULL;
|
||||
VegetableName = NL_DefaultVegetName;
|
||||
Visible = true;
|
||||
_vegetable = NULL;
|
||||
_vegetableName = NL_DefaultVegetName;
|
||||
_visible = true;
|
||||
}
|
||||
|
||||
void CVegetableNode::initDefaultVegetable()
|
||||
{
|
||||
Vegetable= new NL3D::CVegetable;
|
||||
_vegetable = new NL3D::CVegetable;
|
||||
// update vegetableName according to Vegetable
|
||||
updateVegetableName();
|
||||
|
||||
|
@ -44,59 +44,59 @@ void CVegetableNode::initDefaultVegetable()
|
|||
|
||||
// General/Density.
|
||||
// Density.
|
||||
Vegetable->Density.Abs = NL_VEGETABLE_DENSITY_ABS_DEFAULT;
|
||||
Vegetable->Density.Rand = NL_VEGETABLE_DENSITY_RAND_DEFAULT;
|
||||
Vegetable->Density.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->Density.Abs = NL_VEGETABLE_DENSITY_ABS_DEFAULT;
|
||||
_vegetable->Density.Rand = NL_VEGETABLE_DENSITY_RAND_DEFAULT;
|
||||
_vegetable->Density.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
// disable MaxDensity
|
||||
Vegetable->MaxDensity = -1;
|
||||
_vegetable->MaxDensity = -1;
|
||||
// Leave ShapeName to ""
|
||||
// Default DistType is always 0.
|
||||
Vegetable->DistType = 0;
|
||||
_vegetable->DistType = 0;
|
||||
|
||||
|
||||
// Apperance
|
||||
// BendPhase
|
||||
Vegetable->BendPhase.Abs = NL_VEGETABLE_BENDPHASE_ABS_DEFAULT;
|
||||
Vegetable->BendPhase.Rand = NL_VEGETABLE_BENDPHASE_RAND_DEFAULT;
|
||||
Vegetable->BendPhase.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->BendPhase.Abs = NL_VEGETABLE_BENDPHASE_ABS_DEFAULT;
|
||||
_vegetable->BendPhase.Rand = NL_VEGETABLE_BENDPHASE_RAND_DEFAULT;
|
||||
_vegetable->BendPhase.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
// BendFactor
|
||||
Vegetable->BendFactor.Abs = NL_VEGETABLE_BENDFACTOR_ABS_DEFAULT;
|
||||
Vegetable->BendFactor.Rand = NL_VEGETABLE_BENDFACTOR_RAND_DEFAULT;
|
||||
Vegetable->BendFactor.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->BendFactor.Abs = NL_VEGETABLE_BENDFACTOR_ABS_DEFAULT;
|
||||
_vegetable->BendFactor.Rand = NL_VEGETABLE_BENDFACTOR_RAND_DEFAULT;
|
||||
_vegetable->BendFactor.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
// Color
|
||||
Vegetable->Color.NoiseValue.Abs = NL_VEGETABLE_COLOR_ABS_DEFAULT;
|
||||
Vegetable->Color.NoiseValue.Rand = NL_VEGETABLE_COLOR_RAND_DEFAULT;
|
||||
Vegetable->Color.NoiseValue.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->Color.NoiseValue.Abs = NL_VEGETABLE_COLOR_ABS_DEFAULT;
|
||||
_vegetable->Color.NoiseValue.Rand = NL_VEGETABLE_COLOR_RAND_DEFAULT;
|
||||
_vegetable->Color.NoiseValue.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
|
||||
// Scale
|
||||
// ScaleXY
|
||||
Vegetable->Sxy.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
||||
Vegetable->Sxy.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
||||
Vegetable->Sxy.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->Sxy.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
||||
_vegetable->Sxy.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
||||
_vegetable->Sxy.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
// ScaleZ.
|
||||
Vegetable->Sz.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
||||
Vegetable->Sz.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
||||
Vegetable->Sz.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->Sz.Abs = NL_VEGETABLE_SCALE_ABS_DEFAULT;
|
||||
_vegetable->Sz.Rand = NL_VEGETABLE_SCALE_RAND_DEFAULT;
|
||||
_vegetable->Sz.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
|
||||
// Rotate
|
||||
// RotateX
|
||||
Vegetable->Rx.Abs = NL_VEGETABLE_ROTATEX_ABS_DEFAULT;
|
||||
Vegetable->Rx.Rand = NL_VEGETABLE_ROTATEX_RAND_DEFAULT;
|
||||
Vegetable->Rx.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->Rx.Abs = NL_VEGETABLE_ROTATEX_ABS_DEFAULT;
|
||||
_vegetable->Rx.Rand = NL_VEGETABLE_ROTATEX_RAND_DEFAULT;
|
||||
_vegetable->Rx.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
// RotateY
|
||||
Vegetable->Ry.Abs = NL_VEGETABLE_ROTATEY_ABS_DEFAULT;
|
||||
Vegetable->Ry.Rand = NL_VEGETABLE_ROTATEY_RAND_DEFAULT;
|
||||
Vegetable->Ry.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
_vegetable->Ry.Abs = NL_VEGETABLE_ROTATEY_ABS_DEFAULT;
|
||||
_vegetable->Ry.Rand = NL_VEGETABLE_ROTATEY_RAND_DEFAULT;
|
||||
_vegetable->Ry.Frequency = NL_VEGETABLE_FREQ_DEFAULT;
|
||||
// RotateZ
|
||||
Vegetable->Rz.Abs = NL_VEGETABLE_ROTATEZ_ABS_DEFAULT;
|
||||
Vegetable->Rz.Rand = NL_VEGETABLE_ROTATEZ_RAND_DEFAULT;
|
||||
Vegetable->Rz.Frequency = NL_VEGETABLE_ROTATEZ_FREQ_DEFAULT;
|
||||
_vegetable->Rz.Abs = NL_VEGETABLE_ROTATEZ_ABS_DEFAULT;
|
||||
_vegetable->Rz.Rand = NL_VEGETABLE_ROTATEZ_RAND_DEFAULT;
|
||||
_vegetable->Rz.Frequency = NL_VEGETABLE_ROTATEZ_FREQ_DEFAULT;
|
||||
|
||||
}
|
||||
|
||||
void CVegetableNode::initVegetable(const NL3D::CVegetable &vegetable)
|
||||
{
|
||||
Vegetable = new NL3D::CVegetable(vegetable);
|
||||
_vegetable = new NL3D::CVegetable(vegetable);
|
||||
// update vegetableName according to Vegetable
|
||||
updateVegetableName();
|
||||
}
|
||||
|
@ -105,27 +105,27 @@ void CVegetableNode::initVegetable(const NL3D::CVegetable &vegetable)
|
|||
void CVegetableNode::updateVegetableName()
|
||||
{
|
||||
// Build the vegetable Name according to the ShapeName
|
||||
if(Vegetable->ShapeName == "")
|
||||
if(_vegetable->ShapeName == "")
|
||||
{
|
||||
VegetableName = NL_DefaultVegetName;
|
||||
_vegetableName = NL_DefaultVegetName;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string::size_type pos = Vegetable->ShapeName.find(".veget");
|
||||
VegetableName= Vegetable->ShapeName.substr(0, pos);
|
||||
std::string::size_type pos = _vegetable->ShapeName.find(".veget");
|
||||
_vegetableName = _vegetable->ShapeName.substr(0, pos);
|
||||
// And (to be clearer) append distance of creation.
|
||||
char str[256];
|
||||
sprintf(str, " - %dm", (Vegetable->DistType + 1) * 10);
|
||||
VegetableName += str;
|
||||
sprintf(str, " - %dm", (_vegetable->DistType + 1) * 10);
|
||||
_vegetableName += str;
|
||||
// NB: if you add info with other parameters, you must use updateCurSelVegetableName() if they change
|
||||
}
|
||||
}
|
||||
|
||||
void CVegetableNode::deleteVegetable()
|
||||
{
|
||||
delete Vegetable;
|
||||
Vegetable = NULL;
|
||||
VegetableName = NL_DefaultVegetName;
|
||||
delete _vegetable;
|
||||
_vegetable = NULL;
|
||||
_vegetableName = NL_DefaultVegetName;
|
||||
}
|
||||
|
||||
} /* namespace NLQT */
|
|
@ -47,13 +47,13 @@ public:
|
|||
void deleteVegetable();
|
||||
|
||||
// The vegetable
|
||||
NL3D::CVegetable *Vegetable;
|
||||
NL3D::CVegetable *_vegetable;
|
||||
|
||||
// The name of this vegetable.
|
||||
std::string VegetableName;
|
||||
std::string _vegetableName;
|
||||
|
||||
// Visibility. Editor feature only
|
||||
bool Visible;
|
||||
bool _visible;
|
||||
|
||||
}; /* class CVegetableNode */
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
// NeL includes
|
||||
|
||||
#define NL_VEGETABLE_EDIT_SLIDER_NVS_SIZE_THRESHOLD 0.03f
|
||||
#define NL_VEGETABLE_EDIT_SLIDER_NVS_SCALE 3.0f
|
||||
#define NL_VEGETABLE_EDIT_SLIDER_NVS_SCALE 3.0f
|
||||
|
||||
namespace NLQT
|
||||
{
|
||||
|
||||
CVegetNoiseValueWidget::CVegetNoiseValueWidget(QWidget *parent)
|
||||
: QGroupBox(parent), _emit(true)
|
||||
: QGroupBox(parent),
|
||||
_emit(true)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
|
|
@ -40,15 +40,16 @@ public:
|
|||
CVegetNoiseValueWidget(QWidget *parent = 0);
|
||||
~CVegetNoiseValueWidget();
|
||||
|
||||
void setNoiseValue(const NLMISC::CNoiseValue &value, bool emit = true);
|
||||
|
||||
void setDefaultRangeAbs(float defRangeMin, float defRangeMax);
|
||||
void setDefaultRangeRand(float defRangeMin, float defRangeMax);
|
||||
void setDefaultRangeFreq(float defRangeMin, float defRangeMax);
|
||||
|
||||
|
||||
Q_SIGNALS:
|
||||
void noiseValueChanged(const NLMISC::CNoiseValue &value);
|
||||
|
||||
public Q_SLOTS:
|
||||
void setNoiseValue(const NLMISC::CNoiseValue &value, bool emit = true);
|
||||
|
||||
private Q_SLOTS:
|
||||
void setSlider(int value);
|
||||
void sliderReleased();
|
||||
|
|
|
@ -55,7 +55,7 @@ private Q_SLOTS:
|
|||
private:
|
||||
|
||||
// The vegetable to edit.
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
|
||||
Ui::CVegetableRotatePage _ui;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ private Q_SLOTS:
|
|||
private:
|
||||
|
||||
// The vegetable to edit.
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
NL3D::CVegetable *_Vegetable;
|
||||
|
||||
Ui::CVegetableScalePage _ui;
|
||||
|
||||
|
|
Loading…
Reference in a new issue