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


C++ LLColor3类代码示例

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

示例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;
		}
	}

}
开发者ID:Nora28,项目名称:imprudence,代码行数:101,代码来源:llfloatersettingsdebug.cpp

示例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;
		}
	}

}
开发者ID:BillBarnhill,项目名称:SingularityViewer,代码行数:101,代码来源:llfloatersettingsdebug.cpp

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

示例5:

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

示例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;
		}
	}

}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:101,代码来源:llfloatersettingsdebug.cpp

示例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;
        }
    }

}
开发者ID:nebadon2025,项目名称:replex,代码行数:101,代码来源:llfloatersettingsdebug.cpp

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


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