本文整理汇总了C++中IParamBlock2::GetMtl方法的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock2::GetMtl方法的具体用法?C++ IParamBlock2::GetMtl怎么用?C++ IParamBlock2::GetMtl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParamBlock2
的用法示例。
在下文中一共展示了IParamBlock2::GetMtl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DlgProc
INT_PTR PFOperatorMaterialFrequencyDlgProc::DlgProc( TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam )
{
// BOOL alignTo, angleDistortion;
IParamBlock2* pblock;
switch ( msg )
{
case WM_INITDIALOG:
// Send the message to notify the initialization of dialog
map->GetParamBlock()->NotifyDependents( FOREVER, (PartID)map, kMaterialFrequency_RefMsg_InitDlg );
break;
case WM_DESTROY:
break;
case WM_COMMAND:
switch ( LOWORD( wParam ) )
{
case IDC_NEW:
map->GetParamBlock()->NotifyDependents( FOREVER, PART_OBJ, kMaterialFrequency_RefMsg_NewRand );
break;
case kMaterialFrequency_message_assignMaterial:
pblock = map->GetParamBlock();
if (pblock != NULL)
UpdateAssignMaterialDlg( hWnd, pblock->GetInt(kMaterialFrequency_assignMaterial, t),
pblock->GetInt(kMaterialFrequency_assignID, t),
pblock->GetMtl(kMaterialFrequency_material, t) );
break;
case kMaterialFrequency_message_numSubMtls:
pblock = map->GetParamBlock();
if (pblock != NULL)
UpdateNumSubMtlsDlg( hWnd, pblock->GetMtl(kMaterialFrequency_material, t) );
break;
case kMaterialFrequency_message_assignID:
pblock = map->GetParamBlock();
if (pblock != NULL)
UpdateAssignIDDlg( hWnd, pblock->GetInt(kMaterialFrequency_assignID, t));
break;
}
break;
}
return FALSE;
}
示例2: DlgProc
BOOL plClothingComponentProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
IParamBlock2 *pb = pm->GetParamBlock();
HWND hList = GetDlgItem(hWnd, IDC_CLOTHING_LIST);
HWND hGroup = GetDlgItem(hWnd, IDC_CLOTHING_GROUP);
HWND hType = GetDlgItem(hWnd, IDC_CLOTHING_TYPE);
HWND hLOD = GetDlgItem(hWnd, IDC_COMP_LOD_CLOTHING_STATE);
switch (msg)
{
case WM_INITDIALOG:
{
ListBox_ResetContent(hList);
int i;
for (i = 0; i < pb->Count(plClothingComponent::kMaterials); i++)
ListBox_AddString(hList, pb->GetMtl(ParamID(plClothingComponent::kMaterials), 0, i)->GetName());
ListBox_SetCurSel(hList, -1);
for (i = 0; i < plClothingMgr::kMaxGroup; i++)
ComboBox_AddString(hGroup, plClothingMgr::GroupStrings[i]);
ComboBox_SetCurSel(hGroup, pb->GetInt(plClothingComponent::kGroup));
for (i = 0; i < plClothingMgr::kMaxType; i++)
ComboBox_AddString(hType, plClothingMgr::TypeStrings[i]);
ComboBox_SetCurSel(hType, pb->GetInt(plClothingComponent::kType));
ComboBox_AddString(hLOD, "High");
ComboBox_AddString(hLOD, "Medium");
ComboBox_AddString(hLOD, "Low");
ComboBox_SetCurSel(hLOD, pb->GetInt(plClothingComponent::kLODState));
}
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED)
{
if (LOWORD(wParam) == IDC_CLOTHING_ADD)
{
Mtl *pickedMtl = plPickMaterialMap::PickMaterial(plMtlCollector::kClothingMtlOnly);
if (pickedMtl != nil)
{
LRESULT stringIdx = ListBox_FindStringExact(hList, -1, pickedMtl->GetName());
if (stringIdx == LB_ERR) // It's not already there, go and add it
{
pb->Append(ParamID(plClothingComponent::kMaterials), 1, &pickedMtl, 0);
ListBox_AddString(hList, pickedMtl->GetName());
}
}
return TRUE;
}
// Remove the currently selected material
else if (LOWORD(wParam) == IDC_CLOTHING_REMOVE)
{
int sel = ListBox_GetCurSel(hList);
if (sel != LB_ERR)
{
pb->Delete(plClothingComponent::kMaterials, sel, 1);
ListBox_DeleteString(hList, sel);
}
return TRUE;
}
else if( LOWORD( wParam ) == IDC_CLOTHING_CLEARMESH )
{
int state = pb->GetInt(plClothingComponent::kLODState);
pb->SetValue(plClothingComponent::kMeshNodeTab, 0, (INode*)nil, state );
pb->Reset(plClothingComponent::kMeshNodeAddBtn);
}
}
else if (LOWORD(wParam) == IDC_CLOTHING_GROUP)
{
int setIdx = ComboBox_GetCurSel(hGroup);
pb->SetValue(plClothingComponent::kGroup, 0, setIdx);
return TRUE;
}
else if (LOWORD(wParam) == IDC_CLOTHING_TYPE)
{
int setIdx = ComboBox_GetCurSel(hType);
pb->SetValue(plClothingComponent::kType, 0, setIdx);
return TRUE;
}
else
{
int state = pb->GetInt(plClothingComponent::kLODState);
INode *node = pb->GetINode(plClothingComponent::kMeshNodeAddBtn);
if (node)
pb->SetValue(plClothingComponent::kMeshNodeTab, 0, node, state);
if(LOWORD(wParam) == IDC_COMP_LOD_CLOTHING_STATE && HIWORD(wParam) == CBN_SELCHANGE)
{
int idx = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
pb->SetValue(plClothingComponent::kLODState, 0, idx);
node = pb->GetINode(plClothingComponent::kMeshNodeTab, 0, idx);
if (node)
pb->SetValue(plClothingComponent::kMeshNodeAddBtn, 0, node);
else
//.........这里部分代码省略.........