View Issue Details

IDProjectCategoryView StatusLast Update
0025672CommunityOCCT:Visualizationpublic2015-07-14 18:12
ReporterVico Liang Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Product Version6.8.0 
Target Version6.9.0Fixed in Version6.9.0 
Summary0025672: V3d_View::ConvertToGrid doesn't work for grid if the grid plane's origin is not identical to camera origin.
DescriptionThe implementation of ConvertToGrid has an assumption that the grid plane's origin is idential to the view plane's origin. Code snippet:

Graphic3d_Vertex V3d_View::Compute (const Graphic3d_Vertex & AVertex) const
{
  ...
  // project ray from camera onto grid plane
  if (!myCamera->IsOrthographic())
  {
    gp_Vec aPointFromCamera = gp_Vec (myCamera->Eye(), gp_Pnt (x1, y1, z1));
    aPointFromCamera.Normalize();

    Standard_Real aT = -gp_Vec(myCamera->Eye().XYZ()).Dot(aPlaneNormal) /
        aPointFromCamera.Dot(aPlaneNormal);
    //[VicoFix]Standard_Real aT = -gp_Vec(gp_Pnt(x0, y0, z0), myCamera->Eye()).Dot(aPlaneNormal) /aPointFromCamera.Dot(aPlaneNormal);
    aPointOnPlane = gp_Vec (myCamera->Eye().XYZ()) + aPointFromCamera * aT;
  } else
  {
    gp_Vec aPointFromCamera (myCamera->Direction());
    gp_Vec aPointOnCamera (gp_Vec (x1, y1, z1) - aPointFromCamera);

    Standard_Real aT = - aPointOnCamera.Dot (aPlaneNormal) /
                          aPointFromCamera.Dot (aPlaneNormal);
    aPointOnPlane = aPointOnCamera + aPointFromCamera * aT;

      //[VicoFix]
      //gp_Vec aCamDirection(myCamera->Direction());
      //gp_Vec aP0P1(gp_Pnt(x0, y0, z0), gp_Pnt(x1, y1, z1));
      //Standard_Real aT = -aP0P1.Dot(aPlaneNormal) / aCamDirection.Dot(aPlaneNormal);
      //aPointOnPlane = gp_Vec(x1, y1, z1) + aCamDirection * aT;
  }
Steps To Reproducebugs/vis/bug25672
TagsNo tags attached.
Test case numberbugs vis(004) bug25672

Relationships

related to 0025671 closedbugmaster Community Visualization - V3d_View::Convert() does not work as expected in GRID active mode 
related to 0026435 closedbugmaster Open CASCADE Visualization - V3d_View::ConvertToGrid returns wrong coordinates for non-orthogonal projection 

Activities

git

2015-04-14 18:31

administrator   ~0039708

Branch CR25672 has been created by apl.

SHA-1: 4c4edaae1c0256f226b784ce0154b70b8285d139


Detailed log of new commits:

Author: apl
Date: Tue Apr 14 18:31:17 2015 +0300

    0025672: V3d_View::ConvertToGrid doesn't work for grid if the grid plane's origin is not identical to camera origin.
    
    Patched V3d_View::ConverToGrid method to fix the problem
    Added test function "vprivilegedplane" for setting/printing grid plane's coordinate system
    Added test case bugs/vis/bug25672 to check the issue

apl

2015-04-14 18:35

developer   ~0039709

Dear Kirill,

Please review CR25672.

Note that it is based on CR25671 - it uses test command from the branch.

kgv

2015-04-14 19:03

developer   ~0039719

Please test the patch.

git

2015-04-15 12:23

administrator   ~0039765

Branch CR25672 has been updated by apl.

SHA-1: 89046b43ff9b73215233b5a56abfbf76be489218


Detailed log of new commits:

Author: apl
Date: Wed Apr 15 12:23:38 2015 +0300

    remarks from kgv

git

2015-04-16 12:07

administrator   ~0039835

Branch CR25672 has been updated by apv.

SHA-1: 9fe96b266589ff720af64807f2c703e080a48393


Detailed log of new commits:

Author: apv
Date: Thu Apr 16 12:07:34 2015 +0300

    Warnings eliminating (similar to CR25671)

apv

2015-04-16 12:31

tester   ~0039839

Dear BugMaster,

Branch CR25672 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 89046b43ff9b73215233b5a56abfbf76be489218

Number of compiler warnings:
occt component:
   Linux: 20 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 4 (4 on master)
   Windows: 0 (0 on master)
There are new additional warnings on Linux:
1. ViewerTest_ViewerCommands.cxx:5063, GNU C Compiler 4 (gcc), Priority: Normal
suggest parentheses around ‘&&’ within ‘||’
2. ViewerTest_ViewerCommands.cxx:5064, GNU C Compiler 4 (gcc), Priority: Normal
suggest parentheses around ‘&&’ within ‘||’
Warnings are fixed (SHA-1: 9fe96b266589ff720af64807f2c703e080a48393)

Regressions/Differences:
Not detected

Testing cases:
bugs vis(004) bug25672 - OK
http://occt-tests/CR25672-master-occt-64/Debian60-64/bugs/vis/bug25672.html
http://occt-tests/CR25672-master-occt-64/Windows-64-VC10/bugs/vis/bug25672.html

Testing on Linux:
Total MEMORY difference: 94463070 / 94302039 [+0.17%]
Total CPU difference: 52368.49999999927 / 56192.9299999997 [-6.81%]

Testing on Windows:
Total MEMORY difference: 57130269 / 57127464 [+0.00%]
Total CPU difference: 16340.948748999035 / 15976.530412998898 [+2.28%]

git

2015-05-14 16:28

administrator   ~0040983

Branch CR25672 has been deleted by inv.

SHA-1: 9fe96b266589ff720af64807f2c703e080a48393

Related Changesets

occt: master c40b7d58

2015-04-16 09:41:21

apl


Committer: bugmaster Details Diff
0025672: V3d_View::ConvertToGrid doesn't work for grid if the grid plane's origin is not identical to camera origin.

Patched V3d_View::ConverToGrid method to fix the problem
Added test function "vprivilegedplane" for setting/printing grid plane's coordinate system
Added test case bugs/vis/bug25672 to check the issue
remarks from kgv
Warnings eliminating (similar to CR25671)
Affected Issues
0025672
mod - src/V3d/V3d_View_4.cxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
add - tests/bugs/vis/bug25672 Diff File

Issue History

Date Modified Username Field Change
2014-12-28 06:04 Vico Liang New Issue
2014-12-28 06:04 Vico Liang Assigned To => kgv
2015-04-10 09:20 kgv Assigned To kgv => apl
2015-04-10 09:20 kgv Status new => assigned
2015-04-10 09:29 kgv Relationship added related to 0025671
2015-04-14 18:31 git Note Added: 0039708
2015-04-14 18:35 apl Note Added: 0039709
2015-04-14 18:35 apl Assigned To apl => kgv
2015-04-14 18:35 apl Status assigned => resolved
2015-04-14 18:35 apl Steps to Reproduce Updated
2015-04-14 19:03 kgv Note Added: 0039719
2015-04-14 19:03 kgv Assigned To kgv => bugmaster
2015-04-14 19:03 kgv Status resolved => reviewed
2015-04-15 12:23 git Note Added: 0039765
2015-04-15 17:21 apv Assigned To bugmaster => apv
2015-04-16 12:07 git Note Added: 0039835
2015-04-16 12:31 apv Note Added: 0039839
2015-04-16 12:31 apv Assigned To apv => bugmaster
2015-04-16 12:31 apv Status reviewed => tested
2015-04-16 12:32 apv Test case number => bugs vis(004) bug25672
2015-04-17 15:40 bugmaster Changeset attached => occt master c40b7d58
2015-04-17 15:40 bugmaster Status tested => verified
2015-04-17 15:40 bugmaster Resolution open => fixed
2015-05-14 15:28 aiv Status verified => closed
2015-05-14 15:31 aiv Fixed in Version => 6.9.0
2015-05-14 16:28 git Note Added: 0040983
2015-07-14 18:12 kgv Relationship added related to 0026435