MantisBT - Open CASCADE
View Issue Details
0029470Open CASCADE[OCCT] OCCT:Samplespublic2018-02-01 20:222018-06-29 21:21
kgv 
bugmaster 
normalminor 
closedfixed 
[OCCT] 7.2.0 
[OCCT] 7.3.0[OCCT] 7.3.0 
Not needed
0029470: Samples - eliminate references to deprecated Local Context from MFC sample
The code of MFC sample samples/mfc/standard/04_Viewer3d/src/Viewer3dDoc.cpp does not use deprecated Local Context functionality, but still refers to it in text descriptions:
//Set faces selection mode
void CViewer3dDoc::OnFaces() 
{
  myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_FACE));

  myCResultDialog.SetTitle("Standard mode: TopAbs_FACE");
  myCResultDialog.SetText("  myAISContext->OpenLocalContext(); \n"
                                    "  \n"
                                    "  myAISContext->ActivateStandardMode(TopAbs_FACE); \n"
                                    
"  \n");
  SetTitle (L"Standard mode: TopAbs_FACE");
}

//Set edges selection mode
void CViewer3dDoc::OnEdges() 
{
  myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));

  myCResultDialog.SetTitle("Standard mode: TopAbs_EDGE");
  myCResultDialog.SetText("  myAISContext->OpenLocalContext(); \n"
                                    "  \n"
                                    "  myAISContext->ActivateStandardMode(TopAbs_EDGE); \n"
                                    
"  \n");
  SetTitle (L"Standard mode: TopAbs_EDGE");
}

// Set vertices selection mode
void CViewer3dDoc::OnVertices() 
{
  myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX));

  myCResultDialog.SetTitle("Standard mode: TopAbs_VERTEX");
  myCResultDialog.SetText("  myAISContext->OpenLocalContext(); \n"
                                    "  \n"
                                    "  myAISContext->ActivateStandardMode(TopAbs_VERTEX); \n"
                                    
"  \n");
  SetTitle (L"Standard mode: TopAbs_VERTEX");
}

//Neutral selection mode
void CViewer3dDoc::OnNeutral() 
{
  myCResultDialog.SetTitle("Standard mode: Neutral");
  myCResultDialog.SetText("  myAISContext->CloseAllContexts(); \n"
                                    "  \n");
  SetTitle (L"Standard mode: Neutral");
}


Also, CViewer3dDoc::OnNeutral() should be updated to propose a code for switching back to default selection mode.
No tags attached.
related to 0025467verified kgv Visualization - Possibility to remove AIS_LocalContext class 
Issue History
2018-02-01 20:22kgvNew Issue
2018-02-01 20:22kgvAssigned To => kgv
2018-02-27 11:30abvRelationship addedrelated to 0025467
2018-03-11 13:21gitNote Added: 0074371
2018-03-11 13:21kgvNote Added: 0074372
2018-03-11 13:21kgvAssigned Tokgv => san
2018-03-11 13:21kgvStatusnew => resolved
2018-03-11 14:39gitNote Added: 0074373
2018-03-11 17:14kgvNote Edited: 0074372bug_revision_view_page.php?bugnote_id=74372#r18697
2018-03-13 11:15gitNote Added: 0074415
2018-03-13 12:03gitNote Added: 0074424
2018-03-13 20:11sanNote Added: 0074452
2018-03-13 20:11sanAssigned Tosan => bugmaster
2018-03-13 20:11sanStatusresolved => reviewed
2018-03-14 16:04bugmasterTest case number => Not needed
2018-03-14 16:08bugmasterNote Added: 0074476
2018-03-14 16:08bugmasterStatusreviewed => tested
2018-03-18 13:21bugmasterChangeset attached => occt master 8c088c52
2018-03-18 13:21bugmasterStatustested => verified
2018-03-18 13:21bugmasterResolutionopen => fixed
2018-03-19 10:05gitNote Added: 0074606
2018-03-19 10:05gitNote Added: 0074607
2018-06-29 21:16aivFixed in Version => 7.3.0
2018-06-29 21:21aivStatusverified => closed

Notes
(0074371)
git   
2018-03-11 13:21   
Branch CR29470 has been created by kgv.

SHA-1: 87943d01db010e7f9d36a73eed8c9cc70f646538


Detailed log of new commits:

Author: kgv
Date: Sun Mar 11 13:21:01 2018 +0300

    0029470: Samples - eliminate references to deprecated Local Context from MFC sample
(0074372)
kgv   
2018-03-11 13:21   
(edited on: 2018-03-11 17:14)
Patch is ready for review.

http://jenkins-test-10.nnov.opencascade.com/view/CR29470_1-master-KGV/ [^]

(0074373)
git   
2018-03-11 14:39   
Branch CR29470_1 has been created by kgv.

SHA-1: 3ee60ec84106ee282c9504d7752a4915641eaf7e


Detailed log of new commits:

Author: kgv
Date: Sun Mar 11 13:21:01 2018 +0300

    0029470: Samples - eliminate references to deprecated Local Context from MFC sample
    
    AIS_InteractiveContext::MoveTo(), ::Select(), ::ShiftSelect() now throw
    an exception on invalid V3d_View argument instead of returning empty results.
    AIS_InteractiveContext::DetectedShape() and ::BeginImmediateDraw() now can
    be called without opened Local Context.
    
    Draw Harness - removed unused commands vsetam, vunsetam.
    Removed unused methods ViewerTest::StandardModeActivation(), ::PickObject(), PickObjects().
    Interactive input of Selection modes 0..7 now redirects to vselmode
    instead of removed ViewerTest::StandardModeActivation().
(0074415)
git   
2018-03-13 11:15   
Branch CR29470_1 has been updated forcibly by kgv.

SHA-1: bc57cf17f6cdaaa738e452f83851bf45a3e038eb
(0074424)
git   
2018-03-13 12:03   
Branch CR29470_1 has been updated forcibly by kgv.

SHA-1: c73673a1698ffba5bb7e2499e26e0b95d1e09f91
(0074452)
san   
2018-03-13 20:11   
Branch CR29470_1 reviewed without remarks, ready for testing.
(0074476)
bugmaster   
2018-03-14 16:08   
Combination -
OCCT branch : CR29470_1 SHA - 3ee60ec84106ee282c9504d7752a4915641eaf7e
Products branch : master SHA - 4fd289ec73d35d02f23f3990c73b3acac9a60574
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18313.85999999964 / 18338.37999999957 [-0.13%]
Products
Total CPU difference: 7474.19000000002 / 7461.340000000009 [+0.17%]
Windows-64-VC10:
OCCT
Total CPU difference: 17663.618827598657 / 17653.338361698563 [+0.06%]
Products
Total CPU difference: 8037.155919899966 / 7990.761222500007 [+0.58%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0074606)
git   
2018-03-19 10:05   
Branch CR29470 has been deleted by kgv.

SHA-1: 87943d01db010e7f9d36a73eed8c9cc70f646538
(0074607)
git   
2018-03-19 10:05   
Branch CR29470_1 has been deleted by kgv.

SHA-1: c73673a1698ffba5bb7e2499e26e0b95d1e09f91