MantisBT - Community
View Issue Details
0024119Community[OCCT] OCCT:Visualizationpublic2013-08-21 03:482014-03-04 10:44
mach22 
mach22 
normalminor 
closedfixed 
WindowsVC++ 201264 bit
[OCCT] 6.6.0 
[OCCT] 6.7.0[OCCT] 6.7.0 
Not needed
0024119: Dynamic operations on the v3d view can not be simultaneously used with V3d_View::Eye(...) getter
-------------------------------------------------------------------------------
The description of the problem, reported by mach22
-------------------------------------------------------------------------------
I need to get the Eye position every time using the DynamicRotation change the position of the eye. but if I call the method
V3d_View::Eye(V3d_Coordinate &X, V3d_Coordinate &Y, V3d_Coordinate &Z) const
something change in the state of the view and when I activate the DynamicRotation the objects in the scene seem to change their position jumping from a frame to another.

-------------------------------------------------------------------------------
V3d view features interactive operations: Rotation, Panning, Zooming. To perform these operation, the one can call an appropriate method ("Rotation", "Panning", ...) passing a value of special "toStart" flag as TRUE. The method remembers initial state of view or mouse coordinates in a set of temporary variables. Then, the operation can be performed by calling the same method with new mouse cursor position, and "toStart" value equal to FALSE. Using the temporary data, the method derives difference of mouse cursor coordinates, or view state, and performs transformation, relative to the initial state of the view.

The problem is that, in general, these operations remember the initial state in form of static variables - the same ones, which are, for some reason, silently modified by logically independent getters, like Eye(...) or FocalReferencePoint(...).

Calling such methods, like Eye, during the interactive operation will lead to undefined behavior on the next step.
Using the samples provided with the latest release, running the Geometry project.
in the GeometryView.cpp file, in the OnMouseMove method I have added the call to the Eye method in the DynamicRotation section like this:

case CurAction3d_DynamicRotation :
  myView->Rotation(point.x,point.y);

  V3d_Coordinate x, y, z;
  myView->Eye(x,y,z);

  myView->Redraw();
break;
I have added the modified file for the sample
No tags attached.
related to 0024413closed abv Open CASCADE Visualization - get rid of projection shift from orthographic camera definition 
cpp GeometryView.cpp (15,051) 2013-08-21 03:48
https://tracker.dev.opencascade.org/
png dynamic_rotation_sample.png (69,578) 2014-02-17 19:07
https://tracker.dev.opencascade.org/
Issue History
2013-08-21 03:48mach22New Issue
2013-08-21 03:48mach22Assigned To => san
2013-08-21 03:48mach22File Added: GeometryView.cpp
2014-02-17 16:34kgvRelationship addedrelated to 0024413
2014-02-17 16:35kgvNote Added: 0027929
2014-02-17 16:35kgvAssigned Tosan => apl
2014-02-17 16:35kgvPriorityurgent => normal
2014-02-17 16:35kgvSeveritymajor => minor
2014-02-17 16:35kgvStatusnew => feedback
2014-02-17 18:07aplSummarycalling the method V3d_View::Eye(...) change the state of the view => Dynamic operations on the v3d view can not be simultaneously used with V3d_View::Eye(...) getter
2014-02-17 18:07aplDescription Updatedbug_revision_view_page.php?rev_id=6802#r6802
2014-02-17 19:07aplFile Added: dynamic_rotation_sample.png
2014-02-17 19:08aplAssigned Toapl => bugmaster
2014-02-17 19:12aplNote Added: 0027934
2014-02-17 19:13aplRelationship addedrelated to 0024001
2014-02-17 19:16aplDescription Updatedbug_revision_view_page.php?rev_id=6803#r6803
2014-02-17 19:22aplNote Edited: 0027934bug_revision_view_page.php?bugnote_id=27934#r6805
2014-02-27 18:07bugmasterNote Added: 0028056
2014-02-27 18:08bugmasterAssigned Tobugmaster => apn
2014-03-04 10:44apnNote Added: 0028113
2014-03-04 10:44apnAssigned Toapn => mach22
2014-03-04 10:44apnStatusfeedback => closed
2014-03-04 10:44apnResolutionopen => fixed
2014-03-04 10:44apnFixed in Version => 6.7.0
2014-03-04 10:44apnTarget Version => 6.7.0
2014-03-04 10:44apnTest case number => Not needed

Notes
(0027929)
kgv   
2014-02-17 16:35   
Dear apl,

could you please revise bug description?
(0027934)
apl   
2014-02-17 19:12   
(edited on: 2014-02-17 19:22)
Dear Bugmaster,

The problems with static variables in interactive operations on v3d view were fixed with implementation of camera approach #24001.

Could you please check, on current occt master, the MFC Geometry sample with modified "GeometryView.cpp" that the problem is not reproduced anymore? The source file can be found in attachments.

The dynamic rotation operation is shown on illustration.

Thank you!

(0028056)
bugmaster   
2014-02-27 18:07   
Dear APN,

Please check request of APL
(0028113)
apn   
2014-03-04 10:44   
Problem is not reproduced on current occt master with modified "GeometryView.cpp" on MFC Geometry sample.