Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:35

0001 // Created on: 2015-06-18
0002 // Created by: Ilya SEVRIKOV
0003 // Copyright (c) 2015 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef OpenGl_TextBuilder_Header
0017 #define OpenGl_TextBuilder_Header
0018 
0019 #include <OpenGl_Font.hxx>
0020 #include <OpenGl_VertexBuffer.hxx>
0021 #include <OpenGl_VertexBufferEditor.hxx>
0022 #include <OpenGl_Vec.hxx>
0023 
0024 #include <NCollection_Vector.hxx>
0025 #include <NCollection_Handle.hxx>
0026 
0027 class Font_TextFormatter;
0028 
0029 //! This class generates primitive array required for rendering textured text using OpenGl_Font instance.
0030 class OpenGl_TextBuilder
0031 {
0032 public:
0033 
0034   //! Creates empty object.
0035   Standard_EXPORT OpenGl_TextBuilder();
0036 
0037   //! Creates texture quads for the given text.
0038   Standard_EXPORT void Perform (const Handle(Font_TextFormatter)&                theFormatter,
0039                                 const Handle(OpenGl_Context)&                    theContext,
0040                                 OpenGl_Font&                                     theFont,
0041                                 NCollection_Vector<GLuint>&                      theTextures,
0042                                 NCollection_Vector<Handle(OpenGl_VertexBuffer)>& theVertsPerTexture,
0043                                 NCollection_Vector<Handle(OpenGl_VertexBuffer)>& theTCrdsPerTexture);
0044 
0045 protected: //! @name class auxiliary methods
0046 
0047   Standard_EXPORT void createGlyphs (const Handle(Font_TextFormatter)&                                              theFormatter,
0048                                      const Handle(OpenGl_Context)&                                                  theCtx,
0049                                      OpenGl_Font&                                                                   theFont,
0050                                      NCollection_Vector<GLuint>&                                                    theTextures,
0051                                      NCollection_Vector< NCollection_Handle < NCollection_Vector <OpenGl_Vec2> > >& theVertsPerTexture,
0052                                      NCollection_Vector< NCollection_Handle < NCollection_Vector <OpenGl_Vec2> > >& theTCrdsPerTexture);
0053 
0054 protected: //! @name class auxiliary fields
0055 
0056   NCollection_Vector<OpenGl_Font::Tile>  myTileRects;
0057   OpenGl_VertexBufferEditor<OpenGl_Vec2> myVboEditor;
0058 };
0059 
0060 #endif // OpenGl_TextBuilder_Header