MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030537Open CASCADE[OCCT] OCCT:Visualizationpublic2019-03-04 20:072019-07-18 17:34
Reporternds 
Assigned Tonds 
PrioritynormalSeverityminor 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030537: Visualization - wrapping text in font text formatter
DescriptionProvide a possibility to wrap the text given into Font_TextFormatter.
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0082596)
git (administrator)
2019-03-04 20:09

Branch CR30537 has been created by nds.

SHA-1: 858c86bc219d831d4baf2bb6506991761949c5bd


Detailed log of new commits:

Author: nds
Date: Mon Mar 4 20:04:26 2019 +0300

    0030537: Visualization - wrapping text in font text formatter
(0082600)
git (administrator)
2019-03-05 06:43

Branch CR30537 has been updated by nds.

SHA-1: 217d9b95df29d8d34807608d8738719e48304529


Detailed log of new commits:

Author: nds
Date: Tue Mar 5 06:38:12 2019 +0300

    0030537: Visualization - wrapping text in font text formatter
    
    #compilation correction

(0082695)
git (administrator)
2019-03-05 14:04

Branch CR30537 has been updated by nds.

SHA-1: 85092818767d50c34928ff76619d24dc5377a40c


Detailed log of new commits:

Author: nds
Date: Tue Mar 5 13:52:37 2019 +0300

    0030537: Visualization - wrapping text in font text formatter
    
    #LineWidth public method, correction to compute line width in Format()

(0082700)
git (administrator)
2019-03-05 18:56

Branch CR30537 has been updated by nds.

SHA-1: 3ae32a0a4e0fea48e00947c1761f60a0e123e45e


Detailed log of new commits:

Author: nds
Date: Tue Mar 5 18:51:12 2019 +0300

    0030537: Visualization - wrapping text in font text formatter
    
    #corners should be arranged around (0,0) point, example of the first point if rect width is 100, symbol has an empty width:
    # - left alignment: (-50, 0)
    # - center alignment: (0, 0)
    # - right alignment: (50, 0)

(0082702)
git (administrator)
2019-03-05 19:14

Branch CR30537 has been updated by nds.

SHA-1: f3a4b8369495a2c2723cb19d91cdd9cff4401df3


Detailed log of new commits:

Author: nds
Date: Tue Mar 5 18:54:28 2019 +0300

    0030537: Visualization - wrapping text in font text formatter
    
    #corners should be arranged around (0,0) point, example of the first point if rect width is 100, symbol has an empty width:
    # - left alignment: (-50, 0)
    # - center alignment: (0, 0)
    # - right alignment: (50, 0)
    
    (cherry picked from commit 783914e968375a3165dffc83ae66c285a8c8dcbc)

(0082704)
git (administrator)
2019-03-05 20:04

Branch CR30537 has been updated by nds.

SHA-1: 1bbbcca13bc8d1edb782c51793c73c453dd2ef92


Detailed log of new commits:

Author: nds
Date: Tue Mar 5 19:57:36 2019 +0300

    0030537: Visualization - wrapping text in font text formatter
    
    # last row length correction
    
    (cherry picked from commit 7dab09204f899fc54dbd5379bcd76e7d23af831d)

(0085741)
git (administrator)
2019-07-18 11:09

Branch CR30537_1 has been created by nds.

SHA-1: 7ba0c7dc49b4de17aa99908ceea25cc9bdff8909


Detailed log of new commits:

Author: nds
Date: Thu Mar 7 16:28:20 2019 +0300

    0030537: Visualization - wrapping text in font text formatter
    
    (cherry picked from commit 8016b09836d484f061a75ac303953f9d80c05109)
    
    # Conflicts:
    # src/Graphic3d/Graphic3d_Group.hxx
    # src/OpenGl/OpenGl_Text.hxx
    (cherry picked from commit c0a38f3a5294cc0f168bc592f17f4ec9837d5a48)
    (cherry picked from commit ba793f42f8cc07e041f448e2685dca63ecde547f)
(0085751)
nds (developer)
2019-07-18 11:47

Jenkins job:
http://jenkins-test-12.nnov.opencascade.com/view/CR30537_1-CR30537_1-NDS/ [^]
(0085769)
kgv (developer)
2019-07-18 17:34

+  //! Iterator through light sources.
+  class Iterator
+  {
+  public:
+    //! Constructor with initialization.
+    Iterator (const Handle(Font_TextFormatter)& theFormatter,
+              IterationFilter theFilter = IterationFilter_None)

It looks redundant passing/requiring handle in iterator - usually iterators hold a reference (pointer) to the collection.

+    //! Returns current symbol.
+    const Standard_Utf32Char& Symbol() const { return mySymbolChar; }
+
+    //! Returns the next symbol if exists.
+    const Standard_Utf32Char& SymbolNext() const { return mySymbolCharNext; }
+
+    //! Returns current symbol position.
+    const Standard_Integer& SymbolPosition() const { return mySymbolPosition; }
+
+    //! Returns the next symbol position.
+    const Standard_Integer& SymbolPositionNext() const { return mySymbolNext; }

Please avoid returning/passing primitive types like Standard_Integer, Standard_Utf32Char via reference.

-  Font_TextFormatter aFormatter;
-  aFormatter.SetupAlignment (theAlignX, theAlignY);
-  aFormatter.Reset();
+  Handle(Font_TextFormatter) aFormatter = new Font_TextFormatter();

I would suggest avoiding creation of handle where it is not actually needed.

+  //!< Returns true if the symbol is CR, BEL, FF, NP, BS or VT
+  Standard_EXPORT static Standard_Boolean IsCommandSymbol (const Standard_Utf32Char& theSymbol);


This expected to be inline.

+void Graphic3d_Group::Text (const Handle(Font_TextFormatter)&       theTextFormatter,
+                            const gp_Ax2&                           theOrientation,
+                            const Standard_Real                     theHeight,

The expansion of Text() methods should last.
Consider defining a common structure for passing auxiliary parameters and Text representation modes,
and replacing all Text() methods with single one (existing methods to be preserved for a while as deprecated redirections to new method).

-    Font_TextFormatter aFormatter;
-    aFormatter.SetupAlignment (myParams.HAlign, myParams.VAlign);
-    aFormatter.Reset();
+    Handle(Font_TextFormatter) aFormatter = myFormatter;
+    if (myFormatter.IsNull())

It is preferred putting shared temporary instance of Font_TextFormatter inside OpenGl_Context.

+  //!< Returns internal container of the top left corners of a formatted rectangles.
+  const NCollection_Vector < NCollection_Vec2<Standard_ShortReal> >& GetCorners() const 
{ return myCorners; }
+
+  const NCollection_Vector<Standard_ShortReal>& GetNewLines() const { return myNewLines; }

...
+  //! Returns position of the first symbol in a line using alignment
+  Standard_EXPORT Standard_ShortReal GetFirstPosition() const;

"Get" is unexpected prefix.

+  if (aFirstCornerId >= getRectsNb())

Usage of trivial getter within the class implementation looks dubious.

- Issue History
Date Modified Username Field Change
2019-03-04 20:07 nds New Issue
2019-03-04 20:07 nds Assigned To => nds
2019-03-04 20:09 git Note Added: 0082596
2019-03-05 06:43 git Note Added: 0082600
2019-03-05 14:04 git Note Added: 0082695
2019-03-05 18:56 git Note Added: 0082700
2019-03-05 19:14 git Note Added: 0082702
2019-03-05 20:04 git Note Added: 0082704
2019-07-18 11:09 git Note Added: 0085741
2019-07-18 11:47 nds Note Added: 0085751
2019-07-18 17:34 kgv Note Added: 0085769


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker