MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031326Open CASCADE[OCCT] OCCT:Visualizationpublic2020-01-28 18:302020-02-12 23:35
Reporternds 
Assigned Tonds 
PrioritynormalSeverityfeature 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0031326: Foundation Classes - Init from Json for base OCCT classes
DescriptionSome OCCT classes have DumpJson into a stream.
It's proposed to be able to fulfill an instance of the object by the stream.
Result is the object and a boolean state about success.
TagsNo tags attached.
Test case number
Attached Files

- Relationships
child of 0031313verifiedbugmaster Foundation Classes - Dump improvement for classes 
child of 0030949closedbugmaster Foundation Classes - Dump improvement for OCCT classes 

-  Notes
(0090110)
git (administrator)
2020-01-28 18:31

Branch CR31326 has been created by nds.

SHA-1: 4bd49af69b5ea0fa9e40d68f0c6f8bcc311eb724


Detailed log of new commits:

Author: nds
Date: Tue Jan 28 18:28:00 2020 +0300

    0031326: Foundation Classes - Init from Json for base OCCT classes
(0090176)
git (administrator)
2020-01-30 01:57

Branch CR31326_1 has been created by nds.

SHA-1: 427c6cd7d47af1d7b902927e7fa411acfe1ef325


Detailed log of new commits:

Author: nds
Date: Tue Jan 28 18:28:00 2020 +0300

    0031326: Foundation Classes - Init from Json for base OCCT classes
(0090188)
git (administrator)
2020-01-30 08:45

Branch CR31326 has been deleted by nds.

SHA-1: 4bd49af69b5ea0fa9e40d68f0c6f8bcc311eb724
(0090191)
nds (developer)
2020-01-30 09:33

Dear Kirill,

could you please review patch.
Jenkins job: http://jenkins-test-12.nnov.opencascade.com/view/CR31326_1-master-NDS/view/COMPARE/ [^]
please, note that patch is based on fix for 31313.

Thank you in advance, Natalia
(0090198)
kgv (developer)
2020-01-30 12:35

+  Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)

+  {

Please move method implementation after class declaration.

+  //! Inits the content of me into the stream

...from the stream.

+Standard_Boolean  gp_Ax3::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& 
theStreamPos)
...
+Standard_Boolean  gp_Trsf::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& 
theStreamPos)

Double space.

+  Standard_Real mymatrix[3][3];
...
+  Standard_Real myshape;

aMatrix, aShape.

+Standard_Boolean Standard_Dump::ProcessStreamName (const Standard_SStream& theStream,
+                                                   const TCollection_AsciiString& theName,
+                                                   Standard_Integer& theStreamPos)
+{
+  TCollection_AsciiString aText = Text (theStream);

This conception looks very confusing.
Why not just read from JSON loaded into TCollection_AsciiString?

+  if (aSubText.StartsWith (JsonKeyToString (Standard_JsonKey_SeparatorValueToValue)))

Adding "StartsWithAt()" taking position would allow avoiding creation of redundant copy.
(0090218)
nds (developer)
2020-01-30 22:59

Dear Kirill,

Something is not clear:
1. < This conception looks very confusing.
Why not just read from JSON loaded into TCollection_AsciiString? >

Here, is it expected that parameter of this method is not a stream but a text?

2. << Adding "StartsWithAt()"... >>

 TCollection_AsciiString has no StartsWithAt(). Could you please explain in more detail what do you mean here?
(0090219)
kgv (developer)
2020-01-30 23:39

> Here, is it expected that parameter of this method is not a stream but a text?
Yes, it makes no sense passing stream everywhere, to read it entirely into string.

+  TCollection_AsciiString aSubText = aText.SubString (theStreamPos, aText.Length());
+  if (aSubText.StartsWith (JsonKeyToString (Standard_JsonKey_SeparatorValueToValue)))
+  {
+    theStreamPos += JsonKeyLength (Standard_JsonKey_SeparatorValueToValue);
+    aSubText = aText.SubString (theStreamPos, aText.Length());
+  }

> TCollection_AsciiString has no StartsWithAt(). Could you please explain in more detail what do you mean here?
if (theText.StartsWithAt (", ", theStreamPos))
{
  theStreamPos += JsonKeyLength (Standard_JsonKey_SeparatorValueToValue);
}
TCollection_AsciiString aSubText = aText.SubString (theStreamPos, aText.Length());
(0090499)
git (administrator)
2020-02-12 23:35

Branch CR31326_2 has been created by nds.

SHA-1: 10ac0403384f4d7020d4155b7db1de8d5752bde8


No new revisions were added by this update.
(0090500)
git (administrator)
2020-02-12 23:35

Branch CR31326_2 has been updated by nds.

SHA-1: 55b405ba591587b3456d77e0d406a117e8ded286


Detailed log of new commits:

Author: nds
Date: Wed Feb 12 23:35:54 2020 +0300

    0031326: Foundation Classes - Init from Json for base OCCT classes


- Issue History
Date Modified Username Field Change
2020-01-28 18:30 nds New Issue
2020-01-28 18:30 nds Assigned To => nds
2020-01-28 18:31 git Note Added: 0090110
2020-01-28 18:32 nds Relationship added child of 0031313
2020-01-30 01:57 git Note Added: 0090176
2020-01-30 08:36 nds Assigned To nds => kgv
2020-01-30 08:36 nds Status new => resolved
2020-01-30 08:36 nds Additional Information Updated View Revisions
2020-01-30 08:45 git Note Added: 0090188
2020-01-30 09:33 nds Note Added: 0090191
2020-01-30 09:33 nds Additional Information Updated View Revisions
2020-01-30 12:09 kgv Relationship added child of 0030949
2020-01-30 12:35 kgv Note Added: 0090198
2020-01-30 12:35 kgv Assigned To kgv => nds
2020-01-30 12:35 kgv Severity minor => feature
2020-01-30 12:35 kgv Status resolved => assigned
2020-01-30 22:59 nds Note Added: 0090218
2020-01-30 23:39 kgv Note Added: 0090219
2020-02-12 23:35 git Note Added: 0090499
2020-02-12 23:35 git Note Added: 0090500


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker