DiscussionsIssue archiveOCCT:Visualization

Archived issue #0023120

Transform persistence is not restored

Open CASCADEOCCT:Visualizationclosed8 public notes

Search issues

Description

Method OpenGl_View::BeginTransformPersistence never restores previous myTransPers value on finishing of transformation applying (when "mode" is zero).

Now:
  if ( ATransPers->mode == 0 )
  {
    EndTransformPersistence();
    return TransPers_old;
  }

  myTransPers = ATransPers;

But must be:

  myTransPers = ATransPers;

  if ( ATransPers->mode == 0 )
  {
    EndTransformPersistence();
    return TransPers_old;
  }

Steps to reproduce

Method OpenGl_View::Render on visualization in OCC view with AIS trihedron (located constantly in left bottom corner of the view) calls "AWorkspace->DisplayCallback (ACView, (aMode | OCC_PRE_OVERLAY));"
on the "step 6" with transformation matrix that was used during the trihedron visualization. This matrix was not restored to the neutral one.

DRAW script:

box b1 10 20 30
box b2 10 20 30
ttranslate b2 50 50 0
vinit
vdisplay b1
# This line breaks normal rendering
# of all subsequently displayed presentations
vsettransmode b1 32 0 0 0 0 0
# This box is drawn incorrectly due to the bug
vdisplay b2
vfit
vsetdispmode 1
vzoom 0.5
vpan 100 0

Additional information

OpenGl_View::BeginTransformPersistence() method corrected to reset transform persistence parameters after a presentation with transform persistence enabled has been drawn. This ensures that other presentations are not affected by transform persistence logic.

Public activity

8 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Branch CR23120 is ready for reviewing.
02Commenter 1
Patch looks well. Please test it.
03Commenter 3
Dear BugMaster,
Workbench KAS:dev:mkv-23120-occt was created from git branch CR23120
(and mkv-23120-products from git master) and compiled on Linux and WNT platforms.

New test case for this fix is chl 934 M0. The snapshot Attachment 4 (GIF) for this test is KO. Attachment 3 (GIF) - snapshot of the test that created on products-20120518-opt. M0-etalon.gif - snapshot that should be as a reference.

There are not regressions in mkv-23120-products regarding to KAS:dev:products-20120512-opt
There are not improvements in mkv-23120-products regarding to KAS:dev:products-20120512-opt

See results in /QADisk/occttests/results/KAS/dev/mkv-23120-products_24052012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120512-opt_12052012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification


04Commenter 4
This problem requires additional debugging, the reason for transform persistence failure during offscreen scene dump is not clear.
05Commenter 5
On current version of master problem of transform persistence failure in offscreen scene wasn't reproduced. Updated Branch [archived branch] has been created with old patch.
Please, test it again to find out if this problem is reproduced on current version.
06Commenter 6
Dear bugmaster,

Please, re-test branch CR23120_1, we need to know if test case chl 934 M0 still produces wrong result or not.
07Commenter 7
Dear BugMaster,
Branch CR23120_1 (and master from occt GIT master) was compiled on Linux and Windows platforms and tested.

Regressions:
Not detected

Improvements:
Not detected

Testing cases:
chl 934 M0 - OK.
bugs vis(004) bug23120 - OK.

08Commenter 8
Test bugs vis bug23120 fails on IR-2012-11-23 (vc9 32-bit release on Win7 64-bit)