本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}