mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0030737: Visualization - implementing new selection schemes in context
AIS_SelectionScheme enumeration is defined to set which selection behaviour is used in Select of context AIS_InteractiveContext is corrected to use single Select method instead of combination of Select/ShiftSelect methods with a selection scheme parameter. Upgrade: Select() -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_Replace), ShiftSelect -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_XOR)
This commit is contained in:
@@ -244,7 +244,8 @@ void CGeometryDoc::InputEvent2D(const Standard_Integer /*x*/,
|
||||
const Standard_Integer /*y*/,
|
||||
const Handle(V3d_View)& /*aView*/)
|
||||
{
|
||||
myAISContext2D->Select(Standard_True);
|
||||
myAISContext2D->SelectDetected();
|
||||
myAISContext2D->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
@@ -352,7 +353,8 @@ void CGeometryDoc::InputEvent (const Standard_Integer /*theMouseX*/,
|
||||
const Standard_Integer /*theMouseY*/,
|
||||
const Handle(V3d_View)& /*theView*/)
|
||||
{
|
||||
myAISContext->Select (Standard_True);
|
||||
myAISContext->SelectDetected();
|
||||
myAISContext2D->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
@@ -4816,7 +4816,9 @@ void CModelingDoc::InputEvent(const Standard_Integer /*x*/,
|
||||
const Standard_Integer /*y*/,
|
||||
const Handle(V3d_View)& /*aView*/)
|
||||
{
|
||||
myAISContext->Select (Standard_True);
|
||||
myAISContext->SelectDetected();
|
||||
myAISContext->UpdateCurrentViewer();
|
||||
|
||||
if (myState == SELECT_EDGE_PLATE_TGTES_1) {
|
||||
myAISContext->InitSelected();
|
||||
if (myAISContext->MoreSelected()) {
|
||||
|
@@ -506,7 +506,7 @@ void CViewer3dDoc::InputEvent(const Standard_Integer /*x*/,
|
||||
|
||||
Quantity_Color CSFColor;
|
||||
COLORREF MSColor;
|
||||
myAISContext->Select (Standard_True);
|
||||
myAISContext->SelectDetected();
|
||||
|
||||
// Change the color of a selected face in a user cylinder
|
||||
if (myState == FACE_COLOR)
|
||||
|
@@ -327,8 +327,12 @@ void CHLRView3D::DragEvent(const Standard_Integer x ,
|
||||
theButtonDownY=y;
|
||||
}
|
||||
|
||||
if (TheState == 0)
|
||||
GetDocument()->GetAISContext()->Select(theButtonDownX,theButtonDownY,x,y,myView);
|
||||
if (TheState == 0)
|
||||
{
|
||||
GetDocument()->GetAISContext()->SelectRectangle (Graphic3d_Vec2i (theButtonDownX,theButtonDownY),
|
||||
Graphic3d_Vec2i (x,y),
|
||||
myView);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
@@ -337,7 +341,7 @@ void CHLRView3D::DragEvent(const Standard_Integer x ,
|
||||
void CHLRView3D::InputEvent(const Standard_Integer x ,
|
||||
const Standard_Integer y )
|
||||
{
|
||||
GetDocument()->GetAISContext()->Select();
|
||||
GetDocument()->GetAISContext()->SelectDetected();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
@@ -374,8 +378,13 @@ void CHLRView3D::MultiDragEvent(const Standard_Integer x ,
|
||||
theButtonDownY=y;
|
||||
}
|
||||
|
||||
if (TheState == 0)
|
||||
GetDocument()->GetAISContext()->ShiftSelect(theButtonDownX,theButtonDownY,x,y,myView);
|
||||
if (TheState == 0)
|
||||
{
|
||||
GetDocument()->GetAISContext()->SelectRectangle (Graphic3d_Vec2i (theButtonDownX,theButtonDownY),
|
||||
Graphic3d_Vec2i (x,y),
|
||||
myView,
|
||||
AIS_SelectionScheme_XOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -385,6 +394,6 @@ void CHLRView3D::MultiDragEvent(const Standard_Integer x ,
|
||||
void CHLRView3D::MultiInputEvent(const Standard_Integer x ,
|
||||
const Standard_Integer y )
|
||||
{
|
||||
GetDocument()->GetAISContext()->ShiftSelect();
|
||||
GetDocument()->GetAISContext()->SelectDetected (AIS_SelectionScheme_XOR);
|
||||
}
|
||||
|
||||
|
@@ -111,9 +111,10 @@ void OCC_3dBaseDoc::DragEvent (const Standard_Integer theMouseX,
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
myAISContext->Select (aStartDragX, aStartDragY,
|
||||
theMouseX, theMouseY,
|
||||
theView, Standard_True);
|
||||
myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY),
|
||||
Graphic3d_Vec2i (theMouseX, theMouseY),
|
||||
theView);
|
||||
myAISContext->UpdateCurrentViewer();
|
||||
break;
|
||||
}
|
||||
};
|
||||
@@ -127,7 +128,8 @@ void OCC_3dBaseDoc::InputEvent (const Standard_Integer theMouseX,
|
||||
const Handle(V3d_View)& theView)
|
||||
{
|
||||
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_False);
|
||||
myAISContext->Select (Standard_True);
|
||||
myAISContext->SelectDetected();
|
||||
myAISContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
@@ -175,9 +177,10 @@ void OCC_3dBaseDoc::ShiftDragEvent (const Standard_Integer theMouseX,
|
||||
if (theState == 0)
|
||||
{
|
||||
// button up
|
||||
myAISContext->ShiftSelect (aStartDragX, aStartDragY,
|
||||
theMouseX, theMouseY,
|
||||
theView, Standard_True);
|
||||
myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY),
|
||||
Graphic3d_Vec2i (theMouseX, theMouseY),
|
||||
theView, AIS_SelectionScheme_XOR);
|
||||
myAISContext->UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +191,8 @@ void OCC_3dBaseDoc::ShiftInputEvent (const Standard_Integer /*theMouseX*/,
|
||||
const Standard_Integer /*theMouseY*/,
|
||||
const Handle(V3d_View)& /*theView*/)
|
||||
{
|
||||
myAISContext->ShiftSelect (Standard_True);
|
||||
myAISContext->SelectDetected (AIS_SelectionScheme_XOR);
|
||||
myAISContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user