View Issue Details

IDProjectCategoryView StatusLast Update
0029993Open CASCADEOCCT:Visualizationpublic2020-12-02 17:11
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.5.0Fixed in Version7.5.0 
Summary0029993: Visualization - AIS_TextLabel computes selection primitive only for attachment point
DescriptionAIS_TextLabel::ComputeSelection() adds only one sensitive entity - Select3D_SensitivePoint.

It is desired improving this functionality to select text label as whole (as rectangle).
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberbugs/vis/bug29993

Attached Files

  • bug29993_KO.png (19,647 bytes)
  • bug29993_OK.png (22,361 bytes)

Activities

git

2020-07-04 14:41

administrator   ~0092987

Branch CR29993 has been created by mzernova.

SHA-1: 4e227abd93c72034f64db98251af8b9379b56235


Detailed log of new commits:

Author: mzernova
Date: Tue Dec 3 12:32:39 2019 +0300

    0029993: Visualization - AIS_TextLabel computes selection primitive only for attachment point
    
    The text label is selected as a rectangle (adds a sensitive object - Select3D_SensitiveFace).
    The bounding box has been resized to fit the sensitive rectangle.
    Transform persistent has been added to AIS_TextLabel to correctly position the sensitive rectangle.
    The vconnect command was also changed to correctly connect objects with transform persistence.
    
    bugs/vis/bug29993: test case added

mzernova

2020-07-04 16:41

developer  

bug29993_KO.png (19,647 bytes)

mzernova

2020-07-04 16:41

developer  

bug29993_OK.png (22,361 bytes)

git

2020-07-04 22:58

administrator   ~0092990

Branch CR29993 has been updated forcibly by mzernova.

SHA-1: 55548d1e1608c0fb8dfbe4cc646a675348c1416a

mzernova

2020-07-05 09:32

developer   ~0092993

http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR29993-master-mzernova/

mzernova

2020-07-05 09:41

developer   ~0092994

The patch CR29993 is ready to review

kgv

2020-07-05 09:52

developer   ~0092995

+ tests/bugs/vis/bug29993
It would be better makes an extra screenshot with vsensdis to existing test case rather than creating a new one.

--- a/src/ViewerTest/ViewerTest_ObjectCommands.cxx
+++ b/src/ViewerTest/ViewerTest_ObjectCommands.cxx
@@ -4254,6 +4254,10 @@ static Handle(AIS_InteractiveObject) findConnectedObject (const TCollection_Asci
     aConnected->SetDisplayMode (aPrs->DisplayMode());
   }
   aConnected->Connect (aPrs, aPrs->LocalTransformationGeom());
+  if (!aPrs->TransformPersistence().IsNull())
+  {
+    aConnected->SetTransformPersistence (aPrs->TransformPersistence());
+  }

This looks unrelated to bug.
Do you have a test case for this issue?

--- a/src/AIS/AIS_TextLabel.hxx
+++ b/src/AIS/AIS_TextLabel.hxx
@@ -132,6 +132,16 @@ private:
   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
                                                  const Standard_Integer             theMode) Standard_OVERRIDE;
 
+  //! Calculate label center, width and height
+  Standard_EXPORT Standard_Boolean calculateLabelParams

Please change section private -> protected for all these methods.

+  aLabelPlane.SetTranslationPart (theCenterOfLabel.Coord());

theCenterOfLabel.XYZ() is more common.

+    isInit = Standard_True;

This temporary variable looks redundant in new method.

+  if (Handle(Font_FTFont) aFont = Font_FTFont::FindAndCreate (anAsp->Aspect()->Font(), anAsp->Aspect()->GetTextFontAspect(), aFontParams))

Handle(Font_FTFont) aFont = ...;
if (aFont.IsNull()) { return false; }

+      Handle(Select3D_SensitiveEntity) aTextSensitive;
...
+        aTextSensitive = new Select3D_SensitivePoint (anEntityOwner, aPosition);
+        theSelection->Add (aTextSensitive);
+        break;

Defining variable in advance looks redundant.

+        aBox.Add (NCollection_Vec4<float> ((float) aMinPnt.X(), (float) aMinPnt.Y(), (float) aMinPnt.Z(), 1.0));

Graphic3d_Vec4

mzernova

2020-07-05 10:07

developer   ~0092996

Last edited: 2020-07-05 10:07

>This looks unrelated to bug.
>Do you have a test case for this issue?


This problem can be reproduced in test bugs/vis/bug24837_2

test bugs vis bug24837_2 1
vsensdis

For text labels, transform persistent is not set

kgv

2020-07-05 11:44

developer   ~0092998

> This problem can be reproduced in test bugs/vis/bug24837_2
Please extend this test case with an extra screenshot.

git

2020-07-05 19:53

administrator   ~0092999

Branch CR29993 has been updated by mzernova.

SHA-1: 3e33f4a27d3d74035149223f35d534e555015379


Detailed log of new commits:

Author: mzernova
Date: Sun Jul 5 19:31:44 2020 +0300

    remarks from kgv

git

2020-07-05 19:53

administrator   ~0093000

Branch CR29993_1 has been created by mzernova.

SHA-1: 2dff41379e16e36fce42a223200bba7b7c89567f


Detailed log of new commits:

Author: mzernova
Date: Tue Dec 3 12:32:39 2019 +0300

    0029993: Visualization - AIS_TextLabel computes selection primitive only for attachment point
    
    The text label is selected as a rectangle (adds a sensitive object - Select3D_SensitiveFace).
    The bounding box has been resized to fit the sensitive rectangle.
    Transform persistent has been added to AIS_TextLabel to correctly position the sensitive rectangle.
    The findConnectedObject function has also been changed to correctly set transform persistence.

mzernova

2020-07-05 19:54

developer   ~0093001

The patch CR29993_1 is ready to review

git

2020-07-05 20:16

administrator   ~0093002

Branch CR29993 has been updated by mzernova.

SHA-1: 7a18963cd6118485c79bb7defb4732a7b9f60946


Detailed log of new commits:

Author: mzernova
Date: Sun Jul 5 20:15:05 2020 +0300

    remarks from kgv

git

2020-07-05 20:16

administrator   ~0093003

Branch CR29993_1 has been updated forcibly by mzernova.

SHA-1: a6f6b69ed46547a8ad5bd596f78edc4020b4992d

kgv

2020-07-05 20:34

developer   ~0093004

Please raise the patch in OCCT branch CR29993_1.

bugmaster

2020-07-11 12:12

administrator   ~0093097

Combination -
OCCT branch : IR-2020-07-10
master SHA - 74440d215bf268902458b25e36a61c791f21fc38
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-07-10 SHA - 6e90d3ea8d7f26e39ec8b263c708ad6ecf5dfaaa
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17210.790000000085 / 17175.910000000105 [+0.20%]
Products
Total CPU difference: 11229.020000000071 / 11228.490000000076 [+0.00%]
Windows-64-VC14:
OCCT
Total CPU difference: 18725.6875 / 18705.46875 [+0.11%]
Products
Total CPU difference: 11144.125 / 13046.140625 [-14.58%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2020-07-11 12:31

administrator   ~0093122

Branch CR29993 has been deleted by inv.

SHA-1: 7a18963cd6118485c79bb7defb4732a7b9f60946

git

2020-07-11 12:31

administrator   ~0093123

Branch CR29993_1 has been deleted by inv.

SHA-1: a6f6b69ed46547a8ad5bd596f78edc4020b4992d

Related Changesets

occt: master 3e9c1d1e

2019-12-03 09:32:39

mzernova


Committer: bugmaster Details Diff
0029993: Visualization - AIS_TextLabel computes selection primitive only for attachment point

The text label is selected as a rectangle (adds a sensitive object - Select3D_SensitiveFace).
The bounding box has been resized to fit the sensitive rectangle.
Transform persistent has been added to AIS_TextLabel to correctly position the sensitive rectangle.
The findConnectedObject function has also been changed to correctly set transform persistence.
Affected Issues
0029993
mod - src/AIS/AIS_TextLabel.cxx Diff File
mod - src/AIS/AIS_TextLabel.hxx Diff File
mod - src/SelectMgr/SelectMgr_ViewerSelector3d.cxx Diff File
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx Diff File
mod - tests/3rdparty/fonts/A2 Diff File
mod - tests/3rdparty/fonts/A7 Diff File
mod - tests/bugs/vis/bug24837_2 Diff File

Issue History

Date Modified Username Field Change
2018-07-27 12:27 kgv New Issue
2018-07-27 12:27 kgv Assigned To => kgv
2019-09-04 15:36 abv Target Version 7.4.0 => 7.5.0
2019-11-18 17:26 kgv Assigned To kgv => mzernova
2019-11-18 17:26 kgv Status new => assigned
2020-07-04 14:41 git Note Added: 0092987
2020-07-04 16:41 mzernova File Added: bug29993_KO.png
2020-07-04 16:41 mzernova File Added: bug29993_OK.png
2020-07-04 22:58 git Note Added: 0092990
2020-07-05 09:32 mzernova Note Added: 0092993
2020-07-05 09:41 mzernova Note Added: 0092994
2020-07-05 09:41 mzernova Assigned To mzernova => kgv
2020-07-05 09:41 mzernova Status assigned => resolved
2020-07-05 09:41 mzernova Steps to Reproduce Updated
2020-07-05 09:52 kgv Note Added: 0092995
2020-07-05 09:53 kgv Assigned To kgv => mzernova
2020-07-05 09:53 kgv Status resolved => assigned
2020-07-05 10:07 mzernova Note Added: 0092996
2020-07-05 10:07 mzernova Note Edited: 0092996
2020-07-05 11:44 kgv Note Added: 0092998
2020-07-05 19:53 git Note Added: 0092999
2020-07-05 19:53 git Note Added: 0093000
2020-07-05 19:54 mzernova Note Added: 0093001
2020-07-05 19:54 mzernova Assigned To mzernova => kgv
2020-07-05 19:54 mzernova Status assigned => resolved
2020-07-05 19:54 mzernova Steps to Reproduce Updated
2020-07-05 20:16 git Note Added: 0093002
2020-07-05 20:16 git Note Added: 0093003
2020-07-05 20:34 kgv Note Added: 0093004
2020-07-05 20:34 kgv Assigned To kgv => bugmaster
2020-07-05 20:34 kgv Status resolved => reviewed
2020-07-11 12:12 bugmaster Note Added: 0093097
2020-07-11 12:12 bugmaster Status reviewed => tested
2020-07-11 12:14 bugmaster Test case number => bugs/vis/bug29993
2020-07-11 12:22 bugmaster Changeset attached => occt master 3e9c1d1e
2020-07-11 12:22 bugmaster Status tested => verified
2020-07-11 12:22 bugmaster Resolution open => fixed
2020-07-11 12:31 git Note Added: 0093122
2020-07-11 12:31 git Note Added: 0093123
2020-12-02 16:40 emo Fixed in Version => 7.5.0
2020-12-02 17:11 emo Status verified => closed