From fd29df8c720b6c61680ecea002ecf5c116a69fde Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 20 Dec 2011 10:24:56 -0800 Subject: Adding functionality to set the console values from the console class. --- indra/newview/llfloaterpathfindingconsole.cpp | 289 ++++++++++++++++++-------- 1 file changed, 197 insertions(+), 92 deletions(-) (limited to 'indra/newview/llfloaterpathfindingconsole.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 20ce7b8f0c..9cf55ca7f9 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -42,6 +42,18 @@ #include "llpathinglib.h" +#define XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY 1 +#define XUI_RENDER_OVERLAY_ON_ALL_RENDERABLE_GEOMETRY 2 + +#define XUI_PATH_SELECT_NONE 0 +#define XUI_PATH_SELECT_START_POINT 1 +#define XUI_PATH_SELECT_END_POINT 2 + +#define XUI_CHARACTER_TYPE_A 1 +#define XUI_CHARACTER_TYPE_B 2 +#define XUI_CHARACTER_TYPE_C 3 +#define XUI_CHARACTER_TYPE_D 4 + //--------------------------------------------------------------------------- // LLFloaterPathfindingConsole //--------------------------------------------------------------------------- @@ -107,6 +119,191 @@ BOOL LLFloaterPathfindingConsole::postBuild() return LLFloater::postBuild(); } +LLFloaterPathfindingConsole::ERegionOverlayDisplay LLFloaterPathfindingConsole::getRegionOverlayDisplay() const +{ + ERegionOverlayDisplay regionOverlayDisplay; + switch (mRegionOverlayDisplayRadioGroup->getValue().asInteger()) + { + case XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY : + regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry; + break; + case XUI_RENDER_OVERLAY_ON_ALL_RENDERABLE_GEOMETRY : + regionOverlayDisplay = kRenderOverlayOnAllRenderableGeometry; + break; + default : + regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry; + llassert(0); + break; + } + + return regionOverlayDisplay; +} + +void LLFloaterPathfindingConsole::setRegionOverlayDisplay(ERegionOverlayDisplay regionOverlayDisplay) +{ + LLSD radioGroupValue; + + switch (regionOverlayDisplay) + { + case kRenderOverlayOnFixedPhysicsGeometry : + radioGroupValue = XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY; + break; + case kRenderOverlayOnAllRenderableGeometry : + radioGroupValue = XUI_RENDER_OVERLAY_ON_ALL_RENDERABLE_GEOMETRY; + break; + default : + radioGroupValue = XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY; + llassert(0); + break; + } + + mRegionOverlayDisplayRadioGroup->setValue(radioGroupValue); +} + +LLFloaterPathfindingConsole::EPathSelectionState LLFloaterPathfindingConsole::getPathSelectionState() const +{ + EPathSelectionState pathSelectionState; + + switch (mPathSelectionRadioGroup->getValue().asInteger()) + { + case XUI_PATH_SELECT_START_POINT : + pathSelectionState = kPathSelectStartPoint; + break; + case XUI_PATH_SELECT_END_POINT : + pathSelectionState = kPathSelectEndPoint; + break; + default : + pathSelectionState = kPathSelectNone; + break; + } + + return pathSelectionState; +} + +void LLFloaterPathfindingConsole::setPathSelectionState(EPathSelectionState pathSelectionState) +{ + LLSD radioGroupValue; + + switch (pathSelectionState) + { + case kPathSelectStartPoint : + radioGroupValue = XUI_PATH_SELECT_START_POINT; + break; + case kPathSelectEndPoint : + radioGroupValue = XUI_PATH_SELECT_END_POINT; + break; + default : + radioGroupValue = XUI_PATH_SELECT_NONE; + break; + } + + mPathSelectionRadioGroup->setValue(radioGroupValue); +} + +F32 LLFloaterPathfindingConsole::getCharacterWidth() const +{ + return mCharacterWidthSlider->getValueF32(); +} + +void LLFloaterPathfindingConsole::setCharacterWidth(F32 characterWidth) +{ + mCharacterWidthSlider->setValue(LLSD(characterWidth)); +} + +LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getCharacterType() const +{ + ECharacterType characterType; + + switch (mCharacterTypeRadioGroup->getValue().asInteger()) + { + case XUI_CHARACTER_TYPE_A : + characterType = kCharacterTypeA; + break; + case XUI_CHARACTER_TYPE_B : + characterType = kCharacterTypeB; + break; + case XUI_CHARACTER_TYPE_C : + characterType = kCharacterTypeC; + break; + case XUI_CHARACTER_TYPE_D : + characterType = kCharacterTypeD; + break; + default : + characterType = kCharacterTypeA; + llassert(0); + break; + } + + return characterType; +} + +void LLFloaterPathfindingConsole::setCharacterType(ECharacterType characterType) +{ + LLSD radioGroupValue; + + switch (characterType) + { + case kCharacterTypeA : + radioGroupValue = XUI_CHARACTER_TYPE_A; + break; + case kCharacterTypeB : + radioGroupValue = XUI_CHARACTER_TYPE_B; + break; + case kCharacterTypeC : + radioGroupValue = XUI_CHARACTER_TYPE_C; + break; + case kCharacterTypeD : + radioGroupValue = XUI_CHARACTER_TYPE_D; + break; + default : + radioGroupValue = XUI_CHARACTER_TYPE_A; + llassert(0); + break; + } + + mCharacterTypeRadioGroup->setValue(radioGroupValue); +} + +F32 LLFloaterPathfindingConsole::getTerrainMaterialA() const +{ + return mTerrainMaterialA->getValue().asReal(); +} + +void LLFloaterPathfindingConsole::setTerrainMaterialA(F32 terrainMaterial) +{ + mTerrainMaterialA->setValue(LLSD(terrainMaterial)); +} + +F32 LLFloaterPathfindingConsole::getTerrainMaterialB() const +{ + return mTerrainMaterialB->getValue().asReal(); +} + +void LLFloaterPathfindingConsole::setTerrainMaterialB(F32 terrainMaterial) +{ + mTerrainMaterialB->setValue(LLSD(terrainMaterial)); +} + +F32 LLFloaterPathfindingConsole::getTerrainMaterialC() const +{ + return mTerrainMaterialC->getValue().asReal(); +} + +void LLFloaterPathfindingConsole::setTerrainMaterialC(F32 terrainMaterial) +{ + mTerrainMaterialC->setValue(LLSD(terrainMaterial)); +} + +F32 LLFloaterPathfindingConsole::getTerrainMaterialD() const +{ + return mTerrainMaterialD->getValue().asReal(); +} + +void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 terrainMaterial) +{ + mTerrainMaterialD->setValue(LLSD(terrainMaterial)); +} + LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) : LLFloater(pSeed), mShowNavmeshCheckBox(NULL), @@ -338,95 +535,3 @@ void LLFloaterPathfindingConsole::onTerrainMaterialDSet() llwarns << "functionality has not yet been implemented to setting '" << mTerrainMaterialD->getName() << "' to value (" << terrainMaterial << ")" << llendl; } - -LLFloaterPathfindingConsole::ERegionOverlayDisplay LLFloaterPathfindingConsole::getRegionOverlayDisplay() const -{ - ERegionOverlayDisplay regionOverlayDisplay; - switch (mRegionOverlayDisplayRadioGroup->getValue().asInteger()) - { - case 1 : - regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry; - break; - case 2: - regionOverlayDisplay = kRenderOverlayOnAllRenderableGeometry; - break; - default : - regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry; - llassert(0); - break; - } - - return regionOverlayDisplay; -} - -LLFloaterPathfindingConsole::EPathSelectionState LLFloaterPathfindingConsole::getPathSelectionState() const -{ - EPathSelectionState pathSelectionState; - - switch (mPathSelectionRadioGroup->getValue().asInteger()) - { - case 1 : - pathSelectionState = kPathSelectStartPoint; - break; - case 2: - pathSelectionState = kPathSelectEndPoint; - break; - default : - pathSelectionState = kPathSelectNone; - break; - } - - return pathSelectionState; -} - -F32 LLFloaterPathfindingConsole::getCharacterWidth() const -{ - return mCharacterWidthSlider->getValueF32(); -} - -LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getCharacterType() const -{ - ECharacterType characterType; - - switch (mCharacterTypeRadioGroup->getValue().asInteger()) - { - case 1 : - characterType = kCharacterTypeA; - break; - case 2 : - characterType = kCharacterTypeB; - break; - case 3 : - characterType = kCharacterTypeC; - break; - case 4 : - characterType = kCharacterTypeD; - break; - default : - characterType = kCharacterTypeA; - llassert(0); - break; - } - - return characterType; -} - -F32 LLFloaterPathfindingConsole::getTerrainMaterialA() const -{ - return mTerrainMaterialA->getValue().asReal(); -} - -F32 LLFloaterPathfindingConsole::getTerrainMaterialB() const -{ - return mTerrainMaterialB->getValue().asReal(); -} - -F32 LLFloaterPathfindingConsole::getTerrainMaterialC() const -{ - return mTerrainMaterialC->getValue().asReal(); -} - -F32 LLFloaterPathfindingConsole::getTerrainMaterialD() const -{ - return mTerrainMaterialD->getValue().asReal(); -} -- cgit v1.2.3 From 114509270ef592900a0df73390257537a0866e76 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 20 Dec 2011 17:10:09 -0800 Subject: Parameter name change. --- indra/newview/llfloaterpathfindingconsole.cpp | 33 ++++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'indra/newview/llfloaterpathfindingconsole.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 7ee9ac4d1b..abb8844544 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -139,11 +139,11 @@ LLFloaterPathfindingConsole::ERegionOverlayDisplay LLFloaterPathfindingConsole:: return regionOverlayDisplay; } -void LLFloaterPathfindingConsole::setRegionOverlayDisplay(ERegionOverlayDisplay regionOverlayDisplay) +void LLFloaterPathfindingConsole::setRegionOverlayDisplay(ERegionOverlayDisplay pRegionOverlayDisplay) { LLSD radioGroupValue; - switch (regionOverlayDisplay) + switch (pRegionOverlayDisplay) { case kRenderOverlayOnFixedPhysicsGeometry : radioGroupValue = XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY; @@ -180,11 +180,11 @@ LLFloaterPathfindingConsole::EPathSelectionState LLFloaterPathfindingConsole::ge return pathSelectionState; } -void LLFloaterPathfindingConsole::setPathSelectionState(EPathSelectionState pathSelectionState) +void LLFloaterPathfindingConsole::setPathSelectionState(EPathSelectionState pPathSelectionState) { LLSD radioGroupValue; - switch (pathSelectionState) + switch (pPathSelectionState) { case kPathSelectStartPoint : radioGroupValue = XUI_PATH_SELECT_START_POINT; @@ -205,9 +205,9 @@ F32 LLFloaterPathfindingConsole::getCharacterWidth() const return mCharacterWidthSlider->getValueF32(); } -void LLFloaterPathfindingConsole::setCharacterWidth(F32 characterWidth) +void LLFloaterPathfindingConsole::setCharacterWidth(F32 pCharacterWidth) { - mCharacterWidthSlider->setValue(LLSD(characterWidth)); + mCharacterWidthSlider->setValue(LLSD(pCharacterWidth)); } LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getCharacterType() const @@ -237,11 +237,11 @@ LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getChar return characterType; } -void LLFloaterPathfindingConsole::setCharacterType(ECharacterType characterType) +void LLFloaterPathfindingConsole::setCharacterType(ECharacterType pCharacterType) { LLSD radioGroupValue; - switch (characterType) + switch (pCharacterType) { case kCharacterTypeA : radioGroupValue = XUI_CHARACTER_TYPE_A; @@ -269,9 +269,9 @@ F32 LLFloaterPathfindingConsole::getTerrainMaterialA() const return mTerrainMaterialA->getValue().asReal(); } -void LLFloaterPathfindingConsole::setTerrainMaterialA(F32 terrainMaterial) +void LLFloaterPathfindingConsole::setTerrainMaterialA(F32 pTerrainMaterial) { - mTerrainMaterialA->setValue(LLSD(terrainMaterial)); + mTerrainMaterialA->setValue(LLSD(pTerrainMaterial)); } F32 LLFloaterPathfindingConsole::getTerrainMaterialB() const @@ -279,9 +279,9 @@ F32 LLFloaterPathfindingConsole::getTerrainMaterialB() const return mTerrainMaterialB->getValue().asReal(); } -void LLFloaterPathfindingConsole::setTerrainMaterialB(F32 terrainMaterial) +void LLFloaterPathfindingConsole::setTerrainMaterialB(F32 pTerrainMaterial) { - mTerrainMaterialB->setValue(LLSD(terrainMaterial)); + mTerrainMaterialB->setValue(LLSD(pTerrainMaterial)); } F32 LLFloaterPathfindingConsole::getTerrainMaterialC() const @@ -289,9 +289,9 @@ F32 LLFloaterPathfindingConsole::getTerrainMaterialC() const return mTerrainMaterialC->getValue().asReal(); } -void LLFloaterPathfindingConsole::setTerrainMaterialC(F32 terrainMaterial) +void LLFloaterPathfindingConsole::setTerrainMaterialC(F32 pTerrainMaterial) { - mTerrainMaterialC->setValue(LLSD(terrainMaterial)); + mTerrainMaterialC->setValue(LLSD(pTerrainMaterial)); } F32 LLFloaterPathfindingConsole::getTerrainMaterialD() const @@ -299,9 +299,9 @@ F32 LLFloaterPathfindingConsole::getTerrainMaterialD() const return mTerrainMaterialD->getValue().asReal(); } -void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 terrainMaterial) +void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 pTerrainMaterial) { - mTerrainMaterialD->setValue(LLSD(terrainMaterial)); + mTerrainMaterialD->setValue(LLSD(pTerrainMaterial)); } LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) @@ -535,6 +535,7 @@ void LLFloaterPathfindingConsole::onTerrainMaterialDSet() llwarns << "functionality has not yet been implemented to setting '" << mTerrainMaterialD->getName() << "' to value (" << terrainMaterial << ")" << llendl; } + BOOL LLFloaterPathfindingConsole::allowAllRenderables() { return getRegionOverlayDisplay() == kRenderOverlayOnAllRenderableGeometry ? true : false; -- cgit v1.2.3