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


C++ setWeight函数代码示例

本文整理汇总了C++中setWeight函数的典型用法代码示例。如果您正苦于以下问题:C++ setWeight函数的具体用法?C++ setWeight怎么用?C++ setWeight使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setWeight函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setTime

bool CalAnimationAction::update(float deltaTime)
{
  // update animation action time

  if(getState() != STATE_STOPPED)
  {
    setTime(getTime() + deltaTime * getTimeFactor());
  }

  // handle IN phase
  if(getState() == STATE_IN)
  {
    // check if we are still in the IN phase
    if(getTime() < m_delayIn)
    {
      setWeight(getTime() / m_delayIn * m_weightTarget);
      //m_weight = m_time / m_delayIn;
    }
    else
    {
      setState(STATE_STEADY);
      setWeight(m_weightTarget);
    }
  }

  // handle STEADY
  if(getState() == STATE_STEADY)
  {
    // check if we reached OUT phase
    if(!m_autoLock && getTime() >= getCoreAnimation()->getDuration() - m_delayOut)
    {
      setState(STATE_OUT);
    }
    // if the anim is supposed to stay locked on last keyframe, reset the time here.
    else if (m_autoLock && getTime() > getCoreAnimation()->getDuration())
    {
      setState(STATE_STOPPED);
      setTime(getCoreAnimation()->getDuration());
    }      
  }

  // handle OUT phase
  if(getState() == STATE_OUT)
  {
    // check if we are still in the OUT phase
    if(getTime() < getCoreAnimation()->getDuration())
    {
      setWeight((getCoreAnimation()->getDuration() - getTime()) / m_delayOut * m_weightTarget);
    }
    else
    {
      // we reached the end of the action animation
      setWeight(0.0f);
      return false;
    }
  }

  return true;

}
开发者ID:CJFocke,项目名称:vsxu,代码行数:60,代码来源:animation_action.cpp

示例2: setWeight

int IsometricTile::setWeight( Tileset::Weight weight )
{
	setWeight( weight, Orientation::North );
	setWeight( weight, Orientation::South );
	setWeight( weight, Orientation::West );
	setWeight( weight, Orientation::East );
}
开发者ID:thorhunter1,项目名称:Tactics-Ogre-2,代码行数:7,代码来源:IsometricTile.cpp

示例3: setWeight

//----------------------------------------------------------------------------------------------------------------------
void CTRNN::knockOut(int n)
{
  for (int i = 0; i < size; ++i)
  {
    setWeight(i, n, 0);
    setWeight(n, i, 0);
  }
}
开发者ID:buhrmann,项目名称:dynmx,代码行数:9,代码来源:CTRNN.cpp

示例4: setWeight

KateAttribute& KateAttribute::operator+=(const KateAttribute& a)
{
  if (a.itemSet(Weight))
    setWeight(a.weight());

  if (a.itemSet(Italic))
    setItalic(a.italic());

  if (a.itemSet(Underline))
    setUnderline(a.underline());

  if (a.itemSet(Overline))
    setOverline(a.overline());

  if (a.itemSet(StrikeOut))
    setStrikeOut(a.strikeOut());

  if (a.itemSet(Outline))
    setOutline(a.outline());

  if (a.itemSet(TextColor))
    setTextColor(a.textColor());

  if (a.itemSet(SelectedTextColor))
    setSelectedTextColor(a.selectedTextColor());

  if (a.itemSet(BGColor))
    setBGColor(a.bgColor());

  if (a.itemSet(SelectedBGColor))
    setSelectedBGColor(a.selectedBGColor());

  return *this;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:34,代码来源:kateattribute.cpp

示例5: Mammals

 Mammals(char *k, char *name=NULL): Animal(k)
 {
     drink_milk = true;
     kind = "Mammals";
     setWeight(16);
     //std::cout << "Constructor Mammals" << std::endl;
 }
开发者ID:maxchv,项目名称:cpp,代码行数:7,代码来源:01.Inheritance.cpp

示例6: createMinSpanningTree

Graph* createMinSpanningTree(List *list, int size)
{
	int *id = new int[size] { 0 };
	for (int i = 0; i < size; ++i)
	{
		id[i] = i;
	}

	Graph* graph = createGraph(size);

	while (!isEmpty(list))
	{
		Road road = getValue(list);
		pop(list);
		int from = road.from;
		int to = road.to;
		int weight = road.weight;
		if (id[from] != id[to])
		{
			for (int i = 0; i < size; ++i)
			{
				if (id[i] == id[to])
				{
					id[i] = id[from];
				}
			}
			setWeight(graph, from, to, weight);
		}
	}
	delete[] id;
	return graph;
}
开发者ID:AlbertMukhammadiev,项目名称:University,代码行数:32,代码来源:graph.cpp

示例7: setDiveNumber

MobileDive::MobileDive(dive *d)
{
	m_thisDive = d;
	setDiveNumber(QString::number(d->number));
	setDiveId(QString::number(d->id));

	dive_trip *trip = d->divetrip;

	if(trip) {
		//trip is valid
		setTrip(trip->location);
	}

	setDate(get_dive_date_string(d->when));
	setDepth(get_depth_string(d->maxdepth));
	setDuration(get_dive_duration_string(d->duration.seconds, "h:","min"));

	setupDiveTempDetails();

	weight_t tw = { total_weight(d) };
	setWeight(weight_string(tw.grams));

	setSuit(QString(d->suit));
	setCylinder(QString(d->cylinder[0].type.description));
	setSac(QString::number(d->sac));
	setLocation(get_dive_location(d));
	setNotes(d->notes);
	setBuddy(d->buddy);
	setDivemaster(d->divemaster);
}
开发者ID:CosmoGlenns,项目名称:subsurface,代码行数:30,代码来源:divelistmodel.cpp

示例8: width

Mandel::Mandel(int width, int height, double xmin, double xmax, double ymin, double ymax, uint nmax, ColorType type): width(width), height(height), xmin(xmin), xmax(xmax), ymin(ymin), ymax(ymax), nmax(nmax), res(init_res), broad(false), type(type), list(1){
	map = std::vector<std::vector<double>>(width);
	for(auto& column : map){
		column = std::vector<double>(height);
	}
	setWeight(init_sigma[1]);
}
开发者ID:gamma057,项目名称:MandelViewer,代码行数:7,代码来源:Mandel.cpp

示例9: setHandle

void
TDECModuleInfo::loadAll() 
{
  if( !_service ) /* We have a bogus service. All get functions will return empty/zero values */
    return;

  _allLoaded = true;

  // library and factory
  setHandle(_service->property("X-TDE-FactoryName", TQVariant::String).toString());

  TQVariant tmp;

  // read weight
  tmp = _service->property( "X-TDE-Weight", TQVariant::Int );
  setWeight( tmp.isValid() ? tmp.toInt() : 100 );

  // does the module need super user privileges?
  tmp = _service->property( "X-TDE-RootOnly", TQVariant::Bool );
  setNeedsRootPrivileges( tmp.isValid() ? tmp.toBool() : false );

  // does the module need to be shown to root only?
  // Deprecated ! KDE 4
  tmp = _service->property( "X-TDE-IsHiddenByDefault", TQVariant::Bool );
  setIsHiddenByDefault( tmp.isValid() ? tmp.toBool() : false );

  // get the documentation path
  setDocPath( _service->property( "DocPath", TQVariant::String ).toString() );

  tmp = _service->property( "X-TDE-Test-Module", TQVariant::Bool );
  setNeedsTest( tmp.isValid() ? tmp.asBool() : false );
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:32,代码来源:tdecmoduleinfo.cpp

示例10: setItemName

weapon::weapon (string name, CHARACTER_WEAPON type, SIZE_CATEGORY size, int damage, int dice, int range, 
		double value, double weight, bool reach, int enhancementBonus, DAMAGE_TYPE one, 
		DAMAGE_TYPE two, DAMAGE_TYPE three, WEAPON_CATEGORY cat, WEAPON_SUBCATEGORY subcat, int critChance,
			int critValue, MATERIAL substance ) {

	setItemName(name);
	setDamageDie(damage);
	setNumDMGDice(dice);
	setWeaponType(type);
	setRangeIncrement(range);
	setWeight(weight);
	setBaseValue(value);
	setHardness(subcat, substance, enhancementBonus);
	setDurability(subcat, substance, enhancementBonus, size);
	setSize(size);
	setReach(reach);
	setDamageType1( one );
	setDamageType2( two );
	setDamageType3( three );
	setCritChance(critChance);
	setCritValue(critValue);
	setWeaponCategory( cat );
	setWeaponSubCategory ( subcat );
	setEnhancementBonus (enhancementBonus);
}
开发者ID:BBlayne,项目名称:Tagnikzur,代码行数:25,代码来源:weapon.cpp

示例11: llassert

BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
{
	llassert(mInfo == NULL);
	if (info->mID < 0)
		return FALSE;
	mInfo = info;
	mID = info->mID;

	setWeight(getDefaultWeight(), FALSE );
	
	LLDriverParamInfo::entry_info_list_t::iterator iter;
	mDriven.reserve(getInfo()->mDrivenInfoList.size());
	for (iter = getInfo()->mDrivenInfoList.begin(); iter != getInfo()->mDrivenInfoList.end(); iter++)
	{
		LLDrivenEntryInfo *driven_info = &(*iter);
		S32 driven_id = driven_info->mDrivenID;
		LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarp->getVisualParam( driven_id );
		if (param)
		{
			mDriven.push_back(LLDrivenEntry( param, driven_info ));
		}
		else
		{
			llerrs << "<driven> Unable to resolve driven parameter: " << driven_id << llendl;
			mInfo = NULL;
			return FALSE;
		}
	}
	
	return TRUE;
}
开发者ID:Nora28,项目名称:imprudence,代码行数:31,代码来源:lldriverparam.cpp

示例12: QFont

TnooFont::TnooFont(int pointSize) :
    QFont(QStringLiteral("nootka"), pointSize)
{
    setPixelSize(pointSize);
    setBold(false);
    setWeight(50); // Normal
}
开发者ID:SeeLook,项目名称:nootka,代码行数:7,代码来源:tnoofont.cpp

示例13: llassert

//-----------------------------------------------------------------------------
// setInfo()
//-----------------------------------------------------------------------------
BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
{
	llassert(mInfo == NULL);
	if (info->mID < 0)
		return FALSE;
	mInfo = info;
	mID = info->mID;
	setWeight(getDefaultWeight(), FALSE );

	LLVOAvatar* avatarp = mMesh->getAvatar();
	LLPolyMorphTargetInfo::volume_info_list_t::iterator iter;
	for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++)
	{
		LLPolyVolumeMorphInfo *volume_info = &(*iter);
		for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++)
		{
			if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName)
			{
				mVolumeMorphs.push_back(LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i],
														  volume_info->mScale,
														  volume_info->mPos));
				break;
			}
		}
	}

	mMorphData = mMesh->getMorphData(getInfo()->mMorphName);
	if (!mMorphData)
	{
		llwarns << "No morph target named " << getInfo()->mMorphName << " found in mesh." << llendl;
		return FALSE;  // Continue, ignoring this tag
	}
	return TRUE;
}
开发者ID:9skunks,项目名称:imprudence,代码行数:37,代码来源:llpolymorph.cpp

示例14: setStyle

void FontDescription::setTraits(FontTraits traits)
{
    setStyle(traits.style());
    setVariant(traits.variant());
    setWeight(traits.weight());
    setStretch(traits.stretch());
}
开发者ID:ewilligers,项目名称:blink,代码行数:7,代码来源:FontDescription.cpp

示例15: setWeight

bool DrawingManager::switchDrawing(int num, double weight){
    setWeight(weight);
    if(num<savedDrawings.size()){
       currentShapes = &savedDrawings[num];
        indexed=true;
    }
    
}
开发者ID:pixelmaid,项目名称:evodraw,代码行数:8,代码来源:DrawingManager.cpp


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