mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0025338: MFC standard samples: 3D selection rectangle blinking
- Added new interactive object AIS_RubberBand to draw rubber rectangle or polygon - Added using of AIS_RubberBand in DRAW view for rectangular selection - Added using of AIS_RubberBand in MFC samples for rectangular selection
This commit is contained in:
@@ -117,6 +117,7 @@ void CGeometryView2D::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
}
|
||||
else // if ( Ctrl )
|
||||
{
|
||||
const Handle(AIS_InteractiveContext)& aContext = GetDocument()->GetISessionContext();
|
||||
switch (myCurrentMode)
|
||||
{
|
||||
case CurAction2d_Nothing :
|
||||
@@ -130,7 +131,7 @@ void CGeometryView2D::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
GetDocument()->InputEvent2D (point.x,point.y,myV2dView);
|
||||
} else
|
||||
{
|
||||
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False);
|
||||
drawRectangle (myXmin,myYmin,myXmax,myYmax,aContext,Standard_False);
|
||||
myXmax=point.x;
|
||||
myYmax=point.y;
|
||||
if (nFlags & MK_SHIFT)
|
||||
@@ -145,7 +146,7 @@ void CGeometryView2D::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
break;
|
||||
case CurAction2d_WindowZooming :
|
||||
myXmax=point.x; myYmax=point.y;
|
||||
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
|
||||
drawRectangle (myXmin,myYmin,myXmax,myYmax,aContext,Standard_False);
|
||||
if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin))
|
||||
// Test if the zoom window is greater than a minimale window.
|
||||
{
|
||||
@@ -221,14 +222,14 @@ void CGeometryView2D::OnMouseMove(UINT nFlags, CPoint point)
|
||||
}
|
||||
else // if ( Ctrl )
|
||||
{
|
||||
const Handle(AIS_InteractiveContext)& aContext = GetDocument()->GetISessionContext();
|
||||
switch (myCurrentMode)
|
||||
{
|
||||
case CurAction2d_Nothing :
|
||||
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False);
|
||||
myXmax = point.x;
|
||||
myYmax = point.y;
|
||||
GetDocument()->DragEvent2D(myXmax,myYmax,0,myV2dView);
|
||||
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_True);
|
||||
drawRectangle (myXmin,myYmin,myXmax,myYmax, aContext);
|
||||
break;
|
||||
case CurAction2d_DynamicZooming :
|
||||
myV2dView->Zoom(myXmax,myYmax,point.x,point.y);
|
||||
@@ -237,8 +238,7 @@ void CGeometryView2D::OnMouseMove(UINT nFlags, CPoint point)
|
||||
break;
|
||||
case CurAction2d_WindowZooming :
|
||||
myXmax = point.x; myYmax = point.y;
|
||||
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
|
||||
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash);
|
||||
drawRectangle (myXmin,myYmin,myXmax,myYmax, aContext);
|
||||
break;
|
||||
case CurAction2d_DynamicPanning :
|
||||
myV2dView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
|
||||
@@ -305,4 +305,4 @@ void CGeometryView2D::OnInitialUpdate()
|
||||
/* Matrox */
|
||||
/* I suspect another problem elsewhere */
|
||||
::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user