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


C++ IParamBlock2::Count方法代码示例

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


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

示例1: NotifyRefChanged

RefResult Composite::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, 
   PartID& partID, RefMessage message ) {
	switch (message) {
		case REFMSG_CHANGE:			
			if (paramDlg) 
				paramDlg->Invalidate();
			if (pblock->LastNotifyParamID() == comptex_tex && pblock->Count(comptex_tex) != subTex.Count())
				SetNumMaps(pblock->Count(comptex_tex));
			else if (pblock->LastNotifyParamID() == comptex_ons && pblock->Count(comptex_ons) != subTex.Count())
				SetNumMaps(pblock->Count(comptex_ons));
			DiscardTexHandles(); // DS 5/4/00
			ivalid.SetEmpty();
			if (paramDlg&&Active())
				paramDlg->ip->MtlChanged();
			break;
		
		case REFMSG_GET_PARAM_DIM:
			return REF_STOP; 
		
		case REFMSG_GET_PARAM_NAME: {
			GetParamName *gpn = (GetParamName*)partID;
			gpn->name= GetSubTexmapSlotName(gpn->index);			
			return REF_STOP; 
			}
		}
	return(REF_SUCCEED);
	}
开发者ID:2asoft,项目名称:xray,代码行数:27,代码来源:composit.cpp

示例2: AppendTarget

BOOL OrientConstRotation::AppendTarget(INode *target, float weight){

	if (target == NULL){
		float var = 50.0f;
		int ct = pblock->Count(orientation_target_list);
		int ctf = pblock->Count(orientation_target_weight);
		theHold.Begin();
		pblock->SetCount(orientation_target_list, ct + 1);
		pblock->SetValue(orientation_target_list, GetCOREInterface()->GetTime(), target, ct);
		pblock->Append(orientation_target_weight, 1, &var, 1);
		theHold.Accept(GetString(IDS_AG_ORIENTATION_LIST));
		return TRUE;
	}
	else if (!(target->TestForLoop(FOREVER,(ReferenceMaker *) this)!=REF_SUCCEED)) 
	{
		for (int i = 0; i < pblock->Count(orientation_target_list); i++){
			if (target == pblock->GetINode(orientation_target_list, GetCOREInterface()->GetTime(), i)){
				return FALSE; // the target is already in the targetlist
			}
		}
			
		theHold.Begin();
		pblock->Append(orientation_target_list, 1, &target, 1);
		pblock->Append(orientation_target_weight, 1, &weight, 1);
		theHold.Accept(GetString(IDS_AG_ORIENTATION_LIST));
		return TRUE;
	}
	return FALSE;


}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:31,代码来源:orientation_cnstrnt.cpp

示例3: IFixOldPB

void plResponderComponent::IFixOldPB()
{
    if (fCompPB)
    {
        if (fCompPB->Count(kResponderState) == 0)
        {
            IParamBlock2 *pb = CreateParameterBlock2(&gStateBlock, nil);
            int idx = fCompPB->Append(kResponderState, 1, (ReferenceTarget**)&pb);
            pb->SetValue(kStateCmdSwitch, 0, idx);
        }
        if (fCompPB->Count(kResponderStateName) == 0)
        {
            char *name = "";
            fCompPB->Append(kResponderStateName, 1, &name);
        }

        // Make sure there is an enabled value for each command in the state
        for (int i = 0; i < fCompPB->Count(kResponderState); i++)
        {
            IParamBlock2* pb = (IParamBlock2*)fCompPB->GetReferenceTarget(kResponderState, 0, i);
            if (pb->Count(kStateCmdEnabled) != pb->Count(kStateCmdParams))
                pb->SetCount(kStateCmdEnabled, pb->Count(kStateCmdParams));
        }
    }
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:25,代码来源:plResponderComponent.cpp

示例4: DeleteTarget

BOOL OrientConstRotation::DeleteTarget(int selection){
	int ct = pblock->Count(orientation_target_list);
	if (selection >= 0 && selection < pblock->Count(orientation_target_list)){
//		theHold.Begin();
		pblock->Delete(orientation_target_weight, selection, 1);
		pblock->Delete(orientation_target_list, selection, 1);
//		theHold.Accept(GetString(IDS_AG_ORIENTATION_LIST));
		return TRUE;
	}
	else
		return FALSE;

}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:13,代码来源:orientation_cnstrnt.cpp

示例5: GetCommandName

const char* plResponderProc::GetCommandName(int cmdIdx)
{
    static char buf[256];

    if (fStatePB->Count(kStateCmdParams) > cmdIdx)
    {
        buf[0] = '\0';

        BOOL enabled = fStatePB->GetInt(kStateCmdEnabled, 0, cmdIdx);
        if (!enabled)
            strcat(buf, "[D]");

        IParamBlock2 *cmdPB = (IParamBlock2*)fStatePB->GetReferenceTarget(kStateCmdParams, 0, cmdIdx);
        plResponderCmd *cmd = plResponderCmd::Find(cmdPB);

        IParamBlock2 *waitPB = (IParamBlock2*)fStatePB->GetReferenceTarget(kStateCmdWait, 0, cmdIdx);
        int waitingOn = ResponderWait::GetWaitingOn(waitPB);
        if (waitingOn != -1)
        {
            char num[10];
            sprintf(num, "(%d)", waitingOn+1);
            strcat(buf, num);
        }

        strcat(buf, cmd->GetInstanceName(cmdPB));

        return buf;
    }

    hsAssert(0, "Bad index to GetCommandName");
    return nil;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:32,代码来源:plResponderComponent.cpp

示例6: AddCommand

void plResponderProc::AddCommand()
{
    RECT rect;
    GetWindowRect(GetDlgItem(fhDlg, IDC_ADD_CMD), &rect);

    // Create the popup menu and get the option the user selects
    SetForegroundWindow(fhDlg);
    int type = TrackPopupMenu(fhMenu, TPM_RIGHTALIGN | TPM_NONOTIFY | TPM_RETURNCMD, rect.left, rect.top, 0, fhDlg, NULL);
    PostMessage(fhDlg, WM_USER, 0, 0);

    if (type == 0)
        return;

    CmdID& cmdID = fMenuCmds[type];
    plResponderCmd *cmd = cmdID.first;
    int cmdIdx = cmdID.second;

    IParamBlock2 *cmdPB = cmd->CreatePB(cmdIdx);
    fStatePB->Append(kStateCmdParams, 1, (ReferenceTarget**)&cmdPB);

    IParamBlock2 *waitPB = ResponderWait::CreatePB();
    fStatePB->Append(kStateCmdWait, 1, (ReferenceTarget**)&waitPB);

    BOOL enabled = TRUE;
    fStatePB->Append(kStateCmdEnabled, 1, &enabled);

    const char* name = GetCommandName(fStatePB->Count(kStateCmdParams)-1);
    int idx = ListBox_AddString(fhList, name);
    ListBox_SetCurSel(fhList, idx);

    ICreateCmdRollups();
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:32,代码来源:plResponderComponent.cpp

示例7: GetNode

INode* OrientConstRotation::GetNode(int targetNumber){
	if (targetNumber >= 0 && targetNumber < pblock->Count(orientation_target_list)){
		INode *orient_targ;
		pblock->GetValue(orientation_target_list, 0, orient_targ, FOREVER, targetNumber);
		return orient_targ;
	}
	return NULL;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:8,代码来源:orientation_cnstrnt.cpp

示例8: GetValue

void OrientConstRotation::GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method)
{
	if (firstTimeFlag) {
		Point3 trans, scaleP;
		Quat quat;
		Matrix3 tempMat(1);
		// CAL-9/26/2002: in absolute mode the value could be un-initialized (random value).
		if (method == CTRL_RELATIVE) tempMat = *(Matrix3*)val;
		DecomposeMatrix(tempMat, trans, quat, scaleP);
		baseRotQuatWorld = baseRotQuatLocal * quat;
		baseRotQuatWorld.Normalize();
		firstTimeFlag = 0;
	}
	if (!ivalid.InInterval(t)) {
		DbgAssert(val != NULL);
		Update(t);
	}
	valid &= ivalid;

			 
	if (method==CTRL_RELATIVE) {
		Interval iv;

		if (IsLocal()){			// From Update, I'm getting target_local_TM in curRot
			Matrix3 *mat = (Matrix3*)val; // this is source_Parent_TM
			Quat q = curRot;			// this is target_local_TM
			PreRotateMatrix(*mat, q);	// source_world_TM = source_Parent_TM * target_local_TM 
		}
		
		else { 		// i.e., WorldToWorld: from Update, I'm getting target_world_TM in curRot
			int ct = pblock->Count(orientation_target_list);;
			if (ct < 1){
				Matrix3 *mat = (Matrix3*)val;
				Quat q = curRot;
				PreRotateMatrix(*mat, q);
			}
			else{
				Matrix3 *mat = (Matrix3*)val; // this is source_Parent_TM
				// CAL-06/24/02: preserve all components and replace with the new orientation.
				AffineParts ap;
				decomp_affine( *mat, &ap );
				ap.q = curRot;				// target world rotation
				comp_affine( ap, *mat );
				// CAL-06/24/02: this only preserve the translation component
				// Point3 tr;
				// tr = mat->GetTrans();
				// mat->IdentityMatrix();
				// Quat q = curRot;			// this is target_world_TM
				// q.MakeMatrix(*mat);
				// mat->SetTrans(tr);
			}
		}
	} 
	else {
		*((Quat*)val) = curRot;
	}
//		RedrawListbox(GetCOREInterface()->GetTime());
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:58,代码来源:orientation_cnstrnt.cpp

示例9: SetTargetWeight

BOOL OrientConstRotation::SetTargetWeight(int targetNumber, float weight){
	if (targetNumber >= 0 && targetNumber < pblock->Count(orientation_target_list)){
		pblock->SetValue(orientation_target_weight, GetCOREInterface()->GetTime(), weight, targetNumber);
		return TRUE;
	}
	else{
		return FALSE;
	}
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:9,代码来源:orientation_cnstrnt.cpp

示例10: DlgProc

//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
//|					custom UI update for Duration Test  					 |
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
INT_PTR TestSpawnOnCollisionDlgProc::DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) 
	{
	IParamBlock2* pblock;
	case WM_INITDIALOG:
		pblock = map->GetParamBlock();
		UpdateSpawnTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_spawnType,t),
								  pblock->GetInt(kSpawnCollision_deleteParent,t) );
		UpdateSpeedTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_speedType,t) );
		UpdateRandomSeedDlg( hWnd, pblock->GetFloat(kSpawnCollision_spawnAble,t),
								   pblock->GetFloat(kSpawnCollision_numVariation,t),
								   pblock->GetFloat(kSpawnCollision_speedVariation,t),
								   pblock->GetFloat(kSpawnCollision_speedDivergence,t),
								   pblock->GetFloat(kSpawnCollision_scaleVariation,t) );						   
		break;
	case WM_COMMAND:
		pblock = map->GetParamBlock();
		switch (LOWORD(wParam))
		{
		case IDC_NEW:
			if (pblock) pblock->NotifyDependents(FOREVER, PART_OBJ, kSpawnCollision_RefMsg_NewRand);
			return TRUE;
		case IDC_COLLISION_PICKNODE:
			if (pblock) pblock->NotifyDependents( FOREVER, 0, kSpawnCollision_RefMsg_ResetValidatorAction );
			break;
		case IDC_BYLIST:
			if (pblock) pblock->NotifyDependents( FOREVER, 0, kSpawnCollision_RefMsg_ListSelect );
			break;
		case kSpawnCollision_message_type:
			pblock = map->GetParamBlock();
			UpdateSpawnTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_spawnType,t),
									  pblock->GetInt(kSpawnCollision_deleteParent,t) );
			break;
		case kSpawnCollision_message_speed:
			pblock = map->GetParamBlock();
			UpdateSpeedTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_speedType,t) );
			break;
		case kSpawnCollision_message_random:
			pblock = map->GetParamBlock();
			UpdateRandomSeedDlg( hWnd, pblock->GetFloat(kSpawnCollision_spawnAble,t),
									   pblock->GetFloat(kSpawnCollision_numVariation,t),
									   pblock->GetFloat(kSpawnCollision_speedVariation,t),
									   pblock->GetFloat(kSpawnCollision_speedDivergence,t),
									   pblock->GetFloat(kSpawnCollision_scaleVariation,t) );						   
			break;
		case kSpawnCollision_message_deflectors:
			pblock = map->GetParamBlock();
			if (pblock)
				UpdateDeflectorsDlg( hWnd, pblock->Count(kSpawnCollision_deflectors) );
			break;
		}
		break;
	}
	return FALSE;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:59,代码来源:PFTestSpawnOnCollision_ParamBlock.cpp

示例11: GetTargetWeight

float OrientConstRotation::GetTargetWeight(int targetNumber){
	if (targetNumber >= 0 && targetNumber < pblock->Count(orientation_target_list)){
		float targetWt;
		pblock->GetValue(orientation_target_weight, GetCOREInterface()->GetTime(), targetWt, FOREVER, targetNumber);
		return targetWt;
	}
	else{
		return 0.0f;
	}
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:10,代码来源:orientation_cnstrnt.cpp

示例12: LoadList

void plResponderProc::LoadList()
{
    ListBox_ResetContent(fhList);

    for (int i = 0; i < fStatePB->Count(kStateCmdParams); i++)
    {
        const char* name = GetCommandName(i);
        ListBox_AddString(fhList, name);
    }

    ListBox_SetCurSel(fhList, -1);
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:12,代码来源:plResponderComponent.cpp

示例13: IConvertCmds

void plResponderComponent::IConvertCmds(plMaxNode* node, plErrorMsg* pErrMsg, int state, CmdIdxs& cmdIdxs)
{
    IParamBlock2 *statePB = (IParamBlock2*)fCompPB->GetReferenceTarget(kResponderState, 0, state);
    plResponderModifier *responder = IGetResponderMod(node);

    // Add the messages to the logic modifier
    for (int i = 0; i < statePB->Count(kStateCmdParams); i++)
    {
        plMessage *msg = nil;

        BOOL enabled = statePB->GetInt(kStateCmdEnabled, 0, i);
        if (!enabled)
            continue;

        IParamBlock2 *cmdPB = (IParamBlock2*)statePB->GetReferenceTarget(kStateCmdParams, 0, i);

        try
        {
            plResponderCmd *cmd = plResponderCmd::Find(cmdPB);
            if (cmd)
                msg = cmd->CreateMsg(node, pErrMsg, cmdPB);
        }
        catch (char *reason)
        {
            char buf[512];

            char stateName[128];
            const char *curStateName = fCompPB->GetStr(kResponderStateName, 0, state);
            if (curStateName && *curStateName != '\0')
                strcpy(stateName, fCompPB->GetStr(kResponderStateName, 0, state));
            else
                sprintf(stateName, "State %d", state+1);

            sprintf(buf,
                "A responder command failed to export.\n\nResponder:\t%s\nState:\t\t%s\nCommand:\t%d\n\nReason: %s",
                GetINode()->GetName(), stateName, i+1, reason);

            pErrMsg->Set(true, "Responder Warning", buf).Show();
            pErrMsg->Set(false);
        }

        if (msg)
        {
            msg->SetSender(responder->GetKey());
            responder->AddCommand(msg, state);
            int idx = responder->fStates[state].fCmds.Count()-1;
            cmdIdxs[i] = idx;
        }
    }
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:50,代码来源:plResponderComponent.cpp

示例14: Update

void Composite::Update(TimeValue t, Interval& valid) 
	{
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();		
		int n = pblock->Count(comptex_ons);
		if (n!=mapOn.Count()) mapOn.SetCount(n);
		for (int i=0; i<subTex.Count(); i++) {
			pblock->GetValue(comptex_ons,0,mapOn[i],valid,i);
	
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}
		}
	valid &= ivalid;
	}
开发者ID:2asoft,项目名称:xray,代码行数:15,代码来源:composit.cpp

示例15: SetupProperties

hsBool plResponderComponent::SetupProperties(plMaxNode* node, plErrorMsg* pErrMsg)
{
    int numStates = fCompPB->Count(kResponderState);
    for (int i = 0; i < numStates; i++)
    {
        IParamBlock2 *statePB = (IParamBlock2*)fCompPB->GetReferenceTarget(kResponderState, 0, i);

        for (int j = 0; j < statePB->Count(kStateCmdParams); j++)
        {
            IParamBlock2 *cmdPB = (IParamBlock2*)statePB->GetReferenceTarget(kStateCmdParams, 0, j);
            plResponderCmd *cmd = plResponderCmd::Find(cmdPB);
            cmd->SetupProperties(node, pErrMsg, cmdPB);
        }
    }

    return true;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:17,代码来源:plResponderComponent.cpp


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