MantisBT - Open CASCADE
View Issue Details
0027932Open CASCADE[OCCT] OCCT:Application Frameworkpublic2016-10-05 17:182016-12-09 16:39
szy 
abv 
normalminor 
closedfixed 
[OCCT] 7.0.0 
[OCCT] 7.1.0[OCCT] 7.1.0 
caf basic A4, A5, A6, B4, B6, E4, E5, E6, N4, N5, N6
0027932: Improvement of standard attributes usability
Current OCAF approach allows to set on the same label only one Attribute of the same type, for example only one TDataStd_Real attribute.
It is proposed to remove this limitation by adding so called 'user defined' feature to the attribute. I.e. it is proposed to keep GUID (identifying the attribute) as internal field. For example, TDataStd_Real could use the following syntax to set attribute to the given label:

#define DENSITY Standard_GUID("12e9454b-6dbc-11d4-b9c8-0060b0ee2810")
#define VOLUME Standard_GUID("12e9454b-6dbc-11d4-b9c8-0060b0ee2811")
TDF_Label aLabel;
TDataStd_Real::Set(aLabel, 1.1); // the current API
TDataStd_Real::Set(aLabel, DENSITY, 1.2);// same attribute type with user defined GUID
TDataStd_Real::Set(aLabel, VOLUME, 1.3); // same attribute type with user defined GUID

The next list of attributes is supposed to be modified:
TDataStd_Real
TDataStd_Integer
TDataStd_Name
TDataStd_AsciiString

TDataStd_RealArray
TDataStd_IntegerArray
TDataStd_BooleanArray
TDataStd_ReferenceArray
TDataStd_ByteArray
TDataStd_ExtStringArray

TDataStd_RealList
TDataStd_IntegerList
TDataStd_BooleanList
TDataStd_ExtStringList
TDataStd_ReferenceList
TDataStd_ListOfByte

TDataStd_IntPackedMap
The branch CR27932_2 was created rebased to master: the description is updated.
1)Modified sources:

TDataStd
  TDataStd_AsciiString.cx
  TDataStd_AsciiString.hx
  TDataStd_Integer.cxx
  TDataStd_Integer.hxx
  TDataStd_Name.cxx
  TDataStd_Name.hxx
  TDataStd_Real.cxx
  TDataStd_Real.hxx
DDataStd
  DDataStd_BasicCommands.cxx
  DDataStd_NameCommands.cxx
BinLDrivers
  BinLDrivers.cxx
BinMDataStd
BinMDataStd_AsciiStringDriver.cxx
  BinMDataStd_IntegerDriver.cxx
  BinMDataStd_NameDriver.cxx
  BinMDataStd_RealDriver.cxx
XmlMDataStd
  XmlMDataStd_AsciiStringDriver.cxx
  XmlMDataStd_IntegerDriver.cxx
  XmlMDataStd_NameDriver.cxx
  XmlMDataStd_RealDriver.cxx
StdLPersistent
  StdLPersistent_Real.hxx
  StdLPersistent_Value.cxx
  StdLPersistent_Value.hxx
Standard
  Standard_GUID.cxx
  Standard_GUID.hxx

2)Description
The listed attributes (TDataStd_Integer, TDataStd_Real, TDataStd_Name, TDataStd_AsciiString) received the new feature to be user defined. It allows to set at the same Label as many attributes of the same type as you want. Let's consider it on example of the TDataStd_Real attribute. The previous version of the attribute allows to set the attribute using static method Set in next way:

static Handle(TDataStd_Real) Set (const TDF_Label& label, const Standard_Real value);
The is a default form which is kept by the attribute. It uses for the attribute identification the default GUID - TDataStd_Real::GetID(). In case if you want to use the new feature (user defined Real attribute), for example to define several attributes which should keep a value of the same type - Standard_Real, but to be associated with different user's notions (or objects) the new static method Set should be used. In our example we will define two Real attributes which presents two customer's objects - Density and Volume and will be put on the same Label.

#define DENSITY Standard_GUID("12e9454b-6dbc-11d4-b9c8-0060b0ee2810")

#define VOLUME Standard_GUID("12e9454b-6dbc-11d4-b9c8-0060b0ee2811")

TDF_Label aLabel = ...;

// Real attribute type with user defined GUID associated with user's object "Density"
TDataStd_Real::Set(aLabel, DENSITY, 1.2);

// Real attribute type with user defined GUID associated with user's object "Volume"
TDataStd_Real::Set(aLabel, VOLUME, 185.5);

To find an user defined Real attribute just use a corresponding GUID:
Handle (TDataStd_Real anAtt;
aLabel.FindAttribute (DENSITY, anAtt);
No tags attached.
Issue History
2016-10-05 17:18szyNew Issue
2016-10-05 17:18szyAssigned To => szy
2016-10-05 17:19szyStatusnew => assigned
2016-10-05 17:22szyDescription Updatedbug_revision_view_page.php?rev_id=14883#r14883
2016-10-13 17:08gitNote Added: 0058682
2016-10-13 17:15szyNote Added: 0058683
2016-10-13 17:15szyAssigned Toszy => mpv
2016-10-13 17:15szyStatusassigned => resolved
2016-10-13 17:15szySteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14947#r14947
2016-10-14 11:35szyAdditional Information Updatedbug_revision_view_page.php?rev_id=14974#r14974
2016-10-14 19:45mpvNote Added: 0058747
2016-10-14 19:45mpvAssigned Tompv => szy
2016-10-14 19:45mpvStatusresolved => assigned
2016-10-17 11:43szyNote Added: 0058769
2016-10-17 11:43szyStatusassigned => resolved
2016-10-17 11:44szyNote Added: 0058770
2016-10-17 11:44szyAssigned Toszy => bugmaster
2016-10-17 11:44szyStatusresolved => reviewed
2016-10-17 11:47mkvAssigned Tobugmaster => mkv
2016-10-17 12:13gitNote Added: 0058772
2016-10-17 19:30mkvNote Added: 0058826
2016-10-17 19:31mkvNote Added: 0058827
2016-10-17 19:32mkvNote Added: 0058828
2016-10-17 19:32mkvAssigned Tomkv => szy
2016-10-17 19:32mkvStatusreviewed => assigned
2016-10-17 19:33mkvTest case number => caf basic A4, A5, A6, B4, B6, E4, E5, E6, N4, N5, N6
2016-10-27 17:56gitNote Added: 0059290
2016-10-27 17:58szyNote Added: 0059291
2016-10-27 17:58szyStatusassigned => resolved
2016-10-27 17:58szyNote Added: 0059292
2016-10-27 17:58szyAssigned Toszy => bugmaster
2016-10-27 17:58szyStatusresolved => reviewed
2016-10-27 18:18mkvAssigned Tobugmaster => mkv
2016-10-28 15:13gitNote Added: 0059340
2016-11-02 12:13mkvNote Added: 0059760
2016-11-02 12:14mkvNote Added: 0059761
2016-11-02 12:14mkvNote Added: 0059762
2016-11-02 12:14mkvAssigned Tomkv => bugmaster
2016-11-02 12:14mkvStatusreviewed => tested
2016-11-02 14:29gitNote Added: 0059784
2016-11-02 14:29mkvNote Added: 0059785
2016-11-02 16:21abvTarget Version7.1.0 => 7.2.0
2016-11-03 12:25abvTarget Version7.2.0 => 7.1.0
2016-11-08 11:29gitNote Added: 0059983
2016-11-08 11:31mpvAssigned Tobugmaster => mpv
2016-11-08 11:31mpvStatustested => assigned
2016-11-08 11:32mpvStatusassigned => resolved
2016-11-08 11:32mpvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15219#r15219
2016-11-08 11:33mpvNote Added: 0059984
2016-11-08 11:33mpvAssigned Tompv => bugmaster
2016-11-08 11:33mpvStatusresolved => reviewed
2016-11-09 11:53apvNote Added: 0060083
2016-11-09 11:53apvStatusreviewed => tested
2016-11-09 17:43abvChangeset attached => occt master fa53efef
2016-11-09 17:43abvAssigned Tobugmaster => abv
2016-11-09 17:43abvStatustested => verified
2016-11-09 17:43abvResolutionopen => fixed
2016-11-21 18:19kgvRelationship addedrelated to 0028134
2016-12-07 11:25gitNote Added: 0061207
2016-12-07 11:25gitNote Added: 0061208
2016-12-07 11:30gitNote Added: 0061251
2016-12-09 16:30aivStatusverified => closed
2016-12-09 16:39aivFixed in Version => 7.1.0

Notes
(0058682)
git   
2016-10-13 17:08   
Branch CR27932 has been created by szy.

SHA-1: 448e5bee3f2a1fabb00a2ccce50be368a3186ac0


Detailed log of new commits:

Author: szy
Date: Thu Oct 13 17:07:52 2016 +0300

    0027932: Improvement of standard attributes usability.
    
    1. Modified sources
    2. Added new testing scripts
(0058683)
szy   
2016-10-13 17:15   
Removed the limitation (one attribute of the same type per label) for the next set of standard attributes:
1)TDataStd_Integer
2)TDataStd_Real
3)TDataStd_Name
4)TDataStd_AsciiString

There is no regressions.
Review, please.
(0058747)
mpv   
2016-10-14 19:45   
For me it is ok. Please, continue with other attributes.
(0058769)
szy   
2016-10-17 11:43   
Resolved.
I will split content of the current issue to two parts (taking into account that one of our customers is interesting in this extension):
1)simple data: Integer, Real, Name, AsciiString
2)data containers:IntegerArray, RealArray and so on...
It will allow speed up the first part of the patch.
(0058770)
szy   
2016-10-17 11:44   
Reviewed.
Test, please.
(0058772)
git   
2016-10-17 12:13   
Branch CR27932 has been updated forcibly by mkv.

SHA-1: c21a071d4029a4a550ac56abaa9ab925ab5a7cf9
(0058826)
mkv   
2016-10-17 19:30   
Dear BugMaster,
Branch CR27932 was rebased on current master of occt git-repository.
SHA-1: c21a071d4029a4a550ac56abaa9ab925ab5a7cf9
(0058827)
mkv   
2016-10-17 19:31   
Dear BugMaster,
Branch CR27932 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: c21a071d4029a4a550ac56abaa9ab925ab5a7cf9

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 63 (63 on master)
Windows: 0 (0 on master)
MacOS : 1141

Regressions/Differences/Improvements:
http://occt-tests/CR27932-master-OCCT/Debian70-64/summary.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/summary.html [^]
Failed:
  bugs step bug27313
  gdt dimensions A1, A2, A3, A4, A5, A6, A7, A8, A9
  gdt export A1, A2, A3, A4, A5, A6, A7, A8, A9, B1, B2, B3, B4, B5
  gdt import A1, A2, A3, A4, A5
  gdt presentation A1, A2, A3, A4, A9, B1, B4
  gdt tolerances A1, A2

Testing cases:
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/A4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/A4.html [^]
caf basic A4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/A5.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/A5.html [^]
caf basic A5: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/A6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/A6.html [^]
caf basic A6: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/B4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/B4.html [^]
caf basic B4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/B6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/B6.html [^]
caf basic B6: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/E4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/E4.html [^]
caf basic E4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/E5.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/E5.html [^]
caf basic E5: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/E6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/E6.html [^]
caf basic E6: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/N4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/N4.html [^]
caf basic N4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/N5.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/N5.html [^]
caf basic N5: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/N6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/N6.html [^]
caf basic N6: OK

Testing on Linux:
occt component :
Total MEMORY difference: 91066997 / 90394512 [+0.74%]
Total CPU difference: 19299.019999999902 / 19420.269999999935 [-0.62%]
products component :
Total MEMORY difference: 30091122 / 30067436 [+0.08%]
Total CPU difference: 5317.859999999957 / 5271.7599999999675 [+0.87%]

Testing on Windows:
occt component :
Total MEMORY difference: 57242327 / 57250244 [-0.01%]
Total CPU difference: 19022.075535598615 / 18101.186032498666 [+5.09%]
products component :
Total MEMORY difference: 21302191 / 21265221 [+0.17%]
Total CPU difference: 5480.049928299974 / 5148.189000999964 [+6.45%]

There are no differences in images found by testdiff.
(0058828)
mkv   
2016-10-17 19:32   
Dear szy,
Branch CR27932 has been rejected due to:
- regressions/differences/improvements
(0059290)
git   
2016-10-27 17:56   
Branch CR27932_1 has been created by szy.

SHA-1: 16387063fdaa9eed4b55632ff06cd4b5e67ca0c9


Detailed log of new commits:

Author: szy
Date: Thu Oct 27 17:55:43 2016 +0300

    0027932: Improvement of standard attributes usability.
    
    Extension of simple standard attributes: Integer, Real, Name, AsciiString.
(0059291)
szy   
2016-10-27 17:58   
Regressions fixed in branch CR27932_1.
(0059292)
szy   
2016-10-27 17:58   
Reviewed.
Test, please.
(0059340)
git   
2016-10-28 15:13   
Branch CR27932_1 has been updated forcibly by mkv.

SHA-1: d6fa7c0857830b61e408d5f41d7b1294954303d2
(0059760)
mkv   
2016-11-02 12:13   
Dear BugMaster,
Branch CR27932_1 was rebased on current master of occt git-repository.
SHA-1: d6fa7c0857830b61e408d5f41d7b1294954303d2
(0059761)
mkv   
2016-11-02 12:14   
Dear BugMaster,
Branch CR27932_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: d6fa7c0857830b61e408d5f41d7b1294954303d2

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :1
Linux: 63 (63 on master)
Windows: 0 (0 on master)
MacOS : 1142

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/A4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/A4.html [^]
caf basic A4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/A5.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/A5.html [^]
caf basic A5: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/A6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/A6.html [^]
caf basic A6: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/B4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/B4.html [^]
caf basic B4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/B6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/B6.html [^]
caf basic B6: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/E4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/E4.html [^]
caf basic E4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/E5.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/E5.html [^]
caf basic E5: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/E6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/E6.html [^]
caf basic E6: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/N4.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/N4.html [^]
caf basic N4: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/N5.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/N5.html [^]
caf basic N5: OK
http://occt-tests/CR27932-master-OCCT/Debian70-64/caf/basic/N6.html [^]
http://occt-tests/CR27932-master-OCCT/Windows-64-VC10/caf/basic/N6.html [^]
caf basic N6: OK

Testing on Linux:
occt component :
Total MEMORY difference: 91508883 / 90750518 [+0.84%]
Total CPU difference: 19423.23999999989 / 19313.739999999896 [+0.57%]
products component :
Total MEMORY difference: 30570595 / 30591759 [-0.07%]
Total CPU difference: 5319.779999999979 / 5294.23999999997 [+0.48%]

Testing on Windows:
occt component :
Total MEMORY difference: 57319429 / 57321116 [-0.00%]
Total CPU difference: 17968.241980298597 / 18220.18359529866 [-1.38%]
products component :
Total MEMORY difference: 21510427 / 21474056 [+0.17%]
Total CPU difference: 5210.714201799966 / 5260.400520299964 [-0.94%]

There are no differences in images found by testdiff.
(0059762)
mkv   
2016-11-02 12:14   
Dear BugMaster,
Branch CR27932_1 is TESTED.
(0059784)
git   
2016-11-02 14:29   
Branch CR27932_1 has been updated by mkv.

SHA-1: 271a0dcfcbaee9390ac36f3e20107225356f688a


Detailed log of new commits:

Author: mkv
Date: Wed Nov 2 14:29:00 2016 +0300

    Test case for issue CR27932

(0059785)
mkv   
2016-11-02 14:29   
Dear BugMaster,
additional test case was pushed to branch CR27932_1 of occt git-repository

http://occt-tests/CR27932_1-master-OCCT/Debian70-64/caf/basic/B5.html [^]
http://occt-tests/CR27932_1-master-OCCT/Windows-64-VC10/caf/basic/B5.html [^]
caf basic B5: OK
(0059983)
git   
2016-11-08 11:29   
Branch CR27932_2 has been created by mpv.

SHA-1: 0b547b55eacc9c7f53bf868c1dd46066e82f6962


Detailed log of new commits:

Author: mpv
Date: Tue Nov 8 11:29:14 2016 +0300

    Several simple and most popular OCAF attributes are extended: TDataStd_AsciiString, TDataStd_Integer, TDataStd_Name, TDataStd_Real.
    
    Now such attribute of one type may be placed at the same label using different user-defined GUIDs. For this new "Set" methods were added into each attribute, which takes this custom GUID as an argument.
    Other management of attributes on label stays the same. The format of stored/retrieved document is unchanged until a developer does not start to use this new functionality. Thus, the previously saved documents are fully supported, but the new documents with this extension used will be not-readable by the previous version of OCAF libraries.
(0059984)
mpv   
2016-11-08 11:33   
The branch CR27932_2 is prepared, ready for re-testing and integration into 7.1.0.
(0060083)
apv   
2016-11-09 11:53   
Tested in scope of CR0-IR-2016-11-08
(0061207)
git   
2016-12-07 11:25   
Branch CR27932 has been deleted by kgv.

SHA-1: c21a071d4029a4a550ac56abaa9ab925ab5a7cf9
(0061208)
git   
2016-12-07 11:25   
Branch CR27932_1 has been deleted by kgv.

SHA-1: 271a0dcfcbaee9390ac36f3e20107225356f688a
(0061251)
git   
2016-12-07 11:30   
Branch CR27932_2 has been deleted by kgv.

SHA-1: 0b547b55eacc9c7f53bf868c1dd46066e82f6962