diff --git a/code/nel/tools/3d/object_viewer_qt/src/animation_set_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/animation_set_dialog.cpp index a981ccbaa..93436f4d3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/animation_set_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/animation_set_dialog.cpp @@ -88,7 +88,7 @@ void CAnimationSetDialog::updateListObject() std::vector 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& animationList = entity.getAnimationList(); - std::vector& swtList = entity.getSWTList(); - std::vector& playListAnimation = entity.getPlayListAnimation(); + std::vector &animationList = entity.getAnimationList(); + std::vector &swtList = entity.getSWTList(); + std::vector &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 list = ui.animTreeWidget->selectedItems(); + QList 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 list = ui.animPlaylistWidget->selectedItems(); + QList 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 list = ui.animPlaylistWidget->selectedItems(); + QList 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 list = ui.animPlaylistWidget->selectedItems(); + QList list = ui.animPlaylistWidget->selectedItems(); if (list.empty()) return; diff --git a/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp index 2ed2b7a78..63ade787d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp @@ -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(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp index 7f98a5909..f02c21317 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp @@ -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 */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h index ba135139e..a6c0d2fe1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h @@ -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 */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.cpp index abc69f33d..b256bf38f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.cpp @@ -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 *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 diff --git a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp index bc901de7b..f1fb10618 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp @@ -41,8 +41,8 @@ CBinOpDialog::CBinOpDialog(QWidget *widget1, QWidget *widget2, QWidget *parent) setWindowTitle(tr("Bin operator")); _comboBox->clear(); - qobject_cast(widget1)->setTitle(tr("Arg1")); - qobject_cast(widget2)->setTitle(tr("Arg2")); + qobject_cast(widget1)->setTitle(tr("Arg1")); + qobject_cast(widget2)->setTitle(tr("Arg2")); connect(_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setNewOp(int))); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/color_edit_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/color_edit_widget.cpp index 324aaced5..2582e7171 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/color_edit_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/color_edit_widget.cpp @@ -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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp b/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp index fb4b527cc..97f6a6378 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/constraint_mesh_widget.h b/code/nel/tools/3d/object_viewer_qt/src/constraint_mesh_widget.h index 0170fc956..a584fd36e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/constraint_mesh_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/constraint_mesh_widget.h @@ -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 */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp index fda808e72..b74c270a7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp @@ -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())); diff --git a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h index 284d32caa..4d79cfd22 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h @@ -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 */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp index dd5956594..a7d1cb8c5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp index 08d637df8..fe81a245a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h index 0ea70e3fa..ccf8c58f8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/emitter_page.h @@ -133,7 +133,7 @@ private: } _ModulatedStrenghtWrapper; // the emitter being edited - NL3D::CPSEmitter *_Emitter; + NL3D::CPSEmitter *_Emitter; // contains pointers to the located std::vector _LocatedList; diff --git a/code/nel/tools/3d/object_viewer_qt/src/entity.cpp b/code/nel/tools/3d/object_viewer_qt/src/entity.cpp index 6361bdece..4145af622 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/entity.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/entity.cpp @@ -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(""), _FileNameShape(""), - _FileNameSkeleton(""), _inPlace(false), _incPos(false), - _Instance(NULL), _Skeleton(NULL), - _PlayList(NULL), _AnimationSet(NULL) +CEntity::CEntity(void) + : _Name(""), + _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) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/entity.h b/code/nel/tools/3d/object_viewer_qt/src/entity.h index f5ac89025..1022018c1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/entity.h +++ b/code/nel/tools/3d/object_viewer_qt/src/entity.h @@ -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 _AnimationList; + std::vector _AnimationList; // Skeleton weight input file - std::vector _SWTList; + std::vector _SWTList; // Play list animation - std::vector _PlayListAnimation; + std::vector _PlayListAnimation; // Slot info for this object - CSlotInfo _SlotInfo[NL3D::CChannelMixer::NumAnimationSlot]; + CSlotInfo _SlotInfo[NL3D::CChannelMixer::NumAnimationSlot]; friend class CObjectViewer; }; /* class CEntity */ -typedef std::map CEntities; -typedef CEntities::iterator EIT; +typedef std::map CEntities; +typedef CEntities::iterator EIT; } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index f19ac10f9..131342956 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -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); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp index c0d0308cd..85f1ad4fd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp @@ -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(loader.instance()); + IPlugin *pluginObject = qobject_cast(loader.instance()); if (!pluginObject) { loader.unload(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp index c96a54407..32c3bce98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.h index d0a92955f..cf7040d4d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.h @@ -56,7 +56,7 @@ protected: QPushButton *pushButton; NL3D::CPSPlaneBasisFollowSpeed *_FollowPath; - CWorkspaceNode *_Node; + CWorkspaceNode *_Node; }; /* class CFollowPathDialog */ } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp index 57bb08962..fa018d914 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp @@ -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 */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h index dfda7b1fa..f69231cdb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h @@ -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 get(void) const; - void set(const NLMISC::CVector &d); - } _DirectionWrapper;*/ Ui::CGlobalWindDialog _ui; diff --git a/code/nel/tools/3d/object_viewer_qt/src/graphics_info_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/graphics_info_widget.cpp index 8e10abe0d..84ace73c3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/graphics_info_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/graphics_info_widget.cpp @@ -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)), diff --git a/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp b/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp index b45f74ee9..2ea99c576 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp @@ -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(Modules::objView().getDriver())->getDriver(); + NL3D::IDriver *driver = dynamic_cast(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(Modules::objView().getDriver())->getDriver(); + NL3D::IDriver *driver = dynamic_cast(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(Modules::objView().getDriver())->getDriver(); + NL3D::IDriver *driver = dynamic_cast(Modules::objView().getDriver())->getDriver(); if (driver) { x11Proc proc = (x11Proc)driver->getWindowProc(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.h b/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.h index d7c5a1012..b49734776 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.h +++ b/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.h @@ -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) diff --git a/code/nel/tools/3d/object_viewer_qt/src/located_bindable_page.h b/code/nel/tools/3d/object_viewer_qt/src/located_bindable_page.h index 2f4180e33..4f0360f64 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/located_bindable_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/located_bindable_page.h @@ -393,7 +393,7 @@ private: void touchPSState(); - CWorkspaceNode *_Node; + CWorkspaceNode *_Node; /// The bindable being edited NL3D::CPSLocatedBindable *_Bindable; diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index 22fd4472a..1803c081a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -13,9 +13,10 @@ #include #include #include -#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); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp index ba2eb1f31..4bf9000d5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp @@ -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"); diff --git a/code/nel/tools/3d/object_viewer_qt/src/mesh_widget.h b/code/nel/tools/3d/object_viewer_qt/src/mesh_widget.h index c39b4985f..c955c968e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/mesh_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/mesh_widget.h @@ -57,9 +57,9 @@ private Q_SLOTS: void editMorph(); private: - CWorkspaceNode *_Node; + CWorkspaceNode *_Node; - NL3D::CPSShapeParticle *_ShapeParticle; + NL3D::CPSShapeParticle *_ShapeParticle; void updateForMorph(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp index df4da5213..392c97213 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.h index 0a715134e..5cc5615a0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.h @@ -76,7 +76,7 @@ private: CWorkspaceNode *_Node; // the constraint mesh being edited - NL3D::CPSConstraintMesh *_CM; + NL3D::CPSConstraintMesh *_CM; Ui::CMorphMeshDialog _ui; }; /* class CMorphMeshDialog */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp index 64273d12b..968aa9a20 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.h index e6549f407..002560b74 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.h @@ -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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp index 25e4d3621..737e81379 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h index 5bf6066d5..36cd66010 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h @@ -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; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp index 9e7c30238..4e4744136 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp @@ -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(Modules::objView().getDriver()); + NL3D::CDriverUser *driver = dynamic_cast(Modules::objView().getDriver()); _Driver = driver->getDriver(); - NL3D::CSceneUser *scene = dynamic_cast(Modules::objView().getScene()); + NL3D::CSceneUser *scene = dynamic_cast(Modules::objView().getScene()); _Scene = &scene->getScene(); - NL3D::CTextContextUser *textContext = dynamic_cast(Modules::objView().getTextContext()); + NL3D::CTextContextUser *textContext = dynamic_cast(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; } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_editor.h b/code/nel/tools/3d/object_viewer_qt/src/particle_editor.h index ee056992d..205998245 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_editor.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_editor.h @@ -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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_force_page.h b/code/nel/tools/3d/object_viewer_qt/src/particle_force_page.h index 116c57768..1bc23224f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_force_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_force_page.h @@ -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) diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.cpp index b26198ec5..ba5a8efaa 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.cpp @@ -35,7 +35,7 @@ CParticleLinkDialog::CParticleLinkDialog(CSkeletonTreeModel *model, QWidget *par { _ui.setupUi(this); - qobject_cast< QMainWindow* >(parent)->addDockWidget(Qt::RightDockWidgetArea, this); + qobject_cast(parent)->addDockWidget(Qt::RightDockWidgetArea, this); _ui.treeView->setModel(model); @@ -59,7 +59,7 @@ void CParticleLinkDialog::setLink() if (curObj.empty()) return; - CSkeletonTreeItem *item = static_cast(_ui.treeView->currentIndex().internalPointer()); + CSkeletonTreeItem *item = static_cast(_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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.h index 38de98b34..59b531c23 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_link_skeleton_dialog.h @@ -44,7 +44,7 @@ private Q_SLOTS: void setLink(); void setUnlink(); void resetModel(); - void clickedItem(const QModelIndex & index); + void clickedItem(const QModelIndex &index); private: diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp index 93e341127..7c63f92b1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp @@ -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(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_node.h b/code/nel/tools/3d/object_viewer_qt/src/particle_node.h index 88c9c6446..acf7dfcd6 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_node.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_node.h @@ -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 _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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_property_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/particle_property_dialog.h index 9469ca668..dc7e5dfe8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_property_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_property_dialog.h @@ -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 */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_sound_page.h b/code/nel/tools/3d/object_viewer_qt/src/particle_sound_page.h index d1d02da13..2383a087d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_sound_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_sound_page.h @@ -117,7 +117,7 @@ private: } /// the sound being edited - NL3D::CPSSound *_Sound; + NL3D::CPSSound *_Sound; CWorkspaceNode *_Node; diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_system_page.h b/code/nel/tools/3d/object_viewer_qt/src/particle_system_page.h index 94bcb78a2..c5269f058 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_system_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_system_page.h @@ -116,7 +116,7 @@ private: if ((_Node) && (enabledModifiedFlag)) _Node->setModified(true); } - CWorkspaceNode *_Node; + CWorkspaceNode *_Node; struct CGlobalColorWrapper : public IPSSchemeWrapperRGBA { diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_texture_widget.h b/code/nel/tools/3d/object_viewer_qt/src/particle_texture_widget.h index f8e90f144..3b826ca51 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_texture_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_texture_widget.h @@ -68,10 +68,10 @@ private Q_SLOTS: private: void updateTexture(); - IPSWrapperTexture *_Wrapper ; + IPSWrapperTexture *_Wrapper; // the current texture - NLMISC::CSmartPtr _Texture ; + NLMISC::CSmartPtr _Texture; Ui::CParticleTextureWidget _ui; }; /* class CParticleTextureWidget */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp index 911f57af5..69a425329 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp @@ -114,7 +114,7 @@ CParticleTreeItem *CParticleTreeItem::parent() int CParticleTreeItem::row() const { if (_parentItem) - return _parentItem->_childItems.indexOf(const_cast(this)); + return _parentItem->_childItems.indexOf(const_cast(this)); return 0; } @@ -188,7 +188,7 @@ QVariant CParticleTreeModel::data(const QModelIndex &index, int role) const if (role == Qt::DisplayRole) { - CParticleTreeItem *item = static_cast(index.internalPointer()); + CParticleTreeItem *item = static_cast(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(index.internalPointer()); + CParticleTreeItem *item = static_cast(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(index.internalPointer()); + CParticleTreeItem *item = static_cast(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(QObject::parent()); + //CParticleWorkspaceDialog *pwsd = qobject_cast(QObject::parent()); //pwsd->updateTreeView(); return itmFlags; @@ -273,7 +273,7 @@ const if (!parent.isValid()) parentItem = _rootItem; else - parentItem = static_cast(parent.internalPointer()); + parentItem = static_cast(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(index.internalPointer()); + CParticleTreeItem *childItem = static_cast(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(parent.internalPointer()); + parentItem = static_cast(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(index.internalPointer()); + CParticleTreeItem *item = static_cast(index.internalPointer()); QList 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(index.internalPointer()); + CParticleTreeItem *item = static_cast(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(parent.internalPointer()); + CParticleTreeItem *item = static_cast(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(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(parent.internalPointer()); + CParticleTreeItem *item = static_cast(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(parent.internalPointer())); + createItemFromLocatedInstance(loc, index, static_cast(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(parent.internalPointer())); + createItemFromLocatedBindable(lb, static_cast(parent.internalPointer())); endInsertRows(); return true; } bool CParticleTreeModel::removeRows(int position, const QModelIndex &parent) { - CParticleTreeItem *item = static_cast(parent.internalPointer())->child(position); + CParticleTreeItem *item = static_cast(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(parent.internalPointer()); + CParticleTreeItem *item = static_cast(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); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.h b/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.h index 36e0aeccb..2ab5dbe89 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.h @@ -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 _childItems; + QList _childItems; QList _itemData; int _itemIconType; CParticleTreeItem *_parentItem; diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp index 04a1c2972..382c06ec3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp @@ -123,7 +123,8 @@ struct Action static std::map _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(index.internalPointer()); + _currentItem = static_cast(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(index.internalPointer()); + CParticleTreeItem *item = static_cast(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(index.internalPointer())->getNode()); + Modules::psEdit().getParticleWorkspace()->removeNode(static_cast(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(index.internalPointer()); + CParticleTreeItem *item = static_cast(index.internalPointer()); CWorkspaceNode *ownerNode = _treeModel->getOwnerNode(item); nlassert(ownerNode); _ui.treeView->setCurrentIndex(index.parent()); diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.h index 969e72869..3a317adc7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.h @@ -123,7 +123,7 @@ private: QAction *_lod2Action; QAction *_externIDAction; - std::auto_ptr _LocatedCopy; + std::auto_ptr _LocatedCopy; std::auto_ptr _LocatedBindableCopy; CParticleTreeItem *_currentItem; diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.cpp index d4b47c5a9..ec4fde7d3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.cpp @@ -141,7 +141,7 @@ void CWorkspacePage::insertPS() else { QModelIndex index = _treeModel->index(0, 0); - _treeModel->insertRows(node, static_cast(index.internalPointer())->childCount(), index); + _treeModel->insertRows(node, static_cast(index.internalPointer())->childCount(), index); } } } @@ -180,7 +180,7 @@ void CWorkspacePage::createPS() return; } QModelIndex index = _treeModel->index(0, 0); - _treeModel->insertRows(node, static_cast(index.internalPointer())->childCount(), index); + _treeModel->insertRows(node, static_cast(index.internalPointer())->childCount(), index); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h index 8720c6311..c533e8325 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h @@ -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 { diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.cpp index 9129ba0e9..af086596b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.cpp @@ -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(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.h b/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.h index 1d4b29070..0aee9d350 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_zone_page.h @@ -63,7 +63,7 @@ private: NL3D::CPSTargetLocatedBindable *_LBTarget; /// the collision zone being edited - NL3D::CPSZone *_Zone ; + NL3D::CPSZone *_Zone ; CWorkspaceNode *_Node; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp index 6508a79d5..04de3ff98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp @@ -19,7 +19,7 @@ bool MyPlugin::initialize(NLQT::IPluginManager *pluginManager, QString *errorStr _plugMan = pluginManager; QString str; - QList listPlug = pluginManager->plugins(); + QList 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(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(objectByName("CMainWindow")); + nlassert(wnd); + QMessageBox msgBox; msgBox.setText(wnd->objectName() + QString(": width=%1,height=%2").arg(wnd->width()).arg(wnd->height())); msgBox.exec(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.cpp index 6f4feae29..dcc3393e0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.cpp @@ -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())); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.h b/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.h index 85b7f1407..a548b789a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/ps_mover_page.h @@ -20,7 +20,6 @@ #ifndef PS_MOVER_PAGE_H #define PS_MOVER_PAGE_H - #include #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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/setup_fog_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/setup_fog_dialog.h index 6078b4782..19b6da65e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/setup_fog_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/setup_fog_dialog.h @@ -26,7 +26,6 @@ // STL includes // NeL includes -#include #include // Project includes @@ -49,6 +48,7 @@ public: private Q_SLOTS: void apply(); void setColor(); + private: NLMISC::CRGBA colorFog; diff --git a/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.cpp index 888c0a131..a4221279e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.cpp @@ -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(index.internalPointer()); + CSkeletonTreeItem *currentItem = static_cast(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 boneBases; - (NLMISC::safe_cast((NL3D::IShape*)_Skeleton.getObjectPtr()->Shape))->retrieve(boneBases); + (NLMISC::safe_cast((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 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 || diff --git a/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.h index 2215c3a5e..1864d8b53 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/skeleton_scale_dialog.h @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.cpp index e794e9183..fb1887527 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.cpp @@ -46,7 +46,7 @@ CSkeletonTreeModel::~CSkeletonTreeModel() int CSkeletonTreeModel::columnCount(const QModelIndex &parent) const { if (parent.isValid()) - return static_cast(parent.internalPointer())->columnCount(); + return static_cast(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(index.internalPointer()); + CSkeletonTreeItem *item = static_cast(index.internalPointer()); return item->data(index.column()); } @@ -92,7 +92,7 @@ const if (!parent.isValid()) parentItem = _rootItem; else - parentItem = static_cast(parent.internalPointer()); + parentItem = static_cast(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(index.internalPointer()); + CSkeletonTreeItem *childItem = static_cast(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(parent.internalPointer()); + parentItem = static_cast(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(parent.internalPointer()); + CSkeletonTreeItem *item = static_cast(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(currentIndex.internalPointer()); + CSkeletonTreeItem *item = static_cast(currentIndex.internalPointer()); if (item->getId() == id) return currentIndex; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.h b/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.h index ad5d6af08..4d48fb502 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.h +++ b/code/nel/tools/3d/object_viewer_qt/src/skeleton_tree_model.h @@ -76,7 +76,7 @@ public: int row() const { if (_parentItem) - return _parentItem->_childItems.indexOf(const_cast(this)); + return _parentItem->_childItems.indexOf(const_cast(this)); return 0; } @@ -91,7 +91,7 @@ public: private: - QList _childItems; + QList _childItems; QList _itemData; sint32 _id; CSkeletonTreeItem *_parentItem; diff --git a/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp index 78245e2d5..ac0aaf80c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp @@ -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(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp b/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp index 45d07673e..1289fa342 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp @@ -34,8 +34,8 @@ namespace NLQT CSoundSystem::CSoundSystem() :_AudioMixer(NULL), - _AnimManager(NULL), - _Zero(NLMISC::CVector::Null) + _AnimManager(NULL), + _Zero(NLMISC::CVector::Null) { } diff --git a/code/nel/tools/3d/object_viewer_qt/src/sound_system.h b/code/nel/tools/3d/object_viewer_qt/src/sound_system.h index f0ac25bf4..4add4b9db 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/sound_system.h +++ b/code/nel/tools/3d/object_viewer_qt/src/sound_system.h @@ -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 _SampleBanksFileName; - NLSOUND::CSoundAnimManager *_AnimManager; - NLMISC::CVector _Zero; - std::string _SamplePath; - std::string _PackedSheetPath; - NLMISC::CMatrix oldMatrix; + NLSOUND::UAudioMixer *_AudioMixer; + std::set _SampleBanksFileName; + NLSOUND::CSoundAnimManager *_AnimManager; + NLMISC::CVector _Zero; + std::string _SamplePath; + std::string _PackedSheetPath; + NLMISC::CMatrix oldMatrix; }; /* class CSoundSystem */ } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp index f63a7d924..dedfc7239 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.h b/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.h index 749341bcc..2fecb2160 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.h @@ -57,7 +57,7 @@ private Q_SLOTS: private: CWorkspaceNode *_Node; - NL3D::CPSTailParticle *_TailParticle; + NL3D::CPSTailParticle *_TailParticle; Ui::CTailParticleWidget _ui; }; /* class CTailParticleWidget */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.cpp index 69fb77f48..edc5402b8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.cpp @@ -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(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h index 3d573fe72..4970d8da2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h @@ -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 diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp index 1bdba8790..9c49871b3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.cpp @@ -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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h index c1210a685..692b7049a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_appearance_page.h @@ -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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp index 2b6f38ae1..04d42828f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.cpp @@ -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))); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h index c2d6579ee..2a98c1a47 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_density_page.h @@ -65,7 +65,7 @@ private: void updateAngleMax(); // The vegetable to edit. - NL3D::CVegetable *_Vegetable; + NL3D::CVegetable *_Vegetable; float _PrecMaxDensityValue; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_dialog.cpp index 1f3382bc3..ed7271e66 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_dialog.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp index 12abc9b1b..6cddfd90d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp @@ -60,10 +60,10 @@ void CVegetableEditor::init() //H_AUTO2 nldebug("CVegetableEditor::init"); - NL3D::CDriverUser *driver = dynamic_cast(Modules::objView().getDriver()); + NL3D::CDriverUser *driver = dynamic_cast(Modules::objView().getDriver()); _Driver = driver->getDriver(); - NL3D::CSceneUser *scene = dynamic_cast(Modules::objView().getScene()); + NL3D::CSceneUser *scene = dynamic_cast(Modules::objView().getScene()); _Scene = &scene->getScene(); } @@ -101,7 +101,7 @@ bool CVegetableEditor::createVegetableLandscape() loadLandscapeSetup(); // create the landscape. - _VegetableLandscape= static_cast(Modules::veget().getScene()->createModel(NL3D::LandscapeModelId)); + _VegetableLandscape= static_cast(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 &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 vegetables; - for(uint i = 0; i < _Vegetables.size(); i++) + for(uint i = 0; i < _Vegetables.size(); ++i) { // if don't want to keep 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 &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]; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.h index da29a817a..b36458d20 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.h @@ -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 _VegetableLandscapeZoneNames; + std::string _VegetableLandscapeTileBank; + std::string _VegetableLandscapeTileFarBank; + std::vector _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 _Vegetables; - NL3D::IDriver *_Driver; - NL3D::CScene *_Scene; + NL3D::IDriver *_Driver; + NL3D::CScene *_Scene; }; /* class CVegetableEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.cpp index d63180711..73fba5e09 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.cpp @@ -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 { diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.h index efae3eae6..0e0d96dcd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_landscape_page.h @@ -54,7 +54,6 @@ private Q_SLOTS: private: Ui::CVegetableLandscapePage _ui; - }; /* class CVegetableLandscapePage */ } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.cpp index 2c9bd6a76..412d62ecf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.cpp @@ -29,14 +29,14 @@ static const char *NL_DefaultVegetName= ""; 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 */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.h index 328849e11..a6a484d94 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_node.h @@ -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 */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp index 9b23b951a..20bad2067 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp @@ -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); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h index 27c56c542..87467e775 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h @@ -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(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h index 3da7ab3a7..1b86790ac 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_rotate_page.h @@ -55,7 +55,7 @@ private Q_SLOTS: private: // The vegetable to edit. - NL3D::CVegetable *_Vegetable; + NL3D::CVegetable *_Vegetable; Ui::CVegetableRotatePage _ui; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h index e4c1699e2..13c50b541 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_scale_page.h @@ -55,7 +55,7 @@ private Q_SLOTS: private: // The vegetable to edit. - NL3D::CVegetable *_Vegetable; + NL3D::CVegetable *_Vegetable; Ui::CVegetableScalePage _ui;