View Issue Details

IDProjectCategoryView StatusLast Update
0032366Open CASCADEOCCT:Visualizationpublic2021-05-22 13:55
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.6.0Fixed in Version7.6.0 
Summary0032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add option dumping surface normals
DescriptionIt is desired extending SelectMgr_ViewerSelector3d::ToPixMap() functionality to dump surface normals StdSelect_TypeOfSelectionImage_SurfaceNormal (SelectBasics_PickResult::SurfaceNormal()).

See also Draw Harness command "vseldump".
Steps To Reproduce
psphere s 1
vinit
vdisplay s -dispmode 1
vfit
vseldump ${imagedir}/${casename}_sphere.png  -type surfNormal
TagsNo tags attached.
Test case numbertests/vselect/sphere/generate_images,rectangle_selection,single_click_selection

Relationships

child of 0031548 closedbugmaster Visualization, SelectBasics_PickResult - include surface normal into picking details 

Activities

mkrylova

2021-05-13 20:03

developer   ~0100954

Analysis, Solution elaboration

git

2021-05-14 13:01

administrator   ~0100989

Branch CR32366 has been created by mkrylova.

SHA-1: 6f259de50eab293d2b92b0cd3d98b76c357666f0


Detailed log of new commits:

Author: mkrylova
Date: Fri May 14 12:58:43 2021 +0300

    0032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add option dumping surface normals
    
    - extended functionality to dump surface normals
    - added new option to vseldump command

kgv

2021-05-14 13:50

developer   ~0100991

Last edited: 2021-05-14 13:50

+                   "\n\t\t:   normal      normal direction values",

"surfNormal" would look more self-describable.

+  StdSelect_TypeOfSelectionImage_ColoredSelectionMode,    //!< color of selection mode
+  StdSelect_TypeOfSelectionImage_SurfaceNormal

New enumeration value should be documented.

     {
       return new GeneratedSelModeColorFiller (thePixMap, theSelector);
     }
+    case StdSelect_TypeOfSelectionImage_SurfaceNormal:
+      return new SurfaceNormalFiller (thePixMap, theSelector);

Please do not omit braces.

+
+  class SurfaceNormalFiller : public SelectMgr_SelectionImageFiller
+  {

Class description is missing.

+        Graphic3d_Vec3 aNormal = aPickResult.SurfaceNormal();
+        gp_Dir aColor (aNormal.x(), aNormal.y(), aNormal.z());

gp_Dir would throw an exception if surface normal is unavailable.
It should be reproducible by enabling Vertex / Edge selection modes.

+        myImage->SetPixelColor (theCol, theRow, Quantity_ColorRGBA (Abs (aColor.X()), Abs (aColor.Y()), Abs (aColor.Z()), 1.0f));

This mapping would not allow distinguishing normals having an opposite direction (negative values).
It might be better shifting range (as an option), so that ZERO values will be mapped to GRAY and not BLACK:
> aNormalColor = theNormal * 0.5f + 0.5f;

Please also add a test case covering new functionality.
Consider moving the new test case from sphere sensitivity patch (making sure that test doesn't fail).

git

2021-05-17 12:43

administrator   ~0101083

Branch CR32366 has been updated forcibly by mkrylova.

SHA-1: 38a81f70056305bf9be4e746f6c35775e9c36acb

git

2021-05-17 12:49

administrator   ~0101084

Branch CR32366_1 has been created by mkrylova.

SHA-1: 4842b191bfbfde14d954311acf66f185d52505c3


Detailed log of new commits:

Author: mkrylova
Date: Fri May 14 12:58:43 2021 +0300

    0032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add option dumping surface normals
    
    - extended functionality to dump surface normals
    - added new option to vseldump command
    - added new test

Author: mkrylova
Date: Wed Mar 17 17:38:00 2021 +0300

    0032182: Visualization - add Select3D_SensitiveSphere
    
    - created Select3D_SensitiveSphere class
    - implemented interfaces for intersection methods
    - added tests

git

2021-05-17 14:30

administrator   ~0101086

Branch CR32366_1 has been updated forcibly by mkrylova.

SHA-1: 141d864794dbda21a0b8901dd4bb9b24e358aa7f

kgv

2021-05-17 14:49

developer   ~0101089

+tests/vselect/sphere/generate_images

New test grid is not added to the list.
Please also move other tests from 0032182 which pass testing on current master.

git

2021-05-17 16:03

administrator   ~0101091

Branch CR32366_1 has been updated by mkrylova.

SHA-1: 1c72b2441b9f8a3c9b1b6e8e4d3dbeb48dd98d17


Detailed log of new commits:

Author: mkrylova
Date: Mon May 17 16:03:56 2021 +0300

    kgv remarks:
    - moved tests
    - added tests to grids.list

git

2021-05-17 16:05

administrator   ~0101092

Branch CR32366_2 has been created by mkrylova.

SHA-1: 442c5351f062b7a30113b5ae3ed0646514ec17ea


Detailed log of new commits:

Author: mkrylova
Date: Fri May 14 12:58:43 2021 +0300

    0032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add option dumping surface normals
    
    - extended functionality to dump surface normals
    - added new option to vseldump command
    - added tests

kgv

2021-05-17 16:42

developer   ~0101101

Please fix compiler warnings:
/dn63/builds/CR32366_2-master-KGV/OCCT_SRC/src/SelectMgr/SelectMgr_SelectionImageFiller.cxx:344:32: warning: unused variable 'isMatched' [-Wunused-variable]

git

2021-05-17 17:39

administrator   ~0101107

Branch CR32366_2 has been updated by mkrylova.

SHA-1: bc2d04fe97f16738c7652925e4494b999b106cef


Detailed log of new commits:

Author: mkrylova
Date: Mon May 17 17:39:47 2021 +0300

    #kgv remarks
    - fixed compiler warnings

git

2021-05-17 17:40

administrator   ~0101108

Branch CR32366_3 has been created by mkrylova.

SHA-1: 101c47c59e138573c5d8909294e2216fa62f6051


Detailed log of new commits:

Author: mkrylova
Date: Fri May 14 12:58:43 2021 +0300

    0032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add option dumping surface normals
    
    - extended functionality to dump surface normals
    - added new option to vseldump command
    - added tests

kgv

2021-05-17 19:54

developer   ~0101112

Please raise the patch
- OCCT: branch CR32366_3.

bugmaster

2021-05-22 12:23

administrator   ~0101249

Combination -
OCCT branch : IR-2021-05-21
master SHA - 2aa0a6991da6f767c2a6a4c1d6d720fee35867ce
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-05-21 SHA - e89cefb48fe77db69215a5124b453f69d9db404b
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: 17862.650000000373 / 17879.470000000332 [-0.09%]
Products
Total CPU difference: 11535.410000000107 / 11557.880000000083 [-0.19%]
Windows-64-VC14:
OCCT
Total CPU difference: 19361.25 / 19400.171875 [-0.20%]
Products
Total CPU difference: 12920.28125 / 12880.234375 [+0.31%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-05-22 13:55

administrator   ~0101280

Branch CR32366 has been deleted by mnt.

SHA-1: 38a81f70056305bf9be4e746f6c35775e9c36acb

git

2021-05-22 13:55

administrator   ~0101281

Branch CR32366_1 has been deleted by mnt.

SHA-1: 1c72b2441b9f8a3c9b1b6e8e4d3dbeb48dd98d17

git

2021-05-22 13:55

administrator   ~0101282

Branch CR32366_2 has been deleted by mnt.

SHA-1: bc2d04fe97f16738c7652925e4494b999b106cef

git

2021-05-22 13:55

administrator   ~0101283

Branch CR32366_3 has been deleted by mnt.

SHA-1: 101c47c59e138573c5d8909294e2216fa62f6051

Related Changesets

occt: master 114e7a90

2021-05-14 09:58:43

mkrylova


Committer: bugmaster Details Diff
0032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add option dumping surface normals

- extended functionality to dump surface normals
- added new option to vseldump command
- added tests
Affected Issues
0032366
mod - src/SelectMgr/SelectMgr_SelectionImageFiller.cxx Diff File
mod - src/StdSelect/StdSelect_TypeOfSelectionImage.hxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
mod - tests/vselect/grids.list Diff File
add - tests/vselect/sphere/begin Diff File
add - tests/vselect/sphere/generate_images Diff File
add - tests/vselect/sphere/rectangle_selection Diff File
add - tests/vselect/sphere/single_click_selection Diff File

Issue History

Date Modified Username Field Change
2021-05-13 12:02 kgv New Issue
2021-05-13 12:02 kgv Assigned To => mkrylova
2021-05-13 12:03 kgv Relationship added child of 0031548
2021-05-13 12:03 kgv Status new => assigned
2021-05-13 14:49 kgv Description Updated
2021-05-13 20:03 mkrylova Note Added: 0100954
2021-05-14 13:01 git Note Added: 0100989
2021-05-14 13:02 mkrylova Assigned To mkrylova => kgv
2021-05-14 13:02 mkrylova Status assigned => resolved
2021-05-14 13:02 mkrylova Steps to Reproduce Updated
2021-05-14 13:50 kgv Note Added: 0100991
2021-05-14 13:50 kgv Assigned To kgv => mkrylova
2021-05-14 13:50 kgv Status resolved => assigned
2021-05-14 13:50 kgv Note Edited: 0100991
2021-05-17 12:43 git Note Added: 0101083
2021-05-17 12:49 git Note Added: 0101084
2021-05-17 12:51 mkrylova Assigned To mkrylova => kgv
2021-05-17 12:51 mkrylova Status assigned => resolved
2021-05-17 12:51 mkrylova Steps to Reproduce Updated
2021-05-17 13:43 kgv Assigned To kgv => mkrylova
2021-05-17 13:43 kgv Status resolved => assigned
2021-05-17 14:30 git Note Added: 0101086
2021-05-17 14:42 mkrylova Assigned To mkrylova => kgv
2021-05-17 14:42 mkrylova Status assigned => resolved
2021-05-17 14:49 kgv Note Added: 0101089
2021-05-17 14:49 kgv Assigned To kgv => mkrylova
2021-05-17 14:49 kgv Status resolved => assigned
2021-05-17 16:03 git Note Added: 0101091
2021-05-17 16:05 git Note Added: 0101092
2021-05-17 16:06 mkrylova Assigned To mkrylova => kgv
2021-05-17 16:06 mkrylova Status assigned => resolved
2021-05-17 16:42 kgv Note Added: 0101101
2021-05-17 16:42 kgv Assigned To kgv => mkrylova
2021-05-17 16:42 kgv Status resolved => assigned
2021-05-17 17:39 git Note Added: 0101107
2021-05-17 17:40 git Note Added: 0101108
2021-05-17 17:40 mkrylova Assigned To mkrylova => kgv
2021-05-17 17:40 mkrylova Status assigned => resolved
2021-05-17 19:54 kgv Note Added: 0101112
2021-05-17 19:54 kgv Assigned To kgv => bugmaster
2021-05-17 19:54 kgv Status resolved => reviewed
2021-05-17 19:54 kgv Steps to Reproduce Updated
2021-05-22 12:23 bugmaster Note Added: 0101249
2021-05-22 12:23 bugmaster Status reviewed => tested
2021-05-22 12:28 bugmaster Test case number => tests/vselect/sphere/generate_images,rectangle_selection,single_click_selection
2021-05-22 12:38 bugmaster Changeset attached => occt master 114e7a90
2021-05-22 12:38 bugmaster Status tested => verified
2021-05-22 12:38 bugmaster Resolution open => fixed
2021-05-22 13:55 git Note Added: 0101280
2021-05-22 13:55 git Note Added: 0101281
2021-05-22 13:55 git Note Added: 0101282
2021-05-22 13:55 git Note Added: 0101283