//! for AutoHighlight, e.g. is used for selection.
Standard_EXPORT void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner);
- //! Helper function that highlights the owners with check
- //! for AutoHighlight, e.g. is used for selection.
- Standard_EXPORT void highlightOwners (const AIS_NListOfEntityOwner& theOwners);
+ //! Helper function that highlights the owners with check for AutoHighlight, e.g. is used for selection.
+ //! @param theOwners [in] list of owners to highlight
+ //! @param theStyle [in] highlight style to apply or NULL to apply selection style
+ Standard_EXPORT void highlightOwners (const AIS_NListOfEntityOwner& theOwners,
+ const Handle(Prs3d_Drawer)& theStyle);
//! Helper function that highlights global owner of the object given with <theStyle> with check
//! for AutoHighlight, e.g. is used for selection.
{
anOwners.Append (theOwner);
}
- highlightOwners (anOwners);
+ highlightOwners (anOwners, Handle(Prs3d_Drawer)());
}
//=======================================================================
{
anOwners.Append (aGlobOwner);
}
- highlightOwners (anOwners);
+ highlightOwners (anOwners, theStyle);
}
//=======================================================================
// In case of selection without using local context
clearDynamicHighlight();
- highlightOwners (mySelection->Objects());
+ highlightOwners (mySelection->Objects(), Handle(Prs3d_Drawer)());
if (theToUpdateViewer)
UpdateCurrentViewer();
//function : highlightOwners
//purpose :
//=======================================================================
-void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theOwners)
+void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theOwners,
+ const Handle(Prs3d_Drawer)& theStyle)
{
AIS_MapOfObjSelectedOwners anObjOwnerMap;
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
if (anObj.IsNull())
continue;
- const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
+ const Handle(Prs3d_Drawer)& anObjSelStyle = !theStyle.IsNull() ? theStyle : getSelStyle (anObj, anOwner);
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
{
return 0;
}
- // Remove as bad version of QAAddOrRemoveSelected from QADraw
-//static Standard_Integer OCC129 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-//{
-// if( argc != 3) {
-// di<<"Usage : " << argv[0] << " shape islocal\n";
-// return 1;
-// }
-// //get AIS_Shape:
-// Handle(AIS_InteractiveContext) anAISCtx = ViewerTest::GetAISContext();
-//
-// // ViewerTest_DoubleMapOfInteractiveAndName& aMap =
-// // ViewerTest::GetDataMapOfAIS ();
-// ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
-//
-// TCollection_AsciiString aName(argv[1]);
-// Handle(AIS_InteractiveObject) AISObj;
-//
-// if(aMap.IsBound2(aName)) {
-// AISObj = aMap.Find2(aName);
-// if(AISObj.IsNull()){
-// di<<"No interactive object \n";
-// return 1;
-// }
-//
-// Standard_Integer aNum = -1;
-//
-// if(Draw::Atoi(argv[2])) {
-// aNum = anAISCtx->OpenLocalContext();
-// }
-//
-// if(anAISCtx->HasOpenedContext()){
-// anAISCtx->InitSelected();
-// anAISCtx->AddOrRemoveSelected(AISObj);
-// }
-// else {
-// anAISCtx->InitCurrent();
-// anAISCtx->AddOrRemoveCurrentObject(AISObj);
-// }
-//
-// if(aNum >= 0) {
-// // anAISCtx->CloseLocalContext(aNum);
-// }
-//
-// return 0;
-// }
-// //select this shape:
-// else {
-// di<<"Use 'vdisplay' before";
-// return 1;
-// }
-//}
-
static Standard_Integer OCC136 (Draw_Interpretor& di, Standard_Integer argc, const char ** /*argv*/)
{
if(argc > 1){
return 0;
}
+// Test AIS_InteractiveContext::Hilight() call.
+static Standard_Integer OCC31965 (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
+{
+ if (theArgNb != 2)
+ {
+ theDI << "Syntax error: wrong number of arguments";
+ return 1;
+ }
+
+ Handle(AIS_InteractiveObject) aPrs = GetMapOfAIS().Find2 (theArgVec[1]);
+ ViewerTest::GetAISContext()->HilightWithColor (aPrs, ViewerTest::GetAISContext()->HighlightStyle (Prs3d_TypeOfHighlight_Dynamic), true);
+ return 0;
+}
+
static Standard_Integer OCC11457 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
if ((argc < 9) || (((argc-3) % 3) != 0))
theCommands.Add("OCC31189", "OCC31189: check stream buffer interface of Message_Messenger", __FILE__, OCC31189, group);
theCommands.Add("OCC25748", "OCC25748 [-niter val] [-matsize val] [-progr] [-parallel]\n"
"\t\ttest progress indicator in parallel execution", __FILE__, OCC25748, group);
+
+ theCommands.Add("OCC31965", "OCC31965 object : tests AIS_InteractiveContext::Hilight()", __FILE__, OCC31965, group);
return;
}