View Issue Details

IDProjectCategoryView StatusLast Update
0022683Open CASCADEOCCT:Visualizationpublic2012-03-29 17:26
ReporterrkvAssigned Tobugmaster  
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Target Version6.5.3Fixed in Version6.5.3 
Summary0022683: Incorrect result of Select3D_Projector::Project() in the case of perspective projection
DescriptionWe use OCC selection algorithms in VTK viewer. We have our implementation of
ViewerSelector which uses OCC Select3D_Projector. In the parallel projection
mode it's working correctly but in the case of perspective projection the
result is wrong. As well as we use VTK we don't set a view to the projector so
myView field of the projector is null and the difference between parallel and
perspective mode computations is the following:
      if (myPersp) {
    Standard_Real R = 1.-P2.Z()/myFocus;
    Pout.SetCoord(P2.X()/R,P2.Y()/R);
      }

The usage of the projector in our ViewerSelector is the same for both modes
except the focal distance in the case of perspective projection (see code
snippet in attached prj.cxx file).
See also:
ViewerSelector implementation in SVN:
http://svn.nnov.opencascade.com/svn/occt-products/trunk/samples/vtk/VIS/src/
IVtk/IVtk_ViewerSelector.cxx

Sample project for testing in SVN:
http://svn.nnov.opencascade.com/svn/occt-products/trunk/samples/vtk/importexport

VIS component project used by the sample project:
http://svn.nnov.opencascade.com/svn/occt-products/trunk/samples/vtk/VIS
Additional information
and documentation updates
Documentation remark by SAN:

Select3D_Projector class documentation and Visualization User's Guide were updated in order to make usage of the projector class easier. Few obsolete and unused methods were removed from this class in the frames of continuous code clean up activity.

Modified entities:

Select3D package
Select3D_Projector class
Removed methods:
- Directions()
- BoxAdd()
TagsNo tags attached.
Test case numbertest case is not required

Attached Files

  • prj.cxx (3,031 bytes)
  • visu_updated.doc (1,153,024 bytes)

Activities

2011-07-22 16:54

 

prj.cxx (3,031 bytes)

san

2011-08-09 11:39

developer   ~0017929

Last edited: 2011-12-26 16:12

Dear APL,

Please consider this issue in connection with OCCT perspective view first of all, to simplify testing.
Try to debug the projection algo and provide detailed documentation about it in Select3D_Projector.cdl, paying special attention on the meaning of the projector's parameters and how to set them.

Note that the level of documentation should potentially allow us to migrate the projector initialization code in StdSelect_ViewerSelector3d::UpdateProj() method to different implementation of perspective view based on cameras.

As the test case, we could try to use StdSelect_ViewerSelector3d::DisplayAreas() - it displays 2D projections of sensitive areas converting them back to 3D with help of the projector's inverse transformation...But a more reliable way would be to check 2D projections without converting them back to 3D (simulating picking? this is something to think about...)

As soon as you have corrected the projector class, please provide the patch to RKV to test it in VTK environment.

Best regards,
SAN

apl

2011-11-21 12:22

developer   ~0018592

Last edited: 2011-12-26 16:13

Dear SAN,

After a detailed study of principles and algorithm of Select3D_Projector, it seems that it is fully suitable for Vtk component without any modifications.

The undesired behavior of it is a result of very complex algorithm of preparing matrix transformation component for projector. There were some mistakes in interpretation of input parameters for building this matrix. All of them were resolved successfully without great changes to Vtk component and with no changes to Select3D_Project at all.

I suggest that we can limit solution to this bug only with good documentation update, with pointing on all important aspects of using Select3D_Projector.

SAN, what do you think about this?

san

2011-11-21 14:27

developer   ~0018594

Last edited: 2011-12-26 16:12

Dear APL,

I fully support your idea to provide detailed instructions how Select3D_Projector matrix should be set up in case of orthographic and perspective projection to ensure correct operation of projection logic. This should be a part of the class documentation, and matrix calculations can be illustrated in the Visualization User's Guide.

Best regards,
SAN

apl

2011-11-29 14:53

developer  

visu_updated.doc (1,153,024 bytes)

apl

2011-11-29 14:58

developer   ~0018654

Last edited: 2011-12-26 16:12

Dear SAN,

Could you please make a revision of updated .cdl documentation (in the branch)
and attached file "visu_updated.doc" and write all your remarks?

http://svn/svn/occt/branches/OCC22683

I think there might be too much information in updated visualization guide, so if you think that something can be thrown away, please comment.

Best regards,
APL

apl

2011-11-29 15:01

developer   ~0018655

The branch
http://svn/svn/occt/branches/OCC22683
is ready to be reviewed

san

2012-02-01 16:52

developer   ~0019334

Dear Anton,

I have removed some unused methods from Select3D_Projector class: SetDirection(), Directions() and BoxAdd(). Also I have changed slightly CDL documentation. Could you please review the updated branch http://svn/svn/occt/branches/OCC22683?

apl

2012-02-01 17:49

developer   ~0019337

Dear Sergey,

The modifications passed review without any remarks.

apl

2012-02-01 17:50

developer   ~0019338

Dear Bugmaster,

The branch
http://svn/svn/occt/branches/OCC22683 passed review without any remarks and ready to be tested

aan

2012-02-03 17:24

developer   ~0019390

Last edited: 2012-02-03 17:25

Dear BugMaster,
Workbench KAS:dev:aan-OCC22683-occt from SVN branch http://svn/svn/occt/branches/OCC22683
(and aan-OCC22683-products from trunk) was successfully compiled on Linux and Windows platforms, and tested on Linux and Windows platforms.

There are not regressions in aan-OCC22683-products regarding to KAS:dev:products-20120127-opt

See results in /QADisk/occttests/results/KAS/dev/aan-OCC22683-products_02022012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120127-opt_28012012/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

bugmaster

2012-02-10 13:48

administrator   ~0019502

Integrated into trunk of occt repository

Date: 2012-02-10 13:30:38 +0400 (Fri, 10 Feb 2012)
New Revision: 10403

Modified:
   trunk/src/Select3D/Select3D_Projector.cdl
   trunk/src/Select3D/Select3D_Projector.cxx
   trunk/src/Select3D/Select3D_Projector.lxx

Related Changesets

occt: master b0f0bd0c

2012-02-10 09:30:38

apl


Committer: bugmaster Details Diff
0022683: Incorrect result of Select3D_Projector::Project() in the case of perspective projection Affected Issues
0022683
mod - src/Select3D/Select3D_Projector.cdl Diff File
mod - src/Select3D/Select3D_Projector.cxx Diff File
mod - src/Select3D/Select3D_Projector.lxx Diff File

Issue History

Date Modified Username Field Change
2011-07-25 11:24 kgv CC => kgv
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2011-08-09 11:39 san Note Added: 0017929
2011-08-09 11:39 san Assigned To bugmaster => apl
2011-08-09 11:39 san Status new => assigned
2011-08-09 11:51 san Note Edited: 0017929
2011-11-21 12:22 apl Note Added: 0018592
2011-11-21 14:27 san Note Added: 0018594
2011-11-21 15:12 san Note Edited: 0018594
2011-11-29 14:53 apl File Added: visu_updated.doc
2011-11-29 14:58 apl Note Added: 0018654
2011-11-29 15:01 apl Note Added: 0018655
2011-11-29 15:01 apl Status assigned => resolved
2011-11-29 16:52 apl Assigned To apl => san
2011-12-26 16:11 atp Note Edited: 0017929
2011-12-26 16:11 atp Note Edited: 0018592
2011-12-26 16:12 atp Note Edited: 0018594
2011-12-26 16:12 atp Note Edited: 0018654
2011-12-26 16:12 atp Note Edited: 0018654
2011-12-26 16:12 atp Note Edited: 0017929
2011-12-26 16:12 atp Note Edited: 0018594
2011-12-26 16:13 atp Note Edited: 0018592
2012-02-01 16:52 san Note Added: 0019334
2012-02-01 16:52 san Assigned To san => apl
2012-02-01 17:12 san Fixed in Version EMPTY =>
2012-02-01 17:12 san Description Updated
2012-02-01 17:12 san Additional Information Updated
2012-02-01 17:49 apl Note Added: 0019337
2012-02-01 17:50 apl Note Added: 0019338
2012-02-01 17:50 apl Assigned To apl => bugmaster
2012-02-01 17:50 apl Status resolved => reviewed
2012-02-03 17:24 aan Note Added: 0019390
2012-02-03 17:25 aan Note Edited: 0019390
2012-02-03 17:25 aan Status reviewed => tested
2012-02-10 13:47 bugmaster Target Version => 6.5.3
2012-02-10 13:48 bugmaster Note Added: 0019502
2012-02-10 13:48 bugmaster Status tested => verified
2012-02-10 13:48 bugmaster Resolution open => fixed
2012-02-10 13:48 bugmaster Assigned To bugmaster => apl
2012-02-10 15:08 aan Test case number => test case is not required
2012-03-29 17:26 bugmaster Changeset attached => occt master b0f0bd0c