throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
}
- // all objects detected by the selector are taken, previous current objects are emptied,
- // new objects are put...
- if (myAutoHilight)
- {
- clearDynamicHighlight();
- UnhilightSelected (Standard_False);
- }
- myWasLastMain = Standard_True;
-
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
AIS_NListOfEntityOwner aPickedOwners;
{
aPickedOwners.Append (myMainSel->Picked (aPickIter));
}
- mySelection->SelectOwners (aPickedOwners, theSelScheme, myFilters);
- if (myAutoHilight)
- {
- HilightSelected (Standard_False);
- }
-
- Standard_Integer aSelNum = NbSelected();
-
- return (aSelNum == 0) ? AIS_SOP_NothingSelected
- : (aSelNum == 1) ? AIS_SOP_OneSelected
- : AIS_SOP_SeveralSelected;
-
+ return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
}
- // all objects detected by the selector are taken, previous current objects are emptied,
- // new objects are put...
- if (myAutoHilight)
- {
- clearDynamicHighlight();
- UnhilightSelected (Standard_False);
- }
-
- myWasLastMain = Standard_True;
myMainSel->Pick (thePolyline, theView);
AIS_NListOfEntityOwner aPickedOwners;
{
aPickedOwners.Append (myMainSel->Picked (aPickIter));
}
- mySelection->SelectOwners (aPickedOwners, theSelScheme, myFilters);
-
- if (myAutoHilight)
- {
- HilightSelected (Standard_False);
- }
- Standard_Integer aSelNum = NbSelected();
-
- return (aSelNum == 0) ? AIS_SOP_NothingSelected
- : (aSelNum == 1) ? AIS_SOP_OneSelected
- : AIS_SOP_SeveralSelected;
-
+ return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
return getStatusOfPick (NbSelected());
}*/
- if (myAutoHilight)
- {
- clearDynamicHighlight();
- UnhilightSelected (Standard_False);
- }
-
AIS_NListOfEntityOwner aPickedOwners;
aPickedOwners.Append (myLastinMain);
- mySelection->SelectOwners (aPickedOwners, theSelScheme, myFilters);
- if (myAutoHilight)
- {
- HilightSelected (Standard_False);
- }
-
- Standard_Integer aSelNum = NbSelected();
-
- return (aSelNum == 0) ? AIS_SOP_NothingSelected
- : (aSelNum == 1) ? AIS_SOP_OneSelected
- : AIS_SOP_SeveralSelected;
+ return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
return Select (thePolyline, theView, AIS_SelectionScheme_Switch);
}
+//=======================================================================
+//function : Select
+//purpose :
+//=======================================================================
+AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_NListOfEntityOwner& theOwners,
+ const AIS_SelectionScheme theSelScheme)
+{
+ // all objects detected by the selector are taken, previous current objects are emptied,
+ // new objects are put...
+ if (myAutoHilight)
+ {
+ clearDynamicHighlight();
+ UnhilightSelected (Standard_False);
+ }
+ myWasLastMain = Standard_True;
+
+ mySelection->SelectOwners (theOwners, theSelScheme, myFilters);
+
+ if (myAutoHilight)
+ {
+ HilightSelected (Standard_False);
+ }
+
+ Standard_Integer aSelNum = NbSelected();
+
+ return (aSelNum == 0) ? AIS_SOP_NothingSelected
+ : (aSelNum == 1) ? AIS_SOP_OneSelected
+ : AIS_SOP_SeveralSelected;
+}
+
//=======================================================================
//function : HilightSelected
//purpose :
//! It is possible to use combination of schemes.
enum AIS_SelectionScheme
{
+ AIS_SelectionScheme_Empty = 0x0000, // do nothing
AIS_SelectionScheme_Clear = 0x0001, // clears current selection
AIS_SelectionScheme_Add = 0x0002, // add detected object to current selection
AIS_SelectionScheme_Switch = 0x0004, // switch selection state in values selected/deselected
AIS_SelectionScheme_PickedIfEmpty = 0x0008, // if after switch, result selection is empty, select picked objects
AIS_SelectionScheme_ClearAndSwitch = AIS_SelectionScheme_Clear | AIS_SelectionScheme_Switch,
- AIS_SelectionScheme_ClearAndAdd = AIS_SelectionScheme_Clear | AIS_SelectionScheme_Add
+ AIS_SelectionScheme_ClearAndAdd = AIS_SelectionScheme_Clear | AIS_SelectionScheme_Add,
+ AIS_SelectionScheme_ClearAndSwitchAndPicked = AIS_SelectionScheme_ClearAndSwitch | AIS_SelectionScheme_PickedIfEmpty,
+ AIS_SelectionScheme_Custom // reserved item for custom selection scheme
};
#endif // _AIS_SelectionScheme_HeaderFile