View Issue Details

IDProjectCategoryView StatusLast Update
0020842Open CASCADEOCCT:Visualizationpublic2015-09-07 11:52
ReportersanAssigned Tobugmaster  
PrioritylowSeveritytrivial 
Status closedResolutionwon't fix 
OSAll 
Fixed in Version7.0.0 
Summary0020842: Visualization, 2D layer - strange logic of defining viewport geometry
DescriptionReported by R.Lygin on 20.01.2009

In Visual3d_Layer, when defining a non-square viewport with width != height,
object coordinates are mapped incorrectly to the screen ones, unless
a "synthetic" square viewport is specified:

aDim = Max(aWidth, aHeight);
aLayer->SetViewPort(aDim, aDim);

This is due to strange code in call_togl_redraw_layer2d () function in OpenGl
package:

      if (alayer->sizeDependent == 0)
            ratio = (float) dispWidth/dispHeight;
      else
            ratio = aview->DefWindow.dx/aview->DefWindow.dy;

      if (ratio >= 1.0) { /* fenetre horizontale */
            delta = (float )((top - bottom)/2.0);
            switch (attach) {
                  case 0: /* Aspect_TOC_BOTTOM_LEFT */
                        top = bottom + 2*delta/ratio;

Expected behavior is that after

myOverLayer->SetViewPort (aWidth, aHegth);
myOverLayer->SetOrtho (0, aWidth, aHegth, 0, Aspect_TOC_TOP_LEFT);

object coordinates will be mapped "as is" to the screen (pixel) ones.

After correction of this problem, it is necessary to revise also
V3d_LayerMgr::Begin() method that currently always sets a square viewport.
TagsNo tags attached.
Test case number

Relationships

related to 0025789 closedbugmaster Visualization - get rid of obsolete 2d layers implementation 

Activities

kgv

2015-09-04 13:10

developer   ~0045056

Last edited: 2015-09-04 13:12

Dear bugmaster,

please close the issue as related functionality has been removed within 0025789.

Issue History

Date Modified Username Field Change
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2014-02-05 15:18 kgv Priority normal => low
2014-02-05 15:18 kgv Fixed in Version EMPTY =>
2014-02-05 15:18 kgv Summary 2D layer: Strange logic of defining viewport geometry => Visualization, 2D layer - strange logic of defining viewport geometry
2014-02-05 15:18 kgv Description Updated
2015-06-29 12:19 kgv Relationship added related to 0025789
2015-08-25 09:42 kgv Resolution open => won't fix
2015-08-25 09:42 kgv Target Version => 7.0.0
2015-09-04 13:10 kgv Note Added: 0045056
2015-09-04 13:10 kgv Status new => feedback
2015-09-04 13:10 kgv Fixed in Version => 7.0.0
2015-09-04 13:10 kgv Target Version 7.0.0 =>
2015-09-04 13:12 kgv Note Edited: 0045056
2015-09-07 11:52 bugmaster Status feedback => closed