本文整理汇总了C++中LLColor4::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLColor4::getValue方法的具体用法?C++ LLColor4::getValue怎么用?C++ LLColor4::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLColor4
的用法示例。
在下文中一共展示了LLColor4::getValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onColorChanged
//////////////////////////////////////////////////////////////////////////////
// called (infrequently) when the color changes so the subject of the swatch can be updated.
void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
{
LLColorSwatchCtrl* subject = ( LLColorSwatchCtrl* )data;
if ( subject )
{
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)subject->mPickerHandle.get();
if (pickerp)
{
// move color across from selector to internal widget storage
LLColor4 updatedColor ( pickerp->getCurR (),
pickerp->getCurG (),
pickerp->getCurB (),
subject->mColor.mV[VALPHA] ); // keep current alpha
subject->mColor = updatedColor;
subject->setControlValue(updatedColor.getValue());
if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback)
{
subject->mOnCancelCallback(subject, subject->mCallbackUserData);
}
else if (pick_op == COLOR_SELECT && subject->mOnSelectCallback)
{
subject->mOnSelectCallback(subject, subject->mCallbackUserData);
}
else
{
// just commit change
subject->onCommit ();
}
}
}
}
示例2: getControl
void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val)
{
LLControlBase* control = getControl(name);
if (control && control->isType(TYPE_COL4))
{
control->set(val.getValue());
}
else
{
CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl;
}
}
示例3: getControl
void LLControlGroup::setColor4(const std::string& name, const LLColor4 &val)
{
LLControlVariable* control = getControl(name);
if (control && control->isType(TYPE_COL4))
{
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;
}
}
示例4:
//Generate highlight color segments for this paragraph. Pass in default color of paragraph.
void LLConsole::Paragraph::makeParagraphColorSegments (const LLColor4 &color)
{
LLSD paragraph_color_segments;
LLColor4 lcolor=color;
paragraph_color_segments[0]["text"] =wstring_to_utf8str(mParagraphText);
LLSD color_sd = color.getValue();
paragraph_color_segments[0]["color"]=color_sd;
for(LLSD::array_const_iterator color_segment_it = paragraph_color_segments.beginArray();
color_segment_it != paragraph_color_segments.endArray();
++color_segment_it)
{
LLSD color_llsd = (*color_segment_it)["color"];
std::string color_str = (*color_segment_it)["text"].asString();
ParagraphColorSegment color_segment;
color_segment.mColor.setValue(color_llsd);
color_segment.mNumChars = color_str.length();
mParagraphColorSegments.push_back(color_segment);
}
}
示例5: refreshAvatarList
/**
* Redraws the avatar list
* Only does anything if the avatar list is visible.
* @author Dale Glass
*/
void LLFloaterAvatarList::refreshAvatarList()
{
// Don't update list when interface is hidden
if (!sInstance->getVisible()) return;
// We rebuild the list fully each time it's refreshed
// The assumption is that it's faster to refill it and sort than
// to rebuild the whole list.
LLDynamicArray<LLUUID> selected = mAvatarList->getSelectedIDs();
S32 scrollpos = mAvatarList->getScrollPos();
mAvatarList->deleteAllItems();
LLVector3d mypos = gAgent.getPositionGlobal();
LLVector3d posagent;
posagent.setVec(gAgent.getPositionAgent());
LLVector3d simpos = mypos - posagent;
std::map<LLUUID, LLAvatarListEntry>::iterator iter;
for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
{
LLSD element;
LLUUID av_id;
std::string av_name;
LLAvatarListEntry *entry = &iter->second;
// Skip if avatar hasn't been around
if (entry->isDead())
{
continue;
}
av_id = entry->getID();
av_name = entry->getName().c_str();
LLVector3d position = entry->getPosition();
BOOL UnknownAltitude = false;
LLVector3d delta = position - mypos;
F32 distance = (F32)delta.magVec();
if (position.mdV[VZ] == 0.0)
{
UnknownAltitude = true;
distance = 9000.0;
}
delta.mdV[2] = 0.0f;
F32 side_distance = (F32)delta.magVec();
// HACK: Workaround for an apparent bug:
// sometimes avatar entries get stuck, and are registered
// by the client as perpetually moving in the same direction.
// this makes sure they get removed from the visible list eventually
//jcool410 -- this fucks up seeing dueds thru minimap data > 1024m away, so, lets just say > 2048m to the side is bad
//aka 8 sims
if (side_distance > 2048.0f)
{
continue;
}
if (av_id.isNull())
{
//llwarns << "Avatar with null key somehow got into the list!" << llendl;
continue;
}
element["id"] = av_id;
element["columns"][LIST_MARK]["column"] = "marked";
element["columns"][LIST_MARK]["type"] = "text";
if (entry->isMarked())
{
element["columns"][LIST_MARK]["value"] = "X";
element["columns"][LIST_MARK]["color"] = LLColor4::blue.getValue();
element["columns"][LIST_MARK]["font-style"] = "BOLD";
}
else
{
element["columns"][LIST_MARK]["value"] = "";
}
element["columns"][LIST_AVATAR_NAME]["column"] = "avatar_name";
element["columns"][LIST_AVATAR_NAME]["type"] = "text";
element["columns"][LIST_AVATAR_NAME]["value"] = av_name;
if (entry->isFocused())
{
element["columns"][LIST_AVATAR_NAME]["font-style"] = "BOLD";
}
//<edit> custom colors for certain types of avatars!
//Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB
//element["columns"][LIST_AVATAR_NAME]["color"] = gColors.getColor( "MapAvatar" ).getValue();
LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition());
LLUUID estate_owner = LLUUID::null;
//.........这里部分代码省略.........
示例6: 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;
}
示例7: 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;
}
示例8: declareControl
BOOL LLControlGroup::declareColor4(const LLString& name, const LLColor4 &initial_val, const LLString& comment, BOOL persist )
{
return declareControl(name, TYPE_COL4, initial_val.getValue(), comment, persist);
}
示例9: refreshAvatarList
/**
* Redraws the avatar list
* Only does anything if the avatar list is visible.
* @author Dale Glass
*/
void LLFloaterAvatarList::refreshAvatarList()
{
// Don't update list when interface is hidden
if (!sInstance->getVisible()) return;
// We rebuild the list fully each time it's refreshed
// The assumption is that it's faster to refill it and sort than
// to rebuild the whole list.
LLDynamicArray<LLUUID> selected = mAvatarList->getSelectedIDs();
S32 scrollpos = mAvatarList->getScrollPos();
mAvatarList->deleteAllItems();
LLVector3d mypos = gAgent.getPositionGlobal();
LLVector3d posagent;
posagent.setVec(gAgent.getPositionAgent());
LLVector3d simpos = mypos - posagent;
std::map<LLUUID, LLAvatarListEntry>::iterator iter;
for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
{
LLSD element;
LLUUID av_id;
LLAvatarListEntry *entry = &iter->second;
// Skip if avatar hasn't been around
if (entry->isDead())
{
continue;
}
av_id = entry->getID();
LLVector3d position = entry->getPosition();
BOOL UnknownAltitude = false;
LLVector3d delta = position - mypos;
F32 distance = (F32)delta.magVec();
if (position.mdV[VZ] == 0.0)
{
UnknownAltitude = true;
distance = 9000.0;
}
delta.mdV[2] = 0.0f;
F32 side_distance = (F32)delta.magVec();
// HACK: Workaround for an apparent bug:
// sometimes avatar entries get stuck, and are registered
// by the client as perpetually moving in the same direction.
// this makes sure they get removed from the visible list eventually
//jcool410 -- this fucks up seeing dueds thru minimap data > 1024m away, so, lets just say > 2048m to the side is bad
//aka 8 sims
if (side_distance > 2048.0f)
{
continue;
}
if (av_id.isNull())
{
//llwarns << "Avatar with null key somehow got into the list!" << llendl;
continue;
}
element["id"] = av_id;
element["columns"][LIST_MARK]["column"] = "marked";
element["columns"][LIST_MARK]["type"] = "text";
if (entry->isMarked())
{
element["columns"][LIST_MARK]["value"] = "X";
element["columns"][LIST_MARK]["color"] = LLColor4::blue.getValue();
element["columns"][LIST_MARK]["font-style"] = "BOLD";
}
else
{
element["columns"][LIST_MARK]["value"] = "";
}
element["columns"][LIST_AVATAR_NAME]["column"] = "avatar_name";
element["columns"][LIST_AVATAR_NAME]["type"] = "text";
element["columns"][LIST_AVATAR_NAME]["value"] = entry->getName().c_str();
if (entry->isFocused())
{
element["columns"][LIST_AVATAR_NAME]["font-style"] = "BOLD";
}
if (LLMuteList::getInstance()->isMuted(av_id))
{
element["columns"][LIST_AVATAR_NAME]["color"] = LLColor4::red2.getValue();
}
char temp[32];
LLColor4 color = LLColor4::black;
element["columns"][LIST_DISTANCE]["column"] = "distance";
//.........这里部分代码省略.........
示例10:
template <> eControlType get_control_type<LLColor4>(const LLColor4& in, LLSD& out)
{
out = in.getValue();
return TYPE_COL4;
}
示例11: resolveClientTag
LLSD FSData::resolveClientTag(LLUUID id, bool new_system, LLColor4 color){
//WS: Create a new LLSD based on the data from the LegacyClientList if
LLSD curtag;
curtag["uuid"]=id.asString();
curtag["id_based"]=new_system;
curtag["tex_color"]=color.getValue();
// If we don't want to display anything...return
if(gSavedSettings.getU32("FSClientTagsVisibility2") == 0)
{
return curtag;
}
//WS: Do we want to use Legacy Clienttags?
if(gSavedSettings.getU32("FSUseLegacyClienttags") > 0)
{
if(LegacyClientList.has(id.asString()))
{
curtag=LegacyClientList[id.asString()];
}
else
{
if(id == LLUUID("5d9581af-d615-bc16-2667-2f04f8eeefe4"))//green
{
curtag["name"]="Phoenix";
curtag["color"] = LLColor4::green.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("e35f7d40-6071-4b29-9727-5647bdafb5d5"))//white
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::white.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("ae4e92fb-023d-23ba-d060-3403f953ab1a"))//pink
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::pink.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("e71b780e-1a57-400d-4649-959f69ec7d51"))//red
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::red.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("c1c189f5-6dab-fc03-ea5a-f9f68f90b018"))//orange
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::orange.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("8cf0577c-22d3-6a73-523c-15c0a90d6c27")) //purple
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::purple.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("5f0e7c32-38c3-9214-01f0-fb16a5b40128"))//yellow
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::yellow.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("5bb6e4a6-8e24-7c92-be2e-91419bb0ebcb"))//blue
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::blue.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("ed63fbd0-589e-fe1d-a3d0-16905efaa96b"))//default (red)
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::red.getValue();
}
else if(id == LLUUID("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"))//viewer 2.0
{
curtag["name"] = "LL Viewer";
}
else if(id == LLUUID("cc7a030f-282f-c165-44d2-b5ee572e72bf"))
{
curtag["name"] = "Imprudence";
}
else if(id == LLUUID("54d93609-1392-2a93-255c-a9dd429ecca5"))
{
curtag["name"] = "Emergence";
}
else if(id == LLUUID("8873757c-092a-98fb-1afd-ecd347566fcd"))
{
curtag["name"] = "Ascent";
}
else if(id == LLUUID("f25263b7-6167-4f34-a4ef-af65213b2e39"))
{
curtag["name"] = "Singularity";
}
if(curtag.has("name")) curtag["tpvd"]=true;
}
}
// Filtering starts here:
//.........这里部分代码省略.........
示例12: parsePartialLineHighlights
LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLColor4 &color, EHighlightPosition part, S32 index)
{
//evil recursive string atomizer.
LLSD ret_llsd, start_llsd, middle_llsd, end_llsd;
for (S32 i=index;i<mHighlights.size();i++)
{
S32 condition = mHighlights[i]["condition"];
if ((S32)mHighlights[i]["highlight"]==PART && condition!=MATCHES)
{
if ( (condition==STARTS_WITH && part==START) ||
(condition==ENDS_WITH && part==END) ||
condition==CONTAINS || part==WHOLE )
{
S32 start = findPattern(text,mHighlights[i]);
if (start >= 0 )
{
S32 end = std::string(mHighlights[i]["pattern"]).length();
S32 len = text.length();
EHighlightPosition newpart;
if (start==0)
{
start_llsd[0]["text"] =text.substr(0,end);
start_llsd[0]["color"]=mHighlights[i]["color"];
if (end < len)
{
if (part==END || part==WHOLE) newpart=END; else newpart=MIDDLE;
end_llsd=parsePartialLineHighlights(text.substr( end ),color,newpart,i);
}
}
else
{
if (part==START || part==WHOLE) newpart=START; else newpart=MIDDLE;
start_llsd=parsePartialLineHighlights(text.substr(0,start),color,newpart,i+1);
if (end < len)
{
middle_llsd[0]["text"] =text.substr(start,end);
middle_llsd[0]["color"]=mHighlights[i]["color"];
if (part==END || part==WHOLE) newpart=END; else newpart=MIDDLE;
end_llsd=parsePartialLineHighlights(text.substr( (start+end) ),color,newpart,i);
}
else
{
end_llsd[0]["text"] =text.substr(start,end);
end_llsd[0]["color"]=mHighlights[i]["color"];
}
}
S32 retcount=0;
//FIXME These loops should be wrapped into a subroutine.
for (LLSD::array_iterator iter = start_llsd.beginArray();
iter != start_llsd.endArray();++iter)
{
LLSD highlight = *iter;
ret_llsd[retcount++]=highlight;
}
for (LLSD::array_iterator iter = middle_llsd.beginArray();
iter != middle_llsd.endArray();++iter)
{
LLSD highlight = *iter;
ret_llsd[retcount++]=highlight;
}
for (LLSD::array_iterator iter = end_llsd.beginArray();
iter != end_llsd.endArray();++iter)
{
LLSD highlight = *iter;
ret_llsd[retcount++]=highlight;
}
return ret_llsd;
}
}
}
}
//No patterns found. Just send back what was passed in.
ret_llsd[0]["text"] =text;
LLSD color_sd = color.getValue();
ret_llsd[0]["color"]=color_sd;
return ret_llsd;
}
示例13: declareControl
BOOL LLControlGroup::declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist )
{
return declareControl(name, TYPE_COL4, initial_val.getValue(), comment, SANITY_TYPE_NONE, LLSD(), std::string(""), persist);
}