From b0a5c6c8be51aff7c4d05e82a4c73d1054973d19 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 27 May 2009 12:00:45 +0000 Subject: [PATCH] Issue 0019818: EDF 703 SMESH VISU : Display Mesh Groups names in viewer (as a caption) --- src/VTKViewer/VTKViewer_FramedTextActor.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/VTKViewer/VTKViewer_FramedTextActor.cxx b/src/VTKViewer/VTKViewer_FramedTextActor.cxx index b0ab39849..50600be31 100644 --- a/src/VTKViewer/VTKViewer_FramedTextActor.cxx +++ b/src/VTKViewer/VTKViewer_FramedTextActor.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include #define TEXT_MARGIN 4 #define OFFSET_SPACING 2 @@ -273,8 +273,16 @@ void VTKViewer_FramedTextActor::SetOffset(const int theOffset[2]) void VTKViewer_FramedTextActor::SetText(const char* theText) { // remove whitespaces from from the start and the end + // additionally, consider a case of multi-string text QString aString(theText); - myTextMapper->SetInput(aString.trimmed().toLatin1().constData()); + + QStringList aTrimmedStringList; + QStringList aStringList = aString.split("\n"); + QStringListIterator anIter(aStringList); + while(anIter.hasNext()) + aTrimmedStringList.append(anIter.next().trimmed()); + + myTextMapper->SetInput(aTrimmedStringList.join("\n").toLatin1().constData()); Modified(); } -- 2.39.2