MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031946Open CASCADE[OCCT] OCCT:Modeling Datapublic2020-11-17 20:152020-11-27 17:45
Reporterkgv 
Assigned Toasuraven 
PrioritynormalSeverityfeature 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0031946: Modeling Data - replace version numbers with enumerations in TopTools and BinTools
DescriptionCurrently BinTools_ShapeSet::SetFormatNb() and several other tools rely on indexes in code for version checks. It is proposed defining version enumerations which would allow to provide version description and to use named constants instead of magic numbers in the code.

In addition, it is proposed extending "save" and "binsave" commands in Draw Harness to allow saving shapes in older (supported) version formats.
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0031136feedbackasuraven Open CASCADE Modeling Data - BinXCAF persistence loses normals from triangulation-only Faces 
related to 0029217reviewedbugmaster Open CASCADE Application Framework - undocumented API method XmlLDrivers::SetStorageVersion() 
related to 0029723newmsv Open CASCADE Modeling Data - Get rid of second writing format (additional save of UV points) 

-  Notes
(0096848)
git (administrator)
2020-11-17 20:22

Branch CR31946 has been created by kgv.

SHA-1: 68e4521a0079a36f77d7dcd0dc8fe1408bbbaaad


Detailed log of new commits:

Author: asuraven
Date: Tue Nov 3 17:22:14 2020 +0300

    0031946: Modeling Data - replace version numbers with enumerations in TopTools and BinTools
    
    Added enumerations BinLDrivers_FormatVersion, BinTools_FormatVersion, TopTools_FormatVersion
    and XmlLDrivers_FormatVersion for more clear version tracking in the code.
    
    Add new optional -version parameter for save/binsave draw commands.
(0096850)
git (administrator)
2020-11-17 20:54

Branch CR31946 has been updated forcibly by kgv.

SHA-1: a3ee0abc12ba3d3d15df9f7525eee5846d332e98
(0096856)
git (administrator)
2020-11-18 00:29

Branch CR31946 has been updated by kgv.

SHA-1: f352b9dec1a199638211415bb9047e88a7b8678a


Detailed log of new commits:

Author: kgv
Date: Wed Nov 18 00:06:25 2020 +0300

    # extend version comments

(0096904)
git (administrator)
2020-11-19 19:08

Branch CR31946_1 has been created by asuraven.

SHA-1: 095782e8917f4243c1cce285af9c1804d3e35b27


Detailed log of new commits:

Author: asuraven
Date: Tue Nov 3 17:22:14 2020 +0300

    0031946: Modeling Data - replace version numbers with enumerations in TopTools and BinTools
    
    Added enumerations BinLDrivers_FormatVersion, BinTools_FormatVersion, TopTools_FormatVersion
    and XmlLDrivers_FormatVersion for more clear version tracking in the code.
    
    Add new optional -version parameter for save/binsave draw commands.
    
    Add new BinTools::Write & BrepTools::Write overloaded function with version & isWithTriangles parameters
(0096922)
git (administrator)
2020-11-20 18:23

Branch CR31946_1 has been updated by asuraven.

SHA-1: 9c7bc9e287957a7336e04960ede447096aaea103


Detailed log of new commits:

Author: asuraven
Date: Fri Nov 20 18:23:07 2020 +0300

    * Add -noTriangles option for save & binsave commands to prevent triangulation storing
    
    * Add -noTriangles option test

(0096923)
asuraven (developer)
2020-11-20 18:26

@kgv @msv
I added the changes in a separate commit.
Please make your remarks
(0096924)
kgv (developer)
2020-11-20 18:45

+    else if (aParam == "-notriangles")
+    {
+      isWithTriangles = Standard_False;
+    }

Please use Draw::ParseOnOff() to allow optional exact on/off value while using this parameter.

+ Standard_Boolean isWithTriangles,

theWithTriangles

 help save {
   Use: save variable [filename] [-version Version=2]
   Allowed options are:
    -version a number of format version to save;
             available versions are 1 and 2.
+   -noTriangles to save shape without triangles.
+                Ignored (always written) if face defines only triangulation (no surface).

Please extend syntax description above and specify default value.

+  //! Writes <Sh> on <S> in an ASCII format with <isWithTriangles> option 
+  //! and use <theVersion> version.
+  Standard_EXPORT static void Write (const TopoDS_Shape& Sh, Standard_OStream& S,
+                                     const Standard_Boolean isWithTriangles,
+                                     TopTools_FormatVersion theVersion,
+                                     const Message_ProgressRange& theProgress = Message_ProgressRange());

...
+  //! Writes <theShape> on <theStream> with <isWithTriangles> option 
+  //! and use <theVersion> version in binary format.
+  Standard_EXPORT static void Write(const TopoDS_Shape& theShape, Standard_OStream& theStream,

+                                    const Standard_Boolean isWithTriangles,
+                                    BinTools_FormatVersion theVersion,
+                                    const Message_ProgressRange& theRange = Message_ProgressRange());

...

Please use a valid Doxygen syntax (@param, @return) for new methods, follow OCCT coding rules for old arguments (not just new ones), and update description of existing co-named methods - including default parameters values (version, triangulation storage).

-                                     const Message_ProgressRange& theRange = Message_ProgressRange());

+                                     const Message_ProgressRange& theRangee = Message_ProgressRange());


theRangee

-  BinLDrivers_FormatVersion_VERSION_10,    //!< (OCCT 7.2.0) ReadTOC changed to handle 64-bit file 
length [#0028736]
+  BinLDrivers_FormatVersion_VERSION_10,    //!< Process user defined guid

Please restore my modifications in the patch.
(0096925)
msv (developer)
2020-11-20 23:32

I have no remarks in addition to KGV's.
(0097014)
git (administrator)
2020-11-23 20:21

Branch CR31946_1 has been updated by asuraven.

SHA-1: 25380a3023b54a7e2a01575380fe9fb5bae91c83


Detailed log of new commits:

Author: asuraven
Date: Mon Nov 23 20:21:19 2020 +0300

    * remarks fixing

(0097038)
git (administrator)
2020-11-24 16:58

Branch CR31946_1 has been deleted by asuraven.

SHA-1: 25380a3023b54a7e2a01575380fe9fb5bae91c83
(0097039)
git (administrator)
2020-11-24 16:58

Branch CR31946_1 has been created by asuraven.

SHA-1: e5ba4f5f59b8774e8520d5ca621b9dcd4f9149f0


Detailed log of new commits:

Author: asuraven
Date: Tue Nov 3 17:22:14 2020 +0300

    0031946: Modeling Data - replace version numbers with enumerations in TopTools and BinTools
    
    Added enumerations BinLDrivers_FormatVersion, BinTools_FormatVersion, TopTools_FormatVersion
    and XmlLDrivers_FormatVersion for more clear version tracking in the code.
    
    Add new optional -version parameter for save/binsave draw commands.
    
    Add new BinTools::Write & BrepTools::Write overloaded function with version & isWithTriangles parameters

Author: asuraven
Date: Fri Nov 20 18:23:07 2020 +0300

    * Add -noTriangles option for save & binsave commands to prevent triangulation storing
    
    * Add -noTriangles option test

Author: asuraven
Date: Mon Nov 23 20:21:19 2020 +0300

    * remarks fixing
(0097051)
git (administrator)
2020-11-25 09:39

Branch CR31946_2 has been created by asuraven.

SHA-1: 548bfca54e977fe497c214c2db82ef8ded2c1269


Detailed log of new commits:

Author: asuraven
Date: Tue Nov 3 17:22:14 2020 +0300

    0031946: Modeling Data - replace version numbers with enumerations in TopTools and BinTools
    
    Added enumerations BinLDrivers_FormatVersion, BinTools_FormatVersion, TopTools_FormatVersion
    and XmlLDrivers_FormatVersion for more clear version tracking in the code.
    
    Add new optional -version parameter for save/binsave draw commands.
    
    Add new optional -noTriangles option for save/binsave commands to prevent triangulation storing
    
    Add new BinTools::Write & BrepTools::Write overloaded function with version & theWithTriangles parameters
(0097053)
kgv (developer)
2020-11-25 10:24

Following to discussion with Andrey Betenev, TopTools_FormatVersion_VERSION_2 extends TopTools_FormatVersion_VERSION_1 by reading/writing extra properties. In such context, it would useful:
- Check if not-writing these extra properties into V2 file would create a readable file. If yes - add a new flag similar to withTriangles for writing/not writing these properties.
- Analyze what is the use of properties added by V2 and conclude if these should be written by default or not. As current default is V1 in text format (save the XML persistence which uses V2 for some reason) and we have not straggled from issues in testing bugs for many years, the additions of V2 looks doubtful - hence, necessary to double check.
- Provide an interface returning a minimal format version suitable for required set of properties to write (e.g. triangulation + V2 properties + normals). So that the user will choose not a version but meaningful properties necessary to write. Commands "save" and "binsave" will adopt this interface for choosing version (it might be still useful having an explicit "-version" option, but for debugging purposes).
- Make similar analysis for BinTools_FormatVersion as it basically should be the same as TopTools_FormatVersion, but has an extra version bump.
(0097054)
kgv (developer)
2020-11-25 10:29

-  BinTools_FormatVersion_VERSION_3 = 3, //!< (OCCT 6.2.1) Correctly processes geometry with points 
on Curve,
-                                        //!  or point on Surface, or points on curve of surface [#0009745]

+  BinTools_FormatVersion_VERSION_3 = 3,
...
-  XmlLDrivers_FormatVersion_VERSION_9,     //!< (OCCT 7.2.0) No format changes [#0028691]
+  XmlLDrivers_FormatVersion_VERSION_9,

Please restore these comments as well (and they should be probably further improved).
(0097056)
kgv (developer)
2020-11-25 11:16

According to 0029723, it looks like feature of writing UV points is rather useless and can be deprecated in new versions of format persistence...
(0097063)
git (administrator)
2020-11-25 14:17

Branch CR31946_1 has been updated by asuraven.

SHA-1: 386b11ac90f6a8a6e0f6e36e873460dab1438537


Detailed log of new commits:

Author: asuraven
Date: Wed Nov 25 14:17:26 2020 +0300

    * fix

(0097065)
git (administrator)
2020-11-25 14:50

Branch CR31946_1 has been updated by asuraven.

SHA-1: 7434a86a273423ffb939db936200ed3e2913d891


Detailed log of new commits:

Author: kgv
Date: Wed Nov 18 00:06:25 2020 +0300

    # extend version comments

(0097066)
git (administrator)
2020-11-25 14:54

Branch CR31946_2 has been deleted by asuraven.

SHA-1: 548bfca54e977fe497c214c2db82ef8ded2c1269
(0097067)
git (administrator)
2020-11-25 14:54

Branch CR31946_2 has been created by asuraven.

SHA-1: cd42aa846170f1ca4b633e781ad8482074d3ed0a


Detailed log of new commits:

Author: asuraven
Date: Tue Nov 3 17:22:14 2020 +0300

    0031946: Modeling Data - replace version numbers with enumerations in TopTools and BinTools
    
    Added enumerations BinLDrivers_FormatVersion, BinTools_FormatVersion, TopTools_FormatVersion
    and XmlLDrivers_FormatVersion for more clear version tracking in the code.
    
    Add new optional -version parameter for save/binsave draw commands.
    
    Add new optional -noTriangles parameter for save/binsave commands to prevent triangulation storing
    
    Add new BinTools::Write & BrepTools::Write overloaded function with version & isWithTriangles parameters
    
    Extend version comments

- Issue History
Date Modified Username Field Change
2020-11-17 20:15 kgv New Issue
2020-11-17 20:15 kgv Assigned To => msv
2020-11-17 20:16 kgv Relationship added related to 0031136
2020-11-17 20:22 git Note Added: 0096848
2020-11-17 20:22 kgv Assigned To msv => asuraven
2020-11-17 20:22 kgv Status new => assigned
2020-11-17 20:54 git Note Added: 0096850
2020-11-18 00:29 git Note Added: 0096856
2020-11-18 00:31 kgv Relationship added related to 0029217
2020-11-18 00:31 kgv Relationship added related to 0028691
2020-11-19 19:08 git Note Added: 0096904
2020-11-20 18:23 git Note Added: 0096922
2020-11-20 18:26 asuraven Note Added: 0096923
2020-11-20 18:45 kgv Note Added: 0096924
2020-11-20 23:32 msv Note Added: 0096925
2020-11-23 20:21 git Note Added: 0097014
2020-11-24 16:58 git Note Added: 0097038
2020-11-24 16:58 git Note Added: 0097039
2020-11-25 09:39 git Note Added: 0097051
2020-11-25 10:24 kgv Note Added: 0097053
2020-11-25 10:29 kgv Note Added: 0097054
2020-11-25 10:36 emv Relationship added related to 0029723
2020-11-25 11:16 kgv Note Added: 0097056
2020-11-25 14:17 git Note Added: 0097063
2020-11-25 14:50 git Note Added: 0097065
2020-11-25 14:54 git Note Added: 0097066
2020-11-25 14:54 git Note Added: 0097067
2020-11-25 18:53 asuraven File Added: Format versions compare.docx
2020-11-27 17:45 asuraven File Deleted: Format versions compare.docx


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker