本文整理汇总了C++中LLColor4U::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLColor4U::getValue方法的具体用法?C++ LLColor4U::getValue怎么用?C++ LLColor4U::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLColor4U
的用法示例。
在下文中一共展示了LLColor4U::getValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getControl
void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val)
{
LLControlBase* control = getControl(name);
if (control && control->isType(TYPE_COL4U))
{
control->set(val.getValue());
}
else
{
CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl;
}
}
示例2: getControl
void LLControlGroup::setColor4U(const std::string& name, const LLColor4U &val)
{
LLControlVariable* control = getControl(name);
if (control && control->isType(TYPE_COL4U))
{
control->set(val.getValue());
if(mChangeCallback)
mChangeCallback(name,llformat("<%f,%f,%f,%f>",val.mV[VX],val.mV[VY],val.mV[VZ],val.mV[VW]));
}
else
{
CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl;
}
}
示例3: loadFromFile
//.........这里部分代码省略.........
{
U32 initial = 0;
child_nodep->getAttributeU32("value", initial);
control->set((LLSD::Integer) initial);
validitems++;
}
break;
case TYPE_BOOLEAN:
{
BOOL initial = FALSE;
child_nodep->getAttributeBOOL("value", initial);
control->set(initial);
validitems++;
}
break;
case TYPE_STRING:
{
LLString string;
child_nodep->getAttributeString("value", string);
if (string == LLString::null)
{
string = "";
}
control->set(string);
validitems++;
}
break;
case TYPE_VEC3:
{
LLVector3 vector;
child_nodep->getAttributeVector3("value", vector);
control->set(vector.getValue());
validitems++;
}
break;
case TYPE_VEC3D:
{
LLVector3d vector;
child_nodep->getAttributeVector3d("value", vector);
control->set(vector.getValue());
validitems++;
}
break;
case TYPE_RECT:
{
//RN: hack to support reading rectangles from a string
LLString rect_string;
child_nodep->getAttributeString("value", rect_string);
std::istringstream istream(rect_string);
S32 left, bottom, width, height;
istream >> left >> bottom >> width >> height;
LLRect rect;
rect.setOriginAndSize(left, bottom, width, height);
control->set(rect.getValue());
validitems++;
}
break;
case TYPE_COL4U:
{
LLColor4U color;
child_nodep->getAttributeColor4U("value", color);
control->set(color.getValue());
validitems++;
}
break;
case TYPE_COL4:
{
LLColor4 color;
child_nodep->getAttributeColor4("value", color);
control->set(color.getValue());
validitems++;
}
break;
case TYPE_COL3:
{
LLVector3 color;
child_nodep->getAttributeVector3("value", color);
control->set(LLColor3(color.mV).getValue());
validitems++;
}
break;
}
child_nodep = rootp->getNextChild();
}
return validitems;
}
示例4: loadFromFileLegacy
//.........这里部分代码省略.........
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;
}
示例5: declareControl
BOOL LLControlGroup::declareColor4U(const LLString& name, const LLColor4U &initial_val, const LLString& comment, BOOL persist )
{
return declareControl(name, TYPE_COL4U, initial_val.getValue(), comment, persist);
}
示例6:
template <> eControlType get_control_type<LLColor4U>(const LLColor4U& in, LLSD& out)
{
out = in.getValue();
return TYPE_COL4U;
}