当前位置: 首页>>代码示例>>C++>>正文


C++ LLColor4U::getValue方法代码示例

本文整理汇总了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;
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:13,代码来源:llcontrol.cpp

示例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;
	}
}
开发者ID:N3X15,项目名称:Luna-Viewer,代码行数:15,代码来源:llcontrol.cpp

示例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;
}
开发者ID:Boy,项目名称:netbook,代码行数:101,代码来源:llcontrol.cpp

示例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;
}
开发者ID:Boy,项目名称:netbook,代码行数:101,代码来源:llcontrol.cpp

示例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);
}
开发者ID:Boy,项目名称:netbook,代码行数:4,代码来源:llcontrol.cpp

示例6:

template <> eControlType get_control_type<LLColor4U>(const LLColor4U& in, LLSD& out) 
{ 
	out = in.getValue();
	return TYPE_COL4U; 
}
开发者ID:Krazy-Bish-Margie,项目名称:Sausages,代码行数:5,代码来源:llviewercontrol.cpp


注:本文中的LLColor4U::getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。