MantisBT - Open CASCADE
View Issue Details
0030226Open CASCADE[OCCT] PRODUCTS:Point Cloud Renderingpublic2018-10-09 19:452019-02-04 12:32
gka 
bugmaster 
normalintegration request 
verifiedfixed 
[OCCT] 7.2.0 
[OCCT] 7.4.0* 
Not needed
0030226: Point Cloud Rendering - Method PointCloud_PointCloud::GetSelected() returns pointer on a local variable
Method PointCloud_PointCloud::GetSelected() returns pointer on the local variable for class PointCloud_PointStorage
No tags attached.
parent of 0030227verified bugmaster Open CASCADE Point Cloud Rendering - Impossible to select separate point from point cloud  
Issue History
2018-10-09 19:45gkaNew Issue
2018-10-09 19:45gkaAssigned To => gka
2018-10-10 15:44kgvSummaryMethod PointCloud_PointCloud::GetSelected returns pointer on the local variable. => Point Cloud Rendering - Method PointCloud_PointCloud::GetSelected() returns pointer on a local variable
2018-10-10 15:50kgvNote Added: 0079854
2018-10-10 15:50kgvSeverityminor => integration request
2018-10-10 15:51kgvRelationship addedchild of 0028023
2018-10-10 15:51kgvProduct Version7.3.0 => 7.2.0
2018-11-21 15:31gkaStatusnew => assigned
2018-11-22 13:58gkaRelationship addedparent of 0030227
2018-11-22 13:59gkaAssigned Togka => abv
2018-11-22 13:59gkaStatusassigned => resolved
2018-11-22 13:59gkaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=20413#r20413
2018-11-22 14:01gkaNote Added: 0081211
2018-11-22 14:01gkaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=20415#r20415
2019-01-30 17:10kgvNote Added: 0081943
2019-01-30 17:10kgvAssigned Toabv => bugmaster
2019-01-30 17:10kgvStatusresolved => reviewed
2019-01-30 18:54bugmasterNote Added: 0081947
2019-01-30 18:54bugmasterStatusreviewed => tested
2019-01-30 18:54bugmasterTest case number => Not needed
2019-02-03 11:28bugmasterNote Added: 0081999
2019-02-03 11:28bugmasterStatustested => verified
2019-02-03 11:28bugmasterResolutionopen => fixed

Notes
(0079854)
kgv   
2018-10-10 15:50   
   //! Returns storage containing all selected points.
   //! Returns NULL if there is no data at all.
   //! Does not own (will not delete) returned PC_PointStorage object.
-  Standard_EXPORT PointCloud_PointStorage* GetSelected (const bool theGetClosestOnly = false);
+  Standard_EXPORT Handle(PointCloud_PointStorage) PointCloud_PointCloud::GetSelected(const bool theGetClosestOnly 
= false);

The method description and Point Cloud logic suggest that returned pointer
should be wrapped by std::unique_ptr<> or similar.

So that there is NO bug in PointCloud_PointCloud::GetSelected() method - it just follows inconvenient conception.

If Handle() is proposed to be used instead std::unique_ptr,
then documentation across PointCloud module should be updated
(PointCloud_PointCloud::GetSelected( method first of all).
(0081211)
gka   
2018-11-22 14:01   
Branch CR30226 is ready to be reviewed.
Results of tests can be found by path:
http://jenkins-test-12.nnov.opencascade.com/view/CR30226-master-gka/view/COMPARE/ [^]
(0081943)
kgv   
2019-01-30 17:10   
Please take the patch in branch CR30226_2.

http://jenkins-test-12.nnov.opencascade.com:8080/view/master-CR30226_2-KGV/ [^]
(0081947)
bugmaster   
2019-01-30 18:54   
Combination -
OCCT branch : master
Products branch : CR30226_2 SHA - f90843a0951f745396c535eb63e5c3c51ad7e92d
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
---
Products
Total CPU difference: 7154.590000000028 / 7158.8000000000175 [-0.06%]
Windows-64-VC14:
OCCT
---
Products
Total CPU difference: 7897.796875 / 7893.859375 [+0.05%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0081999)
bugmaster   
2019-02-03 11:28   
Fix has been integrated into master of occt-products repository