PageRenderTime 37ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloatermodelwizard.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 140 lines | 83 code | 31 blank | 26 comment | 0 complexity | 15153f7b4aab0a8ff4cf801c7f37d5cc MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloatermodelwizard.h
  3. *
  4. * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2010, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. #ifndef LLFLOATERMODELWIZARD_H
  26. #define LLFLOATERMODELWIZARD_H
  27. #include "llmeshrepository.h"
  28. #include "llmodel.h"
  29. #include "llthread.h"
  30. #include "llfloatermodeluploadbase.h"
  31. class LLModelPreview;
  32. class LLFloaterModelWizard : public LLFloaterModelUploadBase
  33. {
  34. public:
  35. class DecompRequest : public LLPhysicsDecomp::Request
  36. {
  37. public:
  38. S32 mContinue;
  39. LLPointer<LLModel> mModel;
  40. DecompRequest(const std::string& stage, LLModel* mdl);
  41. virtual S32 statusCallback(const char* status, S32 p1, S32 p2);
  42. virtual void completed();
  43. };
  44. static LLFloaterModelWizard* sInstance;
  45. LLFloaterModelWizard(const LLSD& key);
  46. virtual ~LLFloaterModelWizard();
  47. /*virtual*/ BOOL postBuild();
  48. void draw();
  49. void refresh();
  50. BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  51. BOOL handleMouseUp(S32 x, S32 y, MASK mask);
  52. BOOL handleHover(S32 x, S32 y, MASK mask);
  53. BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
  54. void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
  55. void modelLoadedCallback();
  56. void modelChangedCallback();
  57. void initDecompControls();
  58. // shows warning message if agent has no permissions to upload model
  59. /*virtual*/ void onPermissionsReceived(const LLSD& result);
  60. // called when error occurs during permissions request
  61. /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason);
  62. /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
  63. /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
  64. /*virtual*/ void onModelUploadSuccess();
  65. /*virtual*/ void onModelUploadFailure();
  66. const LLRect& getPreviewRect() const { return mPreviewRect; }
  67. LLPhysicsDecomp::decomp_params mDecompParams;
  68. std::set<LLPointer<DecompRequest> > mCurRequest;
  69. std::string mStatusMessage;
  70. static void executePhysicsStage(std::string stage_name);
  71. private:
  72. enum EWizardState
  73. {
  74. CHOOSE_FILE = 0,
  75. OPTIMIZE,
  76. PHYSICS,
  77. REVIEW,
  78. UPLOAD
  79. };
  80. void setState(int state);
  81. void updateButtons();
  82. void onClickSwitchToAdvanced();
  83. void onClickRecalculateGeometry();
  84. void onClickRecalculatePhysics();
  85. void onClickCalculateUploadFee();
  86. void onClickCancel();
  87. void onClickBack();
  88. void onClickNext();
  89. bool onEnableNext();
  90. bool onEnableBack();
  91. void loadModel();
  92. void onPreviewLODCommit(LLUICtrl*);
  93. void onUpload();
  94. LLModelPreview* mModelPreview;
  95. LLRect mPreviewRect;
  96. int mState;
  97. S32 mLastMouseX;
  98. S32 mLastMouseY;
  99. U32 mLastEnabledState;
  100. LLButton* mRecalculateGeometryBtn;
  101. LLButton* mRecalculatePhysicsBtn;
  102. LLButton* mRecalculatingPhysicsBtn;
  103. LLButton* mCalculateWeightsBtn;
  104. LLButton* mCalculatingWeightsBtn;
  105. LLView* mChooseFilePreviewPanel;
  106. LLView* mOptimizePreviewPanel;
  107. LLView* mPhysicsPreviewPanel;
  108. };
  109. #endif