mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0031965: Visualization - AIS_InteractiveContext::HilightWithColor() ignores passed highlight style
AIS_InteractiveContext::highlightGlobal() now passed through Style argument to highlightOwners(). Added OCC31965 command for testing AIS_InteractiveContext::Hilight() behavior.
This commit is contained in:
parent
a110c4a377
commit
4268c64672
@ -1211,9 +1211,11 @@ protected: //! @name internal methods
|
|||||||
//! for AutoHighlight, e.g. is used for selection.
|
//! for AutoHighlight, e.g. is used for selection.
|
||||||
Standard_EXPORT void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner);
|
Standard_EXPORT void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner);
|
||||||
|
|
||||||
//! Helper function that highlights the owners with check
|
//! Helper function that highlights the owners with check for AutoHighlight, e.g. is used for selection.
|
||||||
//! for AutoHighlight, e.g. is used for selection.
|
//! @param theOwners [in] list of owners to highlight
|
||||||
Standard_EXPORT void highlightOwners (const AIS_NListOfEntityOwner& theOwners);
|
//! @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
|
//! Helper function that highlights global owner of the object given with <theStyle> with check
|
||||||
//! for AutoHighlight, e.g. is used for selection.
|
//! for AutoHighlight, e.g. is used for selection.
|
||||||
|
@ -107,7 +107,7 @@ void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwn
|
|||||||
{
|
{
|
||||||
anOwners.Append (theOwner);
|
anOwners.Append (theOwner);
|
||||||
}
|
}
|
||||||
highlightOwners (anOwners);
|
highlightOwners (anOwners, Handle(Prs3d_Drawer)());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -148,7 +148,7 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
|
|||||||
{
|
{
|
||||||
anOwners.Append (aGlobOwner);
|
anOwners.Append (aGlobOwner);
|
||||||
}
|
}
|
||||||
highlightOwners (anOwners);
|
highlightOwners (anOwners, theStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -725,7 +725,7 @@ void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdate
|
|||||||
// In case of selection without using local context
|
// In case of selection without using local context
|
||||||
clearDynamicHighlight();
|
clearDynamicHighlight();
|
||||||
|
|
||||||
highlightOwners (mySelection->Objects());
|
highlightOwners (mySelection->Objects(), Handle(Prs3d_Drawer)());
|
||||||
|
|
||||||
if (theToUpdateViewer)
|
if (theToUpdateViewer)
|
||||||
UpdateCurrentViewer();
|
UpdateCurrentViewer();
|
||||||
@ -735,7 +735,8 @@ void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdate
|
|||||||
//function : highlightOwners
|
//function : highlightOwners
|
||||||
//purpose :
|
//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;
|
AIS_MapOfObjSelectedOwners anObjOwnerMap;
|
||||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
|
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
|
||||||
@ -745,7 +746,7 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
|
|||||||
if (anObj.IsNull())
|
if (anObj.IsNull())
|
||||||
continue;
|
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);
|
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
|
||||||
if (!aStatusPtr)
|
if (!aStatusPtr)
|
||||||
{
|
{
|
||||||
|
@ -139,58 +139,6 @@ static Standard_Integer OCC128 (Draw_Interpretor& di, Standard_Integer /*argc*/
|
|||||||
return 0;
|
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*/)
|
static Standard_Integer OCC136 (Draw_Interpretor& di, Standard_Integer argc, const char ** /*argv*/)
|
||||||
{
|
{
|
||||||
if(argc > 1){
|
if(argc > 1){
|
||||||
@ -3019,6 +2967,20 @@ static Standard_Integer OCC7068 (Draw_Interpretor& di, Standard_Integer argc, co
|
|||||||
return 0;
|
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)
|
static Standard_Integer OCC11457 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||||
{
|
{
|
||||||
if ((argc < 9) || (((argc-3) % 3) != 0))
|
if ((argc < 9) || (((argc-3) % 3) != 0))
|
||||||
@ -5014,5 +4976,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add("OCC31189", "OCC31189: check stream buffer interface of Message_Messenger", __FILE__, OCC31189, group);
|
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"
|
theCommands.Add("OCC25748", "OCC25748 [-niter val] [-matsize val] [-progr] [-parallel]\n"
|
||||||
"\t\ttest progress indicator in parallel execution", __FILE__, OCC25748, group);
|
"\t\ttest progress indicator in parallel execution", __FILE__, OCC25748, group);
|
||||||
|
|
||||||
|
theCommands.Add("OCC31965", "OCC31965 object : tests AIS_InteractiveContext::Hilight()", __FILE__, OCC31965, group);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
14
tests/bugs/vis/bug31965
Normal file
14
tests/bugs/vis/bug31965
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0031965: Visualization - AIS_InteractiveContext::HilightWithColor() ignores passed highlight style"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION QAcommands
|
||||||
|
box b 1 2 3
|
||||||
|
vdisplay -dispMode 1 b
|
||||||
|
vfit
|
||||||
|
vselprops dynHighlight -dispMode 1 -color RED
|
||||||
|
OCC31965 b
|
||||||
|
|
||||||
|
if { [vreadpixel 200 200 -rgb -name] != "RED2" } { puts "Error: wrong highlight color" }
|
||||||
|
vdump ${imagedir}/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user