MantisBT - Open CASCADE
View Issue Details
0031137Open CASCADE[OCCT] OCCT:Modeling Datapublic2019-11-06 23:292019-11-10 11:41
kgv 
bugmaster 
normalintegration request 
verifiedfixed 
 
[OCCT] 7.5.0* 
0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
BinTools_ShapeSet allocates temporary arrays while reading triangulation and polygonal data, which looks redundant, although might be not critical from performance point of view.
N/A
No tags attached.
related to 0031136new kgv Modeling Data - BinXCAF persistence loses normals from triangulation-only Faces 
Issue History
2019-11-06 23:29kgvNew Issue
2019-11-06 23:29kgvAssigned To => msv
2019-11-06 23:44gitNote Added: 0088757
2019-11-07 08:02kgvNote Added: 0088761
2019-11-07 08:02kgvStatusnew => resolved
2019-11-07 08:02kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22164#r22164
2019-11-07 08:03kgvNote Edited: 0088761bug_revision_view_page.php?bugnote_id=88761#r22166
2019-11-07 11:25kgvRelationship addedrelated to 0031136
2019-11-08 11:49msvNote Added: 0088789
2019-11-08 11:49msvAssigned Tomsv => kgv
2019-11-08 11:49msvStatusresolved => assigned
2019-11-08 12:15kgvNote Added: 0088790
2019-11-08 12:31kgvNote Added: 0088791
2019-11-08 12:42gitNote Added: 0088792
2019-11-08 12:46gitNote Added: 0088793
2019-11-08 12:48gitNote Added: 0088794
2019-11-08 12:49kgvNote Added: 0088795
2019-11-08 12:49kgvAssigned Tokgv => msv
2019-11-08 12:49kgvStatusassigned => resolved
2019-11-08 14:40msvNote Added: 0088801
2019-11-08 14:40msvAssigned Tomsv => kgv
2019-11-08 14:40msvStatusresolved => assigned
2019-11-08 14:57gitNote Added: 0088802
2019-11-08 14:57kgvNote Added: 0088803
2019-11-08 14:57kgvAssigned Tokgv => msv
2019-11-08 14:57kgvStatusassigned => resolved
2019-11-08 15:07msvNote Added: 0088804
2019-11-08 15:07msvAssigned Tomsv => bugmaster
2019-11-08 15:07msvStatusresolved => reviewed
2019-11-09 13:50gitNote Added: 0088823
2019-11-10 11:18bugmasterChangeset attached => occt master 6b467e52
2019-11-10 11:18bugmasterStatusreviewed => verified
2019-11-10 11:18bugmasterResolutionopen => fixed
2019-11-10 11:41gitNote Added: 0088830
2019-11-10 11:41gitNote Added: 0088831

Notes
(0088757)
git   
2019-11-06 23:44   
Branch CR31137 has been created by kgv.

SHA-1: 2d022b7f07ae71c8479ff68e0b89165052a1275a


Detailed log of new commits:

Author: kgv
Date: Wed Nov 6 19:26:24 2019 +0300

    0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
    
    BinTools_ShapeSet now defines maps with proper types instead of Standard_Transient.
    BinTools_ShapeSet now avoids allocation of temporary arrays while reading
    triangulation and polygonal data.
    
    Classes Poly_Triangle, Poly_PolygonOnTriangulation, Poly_Polygon3D and Poly_Polygon2D
    have been cleared from .lxx files and extended by new methods for preallocating and filling array,
    as alternative to passing arrays by copy.
    
    wavefront command - export "f" instead of obsolete "fo" keys into file.
    BinTools - added missing tools for reading/writing short reals.
(0088761)
kgv   
2019-11-07 08:02   
(edited on: 2019-11-07 08:03)
Patch is ready for review.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31137-master-KGV [^]

The CPU time of XOpen is reduced up-to 9% on manually checked XBF files.

(0088789)
msv   
2019-11-08 11:49   
Poly_PolygonOnTriangulation has new method:
  Standard_EXPORT void SetParameters (const Handle(TColStd_HArray1OfReal)& theParameters);
Why not to use the notion like in the method ChangeNodes(), and as it is in Poly_Polygon3D.hxx:
  TColStd_Array1OfReal& ChangeParameters() const { return myParameters->ChangeArray1(); }
I think it is needed to have the same convention on methods in the same family of classes.
Also, it is better to have the new constructor of Poly_PolygonOnTriangulation accepting the bool flag theHasParams.

Poly_Polygon2D does not have ctor for preallocating array, as alternative to passing array by copy.

The new ctors in above classes (if they have two parameters) do not need to be declared explicit.

BinTools_ShapeSet does not define the map with proper type instead of Standard_Transient for myPolygons2D.
(0088790)
kgv   
2019-11-08 12:15   
> BinTools_ShapeSet does not define the map with proper type instead of Standard_Transient for myPolygons2D.
In fact, class fills in myPolygons2D but doesn't use it in any way.
This is why I have decided not to change this map definition.
(0088791)
kgv   
2019-11-08 12:31   
> Why not to use the notion like in the method ChangeNodes(), and as it is in Poly_Polygon3D.hxx:
I can add Boolean flag for consistency, but SetParameters() will be still needed.
This is because BinTools_ShapeSet writing hasParameters flag in unfortunate place, unlike other collections.
(0088792)
git   
2019-11-08 12:42   
Branch CR31137 has been updated by kgv.

SHA-1: 0661576c86dd0466268053132fbdc3a521167ce7


Detailed log of new commits:

Author: kgv
Date: Fri Nov 8 12:41:12 2019 +0300

    # remarks

(0088793)
git   
2019-11-08 12:46   
Branch CR31137 has been updated forcibly by kgv.

SHA-1: 02d98729ec0f43853015fce66e9950288fd1dc1a
(0088794)
git   
2019-11-08 12:48   
Branch CR31137 has been updated forcibly by kgv.

SHA-1: bc639e2c8f9fbaac96966010abfe2b20c2fcad50
(0088795)
kgv   
2019-11-08 12:49   
Remarks have been pushed to branch.
(0088801)
msv   
2019-11-08 14:40   
The new ctor of Poly_Polygon2D is better to declare explicit.
(0088802)
git   
2019-11-08 14:57   
Branch CR31137 has been updated by kgv.

SHA-1: df262840050b365d338d976b16cb91f0ebfc04c7


Detailed log of new commits:

Author: kgv
Date: Fri Nov 8 14:55:53 2019 +0300

    # remarks 2

(0088803)
kgv   
2019-11-08 14:57   
> The new ctor of Poly_Polygon2D is better to declare explicit.
Fixed.
(0088804)
msv   
2019-11-08 15:07   
Reviewed.
(0088823)
git   
2019-11-09 13:50   
Branch CR31137_1 has been created by kgv.

SHA-1: 23332b6f9c937a0a0d82030e26879bef90eb23ce


Detailed log of new commits:

Author: kgv
Date: Wed Nov 6 19:26:24 2019 +0300

    0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
    
    BinTools_ShapeSet now defines maps with proper types instead of Standard_Transient.
    BinTools_ShapeSet now avoids allocation of temporary arrays while reading
    triangulation and polygonal data.
    
    Classes Poly_Triangle, Poly_PolygonOnTriangulation, Poly_Polygon3D and Poly_Polygon2D
    have been cleared from .lxx files and extended by new methods for preallocating and filling array,
    as alternative to passing arrays by copy.
    
    wavefront command - export "f" instead of obsolete "fo" keys into file.
    BinTools - added missing tools for reading/writing short reals.
(0088830)
git   
2019-11-10 11:41   
Branch CR31137_1 has been deleted by inv.

SHA-1: 23332b6f9c937a0a0d82030e26879bef90eb23ce
(0088831)
git   
2019-11-10 11:41   
Branch CR31137 has been deleted by inv.

SHA-1: df262840050b365d338d976b16cb91f0ebfc04c7