本文整理汇总了C++中CChildFrame::GetSnapSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::GetSnapSize方法的具体用法?C++ CChildFrame::GetSnapSize怎么用?C++ CChildFrame::GetSnapSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::GetSnapSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseMove
void CNuGenDimensionView::OnMouseMove(UINT nFlags, CPoint point)
{
CChildFrame* pFrame = static_cast<CChildFrame*>(GetParentFrame());
SetFocus();
if (!pFrame->m_commander)
{
switch (m_hand_action )
{
case HA_ROTATE:
if (nFlags & MK_LBUTTON)
{
SG_VECTOR downPnt;
SG_VECTOR curPnt;
// Convert the mouse left button down position to world
m_Camera.GetWorldCoord(m_ScreenLeftButtonDownPoint.x,
m_ScreenLeftButtonDownPoint.y,
0.0,
downPnt);
// Convert the mouse point into world coordinates
m_Camera.GetWorldCoord(point.x, point.y, 0.0,curPnt);
//VecSubf(curPnt, downPnt, curPnt);
curPnt = sgSpaceMath::VectorsSub(curPnt, downPnt);
CSize deltaPos;
deltaPos = m_ScreenLeftButtonDownPoint - point;
m_ScreenLeftButtonDownPoint = point;
RotateCamera(deltaPos);
Invalidate(FALSE);
}
break;
case HA_MOVE:
if (nFlags & MK_LBUTTON)
{
SG_VECTOR downPnt;
SG_VECTOR curPnt;
// Convert the mouse left button down position to world
m_Camera.GetWorldCoord(m_ScreenLeftButtonDownPoint.x,
m_ScreenLeftButtonDownPoint.y,
0.0,
downPnt);
// Convert the mouse point into world coordinates
m_Camera.GetWorldCoord(point.x, point.y, 0.0,curPnt);
//VecSubf(curPnt, downPnt, curPnt);
curPnt = sgSpaceMath::VectorsSub(curPnt, downPnt);
m_ScreenLeftButtonDownPoint = point;
TranslateCamera(curPnt);
Invalidate(FALSE);
}
break;
case HA_ZOOM:
if (nFlags & MK_LBUTTON)
{
SG_VECTOR downPnt;
SG_VECTOR curPnt;
// Convert the mouse left button down position to world
m_Camera.GetWorldCoord(m_ScreenLeftButtonDownPoint.x,
m_ScreenLeftButtonDownPoint.y,
0.0,
downPnt);
// Convert the mouse point into world coordinates
m_Camera.GetWorldCoord(point.x, point.y, 0.0,curPnt);
//VecSubf(curPnt, downPnt, curPnt);
curPnt = sgSpaceMath::VectorsSub(curPnt, downPnt);
CSize deltaPos;
deltaPos = m_ScreenLeftButtonDownPoint - point;
m_ScreenLeftButtonDownPoint = point;
ZoomCamera(deltaPos);
Invalidate(FALSE);
}
break;
default:
break;
}
}
if (!pFrame->m_commander)
/*pFrame->m_commander->MouseMove(nFlags,point.x,point.y);
else*/
if (!(nFlags & MK_LBUTTON))
{
int snapSz = pFrame->GetSnapSize();
const sgCObject* oldHotObj = Drawer::CurrentHotObject;
Drawer::CurrentHotObject = GetTopObject(GetHitsInRect(CRect(point.x-snapSz, point.y-snapSz,
point.x+snapSz, point.y+snapSz),true));
Drawer::TopParentOfHotObject = GetObjectTopParent(Drawer::CurrentHotObject);
if (Drawer::TopParentOfHotObject)
Drawer::CurrentHotObject = Drawer::TopParentOfHotObject;
/**************************************/
if (Drawer::CurrentHotObject &&
(Drawer::CurrentHotObject->GetType()==SG_OT_LINE ||
Drawer::CurrentHotObject->GetType()==SG_OT_CIRCLE ||
Drawer::CurrentHotObject->GetType()==SG_OT_SPLINE ||
Drawer::CurrentHotObject->GetType()==SG_OT_ARC ||
Drawer::CurrentHotObject->GetType()==SG_OT_CONTOUR)
)
{
sgC2DObject* spl = reinterpret_cast<sgC2DObject*>(Drawer::CurrentHotObject);
CString messs = "2DObject ";
if (spl->IsClosed())
messs += " Closed; ";
//.........这里部分代码省略.........