View Issue Details

IDProjectCategoryView StatusLast Update
0033746CommunityOCCT:Visualizationpublic2024-07-19 12:25
Reporterzhouyongjiang Assigned Toiko  
PrioritynormalSeveritymajor 
Status resolvedResolutionopen 
PlatformWindowsOSVC++ 2019 
Product Version7.8.0 
Summary0033746: Visualization - Unexpected moving with AIS_ViewCube
DescriptionIssue when AIS_ViewCube set to Top and AIS_ViewController bind MouseGesture with AIS_MouseGesture_RotateView

The steps about the issue are as follows:
First, In class AIS_ViewController add MouseGesture AIS_MouseGesture_RotateView to myMouseGestureMap in its constructor function.
Second, Create as AIS_ViewCube object in OCC_3dView
Third, draw a box and click the top of the AIS_ViewCube object.
The last, when begin to rotate view, the view will auto rotate with angle PI/2.

sample code :
void OCC_3dView::ShowViewCube()
{
Handle(AIS_ViewCube) aisViewCube = new AIS_ViewCube();
Handle(AIS_InteractiveContext) aisContext = GetAISContext();

aisContext->SetDisplayMode(AIS_Shaded, true);
aisViewCube->SetBoxSideLabel(V3d_Xpos, L"右");
aisViewCube->SetBoxSideLabel(V3d_Ypos, L"后");
aisViewCube->SetBoxSideLabel(V3d_Zpos, L"上");
aisViewCube->SetBoxSideLabel(V3d_Xneg, L"左");
aisViewCube->SetBoxSideLabel(V3d_Yneg, L"前");
aisViewCube->SetBoxSideLabel(V3d_Zneg, L"下");
Quantity_Color viewCubeTextColor;
viewCubeTextColor.SetValues(0 / 255., 0 / 255., 0 / 255., Quantity_TOC_RGB);
aisViewCube->SetTextColor(viewCubeTextColor);
aisViewCube->SetFontHeight(28);
aisViewCube->SetFont(L"Microsoft YaHei");
aisViewCube->SetSize(60, false);
aisViewCube->SetDrawAxes(false);
Quantity_Color viewCubeColor;
viewCubeColor.SetValues(183 / 255., 194 / 255., 213 / 255., Quantity_TOC_RGB);
aisViewCube->SetColor(viewCubeColor);
aisViewCube->SetResetCamera(true);
aisContext->Display(aisViewCube, Standard_True);
}

AIS_ViewController::AIS_ViewController()
{
...
myMouseGestureMap.Bind((Standard_UInteger)Aspect_VKeyMouse_RightButton | (Standard_UInteger)Aspect_VKeyFlags_SHIFT,
AIS_MouseGesture_RotateView);
...
}

With My Best Regard.
Steps To Reproducepload MODELING VISUALIZATION
box b 0 0 -100 100 90 10
vinit View1
vaxo
vdisplay -dispMode 1 b
vfit
vviewcube c
vcamera -navmode fly
TagsNo tags attached.
Test case number

Attached Files

  • image.png (26,152 bytes)

Activities

git

2024-07-17 15:22

administrator   ~0116230

Branch CR33746 has been created by mzernova.

SHA-1: 890e5bde21bf0d6dd19657d459f50dba5398b6d2


Detailed log of new commits:

Author: mzernova
Date: Wed Jul 17 13:21:43 2024 +0100

    0033746: Visualization - Unexpected moving with AIS_ViewCube
    
    Fixed angle calculation for view rotation.
    Added draw command vmousebutton to test mouse button events.

git

2024-07-17 16:23

administrator   ~0116231

Branch CR33746 has been updated forcibly by mzernova.

SHA-1: 683f4890243b18347eb15a55103be8fdc480fc91

mzernova

2024-07-17 17:04

developer   ~0116232

Please review CR33746

Tests:
http://jenkins-test-10.nnov.opencascade.com/view/CR33746-master-mzernova/view/ALL/

iko

2024-07-19 03:19

developer   ~0116263

The same issue can be reproduced for other sides of view cube as well. It seems like after using of view cube it tries to orient camera in the way where words on its sides is readable and horizontal. For example in the same setup with box we can click "FRONT" -> "TOP" -> "RIGHT" (using edges connecting it). After this the word "RIGHT" on cube is vertical. Moving camera in view would produce the same unexpected rotation.

git

2024-07-19 12:20

administrator   ~0116265

Branch CR33746 has been updated forcibly by mzernova.

SHA-1: fd4f248da9a6e44623ed958112faabbf9710c53f

mzernova

2024-07-19 12:24

developer   ~0116266

Please review CR33746

mzernova

2024-07-19 12:25

developer   ~0116267

image.png (26,152 bytes)

Issue History

Date Modified Username Field Change
2024-06-25 11:48 zhouyongjiang New Issue
2024-06-25 11:48 zhouyongjiang Assigned To => pacocastillo
2024-06-25 12:58 dpasukhi Summary Issue when AIS_ViewCube set to Top and AIS_ViewController bind MouseGesture with AIS_MouseGesture_RotateView => Visualization - Unexpected moving with AIS_ViewCube
2024-06-25 12:58 dpasukhi Description Updated
2024-06-25 12:59 dpasukhi Description Updated
2024-07-15 17:08 dpasukhi Assigned To pacocastillo => mzernova
2024-07-17 00:19 mzernova Steps to Reproduce Updated
2024-07-17 15:22 git Note Added: 0116230
2024-07-17 16:23 git Note Added: 0116231
2024-07-17 17:04 mzernova Assigned To mzernova => iko
2024-07-17 17:04 mzernova Status new => resolved
2024-07-17 17:04 mzernova Note Added: 0116232
2024-07-19 03:19 iko Note Added: 0116263
2024-07-19 03:21 iko Assigned To iko => mzernova
2024-07-19 03:21 iko Status resolved => assigned
2024-07-19 12:20 git Note Added: 0116265
2024-07-19 12:24 mzernova Assigned To mzernova => iko
2024-07-19 12:24 mzernova Status assigned => resolved
2024-07-19 12:24 mzernova Note Added: 0116266
2024-07-19 12:25 mzernova Note Added: 0116267
2024-07-19 12:25 mzernova File Added: image.png