MantisBT - Open CASCADE
View Issue Details
0031189Open CASCADE[OCCT] OCCT:DRAWpublic2019-11-24 15:012020-05-10 14:19
kgv 
bugmaster 
normalfeature 
verifiedfixed 
 
[OCCT] 7.5.0 
bugs/fclasses/bug31189
0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
Currently ViewerTest package sends error messages to std::cout or std::cerr.
It is proposed sending them to Message::DefaultMessenger(), which apart from unification will make them colorized.
pload MODELING VISUALIZATION
box b 10 10 10
vdisplay a
vdisplay b
vclear
No tags attached.
related to 0031188verified bugmaster Draw Harness - enable colorized messages output to console by default 
related to 0031501verified bugmaster Foundation Classes, Message_Printer - remove theToPutEndl argument 
png draw_old.png (10,181) 2020-04-15 21:25
https://tracker.dev.opencascade.org/
png draw_new.png (10,331) 2020-04-15 21:25
https://tracker.dev.opencascade.org/
Issue History
2019-11-24 15:01kgvNew Issue
2019-11-24 15:01kgvAssigned To => kgv
2019-11-24 15:04gitNote Added: 0089189
2019-11-24 15:04kgvRelationship addedrelated to 0031188
2020-04-15 15:38gitNote Added: 0091554
2020-04-15 18:16gitNote Added: 0091561
2020-04-15 18:57gitNote Added: 0091562
2020-04-15 20:05gitNote Added: 0091565
2020-04-15 20:09gitNote Added: 0091566
2020-04-15 20:46gitNote Added: 0091570
2020-04-15 20:55gitNote Added: 0091571
2020-04-15 21:25kgvFile Added: draw_old.png
2020-04-15 21:25kgvFile Added: draw_new.png
2020-04-16 00:05kgvRelationship addedrelated to 0031501
2020-04-16 14:31kgvNote Added: 0091593
2020-04-16 14:31kgvAssigned Tokgv => abv
2020-04-16 14:31kgvStatusnew => resolved
2020-04-29 09:41gitNote Added: 0091835
2020-04-29 09:41abvNote Added: 0091836
2020-04-29 09:41abvAssigned Toabv => kgv
2020-04-29 09:41abvStatusresolved => assigned
2020-04-29 09:41abvStatusassigned => feedback
2020-04-29 10:08kgvNote Added: 0091837
2020-04-29 10:09kgvAssigned Tokgv => abv
2020-04-29 11:21gitNote Added: 0091842
2020-04-29 11:21abvNote Added: 0091843
2020-04-29 11:22abvAssigned Toabv => kgv
2020-04-29 11:22abvStatusfeedback => resolved
2020-04-29 11:29kgvNote Added: 0091845
2020-04-29 13:20kgvNote Added: 0091858
2020-04-29 13:23gitNote Added: 0091859
2020-04-29 13:31kgvNote Added: 0091860
2020-04-29 13:31kgvAssigned Tokgv => abv
2020-04-29 13:31kgvStatusresolved => assigned
2020-04-29 22:12gitNote Added: 0091879
2020-04-30 07:50abvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22877#r22877
2020-04-30 07:55gitNote Added: 0091887
2020-04-30 11:02gitNote Added: 0091888
2020-04-30 14:09abvNote Added: 0091898
2020-04-30 14:09abvAssigned Toabv => kgv
2020-04-30 14:09abvStatusassigned => resolved
2020-04-30 14:34kgvNote Added: 0091900
2020-04-30 14:34kgvAssigned Tokgv => bugmaster
2020-04-30 14:34kgvStatusresolved => reviewed
2020-05-07 10:50bugmasterNote Added: 0091979
2020-05-07 10:50bugmasterStatusreviewed => tested
2020-05-07 10:55bugmasterTest case number => bugs/fclasses/bug31189
2020-05-10 14:01bugmasterChangeset attached => occt master 23fe70ec
2020-05-10 14:01bugmasterStatustested => verified
2020-05-10 14:01bugmasterResolutionopen => fixed
2020-05-10 14:16gitNote Added: 0092047
2020-05-10 14:17gitNote Added: 0092055
2020-05-10 14:17gitNote Added: 0092056
2020-05-10 14:17gitNote Added: 0092057

Notes
(0089189)
git   
2019-11-24 15:04   
Branch CR31189 has been created by kgv.

SHA-1: dd62701926cfe7906e6dec9cc7e9e3abeac9a5f5


Detailed log of new commits:

Author: kgv
Date: Sun Nov 24 15:02:39 2019 +0300

    0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
    
    Message::Send() - added short-cuts for sending message to default messenger.
    ViewerTest has been updated to send messages to Message::DefaultMessenger()
    instead of direct output to std::cout/std::cerr.
(0091554)
git   
2020-04-15 15:38   
Branch CR31189_1 has been created by kgv.

SHA-1: 4340d5fb031703d657fe706b976b4c9dfaffe267


Detailed log of new commits:

Author: kgv
Date: Sun Nov 24 15:02:39 2019 +0300

    0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
    
    Message::Send() - added short-cuts for sending message to default messenger.
    ViewerTest has been updated to send messages to Message::DefaultMessenger()
    instead of direct output to std::cout/std::cerr.
(0091561)
git   
2020-04-15 18:16   
Branch CR31189_2 has been created by kgv.

SHA-1: 8d55b92963ccffc598a7bdf89ce2f4c665399eb5


Detailed log of new commits:

Author: kgv
Date: Sun Nov 24 15:02:39 2019 +0300

    0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
    
    Message::Send() - added short-cuts for sending message to default messenger.
    ViewerTest has been updated to send messages to Message::DefaultMessenger()
    instead of direct output to std::cout/std::cerr.
(0091562)
git   
2020-04-15 18:57   
Branch CR31189_2 has been updated forcibly by kgv.

SHA-1: 8c0a8876997f2a3ae45e1fc556ceb32e1f2d4c3f
(0091565)
git   
2020-04-15 20:05   
Branch CR31189_2 has been updated forcibly by kgv.

SHA-1: bd6a0eb1209fcb85e7c37bf40a67fabb87e65353
(0091566)
git   
2020-04-15 20:09   
Branch CR31189_2 has been updated forcibly by kgv.

SHA-1: 6654f42adda2f8914a3f9690cfa8cca53afd7ca0
(0091570)
git   
2020-04-15 20:46   
Branch CR31189_2 has been updated forcibly by kgv.

SHA-1: fc63030cc707fb301d787eecff45bcd181872bbc
(0091571)
git   
2020-04-15 20:55   
Branch CR31189_2 has been updated forcibly by kgv.

SHA-1: 99e8de453210c8da32eb566f50085a6866eb22fd
(0091593)
kgv   
2020-04-16 14:31   
Patch is ready for review in branches CR31189_2 of OCCT and OCC Products.

http://jenkins-test-12.nnov.opencascade.com/view/CR31189_2-master-KGV/ [^]
(0091835)
git   
2020-04-29 09:41   
Branch CR31189_3 has been created by abv.

SHA-1: cac74814a86f31f718e788b1cecfe6bc19d1e39b


Detailed log of new commits:

Author: kgv
Date: Sun Nov 24 15:02:39 2019 +0300

    0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
    
    Added short-cuts methods in Message_Messenger for sending message with specified gravity,
    and stream buffer class for using stream-like interface for that.
    Similar short-cuts to DefaultMessenger() are added in Message package.
    
    ViewerTest has been updated to send messages to Message::DefaultMessenger()
    instead of direct output to std::cout/std::cerr.
(0091836)
abv   
2020-04-29 09:41   
I believe the same API can be also useful for Message_Messenger class itself, not only for its global default instance. I have put modified implementation to CR32289_3, please have a look.

I deem we do not need to expose this interface in C# wrapper, do you agree? I have not modified products branch yet, and did not run tests.

Besides, can you explain why some uses of std::cout remained in ViewerTest package? Should not they be replaced as well?
(0091837)
kgv   
2020-04-29 10:08   
> I deem we do not need to expose this interface in C# wrapper, do you agree?
The purpose of the patch in Products branch is silencing SWIG warnings - I have not found a simpler way to shut up SWIG.

> can you explain why some uses of std::cout remained in ViewerTest package?
As the first iteration, the patch is focused on replacing Error / Fail output messages. Few remaining cases are not failures, but user input requests or some information output with an uncertainly how to classify them (trace / info / Tcl / something else), so that they have been left for future iterations.

+    StreamBuffer (const StreamBuffer&& theOther) 

Your patch relies on Move constructor.
Shouldn't StreamBuffer copy constructor be disabled?
How patch can be applied for ancient C++ compilers, which we still have to support?

+  //! message via stream interface, and and putting result into its creator

and and
(0091842)
git   
2020-04-29 11:21   
Branch CR31189_3 has been updated forcibly by abv.

SHA-1: 1fbb8934b8d48e0fd7e0fd13316f26f286f8bbde
(0091843)
abv   
2020-04-29 11:21   
SWIG warnings can be avoided by adding %ignore for methods that return non-wrapped class. Can you do that? (I do not have SWIG configured)

As far as I understand, move semantic is supported by all compilers we support except VS 2008, which does not seem to be really important, so can be dropped I suppose (it is 13 years old!). VS 2010 builds fine.

"and and" is corrected in updated version of the branch
(0091845)
kgv   
2020-04-29 11:29   
> SWIG warnings can be avoided by adding %ignore for methods that return non-wrapped class.
You may try - I spent half a day with no luck.
(0091858)
kgv   
2020-04-29 13:20   
>CMake Error at adm/cmake/occt_toolkit.cmake:209 (add_library):
> Cannot find source file:
> /dn62/builds/CR31189_3-master-KGV/OCCT_SRC/src/Message/Message_StreamBuffer.hxx
(0091859)
git   
2020-04-29 13:23   
Branch CR31189_3 has been updated forcibly by kgv.

SHA-1: 01818f15084b967a3c7339d66406abd77f741c5a
(0091860)
kgv   
2020-04-29 13:31   
http://vm-jenkins-test-12.nnov.opencascade.com:8080/job/CR31189_3-master-KGV-OCCT-Debian80-64-opt-compile/2/parsed_console/ [^]
/src/Message/Message_Messenger.hxx: In constructor ‘Message_Messenger::StreamBuffer::StreamBuffer(const 
Message_Messenger::StreamBuffer&&)’:
/src/Message/Message_Messenger.hxx:81:70: error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const 
std::basic_stringstream<char>&)’
(0091879)
git   
2020-04-29 22:12   
Branch CR31189_3 has been updated forcibly by abv.

SHA-1: ba7126d64c87208365cce22e16122ed203cfdfe6
(0091887)
git   
2020-04-30 07:55   
Branch CR31189_3 has been updated forcibly by abv.

SHA-1: 0f7af398afb3f05d6d5553587038851be76d29a6
(0091888)
git   
2020-04-30 11:02   
Branch CR31189_3 has been updated forcibly by abv.

SHA-1: 0194f6b198a14ffc002e49ba6a66b9ab5c1681ab
(0091898)
abv   
2020-04-30 14:09   
I have refactored implementation to avoid compiler warnings, please review. Jenkins job CR31189_3-master-KGV has mostly completed. Note that passing std::endl to StreamBuffer will send a message and reset to empty state, this shall allow using it in a more transparent and natural way (mostly like ostream).
(0091900)
kgv   
2020-04-30 14:34   
Please raise the patch in OCCT and OCC Products branches CR31189_3.
(0091979)
bugmaster   
2020-05-07 10:50   
Combination -
OCCT branch : WEEK-18
master SHA - b40cdc2b5584fdf78f90594a3c7469213c7dc4a6
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : WEEK-18 SHA - f3160246a8ae8356b116065842ce354791652bb4
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
Total CPU difference: 17165.480000000167 / 17147.810000000212 [+0.10%]
Products
Total CPU difference: 11271.100000000095 / 11280.480000000087 [-0.08%]
Windows-64-VC14:
OCCT
Total CPU difference: 18654.578125 / 18665.890625 [-0.06%]
Products
Total CPU difference: 13128.59375 / 13209.109375 [-0.61%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0092047)
git   
2020-05-10 14:16   
Branch CR31189_3 has been deleted by inv.

SHA-1: 0194f6b198a14ffc002e49ba6a66b9ab5c1681ab
(0092055)
git   
2020-05-10 14:17   
Branch CR31189_2 has been deleted by inv.

SHA-1: 99e8de453210c8da32eb566f50085a6866eb22fd
(0092056)
git   
2020-05-10 14:17   
Branch CR31189_1 has been deleted by inv.

SHA-1: 4340d5fb031703d657fe706b976b4c9dfaffe267
(0092057)
git   
2020-05-10 14:17   
Branch CR31189 has been deleted by inv.

SHA-1: dd62701926cfe7906e6dec9cc7e9e3abeac9a5f5