00001 /* 00002 Copyright (C) 2002 Carsten Winkelholz, Malte Weiß 00003 00004 Malte Weiß, 25.07.2002: Event handling implemented. 00005 09.04.2003: - CybTextC is now responsible for calculating the text sizes. 00006 (independence from the OpenGL class CybGLTextC) 00007 - Bounding sphere/box calculation now works. 00008 00009 Address: FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V. 00010 Neuenahrer Str. 20 00011 D - 53343 Wachtberg 00012 00013 Email: winkelholz@fgan.de 00014 00015 This program is free software; you can redistribute it and/or 00016 modify it under the terms of the GNU General Public License 00017 as published by the Free Software Foundation; either version 2 00018 of the License, or (at your option) any later version. 00019 00020 This program is distributed in the hope that it will be useful, 00021 but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 GNU General Public License for more details. 00024 00025 You should have received a copy of the GNU General Public License 00026 along with this program; if not, write to the Free Software 00027 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00028 */ 00029 00030 #ifndef CYBTEXT_HC 00031 #define CYBTEXT_HC 00032 00033 #include "cybgeometryc.h" 00034 #include "cybwrlfields.h" 00035 #include "../oawconfig.h" 00036 00037 OAW_BEGIN_NAMESPACE 00038 00039 #define JUSTIFY_BEGIN 0 00040 #define JUSTIFY_FIRST 1 00041 #define JUSTIFY_MIDDLE 2 00042 #define JUSTIFY_END 3 00043 00044 00045 00046 class CybFontStyleC; 00047 class CybIsectLineChannelC; 00048 00049 class OAW_DLLMAPPING CybTextC : public CybGeometryC 00050 { 00051 public: 00052 CybTextC(CybWorldC*); 00053 virtual ~CybTextC(); 00054 CybTextC(const CybTextC&); 00055 CybTextC& operator = (const CybTextC&); 00056 virtual void Copy(const CybNodeC*); 00057 00058 virtual void SetEvent(long, const void*, BaseI*); 00059 virtual long GetFieldEventID(const char*); 00060 virtual long GetFieldDataType(long); 00061 virtual short GetFieldData(long,void* data); 00062 00063 virtual void ToChannelDefault(CybChannelC* pV,long flag); 00064 virtual void ToIsectLineChannel(CybIsectLineChannelC* pIsectChan); 00065 00066 protected: 00067 virtual void CreateNewCopy(CybNodeC*); 00068 virtual void LoadVRML(char*& iter, const char* iterEnd, long& znr); 00069 virtual void FinishInit(); 00070 00071 void CalculateTextSizes(); 00072 void CreateOutputString(); 00073 00074 public: 00075 virtual int SetNode(CybNodeC*); 00076 00077 protected: 00078 void SetFontStyle(CybFontStyleC*); 00079 00080 public: 00081 MFString m_mstrOutput; 00082 00083 protected: 00084 MFString m_msString; 00085 MFFloat m_mfLength; 00086 SFFloat m_fMaxExtent; 00087 CybFontStyleC* m_pFontStyle; 00088 00089 bool m_bLoading; 00090 bool m_bUpdateRender; 00091 00092 // Key list 00093 static char VRMLKeyStrList[][30]; 00094 00095 protected: 00096 struct TextBBox { 00097 SFVec3f vCenter, vSize; 00098 }; 00099 00100 ArrayC<SFVec2f> m_textSizes; 00101 ArrayC<TextBBox> m_textBoxes; 00102 }; 00103 00104 OAW_END_NAMESPACE 00105 00106 00107 #endif 00108 00109 00110 00111
1.3-rc2