summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelwizard.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-01-11 16:42:24 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-01-11 16:42:24 -0500
commit86482ce1d7dbd01e1ebad4d18565bd979a11aa30 (patch)
tree8f77212384a9302d24cde4d196e6443273ceba20 /indra/newview/llfloatermodelwizard.cpp
parent997c0d3924015910b62acaa85e46844fcfb43ec0 (diff)
parent3fcdd7f41581e2e724be703687e717ea6ddc91ba (diff)
merge
Diffstat (limited to 'indra/newview/llfloatermodelwizard.cpp')
-rw-r--r--indra/newview/llfloatermodelwizard.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index fe53eafa40..19bdea5f44 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -30,6 +30,7 @@
#include "llbutton.h"
#include "lldrawable.h"
+#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "llfloater.h"
#include "llfloatermodelwizard.h"
@@ -71,8 +72,15 @@ void LLFloaterModelWizard::setState(int state)
}
}
+ if (state == CHOOSE_FILE)
+ {
+ getChildView("back")->setEnabled(false);
+ }
+
if (state == OPTIMIZE)
{
+ getChildView("back")->setEnabled(true);
+ //mModelPreview->mModel[lod].clear();
mModelPreview->genLODs(-1);
mModelPreview->mViewOption["show_physics"] = false;
}
@@ -423,6 +431,7 @@ BOOL LLFloaterModelWizard::postBuild()
childSetValue("import_scale", (F32) 0.67335826);
getChild<LLUICtrl>("browse")->setCommitCallback(boost::bind(&LLFloaterModelWizard::loadModel, this));
+ //getChild<LLUICtrl>("lod_file")->setCommitCallback(boost::bind(&LLFloaterModelWizard::loadModel, this));
getChild<LLUICtrl>("cancel")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickCancel, this));
getChild<LLUICtrl>("close")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickCancel, this));
getChild<LLUICtrl>("back")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickBack, this));
@@ -441,6 +450,8 @@ BOOL LLFloaterModelWizard::postBuild()
mModelPreview = new LLModelPreview(512, 512, this);
mModelPreview->setPreviewTarget(16.f);
+ mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelWizard::setDetails, this, _1, _2, _3, _4, _5));
+
center();
@@ -455,6 +466,25 @@ BOOL LLFloaterModelWizard::postBuild()
return TRUE;
}
+
+void LLFloaterModelWizard::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost)
+{
+ // iterate through all the panels, setting the dimensions
+ for(size_t t=0; t<LL_ARRAY_SIZE(stateNames); ++t)
+ {
+ LLPanel *panel = getChild<LLPanel>(stateNames[t]+"_panel");
+ if (panel)
+ {
+ panel->childSetText("dimension_x", llformat("%.1f", x));
+ panel->childSetText("dimension_y", llformat("%.1f", y));
+ panel->childSetText("dimension_z", llformat("%.1f", z));
+ panel->childSetTextArg("streaming cost", "[COST]", llformat("%.3f", streaming_cost));
+ panel->childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost));
+ }
+ }
+}
+
+
void LLFloaterModelWizard::onUpload()
{
mModelPreview->rebuildUploadData();
@@ -492,8 +522,30 @@ void LLFloaterModelWizard::onPreviewLODCommit(LLUICtrl* ctrl)
mModelPreview->setPreviewLOD(which_mode);
}
+void LLFloaterModelWizard::refresh()
+{
+ if (mState == CHOOSE_FILE)
+ {
+ bool model_loaded = false;
+
+ if (mModelPreview && mModelPreview->mModelLoader && mModelPreview->mModelLoader->getLoadState() == LLModelLoader::DONE)
+ {
+ model_loaded = true;
+ }
+
+ getChildView("next")->setEnabled(model_loaded);
+ }
+ if (mState == REVIEW)
+ {
+ getChildView("upload")->setEnabled(getChild<LLCheckBoxCtrl>("confirm_checkbox")->getValue().asBoolean());
+ }
+
+}
+
void LLFloaterModelWizard::draw()
{
+ refresh();
+
LLFloater::draw();
LLRect r = getRect();