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


C++ check_arg_count函数代码示例

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


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

示例1: IsPerspView_cf

Value*
IsPerspView_cf(Value** arg_list, int count)
{
	check_arg_count(IsPerspView, 0, count);
	Value* ret = MAXScript_interface->GetActiveViewExp().IsPerspView() ? &true_value : &false_value;
	return ret;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:7,代码来源:GraphicsWindow.cpp

示例2: wm3_CreateMarker_cf

Value*
wm3_CreateMarker_cf(Value** arg_list, int count)
{
	check_arg_count(wm3_CreateMarker_cf, 3, count);
	type_check(arg_list[0], MAXModifier, _T("wm3_CreateMarker [Morpher Modifier] [Morph Index] [Marker Name]"));
	type_check(arg_list[1], Integer, _T("wm3_CreateMarker [Morpher Modifier] [Morph Index] [Marker Name]"));
	type_check(arg_list[2], String, _T("wm3_CreateMarker [Morpher Modifier] [Morph Index] [Marker Name]"));

	ReferenceTarget* obj = arg_list[0]->to_modifier();	
	if( !check_ValidMorpher(obj,arg_list) ) return &false_value;


	MorphR3 *mp = (MorphR3*)arg_list[0]->to_modifier();

	int sel = arg_list[1]->to_int(); 
	sel -= 1;

	const TCHAR *name = arg_list[2]->to_string();

	if (sel >= 0) 
	{
#pragma warning (push)
#pragma warning (disable: 4996)
		IMorphClass imp;
		imp.HoldMarkers(mp);
#pragma warning (pop)
		mp->markerName.AddName(name);
		mp->markerIndex.Append(1,&sel,0);
		mp->Update_channelMarkers();
		return &true_value;
	}

	return &false_value;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:34,代码来源:mcfunc.cpp

示例3: wm3_MoveMorph_cf

/*===========================================================================*\
 |	This swaps the position of 2 morphs in the channel list
 |  
\*===========================================================================*/
Value*
wm3_MoveMorph_cf(Value** arg_list, int count)
{
	check_arg_count(wm3_MoveMorph_cf, 3, count);
	type_check(arg_list[0], MAXModifier, _T("WM3_MoveMorph [Morpher Modifier] [Morph Source Index] [Morph Destination Index]"));
	type_check(arg_list[1], Integer, _T("WM3_MoveMorph [Morpher Modifier] [Morph Source Index] [Morph Destination Index]"));
	type_check(arg_list[2], Integer, _T("WM3_MoveMorph [Morpher Modifier] [Morph Source Index] [Morph Destination Index]"));

	ReferenceTarget* obj = arg_list[0]->to_modifier();	
	if( !check_ValidMorpher(obj,arg_list) ) return &false_value;

	MorphR3 *mp = (MorphR3*)arg_list[0]->to_modifier();

	int morphIndexA = arg_list[2]->to_int(); 
	morphIndexA--;
	if(morphIndexA>=100) morphIndexA = 99;
	if(morphIndexA<0) morphIndexA = 0;

	int morphIndexB = arg_list[1]->to_int(); 
	morphIndexB--;
	if(morphIndexB>=100) morphIndexB = 99;
	if(morphIndexB<0) morphIndexB = 0;
	
	MaxMorphModifier maxMorpher(mp);
	bool res = maxMorpher.MoveMorphChannel(morphIndexA, morphIndexB);
	maxMorpher.RefreshChannelsUI();

	return (res ? &true_value : &false_value);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:33,代码来源:mcfunc.cpp

示例4: import_cf

// python.import function: import a python module to maxscript
Value*
import_cf( Value** arg_list, int count ) {
    // Step 1: make sure the arguments supplied are correct
    check_arg_count( python.import, 1, count );

    // Step 2: protect the maxscript memory
    MXS_PROTECT( two_value_locals( mxs_check, mxs_return ) );

    // Step 3: convert the maxscript value
    MXS_EVAL( arg_list[0], vl.mxs_check );

    // Step 4: calculate the python module name to import
    const MCHAR* module_name = NULL;
    try {
        module_name = vl.mxs_check->to_string();
    }
    MXS_CATCHERRORS();

    // Step 5: import the module
    if ( module_name ) {
        MCharToPyString pys(module_name);
        if( pys.pyString() ) {
            PyObject* module = PyImport_Import( pys.pyString() );
            vl.mxs_return = ( module ) ? ObjectWrapper::intern( module ) : &undefined;
        }

        PY_ERROR_PROPAGATE_MXS_CLEANUP();
    }
    else {
        mprintf( _T("python.import() error: importing modules must be done with a string value\n") );
        vl.mxs_return = &undefined;
    }
    MXS_RETURN( vl.mxs_return );
}
开发者ID:zwadar,项目名称:Py3dsMax,代码行数:35,代码来源:python_struct.cpp

示例5: wm3_GetProgressiveMorphNode_cf

/*===========================================================================*\
 |	Returns the the  progressive morph Node
 |  
\*===========================================================================*/
Value*
wm3_GetProgressiveMorphNode_cf(Value** arg_list, int count)
{
	check_arg_count(wm3_GetProgressiveMorphNode_cf, 3, count);
	type_check(arg_list[0], MAXModifier, _T("WM3_GetProgressiveMorphNode [Morpher Modifier] [Morph Index] [Progressive Morph Index]"));
	type_check(arg_list[1], Integer, _T("WM3_GetProgressiveMorphNode [Morpher Modifier] [Morph Index]  [Progressive Morph Index]"));
	type_check(arg_list[2], Integer, _T("WM3_GetProgressiveMorphNode [Morpher Modifier] [Morph Index]  [Progressive Morph Index]"));

	ReferenceTarget* obj = arg_list[0]->to_modifier();	
	if( !check_ValidMorpher(obj,arg_list) ) return &false_value;


	MorphR3 *mp = (MorphR3*)arg_list[0]->to_modifier();

	int morphIndex = arg_list[1]->to_int(); 
	morphIndex--;
	if(morphIndex>=100) morphIndex = 99;
	if(morphIndex<0) morphIndex = 0;

	int pMorphIndex = arg_list[2]->to_int(); 
	pMorphIndex--;

	MaxMorphModifier maxMorpher(mp);
	INode *node = maxMorpher.GetMorphChannel(morphIndex).GetProgressiveMorphTarget(pMorphIndex);
	if (node != NULL)
	{
		return MAXNode::intern(node);	
	}
	return &undefined;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:34,代码来源:mcfunc.cpp

示例6: st_collection_page_items_item_style

static void
st_collection_page_items_item_style(void)
{
   check_arg_count(1);

   current_item->style = parse_str(0);
}
开发者ID:Stefan-Schmidt,项目名称:efl,代码行数:7,代码来源:elm_prefs_cc_handlers.c

示例7: st_collection_page_items_item_bool_default

static void
st_collection_page_items_item_bool_default(void)
{
   check_arg_count(1);

   current_item->spec.b.def = parse_bool(0);
}
开发者ID:Stefan-Schmidt,项目名称:efl,代码行数:7,代码来源:elm_prefs_cc_handlers.c

示例8: st_collection_page_items_item_date_min

static void
st_collection_page_items_item_date_min(void)
{
   check_min_arg_count(1);

   if (params_min_check(1))
     {
        check_arg_count(3);

        current_item->spec.d.min.y = parse_int_range(0, 1900, 10000);
        current_item->spec.d.min.m = parse_int_range(1, 1, 12);
        current_item->spec.d.min.d = parse_int_range(2, 1, 31);
     }
   else
     {
        const char *date = parse_str(0);
        if (!strcasecmp(date, "today"))
          {
             time_t t = time(NULL);
             struct tm *lt = localtime(&t);

             current_item->spec.d.min.y = lt->tm_year + 1900;
             current_item->spec.d.min.m = lt->tm_mon + 1;
             current_item->spec.d.min.d = lt->tm_mday;
          }
        free((void *)date);
     }
}
开发者ID:Stefan-Schmidt,项目名称:efl,代码行数:28,代码来源:elm_prefs_cc_handlers.c

示例9: st_collection_page_items_item_string_placeholder

static void
st_collection_page_items_item_string_placeholder(void)
{
   check_arg_count(1);

   current_item->spec.s.placeholder = parse_str(0);
}
开发者ID:Stefan-Schmidt,项目名称:efl,代码行数:7,代码来源:elm_prefs_cc_handlers.c

示例10: st_collection_page_items_item_int_max

static void
st_collection_page_items_item_int_max(void)
{
   check_arg_count(1);

   current_item->spec.i.max = parse_int(0);
}
开发者ID:Stefan-Schmidt,项目名称:efl,代码行数:7,代码来源:elm_prefs_cc_handlers.c

示例11: st_collection_page_items_item_float_min

static void
st_collection_page_items_item_float_min(void)
{
   check_arg_count(1);

   current_item->spec.f.min = parse_float(0);
}
开发者ID:Stefan-Schmidt,项目名称:efl,代码行数:7,代码来源:elm_prefs_cc_handlers.c

示例12: wRect_cf

Value*
wRect_cf(Value** arg_list, int count)
{
	check_arg_count(wRect, 2, count);
	Box2 &rect = arg_list[0]->to_box2();
	Point3 color = arg_list[1]->to_point3()/255.f;

	GraphicsWindow	*gw		= MAXScript_interface->GetActiveViewExp().getGW();		
	
	if (MaxSDK::Graphics::IsRetainedModeEnabled() && gw->querySupport(GW_SPT_NUM_LIGHTS) == 0)
	{
		return &undefined;
	}

	Point3*	 col = NULL; // new Point3[2];
	IPoint3* pts = new IPoint3[2]; 

//	col[0]=col[1]=color;
	pts[0]=IPoint3((int)(rect.left),0.f,0.f);
	pts[1]=IPoint3((int)(rect.right),0.f,0.f);

	gw->setColor(LINE_COLOR, color);
	for (int j = rect.top; j <= rect.bottom; j++)
	{
		pts[0].y=pts[1].y=j;
		gw->wPolyline(2, pts, col, FALSE, NULL);	
	}

	delete [] pts;
//	delete [] col;
	return &ok;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:32,代码来源:GraphicsWindow.cpp

示例13: getWinSizeY_cf

Value*
getWinSizeY_cf(Value** arg_list, int count)
{
	check_arg_count(getWinSizeY, 0, count);
	int sizeY = MAXScript_interface->GetActiveViewExp().getGW()->getWinSizeY();
	return Integer::intern(sizeY);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:7,代码来源:GraphicsWindow.cpp

示例14: GetFocalDist_cf

Value*
GetFocalDist_cf(Value** arg_list, int count)
{
	check_arg_count(GetFocalDist, 0, count);
	float ret = MAXScript_interface->GetActiveViewExp().GetFocalDist();
	return Float::intern(ret);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:7,代码来源:GraphicsWindow.cpp

示例15: st_collection_page_items_item_persistent

static void
st_collection_page_items_item_persistent(void)
{
   check_arg_count(1);

   current_item->persistent = parse_bool(0);
}
开发者ID:Stefan-Schmidt,项目名称:efl,代码行数:7,代码来源:elm_prefs_cc_handlers.c


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