Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const { const polyMesh& mesh = *meshPtr_; localPoints ptList(mesh); labelList& usedPoints = ptList.list; label nPoints = 0; forAll(elemLists_, typeI) { const labelList& idList = elemLists_[typeI]; // add all points from cells forAll(idList, i) { label id = idList[i] + offset_; const labelList& cFaces = mesh.cells()[id]; forAll(cFaces, cFaceI) { const face& f = mesh.faces()[cFaces[cFaceI]]; forAll(f, fp) { if (usedPoints[f[fp]] == -1) { usedPoints[f[fp]] = nPoints++; } } } } }
void hdCLibDlg::OnRclickMylist(NMHDR* pNMHDR, LRESULT* pResult) { CMenu* pMenu = NULL; try { pMenu = new CMenu; } catch(...) { pMenu = NULL; } ASSERT(pMenu); POINT point; GetCursorPos(&point); CPoint ptList(point); UINT uHitTest = TVHT_ONITEM; GetDesktopWindow()->MapWindowPoints( &m_mylist, &ptList, 1 ); m_dragTargetList = m_mylist.HitTest( ptList, &uHitTest ); m_dragTargetTree = NULL; if(m_dragTargetList==NULL) m_dragTargetList=ModelParent; VERIFY(pMenu->CreatePopupMenu()); if (m_dragTargetList!=ModelParent) VERIFY(pMenu->AppendMenu(MF_STRING, ID_EDIT_CUT, "Delete Selected")); else VERIFY(pMenu->AppendMenu(MF_STRING, ID_EDIT_FIND, "Import Materials")); VERIFY(pMenu->AppendMenu(MF_STRING, ID_EDIT_COPY, "Add New Material")); if(m_dragTargetList!=NULL) { if(!IsFolder(m_dragTargetList)) VERIFY(pMenu->AppendMenu(MF_STRING, ID_EDIT_REPLACE, "Modify Material")); } pMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON,point.x,point.y,this); try { delete pMenu; } catch(...) { ASSERT(FALSE); TRACE("hdCLibDlg::OnRclickMylist failed to destroy menu resource\n"); pMenu = FALSE; } *pResult = 0; }
void hdCLibDlg::OnMouseMove(UINT nFlags, CPoint point) { if( m_bIsDragging != FALSE ) { CPoint ptDrag( point ); CPoint ptTree( point ); CPoint ptList( point ); UINT uHitTest = TVHT_ONITEM; MapWindowPoints( this, &ptDrag, 1 ); MapWindowPoints( &m_mytree, &ptTree, 1 ); MapWindowPoints( &m_mylist, &ptList, 1 ); CImageList::DragMove( ptDrag ); m_dragTargetTree = m_mytree.HitTest( ptTree, &uHitTest ); m_dragTargetList = m_mylist.HitTest( ptList, &uHitTest ); } CResizableDialog::OnMouseMove(nFlags, point); }
void hdCLibDlg::OnDblclkMytree(NMHDR* pNMHDR, LRESULT* pResult) { POINT point; GetCursorPos(&point); CPoint ptList(point); UINT uHitTest = TVHT_ONITEM; GetDesktopWindow()->MapWindowPoints( &m_mytree, &ptList, 1 ); m_dragTargetTree = m_mytree.HitTest( ptList, &uHitTest ); m_dragTargetList = NULL; if(m_dragTargetTree!=NULL) { if(!IsFolder(m_dragTargetTree)){ int k=(int) m_mytree.GetItemData(m_dragTargetTree); ModifyMaterial(k); m_mytree.SetItemText(m_dragTargetTree,LibProps[k].BlockName); } } *pResult = 0; }