PageRenderTime 29ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lldebugmessagebox.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 89 lines | 47 code | 13 blank | 29 comment | 0 complexity | cec0ccb9b84b3bbc9ff6ef6f526c68dc MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lldebugmessagebox.h
  3. * @brief Debug message box.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLDEBUGMESSAGEBOX_H
  27. #define LL_LLDEBUGMESSAGEBOX_H
  28. #include "lldarray.h"
  29. #include "llfloater.h"
  30. #include "v3math.h"
  31. #include "lltextbox.h"
  32. #include "llstring.h"
  33. #include "llframetimer.h"
  34. #include <vector>
  35. #include <map>
  36. class LLSliderCtrl;
  37. //----------------------------------------------------------------------------
  38. // LLDebugVarMessageBox
  39. //----------------------------------------------------------------------------
  40. typedef enum e_debug_var_type
  41. {
  42. VAR_TYPE_F32,
  43. VAR_TYPE_S32,
  44. VAR_TYPE_VEC2,
  45. VAR_TYPE_VEC3,
  46. VAR_TYPE_VEC4,
  47. VAR_TYPE_COUNT
  48. } EDebugVarType;
  49. class LLDebugVarMessageBox : public LLFloater
  50. {
  51. protected:
  52. LLDebugVarMessageBox(const std::string& title, EDebugVarType var_type, void *var);
  53. ~LLDebugVarMessageBox();
  54. static LLDebugVarMessageBox* show(const std::string& title, EDebugVarType var_type, void *var);
  55. void sliderChanged(const LLSD& data);
  56. void onAnimateClicked(const LLSD& data);
  57. public:
  58. static void show(const std::string& title, F32 *var, F32 max_value = 100.f, F32 increment = 0.1f);
  59. static void show(const std::string& title, S32 *var, S32 max_value = 255, S32 increment = 1);
  60. static void show(const std::string& title, LLVector2 *var, LLVector2 max_value = LLVector2(100.f, 100.f), LLVector2 increment = LLVector2(0.1f, 0.1f));
  61. static void show(const std::string& title, LLVector3 *var, LLVector3 max_value = LLVector3(100.f, 100.f, 100.f), LLVector3 increment = LLVector3(0.1f, 0.1f, 0.1f));
  62. //static void show(const std::string& title, LLVector4 *var, LLVector4 max_value = LLVector4(100.f, 100.f, 100.f, 100.f), LLVector4 increment = LLVector4(0.1f, 0.1f, 0.1f, 0.1f));
  63. virtual void draw();
  64. protected:
  65. EDebugVarType mVarType;
  66. void* mVarData;
  67. LLSliderCtrl* mSlider1;
  68. LLSliderCtrl* mSlider2;
  69. LLSliderCtrl* mSlider3;
  70. LLButton* mAnimateButton;
  71. LLTextBox* mText;
  72. std::string mTitle;
  73. BOOL mAnimate;
  74. static std::map<std::string, LLDebugVarMessageBox*> sInstances;
  75. };
  76. #endif // LL_LLMESSAGEBOX_H