View Issue Details

IDProjectCategoryView StatusLast Update
0033514Open CASCADEOCCT:Visualizationpublic2024-01-23 12:45
Reporterdrochalo Assigned Tomzernova  
PrioritynormalSeverityminor 
Status resolvedResolutionopen 
PlatformWindowsOSVC++ 2022 
Product Version7.7.0 
Target Version7.8.0 
Summary0033514: Visualization - Scaled view twists zoom persistence objects
DescriptionObjects like manipulators with zoom persistence need to maintain its visual aspects for proper usage in a scene.
The application of a visual scale is twisting its effects (see figure zoom_scaled.png). A similar effect was observed in issue https://tracker.dev.opencascade.org/view.php?id=27832.

The proposal is to adjust the zoom persistent object scale according to the view's axial scale.
Steps To Reproducepload ALL
vinit
box b 10 10 10
vdisplay b
vfit
vsetdispmode 1
vmanipulator vm -attach b
vscale 1 3 10
vviewparams -scale 6.28866 -proj 0.57735 -0.57735 0.57735 -up -0.408248 0.408248 0.816497 -at 0 10 30
TagsNo tags attached.
Test case numberv3d/manipulator/bug33514 & v3d/trihedron/bug27832

Attached Files

  • zoom_scaled.png (75,368 bytes)
  • image.png (48,443 bytes)
  • image-2.png (29,347 bytes)

Activities

drochalo

2023-10-24 14:52

developer  

zoom_scaled.png (75,368 bytes)

git

2023-10-24 17:51

administrator   ~0114416

Branch CR33514 has been created by drochalo.

SHA-1: 8e37a5f85c7fbca4045c374ba6470dafbee79dfb


Detailed log of new commits:

Author: drochalo
Date: Tue Oct 24 15:50:27 2023 +0100

     0033514: Visualization - Scaled view twists zoom persistence objects
    
    added test

Author: drochalo
Date: Tue Oct 24 14:44:14 2023 +0100

    0033514: Visualization - Scaled view twists zoom persistence objects
    
    Adjusted object scale of zoom persistent objects.
    Now takes view's axial scale into account.

drochalo

2023-10-25 18:38

developer   ~0114430

Dear Marina,

please review changes made to the behaviour of zoom persistence objects.
The tests in jenkins do not produce errors connected to these particular changes (http://jenkins-test-10.nnov.opencascade.com/view/CR33514-master-drochalo/view/COMPARE/).

mzernova

2023-11-17 02:43

developer   ~0114607

This is wrong
The scale must be applied to all objects with Graphic3d_TMF_ZoomPers except the manipulator.
      //Adjust the camera axial scale for zoom persistent objects 
      gp_XYZ anAxialScale = theCamera->AxialScale();
      Standard_Real anAxialX = anAxialScale.X();
      Standard_Real anAxialY = anAxialScale.Y();
      Standard_Real anAxialZ = anAxialScale.Z();
      if (anAxialX > 0 && anAxialY > 0 && anAxialZ > 0)
      {
        Graphic3d_TransformUtils::Scale(aWorldView, 1.0 / anAxialX, 1.0 / anAxialY, 1.0 / anAxialZ);
      }

git

2023-12-18 19:32

administrator   ~0114815

Branch CR33514 has been updated by drochalo.

SHA-1: 880af45ddf6bf0990abe40be8d18d21b5d374d57


Detailed log of new commits:

Author: drochalo
Date: Mon Dec 18 16:30:32 2023 +0000

    0033514: Visualization - Scaled view twists zoom persistence objects
    
    Added flag to transform persistence to handle axial scaling.
    Modified manipulator's zoom transform persistence to fit in axial scaling events.
    Added tests for cases 27832 and 33514.

Author: drochalo
Date: Mon Dec 18 10:32:36 2023 +0000

    Merge branch 'master' of git.dev.opencascade.org:occt into CR33514

Author: drochalo
Date: Mon Nov 20 13:09:03 2023 +0000

    Merge branch 'master' of git.dev.opencascade.org:occt into CR33514

git

2023-12-19 18:09

administrator   ~0114824

Branch CR33514 has been updated forcibly by drochalo.

SHA-1: 97d8382305add039ad674ceb369f991cd12a3541

git

2023-12-19 19:19

administrator   ~0114826

Branch CR33514 has been updated forcibly by drochalo.

SHA-1: a9defae33c4391419a2070912833f1cd5e84978b

drochalo

2023-12-20 13:08

developer   ~0114830

Dear Marina,
please review.

Note that some of the changes made include fix to bug reported on issue 27832.

Tests on Jenkins present minor issues but only on tests not connected with the changes:
http://jenkins-test-10.nnov.opencascade.com/view/CR33514-master-drochalo/view/COMPARE/

mzernova

2024-01-05 17:55

developer   ~0114865

Please add into Graphic3d_TransformPers::Apply
if ((myMode & Graphic3d_TMF_AxialScalePers) != 0)
{
  //...
}

git

2024-01-05 19:22

administrator   ~0114868

Branch CR33514 has been updated by drochalo.

SHA-1: 566f7690a841aa551215de3af15cbb257b2f6625


Detailed log of new commits:

Author: drochalo
Date: Fri Jan 5 16:21:36 2024 +0000

     0033514: Visualization - Scaled view twists zoom persistence objects
    
    Logic change on Graphic3d_TransformPers::Apply for Graphic3d_TMF_AxialScalePers.

drochalo

2024-01-09 12:10

developer   ~0114880

Dear Marina,

please review once again.
New tests in Jenkins only present minor issues but not connected to the changes:
http://jenkins-test-10.nnov.opencascade.com/view/CR33514-master-drochalo/view/COMPARE/

mzernova

2024-01-09 18:21

developer   ~0114885

Please set Graphic3d_TMF_AxialScalePers if myIsZoomPersistentMode is false
if (myIsZoomPersistentMode)
  {
    if (TransformPersistence().IsNull()
    ||  TransformPersistence()->Mode() != Graphic3d_TMF_ZoomPers
    || !TransformPersistence()->AnchorPoint().IsEqual (myPosition.Location(), 0.0))
    {
      setTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_ZoomPers, myPosition.Location()));
    }
  }


Please split this line
It should be shorter than 120 symbols
Standard_OutOfRange_Raise_if (theAxialScale.X() <= 0.0 || theAxialScale.Y() <= 0.0 || theAxialScale.Z() <= 0.0, "Graphic3d_Camera::SetAxialScale, bad coefficient");


Please update description, not clear what 'locally' means here
  Graphic3d_TMF_AxialZoomPers  = Graphic3d_TMF_ZoomPers
                               | Graphic3d_TMF_AxialScalePers //!< Object doesn't resize locally or with axial scale.


Please provide more clear description
//! Graphic3d_TMF_AxialPers and Graphic3d_TMF_AxialZoomPers defines persistence in the axial scale.


Please split this line
It should be shorter than 120 symbols
Graphic3d_TransformUtils::Scale (aWorldView, 1.0 / theCamera->AxialScale().X(), 1.0 / theCamera->AxialScale().Y(), 1.0 / theCamera->AxialScale().Z());


Please remove extra comments
// Adjust the camera axial scale to preserve trihedron shape.
// Adjust the camera axial scale for axial scale persistent objects.


Please add empty line to the end of test: bug33514

Please use lowercase for description enum values without point in the end of sentence.
Please remove extra spaces.
image.png (48,443 bytes)
image-2.png (29,347 bytes)

git

2024-01-22 20:47

administrator   ~0114955

Branch CR33514 has been updated by drochalo.

SHA-1: ad49fa8b7c99ff01502a7dd854a0f7771a4e00cc


Detailed log of new commits:

Author: drochalo
Date: Tue Jan 9 16:45:40 2024 +0000

    0033514: Visualization - Scaled view twists zoom persistence objects
    
    Logic fixes in AIS_Manipulator to integrate axial scale in both zoomable and unzoomable states.
    Code cleanup.
    Modified test.

drochalo

2024-01-23 12:43

developer   ~0114956

Dear Marina,

I made the requested changes. New tests on Jenkins show no major issues (http://jenkins-test-10.nnov.opencascade.com/view/CR33514-master-drochalo/view/COMPARE/).
Please review.

Issue History

Date Modified Username Field Change
2023-10-24 14:52 drochalo New Issue
2023-10-24 14:52 drochalo Assigned To => drochalo
2023-10-24 14:52 drochalo File Added: zoom_scaled.png
2023-10-24 15:13 drochalo Steps to Reproduce Updated
2023-10-24 17:51 git Note Added: 0114416
2023-10-25 18:38 drochalo Status new => feedback
2023-10-25 18:38 drochalo Note Added: 0114430
2023-10-25 18:38 drochalo Assigned To drochalo => mzernova
2023-10-27 16:55 drochalo Status feedback => resolved
2023-11-17 02:43 mzernova Note Added: 0114607
2023-11-17 02:43 mzernova Assigned To mzernova => drochalo
2023-11-17 02:43 mzernova Status resolved => assigned
2023-12-18 19:32 git Note Added: 0114815
2023-12-19 18:09 git Note Added: 0114824
2023-12-19 19:19 git Note Added: 0114826
2023-12-20 13:08 drochalo Note Added: 0114830
2023-12-20 13:08 drochalo Assigned To drochalo => mzernova
2023-12-20 13:08 drochalo Status assigned => resolved
2024-01-05 17:55 mzernova Note Added: 0114865
2024-01-05 17:55 mzernova Assigned To mzernova => drochalo
2024-01-05 17:55 mzernova Status resolved => assigned
2024-01-05 19:22 git Note Added: 0114868
2024-01-09 12:10 drochalo Note Added: 0114880
2024-01-09 12:10 drochalo Assigned To drochalo => mzernova
2024-01-09 12:10 drochalo Status assigned => resolved
2024-01-09 18:21 mzernova Note Added: 0114885
2024-01-09 18:21 mzernova File Added: image.png
2024-01-09 18:21 mzernova File Added: image-2.png
2024-01-09 18:21 mzernova Assigned To mzernova => drochalo
2024-01-09 18:21 mzernova Status resolved => assigned
2024-01-22 20:47 git Note Added: 0114955
2024-01-23 12:43 drochalo Note Added: 0114956
2024-01-23 12:45 drochalo Assigned To drochalo => mzernova
2024-01-23 12:45 drochalo Status assigned => resolved
2024-01-23 12:45 drochalo Test case number => v3d/manipulator/bug33514 & v3d/trihedron/bug27832