本文整理汇总了C++中LLColor3类的典型用法代码示例。如果您正苦于以下问题:C++ LLColor3类的具体用法?C++ LLColor3怎么用?C++ LLColor3使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLColor3类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//.........这里部分代码省略.........
else if (!strcmp("FALSE", boolstring))
{
initial = FALSE;
valid = TRUE;
}
if (valid)
{
control->set(initial);
}
else
{
llinfos << filename << "Item " << item << ": Invalid BOOL control " << name << ", " << boolstring << llendl;
}
validitems++;
}
break;
case TYPE_STRING:
{
LLString string;
file >> string;
control->set(string);
validitems++;
}
break;
case TYPE_VEC3:
{
F32 x, y, z;
file >> x >> y >> z;
LLVector3 vector(x, y, z);
control->set(vector.getValue());
validitems++;
}
break;
case TYPE_VEC3D:
{
F64 x, y, z;
file >> x >> y >> z;
LLVector3d vector(x, y, z);
control->set(vector.getValue());
validitems++;
}
break;
case TYPE_RECT:
{
S32 left, bottom, width, height;
file >> left >> bottom >> width >> height;
LLRect rect;
rect.setOriginAndSize(left, bottom, width, height);
control->set(rect.getValue());
validitems++;
}
break;
case TYPE_COL4U:
{
S32 red, green, blue, alpha;
LLColor4U color;
file >> red >> green >> blue >> alpha;
color.setVec(red, green, blue, alpha);
control->set(color.getValue());
validitems++;
}
break;
case TYPE_COL4:
{
LLColor4 color;
file >> color.mV[VRED] >> color.mV[VGREEN]
>> color.mV[VBLUE] >> color.mV[VALPHA];
control->set(color.getValue());
validitems++;
}
break;
case TYPE_COL3:
{
LLColor3 color;
file >> color.mV[VRED] >> color.mV[VGREEN]
>> color.mV[VBLUE];
control->set(color.getValue());
validitems++;
}
break;
}
}
file.close();
return validitems;
}
示例2: childSetVisible
//.........这里部分代码省略.........
spinner3->setLabel(std::string("Bottom"));
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Top"));
if (!spinner1->hasFocus())
{
spinner1->setPrecision(0);
spinner1->setValue(r.mLeft);
}
if (!spinner2->hasFocus())
{
spinner2->setPrecision(0);
spinner2->setValue(r.mRight);
}
if (!spinner3->hasFocus())
{
spinner3->setPrecision(0);
spinner3->setValue(r.mBottom);
}
if (!spinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(r.mTop);
}
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner2->setMinValue((F32)S32_MIN);
spinner2->setMaxValue((F32)S32_MAX);
spinner2->setIncrement(1.f);
spinner3->setMinValue((F32)S32_MIN);
spinner3->setMaxValue((F32)S32_MAX);
spinner3->setIncrement(1.f);
spinner4->setMinValue((F32)S32_MIN);
spinner4->setMaxValue((F32)S32_MAX);
spinner4->setIncrement(1.f);
break;
}
case TYPE_COL4:
{
LLColor4 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
// only set if changed so color picker doesn't update
if(clr != LLColor4(color_swatch->getValue()))
{
color_swatch->set(LLColor4(sd), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if (!spinner4->hasFocus())
{
spinner4->setPrecision(3);
spinner4->setMinValue(0.0);
spinner4->setMaxValue(1.f);
spinner4->setValue(clr.mV[VALPHA]);
}
break;
}
case TYPE_COL3:
{
LLColor3 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
color_swatch->setValue(sd);
break;
}
case TYPE_COL4U:
{
LLColor4U clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
if(LLColor4(clr) != LLColor4(color_swatch->getValue()))
{
color_swatch->set(LLColor4(clr), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if(!spinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(clr.mV[VALPHA]);
}
spinner4->setMinValue(0);
spinner4->setMaxValue(255);
spinner4->setIncrement(1.f);
break;
}
default:
mComment->setText(std::string("unknown"));
break;
}
}
}
示例3: childSetVisible
//.........这里部分代码省略.........
spinner3->setLabel(std::string("Bottom"));
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Top"));
if (!spinner1->hasFocus())
{
spinner1->setPrecision(0);
spinner1->setValue(r.mLeft);
}
if (!spinner2->hasFocus())
{
spinner2->setPrecision(0);
spinner2->setValue(r.mRight);
}
if (!spinner3->hasFocus())
{
spinner3->setPrecision(0);
spinner3->setValue(r.mBottom);
}
if (!spinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(r.mTop);
}
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner2->setMinValue((F32)S32_MIN);
spinner2->setMaxValue((F32)S32_MAX);
spinner2->setIncrement(1.f);
spinner3->setMinValue((F32)S32_MIN);
spinner3->setMaxValue((F32)S32_MAX);
spinner3->setIncrement(1.f);
spinner4->setMinValue((F32)S32_MIN);
spinner4->setMaxValue((F32)S32_MAX);
spinner4->setIncrement(1.f);
break;
}
case TYPE_COL4:
{
LLColor4 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
// only set if changed so color picker doesn't update
if(clr != LLColor4(color_swatch->getValue()))
{
color_swatch->set(LLColor4(sd), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if (!spinner4->hasFocus())
{
spinner4->setPrecision(3);
spinner4->setMinValue(0.0);
spinner4->setMaxValue(1.f);
spinner4->setValue(clr.mV[VALPHA]);
}
break;
}
case TYPE_COL3:
{
LLColor3 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
color_swatch->setValue(sd);
break;
}
case TYPE_COL4U:
{
LLColor4U clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
if(LLColor4(clr) != LLColor4(color_swatch->getValue()))
{
color_swatch->set(LLColor4(clr), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if(!spinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(clr.mV[VALPHA]);
}
spinner4->setMinValue(0);
spinner4->setMaxValue(255);
spinner4->setIncrement(1.f);
break;
}
default:
mComment->setText(std::string("unknown"));
break;
}
}
}
示例4: declareControl
BOOL LLControlGroup::declareColor3(const LLString& name, const LLColor3 &initial_val, const LLString& comment, BOOL persist )
{
return declareControl(name, TYPE_COL3, initial_val.getValue(), comment, persist);
}
示例5:
template <> eControlType get_control_type<LLColor3>(const LLColor3& in, LLSD& out)
{
out = in.getValue();
return TYPE_COL3;
}
示例6: getChildView
//.........这里部分代码省略.........
spinner1->setValue(v[VX]);
}
if (!spinner2->hasFocus())
{
spinner2->setPrecision(3);
spinner2->setValue(v[VY]);
}
if (!spinner3->hasFocus())
{
spinner3->setPrecision(3);
spinner3->setValue(v[VZ]);
}
break;
}
case TYPE_RECT:
{
LLRect r;
r.setValue(sd);
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("Left"));
spinner2->setVisible(TRUE);
spinner2->setLabel(std::string("Right"));
spinner3->setVisible(TRUE);
spinner3->setLabel(std::string("Bottom"));
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Top"));
if (!spinner1->hasFocus())
{
spinner1->setPrecision(0);
spinner1->setValue(r.mLeft);
}
if (!spinner2->hasFocus())
{
spinner2->setPrecision(0);
spinner2->setValue(r.mRight);
}
if (!spinner3->hasFocus())
{
spinner3->setPrecision(0);
spinner3->setValue(r.mBottom);
}
if (!spinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(r.mTop);
}
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner2->setMinValue((F32)S32_MIN);
spinner2->setMaxValue((F32)S32_MAX);
spinner2->setIncrement(1.f);
spinner3->setMinValue((F32)S32_MIN);
spinner3->setMaxValue((F32)S32_MAX);
spinner3->setIncrement(1.f);
spinner4->setMinValue((F32)S32_MIN);
spinner4->setMaxValue((F32)S32_MAX);
spinner4->setIncrement(1.f);
break;
}
case TYPE_COL4:
{
LLColor4 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
// only set if changed so color picker doesn't update
if(clr != LLColor4(color_swatch->getValue()))
{
color_swatch->set(LLColor4(sd), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if (!spinner4->hasFocus())
{
spinner4->setPrecision(3);
spinner4->setMinValue(0.0);
spinner4->setMaxValue(1.f);
spinner4->setValue(clr.mV[VALPHA]);
}
break;
}
case TYPE_COL3:
{
LLColor3 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
color_swatch->setValue(sd);
break;
}
default:
mComment->setText(std::string("unknown"));
break;
}
}
}
示例7: getChildView
//.........这里部分代码省略.........
spinner3->setLabel(std::string("Bottom"));
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Top"));
if (!spinner1->hasFocus())
{
spinner1->setPrecision(0);
spinner1->setValue(r.mLeft);
}
if (!spinner2->hasFocus())
{
spinner2->setPrecision(0);
spinner2->setValue(r.mRight);
}
if (!spinner3->hasFocus())
{
spinner3->setPrecision(0);
spinner3->setValue(r.mBottom);
}
if (!spinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(r.mTop);
}
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner2->setMinValue((F32)S32_MIN);
spinner2->setMaxValue((F32)S32_MAX);
spinner2->setIncrement(1.f);
spinner3->setMinValue((F32)S32_MIN);
spinner3->setMaxValue((F32)S32_MAX);
spinner3->setIncrement(1.f);
spinner4->setMinValue((F32)S32_MIN);
spinner4->setMaxValue((F32)S32_MAX);
spinner4->setIncrement(1.f);
break;
}
case TYPE_COL4:
{
LLColor4 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
// only set if changed so color picker doesn't update
if(clr != LLColor4(color_swatch->getValue()))
{
color_swatch->set(LLColor4(sd), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if (!spinner4->hasFocus())
{
spinner4->setPrecision(3);
spinner4->setMinValue(0.0);
spinner4->setMaxValue(1.f);
spinner4->setValue(clr.mV[VALPHA]);
}
break;
}
case TYPE_COL3:
{
LLColor3 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
color_swatch->setValue(sd);
break;
}
case TYPE_COL4U:
{
LLColor4U clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
if(LLColor4(clr) != LLColor4(color_swatch->getValue()))
{
color_swatch->set(LLColor4(clr), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if(!spinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(clr.mV[VALPHA]);
}
spinner4->setMinValue(0);
spinner4->setMaxValue(255);
spinner4->setIncrement(1.f);
break;
}
default:
mComment->setText(std::string("unknown"));
break;
}
}
}
示例8: declareControl
BOOL LLControlGroup::declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, BOOL persist )
{
return declareControl(name, TYPE_COL3, initial_val.getValue(), comment, SANITY_TYPE_NONE, LLSD(), std::string(""), persist);
}