Gizmo3D

gzText.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 // File         : gzText.h
00003 // Module       : 
00004 // Description  : Class definition of the gzText class
00005 // Author       : Anders Modén      
00006 // Product      : Gizmo3D 2.1.1
00007 //      
00008 // Copyright © 2003- Saab Training Systems AB, Sweden
00009 //          
00010 // NOTE:    Gizmo3D is a high performance 3D Scene Graph and effect visualisation 
00011 //          C++ toolkit for Linux, Mac OS X, Windows (Win32) and IRIX® for  
00012 //          usage in Game or VisSim development.
00013 //
00014 //
00015 // Revision History...                          
00016 //                                  
00017 // Who  Date    Description                     
00018 //                                  
00019 // AMO  001016  Created file    
00020 //
00021 //******************************************************************************
00022 #ifndef __GZ_TEXT_H__
00023 #define __GZ_TEXT_H__
00024 
00030 #include "gzNode.h"
00031 #include "gzFont.h"
00032 
00033 // Common 2D text start positions
00034 const gzVec3 GZ_TEXT_UPPER_LEFT_POS=gzVec3((gzReal)-1,(gzReal)1,(gzReal)0);
00035 const gzVec3 GZ_TEXT_CENTER_POS=gzVec3((gzReal)0,(gzReal)0,(gzReal)0);
00036 
00037 //******************************************************************************
00038 // Class    : gzText
00039 //                                  
00040 // Purpose  : -
00041 //                                  
00042 // Notes    : - 
00043 //                                  
00044 // Revision History...                          
00045 //                                  
00046 // Who  Date    Description                     
00047 //                                  
00048 // AMO  001016  Created 
00049 //                                  
00050 //******************************************************************************
00051 class gzText : public gzNode
00052 {
00053 public:
00054     GZ_GRAPH_EXPORT gzText(const gzString &name=GZ_EMPTY_STRING);
00055 
00056     GZ_GRAPH_EXPORT virtual ~gzText(){};
00057 
00058     GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);  // typed interface
00059 
00060     // ---------- Common graph functions --------------------------------
00061 
00062     GZ_GRAPH_EXPORT virtual gzVoid updateNode();
00063 
00064     // ---------- Clone interface ---------------------------------------
00065     GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00066     GZ_GRAPH_EXPORT virtual gzVoid  setCopyMode(gzCopyMode mode);
00067 
00068     // ---------- text commands -----------------------------------------
00069 
00070     GZ_GRAPH_EXPORT gzVoid setFont(gzFont *font);
00071 
00072     GZ_GRAPH_EXPORT gzVoid useOverlay(gzBool on);
00073 
00074     GZ_GRAPH_EXPORT gzVoid use2DPosition(gzBool on);
00075 
00076     GZ_GRAPH_EXPORT gzVoid set2DPosition( gzShort x_off_pixels=0, gzShort y_off_pixels=0,const gzVec3 &startPosition=GZ_TEXT_UPPER_LEFT_POS);
00077 
00078     GZ_GRAPH_EXPORT gzVoid setText(const gzString &text);
00079 
00080     GZ_GRAPH_EXPORT gzVoid setText(gzWideChar *text,gzULong len);
00081 
00082     GZ_GRAPH_EXPORT gzVoid clear();
00083 
00084     GZ_GRAPH_EXPORT gzVoid format( const gzString &format, ARG_DECL_LIST );
00085 
00086     GZ_GRAPH_EXPORT gzVoid setColor(const gzVec4 &color);
00087 
00088     GZ_GRAPH_EXPORT gzVoid setMaskColor(const gzVec4 &maskColor);
00089 
00090     GZ_GRAPH_EXPORT gzVoid useMaskColor(gzBool on);
00091 
00092     GZ_GRAPH_EXPORT gzVoid useScreenFixFont(gzBool on=TRUE);
00093 
00094     GZ_GRAPH_EXPORT gzVoid useTransparentBackground(gzBool on=TRUE);
00095 
00096     GZ_GRAPH_EXPORT gzVoid scrollText(const gzString &text, gzBool down=FALSE);
00097 
00098     GZ_GRAPH_EXPORT gzVoid renderText(gzContext *context, gzVec3 rasterpos);
00099 
00100     // ---------- overall orientation etc.. ------------------------------
00101 
00102     GZ_GRAPH_EXPORT gzVoid  setScale(const gzVec3 &scale);
00103     GZ_GRAPH_EXPORT gzVoid  setScale(gzFloat scale);
00104 
00105     GZ_GRAPH_EXPORT gzVoid  setHPR(const gzVec3 &hpr);
00106     GZ_GRAPH_EXPORT gzVoid  setHPR(gzFloat heading,gzFloat pitch,gzFloat roll);
00107 
00108     // ---------- Action Interface --------------------------------------
00109 
00110     GZ_GRAPH_EXPORT virtual gzVoid preTraverseAction( gzTraverseAction *actionclass , gzContext *context);
00111 
00112     GZ_GRAPH_EXPORT virtual gzActionStage  useActionStage( gzTraverseAction *actionclass , gzContext *context);
00113 
00114     // ---------- Debug function ----------------------------------------
00115     GZ_GRAPH_EXPORT virtual gzVoid  debugOutput(gzString base , gzString anchor , gzDebugFlags features);
00116 
00117     // ---------- Properties -------------------------------------------
00118     
00119     GZ_PROPERTY_EXPORT(gzReal,              DeltaX,         GZ_GRAPH_EXPORT);   
00120     GZ_PROPERTY_EXPORT(gzReal,              DeltaY,         GZ_GRAPH_EXPORT);   
00121 
00122     GZ_PROPERTY_EXPORT(gzArray<gzReal>,     TSpanX,         GZ_GRAPH_EXPORT);   
00123     GZ_PROPERTY_EXPORT(gzArray<gzReal>,     TSpanY,         GZ_GRAPH_EXPORT);   
00124 
00125 protected:
00126 
00127     gzBool                  m_useOverlay:1;
00128 
00129     gzBool                  m_use2DPosition:1;
00130 
00131     gzBool                  m_useMaskColor:1;
00132 
00133     gzBool                  m_useScreenFixFont:1;
00134 
00135     gzBool                  m_useTranspBack:1;
00136 
00137     gzRefPointer<gzFont>    m_font;
00138 
00139     gzVec4                  m_color;
00140 
00141     gzVec4                  m_maskColor;
00142 
00143     gzVec3                  m_2DPosition;
00144 
00145     gzShort                 m_x_off_pixels;
00146 
00147     gzShort                 m_y_off_pixels;
00148 
00149     gzVec3                  m_scale;
00150 
00151     gzVec3                  m_hpr;
00152 
00153     gzArray<gzWideChar>     m_text;
00154 
00155 };
00156 
00157 // Declare smart pointer type
00158 GZ_DECLARE_REFPTR(gzText);
00159 
00160 #endif

Documentation for Gizmo3D generated at Wed Feb 20 11:54:11 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond