Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Text3D Class Reference

Classe de gestion d'alignement de text 3D (basée sur la FTGL). More...

#include <text3d.h>

Inheritance diagram for Text3D:

BasicText3D List of all members.

Public Member Functions

 Text3D ()
 ~Text3D ()
void operator= (Text3D &src)
void SetJustifyLimit (GLdouble x, GLdouble y)
 Definistion de la taille maximum des justification (en texel).

void SetWrapping (BOOL line, BOOL word, BOOL letter)
void SetClipping (double x, double y)
void SetClipping (Point2D< double > newClipping)
void SetAlign (TextAlign x=align_center, TextAlign y=align_center)
void Setup (FTFont *f, FontType t=ft_texture)
BOOL Draw ()
 Affiche un text en respectant sont alignement.

BOOL DrawPicking ()
void ComputeSize (MyList< ParsingLine > *linesCur, BOOL isWordSizeCompute)
void ComputeLineSize (ParsingLine *line, BOOL isWordSizeCompute)
float ComputeLayout ()
void ApplyRealClipping ()
void SetText (char *text)
char * GetText ()
BOOL AnalyseLex (int indBegin, int *indEnd, BOOL *isEnd, BOOL *isReturn)
void AnalyseGram ()

Public Attributes

TextAlign xAlign
 type de justification dans les X

TextAlign yAlign
 type de justification dans les Y

GLdouble xJustifyLimit
 limit de la taille max de justification dans les X, pour eviter des justications trop importente

GLdouble yJustifyLimit
 limit de la taille max de justification dans les Y, pour eviter des justications trop importente

BOOL wordWrap
 un mots est il secable ?

BOOL lineWrap
 une ligne est elle secable ?

BOOL letterWrap
 une lettre est elle secable ?


Detailed Description

Classe de gestion d'alignement de text 3D (basée sur la FTGL).

Les parametres:

Example:

Text3D textHautGauche,textCentreBas,textJustifyCentre; // affiche en du text en haut a gauche du contenant sans justifiaction textHautGauche.Setup(fontTexture,ft_texture); textHautGauche.SetClipping((100,100); textHautGauche.SetAlign(align_begin,align_begin); textHautGauche.value="Haut a gauche"; // affiche en du text en centré en bas sans justifiaction textCentreBas.Setup(fontTexture,ft_texture); textCentreBas.SetClipping((100,100); textCentreBas.SetAlign(align_center,align_end); textCentreBas.value="Centré en bas"; // affiche en du text en justifier dans les x et centré dans les y textJustifyCentre.Setup(fontTexture,ft_texture); textJustifyCentre.SetClipping((100,100); textJustifyCentre.SetAlign(align_justify,align_center); textJustifyCentre.value="Justify centré"; textJustifyCentre.SetWrapping(FALSE,FALSE,FALSE); // affiche une seul ligne - ou - textJustifyCentre.SetWrapping(TRUE,FALSE,FALSE); // revient a la ligne si la ligne est pleine - ou - textJustifyCentre.SetWrapping(FALSE,TRUE,FALSE); // affiche une seul ligne finis par un mots - ou - textJustifyCentre.SetWrapping(TRUE,TRUE,FALSE); // retour a la ligne si cela coup un mots de fin de ligne

Definition at line 192 of file text3d.h.


Constructor & Destructor Documentation

Text3D::Text3D  ) 
 

Definition at line 241 of file text3d.cpp.

References align_begin, SetJustifyLimit(), SetWrapping(), xAlign, and yAlign.

Text3D::~Text3D  ) 
 

Definition at line 252 of file text3d.cpp.


Member Function Documentation

void Text3D::AnalyseGram  ) 
 

Analyse gramatical

Fait le parsing de tout les mots ==> remplie les "lines" et "words" tel que specifié dans le "value" en cours

Definition at line 488 of file text3d.cpp.

References MyListIterator< ParsingWord >::AddNewLast(), MyListIterator< ParsingLine >::AddNewLast(), AnalyseLex(), BOOL(), MyList< ParsingWord >::i, MyList< ParsingLine >::i, ParsingElem::isWord, MyString::Mids(), MyListIterator< ParsingWord >::SuprAll(), MyListIterator< ParsingLine >::SuprAll(), and ParsingWord::text.

Referenced by SetText().

BOOL Text3D::AnalyseLex int  indBegin,
int *  indEnd,
BOOL *  isEnd,
BOOL *  isReturn
 

Analyse syntaxique

Delimite les mots et les type (word ou type de separateur)

Returns:
isWord: le mot est il un mot ou un separateur ?
ex.: "coucou\n ca va! \ntoi"

Lexieme isWord isReturn isEnd "coucou" 1 1 0 " " 0 0 0 "ca" 1 0 0 " " 0 0 0 "va!" 1 0 0 " " 0 1 0 "toi" 1 0 1

Definition at line 443 of file text3d.cpp.

References BOOL(), and MyString::GetSize().

Referenced by AnalyseGram().

void Text3D::ApplyRealClipping  ) 
 

Definition at line 363 of file text3d.cpp.

Referenced by Draw().

float Text3D::ComputeLayout  ) 
 

Definition at line 521 of file text3d.cpp.

References MyListIterator< ParsingWord >::AddNewLast(), MyListIterator< ParsingLine >::AddNewLast(), BOOL(), ComputeLineSize(), ParsingElem::deltaX, ParsingLine::deltaY, MyListIterator< ParsingLine >::GetElemPtr(), BasicText3D::GetWidth(), MyList< ParsingWord * >::i, MyList< ParsingLine * >::i, MyList< ParsingWord >::i, MyList< ParsingLine >::i, lineWrap, list_current, MyString::Mids(), MyListIterator< ParsingLine >::More(), MyListIterator< ParsingLine * >::SuprAll(), MyListIterator< ParsingWord >::SuprAll(), MyListIterator< ParsingLine >::SuprAll(), ParsingWord::text, ParsingLine::words, wordWrap, Point2D< GLdouble >::x, and Point2D< GLdouble >::y.

Referenced by Draw().

void Text3D::ComputeLineSize ParsingLine line,
BOOL  isWordSizeCompute
 

Definition at line 315 of file text3d.cpp.

References ParsingElem::deltaX, BasicText3D::GetHeight(), MyString::GetSize(), BasicText3D::GetWidth(), ParsingWord::text, and xAlign.

Referenced by ComputeLayout(), and ComputeSize().

void Text3D::ComputeSize MyList< ParsingLine > *  linesCur,
BOOL  isWordSizeCompute
 

Definition at line 305 of file text3d.cpp.

References ComputeLineSize(), and MyList< T >::i.

Referenced by Draw().

BOOL Text3D::Draw  ) 
 

Affiche un text en respectant sont alignement.

Le parsing du text etant fait automatiquement il n'est pas a refaire a chaque affichage.

Returns:
VRAI si le text a ete affiché completement , sinon FAUX (en dehors du clipping)

Todo:
a optimiser: doit etre appeler uniquement si le text,font,scale ou clipping on changé

Definition at line 383 of file text3d.cpp.

References align_begin, align_center, align_end, align_justify, ApplyRealClipping(), BOOL(), ce, ComputeLayout(), ComputeSize(), MyListIterator< ParsingLine * >::GetElem(), MyList< ParsingLine * >::GetNbElem(), MyList< ParsingLine * >::i, MyString::IsEmpty(), ControlEngine::monitor, MyListIterator< ParsingLine * >::More(), Point2D< GLdouble >::y, yAlign, and yJustifyLimit.

Referenced by Face::Draw().

BOOL Text3D::DrawPicking  ) 
 

Definition at line 692 of file text3d.cpp.

References BOOL().

Referenced by Face::Draw().

char * Text3D::GetText  ) 
 

Definition at line 642 of file text3d.cpp.

References MyString::GetValue().

Referenced by TaskWindow::Add().

void Text3D::operator= Text3D src  ) 
 

Definition at line 256 of file text3d.cpp.

References letterWrap, lineWrap, BasicText3D::operator=(), src, wordWrap, xAlign, xJustifyLimit, and yAlign.

void Text3D::SetAlign TextAlign  x = align_center,
TextAlign  y = align_center
 

Definition at line 292 of file text3d.cpp.

References xAlign, and yAlign.

Referenced by Tutorial::ApplicationDemo::ApplicationDemo(), Tutorial::BaseDemo::BaseDemo(), Button::Button(), Calculator::Calculator(), Tutorial::LayoutDemo::ConfigTextFace(), Calculator::Create(), Tutorial::FaceDemo::FaceDemo(), Tutorial::LayoutDemo::LayoutDemo(), Univers::OnKeyUp(), Tutorial::UniversDemo::SetFace(), TextBox::TextBox(), Tip::Tip(), Title::Title(), Tutorial::Tutorial(), and Tutorial::WindowDemo::WindowDemo().

void Text3D::SetClipping Point2D< double >  newClipping  ) 
 

Definition at line 285 of file text3d.cpp.

References Point2D< T >::x, Point2D< GLdouble >::x, Point2D< T >::y, and Point2D< GLdouble >::y.

void Text3D::SetClipping double  x,
double  y
 

Definition at line 278 of file text3d.cpp.

References Point2D< GLdouble >::Set(), Point2D< GLdouble >::x, and Point2D< GLdouble >::y.

Referenced by Face::Draw().

void Text3D::SetJustifyLimit GLdouble  x,
GLdouble  y
 

Definistion de la taille maximum des justification (en texel).

Definition at line 702 of file text3d.cpp.

References xJustifyLimit, and yJustifyLimit.

Referenced by Tutorial::FaceDemo::FaceDemo(), and Text3D().

void Text3D::SetText char *  text  ) 
 

Definition at line 418 of file text3d.cpp.

References AnalyseGram().

Referenced by Tutorial::BaseDemo::BaseDemo(), Tutorial::LayoutDemo::ConfigTextFace(), Tutorial::FaceDemo::FaceDemo(), Tutorial::ApplicationDemo::OnSelectExplorer(), Tutorial::BaseDemo::OnWinOut(), Tip::operator=(), TextBox::operator=(), Button::operator=(), Tutorial::UniversDemo::SetFace(), Title::SetText(), Tip::SetText(), TextBox::SetText(), Button::SetText(), and Tutorial::WindowDemo::WindowDemo().

void Text3D::Setup FTFont *  f,
FontType  t = ft_texture
 

Definition at line 299 of file text3d.cpp.

References f, BasicText3D::Setup(), t, and type.

Referenced by Tutorial::BaseDemo::BaseDemo(), Button::Button(), Tutorial::LayoutDemo::ConfigTextFace(), Tutorial::FaceDemo::FaceDemo(), Tutorial::UniversDemo::SetFace(), TextBox::TextBox(), Tip::Tip(), Title::Title(), and Tutorial::WindowDemo::WindowDemo().

void Text3D::SetWrapping BOOL  line,
BOOL  word,
BOOL  letter
 

Definition at line 271 of file text3d.cpp.

References letterWrap, lineWrap, and wordWrap.

Referenced by TaskWindow::Add(), Tutorial::ApplicationDemo::ApplicationDemo(), Tutorial::BaseDemo::BaseDemo(), Tutorial::LayoutDemo::ConfigTextFace(), Tutorial::FaceDemo::FaceDemo(), Text3D(), Tip::Tip(), and Title::Title().


Member Data Documentation

BOOL Text3D::letterWrap
 

une lettre est elle secable ?

Definition at line 219 of file text3d.h.

Referenced by ValueEditors::MakeElemFaceStruct(), operator=(), and SetWrapping().

BOOL Text3D::lineWrap
 

une ligne est elle secable ?

Definition at line 218 of file text3d.h.

Referenced by ComputeLayout(), ValueEditors::MakeElemFaceStruct(), operator=(), and SetWrapping().

BOOL Text3D::wordWrap
 

un mots est il secable ?

Definition at line 217 of file text3d.h.

Referenced by ComputeLayout(), ValueEditors::MakeElemFaceStruct(), operator=(), and SetWrapping().

TextAlign Text3D::xAlign
 

type de justification dans les X

Definition at line 213 of file text3d.h.

Referenced by ComputeLineSize(), ValueEditors::MakeElemFaceStruct(), operator=(), SetAlign(), and Text3D().

GLdouble Text3D::xJustifyLimit
 

limit de la taille max de justification dans les X, pour eviter des justications trop importente

Definition at line 215 of file text3d.h.

Referenced by ValueEditors::MakeElemFaceStruct(), operator=(), and SetJustifyLimit().

TextAlign Text3D::yAlign
 

type de justification dans les Y

Definition at line 214 of file text3d.h.

Referenced by Draw(), ValueEditors::MakeElemFaceStruct(), operator=(), SetAlign(), and Text3D().

GLdouble Text3D::yJustifyLimit
 

limit de la taille max de justification dans les Y, pour eviter des justications trop importente

Definition at line 216 of file text3d.h.

Referenced by Draw(), ValueEditors::MakeElemFaceStruct(), and SetJustifyLimit().


The documentation for this class was generated from the following files:
Generated on Fri Aug 20 19:21:44 2004 for 3d Controls by doxygen 1.3.6