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


C++ Peak::getOwner方法代码示例

本文整理汇总了C++中Peak::getOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ Peak::getOwner方法的具体用法?C++ Peak::getOwner怎么用?C++ Peak::getOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Peak的用法示例。


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

示例1: setLabel

int LuaPeak::setLabel(lua_State *L)
{
	Peak* obj = RefBinding<Peak>::check( L, 1);
	const char* str = "";
	if( lua_gettop(L) > 1 )
		str = luaL_checkstring( L, 2 );
	obj->getOwner()->setTag( obj, str );
	return 0;
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:9,代码来源:LuaPeakList.cpp

示例2: setAssig

int LuaPeak::setAssig(lua_State *L)
{
	Peak* obj = RefBinding<Peak>::check( L, 1);
	const int n = lua_gettop(L);  /* number of arguments */
	if( n != ( obj->getDimCount() + 1 ) )
		luaL_error( L, "Expecting %d arguments", int( obj->getDimCount() + 1 ) );
	Peak::Assig a;
	for( int i = 2; i <= n; i++ )
		a[ i-1 ] = luaL_checknumber( L, i ); // TEST
	obj->getOwner()->setAssig( obj, a );
	return 0;
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:12,代码来源:LuaPeakList.cpp

示例3: setModel

int LuaPeak::setModel(lua_State *L)
{
	Peak* obj = RefBinding<Peak>::check( L, 1);
	const int n = lua_gettop(L);  /* number of arguments */
	int id = 0;
	if( n > 1 )
		id = luaL_checknumber( L, 2 );
	Spectrum* spec = 0;
	if( n > 2 )
	{
		spec = RefBinding<Spectrum>::cast( L, 3 );
	}
	obj->getOwner()->setModel( obj, id, spec );
	return 0;
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:15,代码来源:LuaPeakList.cpp

示例4: setAmp

int LuaPeak::setAmp(lua_State *L)
{
	Peak* obj = RefBinding<Peak>::check( L, 1);
	int n = lua_gettop(L);  /* number of arguments */
	Amplitude a = 0;
	if( n > 1 )
		a = luaL_checknumber( L, 2 );
	Spectrum* spec = 0;
	if( n > 2 )
	{
		spec = RefBinding<Spectrum>::cast( L, 3 );
	}
	obj->getOwner()->setAmp( obj, a, spec );
	return 0;
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:15,代码来源:LuaPeakList.cpp

示例5: setPos

int LuaPeak::setPos(lua_State *L)
{
	Peak* obj = RefBinding<Peak>::check( L, 1);
	const int n = lua_gettop(L);  /* number of arguments */
	const int dim = obj->getDimCount();
	if( n < dim + 1 )
		luaL_error( L, "Expecting at least %d arguments", dim );
	PpmPoint a;
	for( int i = 1; i <= dim; i++ )
		a.push_back( luaL_checknumber( L, i + 1 ) );
	Spectrum* spec = 0;
	if( n > ( dim + 1 ) )
	{
		spec = RefBinding<Spectrum>::cast( L, n );
	}
	obj->getOwner()->setPos( obj, a, spec );
	return 0;
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:18,代码来源:LuaPeakList.cpp

示例6: setGuess

int LuaPeak::setGuess(lua_State *L)
{
	Peak* obj = RefBinding<Peak>::check( L, 1);
	int n = lua_gettop(L);  /* number of arguments */
	Peak::Guess* g = RefBinding<Peak::Guess>::check( L, 2 );
	float f = 0.0;
	Peak::Assig a;
	if( n > 2 )
	{
		f = luaL_checknumber( L, 3 );
		if( f < 0.0 || f > 1.0 )
			luaL_error( L, "Invalid probability value" );
		const int off = 4;
		for( int i = off; i <= n; i++ )
		{
			if( i - off >= Peak::Assig::MAX_DIM )
				luaL_error( L, "Invalid number of dimensions" );
			a[ i - off ] = luaL_checknumber( L, i );
		}
	}
	obj->getOwner()->setGuess( obj, g->getId(), a, f );
	return 0;
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:23,代码来源:LuaPeakList.cpp

示例7: setColor

int LuaPeak::setColor(lua_State *L)
{
	Peak* obj = RefBinding<Peak>::check( L, 1);
	obj->getOwner()->setColor( obj, luaL_checknumber( L, 2 ) );
	return 0;
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:6,代码来源:LuaPeakList.cpp


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