| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /********************************************************************** 00002 VRS - The Virtual Rendering System 00003 Copyright (C) 2001 Computer Graphics Systems Group at the 00004 Hasso-Plattner-Institute, Potsdam, Germany. 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 This library is distributed in the hope that it will be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 See the GNU Lesser General Public License for more details. 00013 You should have received a copy of the GNU Lesser+ General Public 00014 License along with this library; if not, write to the FreeSoftware 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA, 02111-1307, USA. 00016 **********************************************************************/ 00017 // $Id: curvetext.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00018 // $Date: 2007-08-09 09:51:16 +0200 (Thu, 09 Aug 2007) $ 00019 // $Revision: 6014 $ 00020 // $State$ 00021 // $Author: Konstantin_Baumann $ 00022 // 00023 // $Log$ 00024 // Revision 1.21 2005/01/03 01:43:10 klimetschek 00025 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00026 // - removed vrs.vcproj 00027 // minor things: 00028 // - added all glutexamples to vrs4glut.sln 00029 // - fixed some problems in glutexamples 00030 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00031 // 00032 // Revision 1.20 2004/10/28 14:16:01 basch 00033 // Class comment changed (Doxygen style) 00034 // 00035 // Revision 1.19 2004/03/12 16:28:41 baumann 00036 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00037 // 00038 // Revision 1.18 2004/02/16 16:42:08 baumann 00039 // - moved class VRS::SceneNode from "vrs/sg/" to "vrs/" 00040 // - renamed class VRS::SceneGraphVisitor to class VRS::SceneNodeVisitor 00041 // and moved it from "vrs/sg/" to "vrs/" 00042 // 00043 // Revision 1.17 2004/01/19 11:43:58 baumann 00044 // serialization mechanism improved 00045 // 00046 // Revision 1.16 2003/11/07 14:19:25 kirsch 00047 // removed leading underscore from include guards 00048 // 00049 // Revision 1.15 2003/01/21 21:08:29 skirsch 00050 // moved length calculation to curve 00051 // 00052 // Revision 1.14 2002/12/16 20:23:06 skirsch 00053 // added public access to the curve length and removed intervall 00054 // 00055 // Revision 1.13 2002/12/05 12:08:31 skirsch 00056 // added flip guard 00057 // 00058 // Revision 1.12 2002/11/26 18:09:39 lorenz 00059 // lengthMapping is working now 00060 // 00061 // Revision 1.11 2002/11/25 23:53:09 lorenz 00062 // text is layouted now better, interval is obsolete 00063 // 00064 // Revision 1.10 2002/11/05 08:28:58 skirsch 00065 // merged UnicodeText and Text 00066 // 00067 // Revision 1.9 2002/10/31 14:21:04 kirsch 00068 // changed initializers in constructors to match declaration order 00069 // 00070 // Revision 1.8 2002/10/29 23:57:24 skirsch 00071 // introduced unicode support 00072 // 00073 // Revision 1.7 2002/10/29 10:32:53 baumann 00074 // macros VRS_CLASSNAME_* and VRS_IMPL_TYPEINFO_* removed 00075 // 00076 // Revision 1.6 2002/10/10 06:59:28 skirsch 00077 // imrpoved performance 00078 // 00079 // Revision 1.5 2002/10/06 17:00:47 skirsch 00080 // added external text shape support 00081 // 00082 // Revision 1.4 2002/06/04 08:43:39 skirsch 00083 // removed ftgl 00084 // 00085 // Revision 1.3 2002/05/22 15:28:07 kersting 00086 // changed string default 00087 // 00088 // Revision 1.2 2002/05/02 10:42:58 baumann 00089 // log header & VRS_CORE_API added 00090 // 00091 00092 #ifndef VRS_SG_CURVETEXT_H_ 00093 #define VRS_SG_CURVETEXT_H_ 00094 00095 #include <vrs/text/vrs_textprerequisites.h> 00096 #include <vrs/scenenode.h> 00097 #include <vrs/text/deprecated/font.h> 00098 #include <vrs/text/deprecated/text.h> 00099 #include <vrs/curve.h> 00100 00101 namespace VRS { 00102 00104 class VRS_CORE_API CurveText : public SceneNode { 00105 00106 public: 00107 CurveText(Font* font, Curve* curve, const std::string& text = std::string(), double size = 1.0, 00108 double begin = 0.0, bool runFlipGuard = false); 00110 00114 CurveText(Curve* curve, Text* text, double begin = 0.0, bool runFlipGuard = false); 00116 00122 void setFont(Font* font); 00124 Font* getFont() const; 00126 00127 void setTextString(const std::string& text); 00129 std::string getTextString() const; 00131 00132 void setText(Text* text); 00134 00135 Text* getText() const; 00137 00141 void setCurve(Curve* curve); 00143 Curve* getCurve() const; 00145 00146 void setSize(double size); 00148 00150 double getSize() const; 00152 00153 void setBegin(double begin); 00155 00156 double getBegin() const; 00158 00160 void startFlipGuard(); 00162 00169 void stopFlipGuard(); 00171 00172 virtual void evaluate(Engine* engine); 00174 00175 virtual Bounds boundingBox(Engine*) const; 00177 00178 virtual void modified(); 00180 00181 VRS_TYPEINFO(CurveText, SceneNode) 00182 VRS_SERIALIZABLE(CurveText) 00183 00184 private: 00185 CurveText(); 00187 00188 SO<Font> font_; 00189 SO<Text> text_; 00190 SO<Curve> curve_; 00191 double size_; 00192 double begin_; 00193 00194 SO<Array<bool> > startFlipGuards_; 00195 SO<Array<bool> > flipGuardsActive_; 00196 00197 SO<Array<Vector> > lastNormals_; 00198 00199 SO<NonPersistentArray<SO<Cache> > > glyphs_; 00200 SO<NonPersistentArray<double> > glyphStart_; 00201 00202 bool updateBBox_; 00203 Bounds bbox_; 00204 00205 bool curveChanged_; 00206 bool textChanged_; 00207 }; 00208 00209 } // namespace VRS 00210 00211 #endif // VRS_SG_CURVETEXT_H_