mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0023234: Incorrect behavior of AIS_Trihedron
AIS_InteractiveContext::myLocalContexts map accessed before newly created AIS_LocalContext bound to it Minor remarks: comments revised. Adding test case Adding new draw command Small correction of tests
This commit is contained in:
parent
2478cd9d9f
commit
64e2d3bd71
@ -77,14 +77,16 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
|
|||||||
UseDisplayedObjects,
|
UseDisplayedObjects,
|
||||||
AllowShapeDecomposition,
|
AllowShapeDecomposition,
|
||||||
AcceptEraseOfTemporary);
|
AcceptEraseOfTemporary);
|
||||||
NewLocal->MainSelector()->Set ((myLocalContexts.Extent() > 0)
|
// the AIS_LocalContext bind itself to myLocalContexts
|
||||||
|
// because procedures performed in AIS_LocalContext constructor
|
||||||
|
// already may access myLocalContexts(myCurLocalIndex) (like methods AIS_LocalContext::IsSelected()).
|
||||||
|
//myLocalContexts.Bind (myCurLocalIndex, NewLocal);
|
||||||
|
NewLocal->MainSelector()->Set ((myLocalContexts.Extent() > 1)
|
||||||
? myLocalContexts (untilnow)->MainSelector()->Projector()
|
? myLocalContexts (untilnow)->MainSelector()->Projector()
|
||||||
: myMainSel->Projector());
|
: myMainSel->Projector());
|
||||||
|
|
||||||
NewLocal->MainSelector()->UpdateConversion();
|
NewLocal->MainSelector()->UpdateConversion();
|
||||||
|
|
||||||
myLocalContexts.Bind(myCurLocalIndex,NewLocal);
|
|
||||||
|
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
cout<<"\tOpen Local Context No "<<myCurLocalIndex<<endl;
|
cout<<"\tOpen Local Context No "<<myCurLocalIndex<<endl;
|
||||||
if(UseDisplayedObjects){
|
if(UseDisplayedObjects){
|
||||||
|
@ -119,6 +119,11 @@ myCurDetected(0)
|
|||||||
,myAISCurDetected(0)
|
,myAISCurDetected(0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
// bind self to AIS_InteractiveContext::myLocalContexts. Further, the
|
||||||
|
// constructor executes logic that implies that the context is already
|
||||||
|
// created and mapped.
|
||||||
|
aCtx->myLocalContexts.Bind (Index, this);
|
||||||
|
|
||||||
myMainPM = aCtx->MainPrsMgr();
|
myMainPM = aCtx->MainPrsMgr();
|
||||||
mySelName = AIS_Local_SelName(this, Index);
|
mySelName = AIS_Local_SelName(this, Index);
|
||||||
AIS_Selection::CreateSelection(mySelName.ToCString());
|
AIS_Selection::CreateSelection(mySelName.ToCString());
|
||||||
|
@ -5403,6 +5403,59 @@ Standard_Integer CR23403 (Draw_Interpretor& di, Standard_Integer argc, const cha
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <Quantity_NameOfColor.hxx>
|
||||||
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
|
Standard_Integer CR23234 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||||
|
{
|
||||||
|
// Check the command arguments
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
di <<"Error: "<<argv[0]<<" - invalid number of arguments"<< "\n";
|
||||||
|
di << "Usage : " << argv[0] << " mode(0/1)\n";
|
||||||
|
return 1; //TCL_ERROR
|
||||||
|
}
|
||||||
|
|
||||||
|
const Standard_Integer aMode = atoi(argv[1]);
|
||||||
|
|
||||||
|
//===================================================================
|
||||||
|
|
||||||
|
Handle(AIS_InteractiveContext) aisContext = ViewerTest::GetAISContext();
|
||||||
|
if (aisContext.IsNull())
|
||||||
|
{
|
||||||
|
di <<"Error: call 'vinit' first"<< "\n";
|
||||||
|
return 1; //TCL_ERROR
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aisContext->HasOpenedContext())
|
||||||
|
{
|
||||||
|
aisContext->CloseAllContexts();
|
||||||
|
aisContext->RemoveAll(false);
|
||||||
|
aisContext->EraseSelected(false, false);
|
||||||
|
}
|
||||||
|
aisContext->EraseAll(false,false);
|
||||||
|
Handle(Geom_Axis2Placement) trihedronAxis = new Geom_Axis2Placement(gp::XOY());
|
||||||
|
Handle(AIS_Trihedron) trihedron = new AIS_Trihedron(trihedronAxis);
|
||||||
|
if (aMode)
|
||||||
|
trihedron->UnsetSelectionMode(); // this line causes an exception on OpenLocalContext
|
||||||
|
trihedron->SetSize(20);
|
||||||
|
trihedron->SetColor(Quantity_NOC_GRAY30);
|
||||||
|
trihedron->SetArrowColor(Quantity_NOC_GRAY30);
|
||||||
|
trihedron->SetTextColor(Quantity_NOC_DARKSLATEBLUE);
|
||||||
|
|
||||||
|
//trihedron->SetColor(Quantity_NameOfColor::Quantity_NOC_GRAY30);
|
||||||
|
//trihedron->SetArrowColor(Quantity_NameOfColor::Quantity_NOC_GRAY30);
|
||||||
|
//trihedron->SetTextColor(Quantity_NameOfColor::Quantity_NOC_DARKSLATEBLUE);
|
||||||
|
|
||||||
|
|
||||||
|
aisContext->Display(trihedron, true);
|
||||||
|
aisContext->OpenLocalContext();
|
||||||
|
//aisContext->ActivateStandardMode(TopAbs_ShapeEnum::TopAbs_EDGE);
|
||||||
|
aisContext->ActivateStandardMode(TopAbs_EDGE);
|
||||||
|
aisContext->SetSensitivity(8);
|
||||||
|
|
||||||
|
return 0; //TCL_OK
|
||||||
|
}
|
||||||
|
|
||||||
void QABugs::Commands_11(Draw_Interpretor& theCommands) {
|
void QABugs::Commands_11(Draw_Interpretor& theCommands) {
|
||||||
const char *group = "QABugs";
|
const char *group = "QABugs";
|
||||||
|
|
||||||
@ -5514,5 +5567,6 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add("OCC22558", "OCC22558 x_vec y_vec z_vec x_dir y_dir z_dit x_pnt y_pnt z_pnt", __FILE__, OCC22558, group);
|
theCommands.Add("OCC22558", "OCC22558 x_vec y_vec z_vec x_dir y_dir z_dit x_pnt y_pnt z_pnt", __FILE__, OCC22558, group);
|
||||||
theCommands.Add("CR23403", "CR23403 string", __FILE__, CR23403, group);
|
theCommands.Add("CR23403", "CR23403 string", __FILE__, CR23403, group);
|
||||||
theCommands.Add("OCC23429", "OCC23429 res shape tool [appr]", __FILE__, OCC23429, group);
|
theCommands.Add("OCC23429", "OCC23429 res shape tool [appr]", __FILE__, OCC23429, group);
|
||||||
|
theCommands.Add("CR23234", "CR23234 mode(0/1)", __FILE__, CR23234, group);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,12 @@ if { [isdraw result] } {
|
|||||||
vfit
|
vfit
|
||||||
vdump $imagedir/${test_image}.gif
|
vdump $imagedir/${test_image}.gif
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if { [info exists 3dviewer] } {
|
||||||
|
if { ${3dviewer} == 2 } {
|
||||||
|
vdump $imagedir/${test_image}.gif
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if { [info exist only_xwd] } {
|
if { [info exist only_xwd] } {
|
||||||
xwd $imagedir/${test_image}.gif
|
xwd $imagedir/${test_image}.gif
|
||||||
|
@ -31,10 +31,4 @@ if { $rd != $r_check || $gr != $g_check || $bl != $b_check } {
|
|||||||
puts "Error : Boundary of face is not changed"
|
puts "Error : Boundary of face is not changed"
|
||||||
}
|
}
|
||||||
|
|
||||||
set 3dviewer 1
|
set 3dviewer 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,9 +31,4 @@ if { $rd != $r_check || $gr != $g_check || $bl != $b_check } {
|
|||||||
puts "Error : Boundary of face is not changed"
|
puts "Error : Boundary of face is not changed"
|
||||||
}
|
}
|
||||||
|
|
||||||
set 3dviewer 1
|
set 3dviewer 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user