From 2581f9ba0a78416575e48a09616a0d5a8d0a360c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:29:08 +0000 Subject: start to abstract-out the 'is a spotlight' question so one day we can perhaps make the UI hurt less. --- indra/newview/llpanelvolume.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelvolume.cpp') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index fbe68b4d92..8b01637239 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -574,7 +574,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (volobjp->getLightTextureID().isNull()) + if (!volobjp->isLightSpotlight()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); @@ -591,7 +591,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->getLightTextureID().notNull()) + else if (volobjp->isLightSpotlight()) { //no longer a spot light volobjp->setLightTextureID(id); //self->childDisable("Light FOV"); -- cgit v1.2.3 From 566e3969f98c7ac10fe151ba119a78ac5eda2e3c Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 30 Jul 2010 10:02:30 -0700 Subject: deprecated LLPanel::child*() methods --- indra/newview/llpanelvolume.cpp | 250 ++++++++++++++++++++-------------------- 1 file changed, 125 insertions(+), 125 deletions(-) (limited to 'indra/newview/llpanelvolume.cpp') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 8b01637239..2b76b71568 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -85,21 +85,21 @@ BOOL LLPanelVolume::postBuild() { childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this); childSetCommitCallback("FlexNumSections",onCommitFlexible,this); - childSetValidate("FlexNumSections",precommitValidate); + getChild("FlexNumSections")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexGravity",onCommitFlexible,this); - childSetValidate("FlexGravity",precommitValidate); + getChild("FlexGravity")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexFriction",onCommitFlexible,this); - childSetValidate("FlexFriction",precommitValidate); + getChild("FlexFriction")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexWind",onCommitFlexible,this); - childSetValidate("FlexWind",precommitValidate); + getChild("FlexWind")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexTension",onCommitFlexible,this); - childSetValidate("FlexTension",precommitValidate); + getChild("FlexTension")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexForceX",onCommitFlexible,this); - childSetValidate("FlexForceX",precommitValidate); + getChild("FlexForceX")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexForceY",onCommitFlexible,this); - childSetValidate("FlexForceY",precommitValidate); + getChild("FlexForceY")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexForceZ",onCommitFlexible,this); - childSetValidate("FlexForceZ",precommitValidate); + getChild("FlexForceZ")->setValidateBeforeCommit(precommitValidate); } // LIGHT Parameters @@ -121,18 +121,18 @@ BOOL LLPanelVolume::postBuild() } childSetCommitCallback("Light Intensity",onCommitLight,this); - childSetValidate("Light Intensity",precommitValidate); + getChild("Light Intensity")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("Light Radius",onCommitLight,this); - childSetValidate("Light Radius",precommitValidate); + getChild("Light Radius")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("Light Falloff",onCommitLight,this); - childSetValidate("Light Falloff",precommitValidate); + getChild("Light Falloff")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("Light FOV", onCommitLight, this); - childSetValidate("Light FOV", precommitValidate); + getChild("Light FOV")->setValidateBeforeCommit( precommitValidate); childSetCommitCallback("Light Focus", onCommitLight, this); - childSetValidate("Light Focus", precommitValidate); + getChild("Light Focus")->setValidateBeforeCommit( precommitValidate); childSetCommitCallback("Light Ambiance", onCommitLight, this); - childSetValidate("Light Ambiance", precommitValidate); + getChild("Light Ambiance")->setValidateBeforeCommit( precommitValidate); } // Start with everyone disabled @@ -210,25 +210,25 @@ void LLPanelVolume::getState( ) // Select Single Message if (single_volume) { - childSetVisible("edit_object",true); - childSetEnabled("edit_object",true); - childSetVisible("select_single",false); + getChildView("edit_object")->setVisible(true); + getChildView("edit_object")->setEnabled(true); + getChildView("select_single")->setVisible(false); } else { - childSetVisible("edit_object",false); - childSetVisible("select_single",true); - childSetEnabled("select_single",true); + getChildView("edit_object")->setVisible(false); + getChildView("select_single")->setVisible(true); + getChildView("select_single")->setEnabled(true); } // Light properties BOOL is_light = volobjp && volobjp->getIsLight(); - childSetValue("Light Checkbox Ctrl",is_light); - childSetEnabled("Light Checkbox Ctrl",editable && single_volume && volobjp); + getChild("Light Checkbox Ctrl")->setValue(is_light); + getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); if (is_light && editable && single_volume) { - childSetEnabled("label color",true); + getChildView("label color")->setEnabled(true); //mLabelColor ->setEnabled( TRUE ); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) @@ -246,22 +246,22 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); } - childSetEnabled("Light Intensity",true); - childSetEnabled("Light Radius",true); - childSetEnabled("Light Falloff",true); + getChildView("Light Intensity")->setEnabled(true); + getChildView("Light Radius")->setEnabled(true); + getChildView("Light Falloff")->setEnabled(true); - childSetEnabled("Light FOV", true); - childSetEnabled("Light Focus", true); - childSetEnabled("Light Ambiance", true); + getChildView("Light FOV")->setEnabled(true); + getChildView("Light Focus")->setEnabled(true); + getChildView("Light Ambiance")->setEnabled(true); - childSetValue("Light Intensity",volobjp->getLightIntensity()); - childSetValue("Light Radius",volobjp->getLightRadius()); - childSetValue("Light Falloff",volobjp->getLightFalloff()); + getChild("Light Intensity")->setValue(volobjp->getLightIntensity()); + getChild("Light Radius")->setValue(volobjp->getLightRadius()); + getChild("Light Falloff")->setValue(volobjp->getLightFalloff()); LLVector3 params = volobjp->getSpotLightParams(); - childSetValue("Light FOV", params.mV[0]); - childSetValue("Light Focus", params.mV[1]); - childSetValue("Light Ambiance", params.mV[2]); + getChild("Light FOV")->setValue(params.mV[0]); + getChild("Light Focus")->setValue(params.mV[1]); + getChild("Light Ambiance")->setValue(params.mV[2]); mLightSavedColor = volobjp->getLightColor(); } @@ -271,7 +271,7 @@ void LLPanelVolume::getState( ) getChild("Light Radius", true)->clear(); getChild("Light Falloff", true)->clear(); - childSetEnabled("label color",false); + getChildView("label color")->setEnabled(false); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { @@ -285,56 +285,56 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setValid(FALSE); } - childSetEnabled("Light Intensity",false); - childSetEnabled("Light Radius",false); - childSetEnabled("Light Falloff",false); + getChildView("Light Intensity")->setEnabled(false); + getChildView("Light Radius")->setEnabled(false); + getChildView("Light Falloff")->setEnabled(false); - childSetEnabled("Light FOV",false); - childSetEnabled("Light Focus",false); - childSetEnabled("Light Ambiance",false); + getChildView("Light FOV")->setEnabled(false); + getChildView("Light Focus")->setEnabled(false); + getChildView("Light Ambiance")->setEnabled(false); } // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); - childSetValue("Flexible1D Checkbox Ctrl",is_flexible); + getChild("Flexible1D Checkbox Ctrl")->setValue(is_flexible); if (is_flexible || (volobjp && volobjp->canBeFlexible())) { - childSetEnabled("Flexible1D Checkbox Ctrl", editable && single_volume && volobjp); + getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); } else { - childSetEnabled("Flexible1D Checkbox Ctrl", false); + getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); } if (is_flexible && editable && single_volume) { - childSetVisible("FlexNumSections",true); - childSetVisible("FlexGravity",true); - childSetVisible("FlexTension",true); - childSetVisible("FlexFriction",true); - childSetVisible("FlexWind",true); - childSetVisible("FlexForceX",true); - childSetVisible("FlexForceY",true); - childSetVisible("FlexForceZ",true); - - childSetEnabled("FlexNumSections",true); - childSetEnabled("FlexGravity",true); - childSetEnabled("FlexTension",true); - childSetEnabled("FlexFriction",true); - childSetEnabled("FlexWind",true); - childSetEnabled("FlexForceX",true); - childSetEnabled("FlexForceY",true); - childSetEnabled("FlexForceZ",true); + getChildView("FlexNumSections")->setVisible(true); + getChildView("FlexGravity")->setVisible(true); + getChildView("FlexTension")->setVisible(true); + getChildView("FlexFriction")->setVisible(true); + getChildView("FlexWind")->setVisible(true); + getChildView("FlexForceX")->setVisible(true); + getChildView("FlexForceY")->setVisible(true); + getChildView("FlexForceZ")->setVisible(true); + + getChildView("FlexNumSections")->setEnabled(true); + getChildView("FlexGravity")->setEnabled(true); + getChildView("FlexTension")->setEnabled(true); + getChildView("FlexFriction")->setEnabled(true); + getChildView("FlexWind")->setEnabled(true); + getChildView("FlexForceX")->setEnabled(true); + getChildView("FlexForceY")->setEnabled(true); + getChildView("FlexForceZ")->setEnabled(true); LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - childSetValue("FlexNumSections",(F32)attributes->getSimulateLOD()); - childSetValue("FlexGravity",attributes->getGravity()); - childSetValue("FlexTension",attributes->getTension()); - childSetValue("FlexFriction",attributes->getAirFriction()); - childSetValue("FlexWind",attributes->getWindSensitivity()); - childSetValue("FlexForceX",attributes->getUserForce().mV[VX]); - childSetValue("FlexForceY",attributes->getUserForce().mV[VY]); - childSetValue("FlexForceZ",attributes->getUserForce().mV[VZ]); + getChild("FlexNumSections")->setValue((F32)attributes->getSimulateLOD()); + getChild("FlexGravity")->setValue(attributes->getGravity()); + getChild("FlexTension")->setValue(attributes->getTension()); + getChild("FlexFriction")->setValue(attributes->getAirFriction()); + getChild("FlexWind")->setValue(attributes->getWindSensitivity()); + getChild("FlexForceX")->setValue(attributes->getUserForce().mV[VX]); + getChild("FlexForceY")->setValue(attributes->getUserForce().mV[VY]); + getChild("FlexForceZ")->setValue(attributes->getUserForce().mV[VZ]); } else { @@ -347,14 +347,14 @@ void LLPanelVolume::getState( ) getChild("FlexForceY", true)->clear(); getChild("FlexForceZ", true)->clear(); - childSetEnabled("FlexNumSections",false); - childSetEnabled("FlexGravity",false); - childSetEnabled("FlexTension",false); - childSetEnabled("FlexFriction",false); - childSetEnabled("FlexWind",false); - childSetEnabled("FlexForceX",false); - childSetEnabled("FlexForceY",false); - childSetEnabled("FlexForceZ",false); + getChildView("FlexNumSections")->setEnabled(false); + getChildView("FlexGravity")->setEnabled(false); + getChildView("FlexTension")->setEnabled(false); + getChildView("FlexFriction")->setEnabled(false); + getChildView("FlexWind")->setEnabled(false); + getChildView("FlexForceX")->setEnabled(false); + getChildView("FlexForceY")->setEnabled(false); + getChildView("FlexForceZ")->setEnabled(false); } mObject = objectp; @@ -384,11 +384,11 @@ void LLPanelVolume::refresh() BOOL visible = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; - childSetVisible("label texture", visible); - childSetVisible("Light FOV", visible); - childSetVisible("Light Focus", visible); - childSetVisible("Light Ambiance", visible); - childSetVisible("light texture control", visible); + getChildView("label texture")->setVisible( visible); + getChildView("Light FOV")->setVisible( visible); + getChildView("Light Focus")->setVisible( visible); + getChildView("Light Ambiance")->setVisible( visible); + getChildView("light texture control")->setVisible( visible); } @@ -403,13 +403,13 @@ void LLPanelVolume::clearCtrls() { LLPanel::clearCtrls(); - childSetEnabled("select_single",false); - childSetVisible("select_single",true); - childSetEnabled("edit_object",false); - childSetVisible("edit_object",false); - childSetEnabled("Light Checkbox Ctrl",false); - childSetEnabled("label color",false); - childSetEnabled("label color",false); + getChildView("select_single")->setEnabled(false); + getChildView("select_single")->setVisible(true); + getChildView("edit_object")->setEnabled(false); + getChildView("edit_object")->setVisible(false); + getChildView("Light Checkbox Ctrl")->setEnabled(false); + getChildView("label color")->setEnabled(false); + getChildView("label color")->setEnabled(false); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { @@ -423,19 +423,19 @@ void LLPanelVolume::clearCtrls() LightTextureCtrl->setValid( FALSE ); } - childSetEnabled("Light Intensity",false); - childSetEnabled("Light Radius",false); - childSetEnabled("Light Falloff",false); - - childSetEnabled("Flexible1D Checkbox Ctrl",false); - childSetEnabled("FlexNumSections",false); - childSetEnabled("FlexGravity",false); - childSetEnabled("FlexTension",false); - childSetEnabled("FlexFriction",false); - childSetEnabled("FlexWind",false); - childSetEnabled("FlexForceX",false); - childSetEnabled("FlexForceY",false); - childSetEnabled("FlexForceZ",false); + getChildView("Light Intensity")->setEnabled(false); + getChildView("Light Radius")->setEnabled(false); + getChildView("Light Falloff")->setEnabled(false); + + getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); + getChildView("FlexNumSections")->setEnabled(false); + getChildView("FlexGravity")->setEnabled(false); + getChildView("FlexTension")->setEnabled(false); + getChildView("FlexFriction")->setEnabled(false); + getChildView("FlexWind")->setEnabled(false); + getChildView("FlexForceX")->setEnabled(false); + getChildView("FlexForceY")->setEnabled(false); + getChildView("FlexForceZ")->setEnabled(false); } // @@ -451,7 +451,7 @@ void LLPanelVolume::sendIsLight() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL value = childGetValue("Light Checkbox Ctrl"); + BOOL value = getChild("Light Checkbox Ctrl")->getValue(); volobjp->setIsLight(value); llinfos << "update light sent" << llendl; } @@ -465,7 +465,7 @@ void LLPanelVolume::sendIsFlexible() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL is_flexible = childGetValue("Flexible1D Checkbox Ctrl"); + BOOL is_flexible = getChild("Flexible1D Checkbox Ctrl")->getValue(); //BOOL is_flexible = mCheckFlexible1D->get(); if (is_flexible) @@ -557,9 +557,9 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLVOVolume *volobjp = (LLVOVolume *)objectp; - volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal()); - volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal()); - volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal()); + volobjp->setLightIntensity((F32)self->getChild("Light Intensity")->getValue().asReal()); + volobjp->setLightRadius((F32)self->getChild("Light Radius")->getValue().asReal()); + volobjp->setLightFalloff((F32)self->getChild("Light Falloff")->getValue().asReal()); LLColorSwatchCtrl* LightColorSwatch = self->getChild("colorswatch"); if(LightColorSwatch) @@ -578,25 +578,25 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); - self->childSetValue("Light FOV", spot_params.mV[0]); - self->childSetValue("Light Focus", spot_params.mV[1]); - self->childSetValue("Light Ambiance", spot_params.mV[2]); + self->getChild("Light FOV")->setValue(spot_params.mV[0]); + self->getChild("Light Focus")->setValue(spot_params.mV[1]); + self->getChild("Light Ambiance")->setValue(spot_params.mV[2]); } else { //modifying existing params LLVector3 spot_params; - spot_params.mV[0] = (F32) self->childGetValue("Light FOV").asReal(); - spot_params.mV[1] = (F32) self->childGetValue("Light Focus").asReal(); - spot_params.mV[2] = (F32) self->childGetValue("Light Ambiance").asReal(); + spot_params.mV[0] = (F32) self->getChild("Light FOV")->getValue().asReal(); + spot_params.mV[1] = (F32) self->getChild("Light Focus")->getValue().asReal(); + spot_params.mV[2] = (F32) self->getChild("Light Ambiance")->getValue().asReal(); volobjp->setSpotLightParams(spot_params); } } else if (volobjp->isLightSpotlight()) { //no longer a spot light volobjp->setLightTextureID(id); - //self->childDisable("Light FOV"); - //self->childDisable("Light Focus"); - //self->childDisable("Light Ambiance"); + //self->getChildView("Light FOV")->setEnabled(FALSE); + //self->getChildView("Light Focus")->setEnabled(FALSE); + //self->getChildView("Light Ambiance")->setEnabled(FALSE); } } @@ -629,14 +629,14 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata ) new_attributes = *attributes; - new_attributes.setSimulateLOD(self->childGetValue("FlexNumSections").asInteger());//(S32)self->mSpinSections->get()); - new_attributes.setGravity((F32)self->childGetValue("FlexGravity").asReal()); - new_attributes.setTension((F32)self->childGetValue("FlexTension").asReal()); - new_attributes.setAirFriction((F32)self->childGetValue("FlexFriction").asReal()); - new_attributes.setWindSensitivity((F32)self->childGetValue("FlexWind").asReal()); - F32 fx = (F32)self->childGetValue("FlexForceX").asReal(); - F32 fy = (F32)self->childGetValue("FlexForceY").asReal(); - F32 fz = (F32)self->childGetValue("FlexForceZ").asReal(); + new_attributes.setSimulateLOD(self->getChild("FlexNumSections")->getValue().asInteger());//(S32)self->mSpinSections->get()); + new_attributes.setGravity((F32)self->getChild("FlexGravity")->getValue().asReal()); + new_attributes.setTension((F32)self->getChild("FlexTension")->getValue().asReal()); + new_attributes.setAirFriction((F32)self->getChild("FlexFriction")->getValue().asReal()); + new_attributes.setWindSensitivity((F32)self->getChild("FlexWind")->getValue().asReal()); + F32 fx = (F32)self->getChild("FlexForceX")->getValue().asReal(); + F32 fy = (F32)self->getChild("FlexForceY")->getValue().asReal(); + F32 fz = (F32)self->getChild("FlexForceZ")->getValue().asReal(); LLVector3 force(fx,fy,fz); new_attributes.setUserForce(force); -- cgit v1.2.3 From 06b0d72efa96b6a0ed665f7cd46f358c48929e7b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 13 Aug 2010 07:24:57 -0400 Subject: Change license from GPL to LGPL (version 2.1) --- indra/newview/llpanelvolume.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llpanelvolume.cpp') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index fbe68b4d92..faf260881e 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -2,31 +2,25 @@ * @file llpanelvolume.cpp * @brief Object editing (position, scale, etc.) in the tools floater * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 98cc2365034a93c69704daa69efb389799cc9627 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 18:44:39 +0100 Subject: Backed out changeset a62bf7c0af21 Backing out this merge that I pushed (prematurely) to the wrong place. --- indra/newview/llpanelvolume.cpp | 254 ++++++++++++++++++++-------------------- 1 file changed, 127 insertions(+), 127 deletions(-) (limited to 'indra/newview/llpanelvolume.cpp') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 065c4d0b92..faf260881e 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -79,21 +79,21 @@ BOOL LLPanelVolume::postBuild() { childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this); childSetCommitCallback("FlexNumSections",onCommitFlexible,this); - getChild("FlexNumSections")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexNumSections",precommitValidate); childSetCommitCallback("FlexGravity",onCommitFlexible,this); - getChild("FlexGravity")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexGravity",precommitValidate); childSetCommitCallback("FlexFriction",onCommitFlexible,this); - getChild("FlexFriction")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexFriction",precommitValidate); childSetCommitCallback("FlexWind",onCommitFlexible,this); - getChild("FlexWind")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexWind",precommitValidate); childSetCommitCallback("FlexTension",onCommitFlexible,this); - getChild("FlexTension")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexTension",precommitValidate); childSetCommitCallback("FlexForceX",onCommitFlexible,this); - getChild("FlexForceX")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceX",precommitValidate); childSetCommitCallback("FlexForceY",onCommitFlexible,this); - getChild("FlexForceY")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceY",precommitValidate); childSetCommitCallback("FlexForceZ",onCommitFlexible,this); - getChild("FlexForceZ")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceZ",precommitValidate); } // LIGHT Parameters @@ -115,18 +115,18 @@ BOOL LLPanelVolume::postBuild() } childSetCommitCallback("Light Intensity",onCommitLight,this); - getChild("Light Intensity")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Intensity",precommitValidate); childSetCommitCallback("Light Radius",onCommitLight,this); - getChild("Light Radius")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Radius",precommitValidate); childSetCommitCallback("Light Falloff",onCommitLight,this); - getChild("Light Falloff")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Falloff",precommitValidate); childSetCommitCallback("Light FOV", onCommitLight, this); - getChild("Light FOV")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light FOV", precommitValidate); childSetCommitCallback("Light Focus", onCommitLight, this); - getChild("Light Focus")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light Focus", precommitValidate); childSetCommitCallback("Light Ambiance", onCommitLight, this); - getChild("Light Ambiance")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light Ambiance", precommitValidate); } // Start with everyone disabled @@ -204,25 +204,25 @@ void LLPanelVolume::getState( ) // Select Single Message if (single_volume) { - getChildView("edit_object")->setVisible(true); - getChildView("edit_object")->setEnabled(true); - getChildView("select_single")->setVisible(false); + childSetVisible("edit_object",true); + childSetEnabled("edit_object",true); + childSetVisible("select_single",false); } else { - getChildView("edit_object")->setVisible(false); - getChildView("select_single")->setVisible(true); - getChildView("select_single")->setEnabled(true); + childSetVisible("edit_object",false); + childSetVisible("select_single",true); + childSetEnabled("select_single",true); } // Light properties BOOL is_light = volobjp && volobjp->getIsLight(); - getChild("Light Checkbox Ctrl")->setValue(is_light); - getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); + childSetValue("Light Checkbox Ctrl",is_light); + childSetEnabled("Light Checkbox Ctrl",editable && single_volume && volobjp); if (is_light && editable && single_volume) { - getChildView("label color")->setEnabled(true); + childSetEnabled("label color",true); //mLabelColor ->setEnabled( TRUE ); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) @@ -240,22 +240,22 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); } - getChildView("Light Intensity")->setEnabled(true); - getChildView("Light Radius")->setEnabled(true); - getChildView("Light Falloff")->setEnabled(true); + childSetEnabled("Light Intensity",true); + childSetEnabled("Light Radius",true); + childSetEnabled("Light Falloff",true); - getChildView("Light FOV")->setEnabled(true); - getChildView("Light Focus")->setEnabled(true); - getChildView("Light Ambiance")->setEnabled(true); + childSetEnabled("Light FOV", true); + childSetEnabled("Light Focus", true); + childSetEnabled("Light Ambiance", true); - getChild("Light Intensity")->setValue(volobjp->getLightIntensity()); - getChild("Light Radius")->setValue(volobjp->getLightRadius()); - getChild("Light Falloff")->setValue(volobjp->getLightFalloff()); + childSetValue("Light Intensity",volobjp->getLightIntensity()); + childSetValue("Light Radius",volobjp->getLightRadius()); + childSetValue("Light Falloff",volobjp->getLightFalloff()); LLVector3 params = volobjp->getSpotLightParams(); - getChild("Light FOV")->setValue(params.mV[0]); - getChild("Light Focus")->setValue(params.mV[1]); - getChild("Light Ambiance")->setValue(params.mV[2]); + childSetValue("Light FOV", params.mV[0]); + childSetValue("Light Focus", params.mV[1]); + childSetValue("Light Ambiance", params.mV[2]); mLightSavedColor = volobjp->getLightColor(); } @@ -265,7 +265,7 @@ void LLPanelVolume::getState( ) getChild("Light Radius", true)->clear(); getChild("Light Falloff", true)->clear(); - getChildView("label color")->setEnabled(false); + childSetEnabled("label color",false); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { @@ -279,56 +279,56 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setValid(FALSE); } - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); + childSetEnabled("Light Intensity",false); + childSetEnabled("Light Radius",false); + childSetEnabled("Light Falloff",false); - getChildView("Light FOV")->setEnabled(false); - getChildView("Light Focus")->setEnabled(false); - getChildView("Light Ambiance")->setEnabled(false); + childSetEnabled("Light FOV",false); + childSetEnabled("Light Focus",false); + childSetEnabled("Light Ambiance",false); } // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); - getChild("Flexible1D Checkbox Ctrl")->setValue(is_flexible); + childSetValue("Flexible1D Checkbox Ctrl",is_flexible); if (is_flexible || (volobjp && volobjp->canBeFlexible())) { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); + childSetEnabled("Flexible1D Checkbox Ctrl", editable && single_volume && volobjp); } else { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); + childSetEnabled("Flexible1D Checkbox Ctrl", false); } if (is_flexible && editable && single_volume) { - getChildView("FlexNumSections")->setVisible(true); - getChildView("FlexGravity")->setVisible(true); - getChildView("FlexTension")->setVisible(true); - getChildView("FlexFriction")->setVisible(true); - getChildView("FlexWind")->setVisible(true); - getChildView("FlexForceX")->setVisible(true); - getChildView("FlexForceY")->setVisible(true); - getChildView("FlexForceZ")->setVisible(true); - - getChildView("FlexNumSections")->setEnabled(true); - getChildView("FlexGravity")->setEnabled(true); - getChildView("FlexTension")->setEnabled(true); - getChildView("FlexFriction")->setEnabled(true); - getChildView("FlexWind")->setEnabled(true); - getChildView("FlexForceX")->setEnabled(true); - getChildView("FlexForceY")->setEnabled(true); - getChildView("FlexForceZ")->setEnabled(true); + childSetVisible("FlexNumSections",true); + childSetVisible("FlexGravity",true); + childSetVisible("FlexTension",true); + childSetVisible("FlexFriction",true); + childSetVisible("FlexWind",true); + childSetVisible("FlexForceX",true); + childSetVisible("FlexForceY",true); + childSetVisible("FlexForceZ",true); + + childSetEnabled("FlexNumSections",true); + childSetEnabled("FlexGravity",true); + childSetEnabled("FlexTension",true); + childSetEnabled("FlexFriction",true); + childSetEnabled("FlexWind",true); + childSetEnabled("FlexForceX",true); + childSetEnabled("FlexForceY",true); + childSetEnabled("FlexForceZ",true); LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - getChild("FlexNumSections")->setValue((F32)attributes->getSimulateLOD()); - getChild("FlexGravity")->setValue(attributes->getGravity()); - getChild("FlexTension")->setValue(attributes->getTension()); - getChild("FlexFriction")->setValue(attributes->getAirFriction()); - getChild("FlexWind")->setValue(attributes->getWindSensitivity()); - getChild("FlexForceX")->setValue(attributes->getUserForce().mV[VX]); - getChild("FlexForceY")->setValue(attributes->getUserForce().mV[VY]); - getChild("FlexForceZ")->setValue(attributes->getUserForce().mV[VZ]); + childSetValue("FlexNumSections",(F32)attributes->getSimulateLOD()); + childSetValue("FlexGravity",attributes->getGravity()); + childSetValue("FlexTension",attributes->getTension()); + childSetValue("FlexFriction",attributes->getAirFriction()); + childSetValue("FlexWind",attributes->getWindSensitivity()); + childSetValue("FlexForceX",attributes->getUserForce().mV[VX]); + childSetValue("FlexForceY",attributes->getUserForce().mV[VY]); + childSetValue("FlexForceZ",attributes->getUserForce().mV[VZ]); } else { @@ -341,14 +341,14 @@ void LLPanelVolume::getState( ) getChild("FlexForceY", true)->clear(); getChild("FlexForceZ", true)->clear(); - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + childSetEnabled("FlexNumSections",false); + childSetEnabled("FlexGravity",false); + childSetEnabled("FlexTension",false); + childSetEnabled("FlexFriction",false); + childSetEnabled("FlexWind",false); + childSetEnabled("FlexForceX",false); + childSetEnabled("FlexForceY",false); + childSetEnabled("FlexForceZ",false); } mObject = objectp; @@ -378,11 +378,11 @@ void LLPanelVolume::refresh() BOOL visible = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; - getChildView("label texture")->setVisible( visible); - getChildView("Light FOV")->setVisible( visible); - getChildView("Light Focus")->setVisible( visible); - getChildView("Light Ambiance")->setVisible( visible); - getChildView("light texture control")->setVisible( visible); + childSetVisible("label texture", visible); + childSetVisible("Light FOV", visible); + childSetVisible("Light Focus", visible); + childSetVisible("Light Ambiance", visible); + childSetVisible("light texture control", visible); } @@ -397,13 +397,13 @@ void LLPanelVolume::clearCtrls() { LLPanel::clearCtrls(); - getChildView("select_single")->setEnabled(false); - getChildView("select_single")->setVisible(true); - getChildView("edit_object")->setEnabled(false); - getChildView("edit_object")->setVisible(false); - getChildView("Light Checkbox Ctrl")->setEnabled(false); - getChildView("label color")->setEnabled(false); - getChildView("label color")->setEnabled(false); + childSetEnabled("select_single",false); + childSetVisible("select_single",true); + childSetEnabled("edit_object",false); + childSetVisible("edit_object",false); + childSetEnabled("Light Checkbox Ctrl",false); + childSetEnabled("label color",false); + childSetEnabled("label color",false); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { @@ -417,19 +417,19 @@ void LLPanelVolume::clearCtrls() LightTextureCtrl->setValid( FALSE ); } - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); - - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + childSetEnabled("Light Intensity",false); + childSetEnabled("Light Radius",false); + childSetEnabled("Light Falloff",false); + + childSetEnabled("Flexible1D Checkbox Ctrl",false); + childSetEnabled("FlexNumSections",false); + childSetEnabled("FlexGravity",false); + childSetEnabled("FlexTension",false); + childSetEnabled("FlexFriction",false); + childSetEnabled("FlexWind",false); + childSetEnabled("FlexForceX",false); + childSetEnabled("FlexForceY",false); + childSetEnabled("FlexForceZ",false); } // @@ -445,7 +445,7 @@ void LLPanelVolume::sendIsLight() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL value = getChild("Light Checkbox Ctrl")->getValue(); + BOOL value = childGetValue("Light Checkbox Ctrl"); volobjp->setIsLight(value); llinfos << "update light sent" << llendl; } @@ -459,7 +459,7 @@ void LLPanelVolume::sendIsFlexible() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL is_flexible = getChild("Flexible1D Checkbox Ctrl")->getValue(); + BOOL is_flexible = childGetValue("Flexible1D Checkbox Ctrl"); //BOOL is_flexible = mCheckFlexible1D->get(); if (is_flexible) @@ -551,9 +551,9 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLVOVolume *volobjp = (LLVOVolume *)objectp; - volobjp->setLightIntensity((F32)self->getChild("Light Intensity")->getValue().asReal()); - volobjp->setLightRadius((F32)self->getChild("Light Radius")->getValue().asReal()); - volobjp->setLightFalloff((F32)self->getChild("Light Falloff")->getValue().asReal()); + volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal()); + volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal()); + volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal()); LLColorSwatchCtrl* LightColorSwatch = self->getChild("colorswatch"); if(LightColorSwatch) @@ -568,29 +568,29 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (!volobjp->isLightSpotlight()) + if (volobjp->getLightTextureID().isNull()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); - self->getChild("Light FOV")->setValue(spot_params.mV[0]); - self->getChild("Light Focus")->setValue(spot_params.mV[1]); - self->getChild("Light Ambiance")->setValue(spot_params.mV[2]); + self->childSetValue("Light FOV", spot_params.mV[0]); + self->childSetValue("Light Focus", spot_params.mV[1]); + self->childSetValue("Light Ambiance", spot_params.mV[2]); } else { //modifying existing params LLVector3 spot_params; - spot_params.mV[0] = (F32) self->getChild("Light FOV")->getValue().asReal(); - spot_params.mV[1] = (F32) self->getChild("Light Focus")->getValue().asReal(); - spot_params.mV[2] = (F32) self->getChild("Light Ambiance")->getValue().asReal(); + spot_params.mV[0] = (F32) self->childGetValue("Light FOV").asReal(); + spot_params.mV[1] = (F32) self->childGetValue("Light Focus").asReal(); + spot_params.mV[2] = (F32) self->childGetValue("Light Ambiance").asReal(); volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->isLightSpotlight()) + else if (volobjp->getLightTextureID().notNull()) { //no longer a spot light volobjp->setLightTextureID(id); - //self->getChildView("Light FOV")->setEnabled(FALSE); - //self->getChildView("Light Focus")->setEnabled(FALSE); - //self->getChildView("Light Ambiance")->setEnabled(FALSE); + //self->childDisable("Light FOV"); + //self->childDisable("Light Focus"); + //self->childDisable("Light Ambiance"); } } @@ -623,14 +623,14 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata ) new_attributes = *attributes; - new_attributes.setSimulateLOD(self->getChild("FlexNumSections")->getValue().asInteger());//(S32)self->mSpinSections->get()); - new_attributes.setGravity((F32)self->getChild("FlexGravity")->getValue().asReal()); - new_attributes.setTension((F32)self->getChild("FlexTension")->getValue().asReal()); - new_attributes.setAirFriction((F32)self->getChild("FlexFriction")->getValue().asReal()); - new_attributes.setWindSensitivity((F32)self->getChild("FlexWind")->getValue().asReal()); - F32 fx = (F32)self->getChild("FlexForceX")->getValue().asReal(); - F32 fy = (F32)self->getChild("FlexForceY")->getValue().asReal(); - F32 fz = (F32)self->getChild("FlexForceZ")->getValue().asReal(); + new_attributes.setSimulateLOD(self->childGetValue("FlexNumSections").asInteger());//(S32)self->mSpinSections->get()); + new_attributes.setGravity((F32)self->childGetValue("FlexGravity").asReal()); + new_attributes.setTension((F32)self->childGetValue("FlexTension").asReal()); + new_attributes.setAirFriction((F32)self->childGetValue("FlexFriction").asReal()); + new_attributes.setWindSensitivity((F32)self->childGetValue("FlexWind").asReal()); + F32 fx = (F32)self->childGetValue("FlexForceX").asReal(); + F32 fy = (F32)self->childGetValue("FlexForceY").asReal(); + F32 fz = (F32)self->childGetValue("FlexForceZ").asReal(); LLVector3 force(fx,fy,fz); new_attributes.setUserForce(force); -- cgit v1.2.3 From 956074541f429725a5ba216d6a8fa8204a676e59 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:29:08 +0000 Subject: start to abstract-out the 'is a spotlight' question so one day we can perhaps make the UI hurt less. --- indra/newview/llpanelvolume.cpp | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'indra/newview/llpanelvolume.cpp') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index faf260881e..8b01637239 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -2,25 +2,31 @@ * @file llpanelvolume.cpp * @brief Object editing (position, scale, etc.) in the tools floater * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ @@ -568,7 +574,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (volobjp->getLightTextureID().isNull()) + if (!volobjp->isLightSpotlight()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); @@ -585,7 +591,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->getLightTextureID().notNull()) + else if (volobjp->isLightSpotlight()) { //no longer a spot light volobjp->setLightTextureID(id); //self->childDisable("Light FOV"); -- cgit v1.2.3