本文整理汇总了C++中IParamBlock2::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock2::Clone方法的具体用法?C++ IParamBlock2::Clone怎么用?C++ IParamBlock2::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParamBlock2
的用法示例。
在下文中一共展示了IParamBlock2::Clone方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
ReferenceTarget *CubeMap::Clone(RemapDir &remap)
{
CubeMap *pnew = new CubeMap;
pnew->ReplaceReference(0,pblock->Clone(remap));
BaseClone(this, pnew, remap);
return pnew;
}
示例2: Clone
//---------------------------------------------------------------------------
//
RefTargetHandle LuminaireObject::Clone(RemapDir& remap)
{
LuminaireObject* newObj = new LuminaireObject();
newObj->ReplaceReference(0, mpBlock->Clone(remap));
BaseClone(this, newObj, remap);
return newObj;
}
示例3: Clone
RefTargetHandle SolidifyPW::Clone(RemapDir& remap)
{
SolidifyPW* newmod = new SolidifyPW();
//TODO: Add the cloning code here
newmod->ReplaceReference(PBLOCK_REF,pblock->Clone(remap));
BaseClone(this, newmod, remap);
return(newmod);
}
示例4: DlgProc
//.........这里部分代码省略.........
ComboBox_DeleteString(hCombo, fCurState);
ComboBox_InsertString(hCombo, fCurState, buf);
// ComboBox_SetCurSel(hCombo, fCurState);
}
return TRUE;
}
else if (code == CBN_SELCHANGE)
{
int sel = ComboBox_GetCurSel(hCombo);
int type = ComboBox_GetItemData(hCombo, sel);
if (type == kStateAdd)
{
IParamBlock2 *pb = CreateParameterBlock2(&gStateBlock, nil);
fCurState = AddState(pb);
fCmdIdx = -1;
}
else if (type == kStateRemove)
{
int count = fPB->Count(kResponderState);
// Don't let the user remove the last state
if (count == 1)
{
hsMessageBox("You must have at least one state.", "Error", hsMessageBoxNormal);
ComboBox_SetCurSel(hCombo, fCurState);
return TRUE;
}
// Verify that the user really wants to delete the state
else
{
int ret = hsMessageBox("Are you sure you want to remove this state?", "Verify Remove", hsMessageBoxYesNo);
if (ret == hsMBoxNo)
{
ComboBox_SetCurSel(hCombo, fCurState);
return TRUE;
}
}
fPB->Delete(kResponderState, fCurState, 1);
fPB->Delete(kResponderStateName, fCurState, 1);
ComboBox_DeleteString(hCombo, fCurState);
ComboBox_SetCurSel(hCombo, 0);
HWND hSwitch = GetDlgItem(hWnd, IDC_SWITCH_COMBO);
ComboBox_DeleteString(hSwitch, fCurState);
// If the deleted state was the default, set the default to the first
int defState = fPB->GetInt(kResponderStateDef);
if (fCurState == defState)
fPB->SetValue(kResponderStateDef, 0, 0);
else if (fCurState < defState)
fPB->SetValue(kResponderStateDef, 0, defState-1);
// Patch up the switch commands
for (int i = fCurState; i < fPB->Count(kResponderState); i++)
{
IParamBlock2 *pb = (IParamBlock2*)fPB->GetReferenceTarget(kResponderState, 0, i);
int switchState = pb->GetInt(kStateCmdSwitch);
// TODO: might want to warn about this
if (switchState == fCurState)
pb->SetValue(kStateCmdSwitch, 0, 0);
else if (switchState > fCurState)
pb->SetValue(kStateCmdSwitch, 0, switchState-1);
}
fCurState = 0;
fCmdIdx = -1;
}
else if (type == kStateDefault)
{
// Set the current state as the default
fPB->SetValue(kResponderStateDef, 0, fCurState);
ComboBox_SetCurSel(hCombo, fCurState);
}
else if (type == kStateCopy)
{
// Clone the state PB
IParamBlock2 *origPB = (IParamBlock2*)fPB->GetReferenceTarget(kResponderState, 0, fCurState);
IParamBlock2 *copyPB = (IParamBlock2*)origPB->Clone(gMyRemapDir);
fCurState = AddState(copyPB);
fCmdIdx = -1;
}
else
{
fCurState = sel;
fCmdIdx = -1;
}
LoadState();
return TRUE;
}
}
}
return FALSE;
}
示例5: Clone
RefTargetHandle ConvertToPoly::Clone(RemapDir& remap) {
ConvertToPoly *mod = new ConvertToPoly();
mod->ReplaceReference (0, pblock->Clone(remap));
BaseClone(this, mod, remap);
return mod;
}