本文整理汇总了C++中Peak::getDimCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Peak::getDimCount方法的具体用法?C++ Peak::getDimCount怎么用?C++ Peak::getDimCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Peak
的用法示例。
在下文中一共展示了Peak::getDimCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAssig
int LuaPeak::getAssig(lua_State *L)
{
Peak* obj = RefBinding<Peak>::check( L, 1);
const Peak::Assig& a = obj->getAssig();
{
for( int i = 0; i < obj->getDimCount(); i++ )
lua_pushnumber( L, a[ i ] );
}
return obj->getDimCount();
}
示例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: getPos
int LuaPeak::getPos(lua_State *L)
{
Peak* obj = RefBinding<Peak>::check( L, 1);
Spectrum* spec = 0;
if( lua_gettop( L ) > 1 )
{
spec = RefBinding<Spectrum>::cast( L, 2 );
}
const PeakPos& a = obj->getPos( spec );
for( int i = 0; i < obj->getDimCount(); i++ )
lua_pushnumber( L, a[ i ] );
return obj->getDimCount();
}
示例4: 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;
}