本文整理汇总了C++中MorphR3::EndDependencyTest方法的典型用法代码示例。如果您正苦于以下问题:C++ MorphR3::EndDependencyTest方法的具体用法?C++ MorphR3::EndDependencyTest怎么用?C++ MorphR3::EndDependencyTest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MorphR3
的用法示例。
在下文中一共展示了MorphR3::EndDependencyTest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BindProc
INT_PTR CALLBACK BindProc(
HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
M3Mat *mp = (M3Mat*)GetWindowLongPtr(hWnd,GWLP_USERDATA);
if (!mp && msg!=WM_INITDIALOG) return FALSE;
int id = LOWORD(wParam);
int notify = HIWORD(wParam);
switch (msg) {
case WM_INITDIALOG:{
mp = (M3Mat*)lParam;
SetWindowLongPtr(hWnd,GWLP_USERDATA,(LONG_PTR)mp);
HWND modList = GetDlgItem(hWnd,IDC_MODLIST);
SendMessage(modList,LB_RESETCONTENT,0,0);
POINT lpPt; GetCursorPos(&lpPt);
SetWindowPos(hWnd, NULL, lpPt.x, lpPt.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
Object *pObj = mp->Wnode->GetObjectRef();
IDerivedObject *pDerObj = NULL;
Modifier *pMod = NULL;
if( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
pDerObj = (IDerivedObject *) pObj;
for(int i = 0 ; i < pDerObj->NumModifiers() ; i++ )
{
pMod = pDerObj->GetModifier(i);
SendMessage(modList,LB_ADDSTRING,0,(LPARAM) (LPCTSTR) pMod->GetName());
}
}
SendMessage(modList,LB_SETCURSEL ,(WPARAM)-1,0);
break;}
case WM_COMMAND:
if (notify==LBN_SELCHANGE){
if(id==IDC_MODLIST){
int mkSel = SendMessage(GetDlgItem(hWnd, IDC_MODLIST), LB_GETCURSEL, 0, 0);
if(mkSel>=0){
Object *pObj = mp->Wnode->GetObjectRef();
IDerivedObject *pDerObj = NULL;
Modifier *pMod = NULL;
if( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
pDerObj = (IDerivedObject *) pObj;
pMod = pDerObj->GetModifier(mkSel);
if(pMod->ClassID() == MR3_CLASS_ID) EnableWindow(GetDlgItem(hWnd,IDOK),TRUE);
else EnableWindow(GetDlgItem(hWnd,IDOK),FALSE);
}
}
}
}
switch (id) {
case IDOK:
{
int mkSel = SendMessage(GetDlgItem(hWnd, IDC_MODLIST), LB_GETCURSEL, 0, 0);
if(mkSel>=0){
Object *pObj = mp->Wnode->GetObjectRef();
IDerivedObject *pDerObj = NULL;
Modifier *pMod = NULL;
if( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
pDerObj = (IDerivedObject *) pObj;
pMod = pDerObj->GetModifier(mkSel);
MorphR3 *mod = (MorphR3*)pMod;
if(mod->CheckMaterialDependency() ) {
EndDialog(hWnd,1);return TRUE;
}
// Make sure the node does not depend on us
mod->BeginDependencyTest();
mp->NotifyDependents(FOREVER,0,REFMSG_TEST_DEPENDENCY);
if (mod->EndDependencyTest()) {
// display cyclic warning
//
if (GetCOREInterface()->GetQuietMode()) {
TSTR cyclic;
cyclic = GetString(IDS_CANNOT_BIND);
GetCOREInterface()->Log()->LogEntry(SYSLOG_WARN,NO_DIALOG,GetString(IDS_CLASS_NAME),cyclic);
}
else
{
TSTR cyclic;
//.........这里部分代码省略.........