本文整理汇总了C++中LLVector3d::setValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVector3d::setValue方法的具体用法?C++ LLVector3d::setValue怎么用?C++ LLVector3d::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVector3d
的用法示例。
在下文中一共展示了LLVector3d::setValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateControl
// we've switched controls, or doing per-frame update, so update spinners, etc.
void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLSpinCtrl* spinner1 = getChild<LLSpinCtrl>("val_spinner_1");
LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2");
LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3");
LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4");
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("color_swatch");
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
llwarns << "Could not find all desired controls by name"
<< llendl;
return;
}
spinner1->setVisible(FALSE);
spinner2->setVisible(FALSE);
spinner3->setVisible(FALSE);
spinner4->setVisible(FALSE);
color_swatch->setVisible(FALSE);
childSetVisible("val_text", FALSE);
mComment->setText(LLStringUtil::null);
if (controlp)
{
eControlType type = controlp->type();
//hide combo box only for non booleans, otherwise this will result in the combo box closing every frame
childSetVisible("boolean_combo", type == TYPE_BOOLEAN);
mComment->setText(controlp->getComment());
spinner1->setMaxValue(F32_MAX);
spinner2->setMaxValue(F32_MAX);
spinner3->setMaxValue(F32_MAX);
spinner4->setMaxValue(F32_MAX);
spinner1->setMinValue(-F32_MAX);
spinner2->setMinValue(-F32_MAX);
spinner3->setMinValue(-F32_MAX);
spinner4->setMinValue(-F32_MAX);
if (!spinner1->hasFocus())
{
spinner1->setIncrement(0.1f);
}
if (!spinner2->hasFocus())
{
spinner2->setIncrement(0.1f);
}
if (!spinner3->hasFocus())
{
spinner3->setIncrement(0.1f);
}
if (!spinner4->hasFocus())
{
spinner4->setIncrement(0.1f);
}
LLSD sd = controlp->get();
switch(type)
{
case TYPE_U32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)U32_MIN);
spinner1->setMaxValue((F32)U32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_S32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_F32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(sd);
}
break;
case TYPE_BOOLEAN:
if (!childHasFocus("boolean_combo"))
{
if (sd.asBoolean())
{
childSetValue("boolean_combo", LLSD("true"));
//.........这里部分代码省略.........
示例2: updateControl
// we've switched controls, or doing per-frame update, so update spinners, etc.
void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLSpinCtrl* spinner1 = getChild<LLSpinCtrl>("val_spinner_1");
LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2");
LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3");
LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4");
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("val_color_swatch");
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
llwarns << "Could not find all desired controls by name"
<< llendl;
return;
}
spinner1->setVisible(FALSE);
spinner2->setVisible(FALSE);
spinner3->setVisible(FALSE);
spinner4->setVisible(FALSE);
color_swatch->setVisible(FALSE);
getChildView("val_text")->setVisible( FALSE);
mComment->setText(LLStringUtil::null);
if (controlp)
{
// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a
// If "HideFromEditor" was toggled while the floater is open then we need to manually disable access to the control
// NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault()
bool fEnable = !controlp->isHiddenFromSettingsEditor();
spinner1->setEnabled(fEnable);
spinner2->setEnabled(fEnable);
spinner3->setEnabled(fEnable);
spinner4->setEnabled(fEnable);
color_swatch->setEnabled(fEnable);
childSetEnabled("val_text", fEnable);
childSetEnabled("boolean_combo", fEnable);
childSetEnabled("default_btn", fEnable);
// [/RLVa:KB]
eControlType type = controlp->type();
//hide combo box only for non booleans, otherwise this will result in the combo box closing every frame
getChildView("boolean_combo")->setVisible( type == TYPE_BOOLEAN);
mComment->setText(controlp->getComment());
spinner1->setMaxValue(F32_MAX);
spinner2->setMaxValue(F32_MAX);
spinner3->setMaxValue(F32_MAX);
spinner4->setMaxValue(F32_MAX);
spinner1->setMinValue(-F32_MAX);
spinner2->setMinValue(-F32_MAX);
spinner3->setMinValue(-F32_MAX);
spinner4->setMinValue(-F32_MAX);
if (!spinner1->hasFocus())
{
spinner1->setIncrement(0.1f);
}
if (!spinner2->hasFocus())
{
spinner2->setIncrement(0.1f);
}
if (!spinner3->hasFocus())
{
spinner3->setIncrement(0.1f);
}
if (!spinner4->hasFocus())
{
spinner4->setIncrement(0.1f);
}
LLSD sd = controlp->get();
switch(type)
{
case TYPE_U32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)U32_MIN);
spinner1->setMaxValue((F32)U32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_S32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_F32:
//.........这里部分代码省略.........
示例3: updateControl
// we've switched controls, or doing per-frame update, so update spinners, etc.
void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLSpinCtrl* spinner1 = getChild<LLSpinCtrl>("val_spinner_1");
LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2");
LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3");
LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4");
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("color_swatch");
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
llwarns << "Could not find all desired controls by name"
<< llendl;
return;
}
spinner1->setVisible(FALSE);
spinner2->setVisible(FALSE);
spinner3->setVisible(FALSE);
spinner4->setVisible(FALSE);
color_swatch->setVisible(FALSE);
childSetVisible("val_text", FALSE);
mComment->setText(LLStringUtil::null);
if (controlp)
{
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.1d
if (rlv_handler_t::isEnabled())
{
// Don't allow changing DBG_WRITE debug settings under @setdebug=n
bool fEnable = !( (gRlvHandler.hasBehaviour(RLV_BHVR_SETDEBUG)) &&
(RlvExtGetSet::getDebugSettingFlags(controlp->getName()) & RlvExtGetSet::DBG_WRITE) );
// Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n
fEnable &= !((gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) &&
(("VertexShaderEnable" == controlp->getName()) || ("WindLightUseAtmosShaders" == controlp->getName())));
#ifdef RLV_EXTENSION_STARTLOCATION
// Don't allow toggling RLVaLoginLastLocation
fEnable &= !(RLV_SETTING_LOGINLASTLOCATION == controlp->getName());
#endif // RLV_EXTENSION_STARTLOCATION
// NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault()
spinner1->setEnabled(fEnable);
spinner2->setEnabled(fEnable);
spinner3->setEnabled(fEnable);
spinner4->setEnabled(fEnable);
color_swatch->setEnabled(fEnable);
childSetEnabled("val_text", fEnable);
childSetEnabled("boolean_combo", fEnable);
childSetEnabled("default_btn", fEnable);
}
// [/RLVa:KB]
controlp = controlp->getCOAActive();
eControlType type = controlp->type();
//hide combo box only for non booleans, otherwise this will result in the combo box closing every frame
childSetVisible("boolean_combo", type == TYPE_BOOLEAN);
mComment->setText(controlp->getComment());
spinner1->setMaxValue(F32_MAX);
spinner2->setMaxValue(F32_MAX);
spinner3->setMaxValue(F32_MAX);
spinner4->setMaxValue(F32_MAX);
spinner1->setMinValue(-F32_MAX);
spinner2->setMinValue(-F32_MAX);
spinner3->setMinValue(-F32_MAX);
spinner4->setMinValue(-F32_MAX);
if (!spinner1->hasFocus())
{
spinner1->setIncrement(0.1f);
}
if (!spinner2->hasFocus())
{
spinner2->setIncrement(0.1f);
}
if (!spinner3->hasFocus())
{
spinner3->setIncrement(0.1f);
}
if (!spinner4->hasFocus())
{
spinner4->setIncrement(0.1f);
}
LLSD sd = controlp->get();
switch(type)
{
case TYPE_U32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)U32_MIN);
spinner1->setMaxValue((F32)U32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
//.........这里部分代码省略.........
示例4: updateControl
// we've switched controls, so update spinners, etc.
void LLFloaterSettingsDebug::updateControl()
{
LLSpinCtrl* spinner1 = getChild<LLSpinCtrl>("val_spinner_1");
LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2");
LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3");
LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4");
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("val_color_swatch");
LLUICtrl* bool_ctrl = getChild<LLUICtrl>("boolean_combo");
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
llwarns << "Could not find all desired controls by name"
<< llendl;
return;
}
spinner1->setVisible(FALSE);
spinner2->setVisible(FALSE);
spinner3->setVisible(FALSE);
spinner4->setVisible(FALSE);
color_swatch->setVisible(FALSE);
getChildView("val_text")->setVisible( FALSE);
mComment->setText(LLStringUtil::null);
childSetEnabled("copy_btn", false);
childSetEnabled("default_btn", false);
bool_ctrl->setVisible(false);
if (mCurrentControlVariable)
{
// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a
// If "HideFromEditor" was toggled while the floater is open then we need to manually disable access to the control
mOldVisibility = mCurrentControlVariable->isHiddenFromSettingsEditor();
spinner1->setEnabled(!mOldVisibility);
spinner2->setEnabled(!mOldVisibility);
spinner3->setEnabled(!mOldVisibility);
spinner4->setEnabled(!mOldVisibility);
color_swatch->setEnabled(!mOldVisibility);
childSetEnabled("val_text", !mOldVisibility);
bool_ctrl->setEnabled(!mOldVisibility);
childSetEnabled("default_btn", !mOldVisibility);
// [/RLVa:KB]
childSetEnabled("copy_btn", true);
eControlType type = mCurrentControlVariable->type();
mComment->setText(mCurrentControlVariable->getName() + std::string(": ") + mCurrentControlVariable->getComment());
spinner1->setMaxValue(F32_MAX);
spinner2->setMaxValue(F32_MAX);
spinner3->setMaxValue(F32_MAX);
spinner4->setMaxValue(F32_MAX);
spinner1->setMinValue(-F32_MAX);
spinner2->setMinValue(-F32_MAX);
spinner3->setMinValue(-F32_MAX);
spinner4->setMinValue(-F32_MAX);
if (!spinner1->hasFocus())
{
spinner1->setIncrement(0.1f);
}
if (!spinner2->hasFocus())
{
spinner2->setIncrement(0.1f);
}
if (!spinner3->hasFocus())
{
spinner3->setIncrement(0.1f);
}
if (!spinner4->hasFocus())
{
spinner4->setIncrement(0.1f);
}
LLSD sd = mCurrentControlVariable->get();
switch(type)
{
case TYPE_U32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)U32_MIN);
spinner1->setMaxValue((F32)U32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_S32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
//.........这里部分代码省略.........