PageRenderTime 304ms CodeModel.GetById 181ms app.highlight 9ms RepoModel.GetById 112ms app.codeStats 0ms

/indra/newview/llfloatereditwater.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 115 lines | 62 code | 25 blank | 28 comment | 0 complexity | 78ccd3cf99fbaa4c9b694fbb25115213 MD5 | raw file
  1/** 
  2 * @file llfloatereditwater.h
  3 * @brief Floater to create or edit a water preset
  4 *
  5 * $LicenseInfo:firstyear=2011&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2011, 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
 27#ifndef LL_LLFLOATEREDITWATER_H
 28#define LL_LLFLOATEREDITWATER_H
 29
 30#include "llfloater.h"
 31#include "llenvmanager.h" // for LLEnvKey
 32
 33class LLButton;
 34class LLCheckBoxCtrl;
 35class LLComboBox;
 36class LLLineEditor;
 37
 38struct WaterVector2Control;
 39struct WaterVector3Control;
 40struct WaterColorControl;
 41struct WaterFloatControl;
 42struct WaterExpFloatControl;
 43
 44class LLFloaterEditWater : public LLFloater
 45{
 46	LOG_CLASS(LLFloaterEditWater);
 47
 48public:
 49	LLFloaterEditWater(const LLSD &key);
 50
 51	/*virtual*/	BOOL	postBuild();
 52	/*virtual*/ void	onOpen(const LLSD& key);
 53	/*virtual*/ void	onClose(bool app_quitting);
 54	/*virtual*/ void	draw();
 55
 56private:
 57	void initCallbacks(void);
 58
 59	//-- WL stuff begins ------------------------------------------------------
 60
 61	void syncControls(); /// sync up sliders with parameters
 62
 63	// general purpose callbacks for dealing with color controllers
 64	void onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl);
 65	void onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl);
 66	void onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl);
 67	void onColorControlAMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl);
 68	void onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl);
 69
 70	void onVector3ControlXMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl);
 71	void onVector3ControlYMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl);
 72	void onVector3ControlZMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl);
 73
 74	void onVector2ControlXMoved(LLUICtrl* ctrl, WaterVector2Control* vector_ctrl);
 75	void onVector2ControlYMoved(LLUICtrl* ctrl, WaterVector2Control* vector_ctrl);
 76
 77	void onFloatControlMoved(LLUICtrl* ctrl, WaterFloatControl* floatControl);
 78
 79	void onExpFloatControlMoved(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl);
 80
 81	void onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl);
 82
 83	void onNormalMapPicked(LLUICtrl* ctrl); /// handle if they choose a new normal map
 84
 85	//-- WL stuff ends --------------------------------------------------------
 86
 87	void reset();
 88	bool isNewPreset() const;
 89	void refreshWaterPresetsList();
 90	void enableEditing(bool enable);
 91	void saveRegionWater();
 92
 93	std::string			getCurrentPresetName() const;
 94	LLEnvKey::EScope	getCurrentScope() const;
 95	void				getSelectedPreset(std::string& name, LLEnvKey::EScope& scope) const;
 96
 97	void onWaterPresetNameEdited();
 98	void onWaterPresetSelected();
 99	bool onSaveAnswer(const LLSD& notification, const LLSD& response);
100	void onSaveConfirmed();
101
102	void onBtnSave();
103	void onBtnCancel();
104
105	void onWaterPresetListChange();
106	void onRegionSettingsChange();
107	void onRegionInfoUpdate();
108
109	LLLineEditor*	mWaterPresetNameEditor;
110	LLComboBox*		mWaterPresetCombo;
111	LLCheckBoxCtrl*	mMakeDefaultCheckBox;
112	LLButton*		mSaveButton;
113};
114
115#endif // LL_LLFLOATEREDITWATER_H