MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0025672Community[OCCT] OCCT:Visualizationpublic2014-12-28 06:042015-07-14 18:12
ReporterVico Liang 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformWindowsOSVC++ 2013OS Version64 bit
Product Version[OCCT] 6.8.0 
Target Version[OCCT] 6.9.0Fixed in Version[OCCT] 6.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
Attached Files

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

-  Notes
(0039708)
git (administrator)
2015-04-14 18:31

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
(0039709)
apl (developer)
2015-04-14 18:35

Dear Kirill,

Please review CR25672.

Note that it is based on CR25671 - it uses test command from the branch.
(0039719)
kgv (developer)
2015-04-14 19:03

Please test the patch.
(0039765)
git (administrator)
2015-04-15 12:23

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

(0039835)
git (administrator)
2015-04-16 12:07

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)

(0039839)
apv (tester)
2015-04-16 12:31

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%]
(0040983)
git (administrator)
2015-05-14 16:28

Branch CR25672 has been deleted by inv.

SHA-1: 9fe96b266589ff720af64807f2c703e080a48393

- Related Changesets
occt: master c40b7d58
Timestamp: 2015-04-16 09:41:21
Author: 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)
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 View Revisions
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 user533 Status verified => closed
2015-05-14 15:31 user533 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


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker