From Lilin Xiong, "I change ive plugin a little for osgText inout, so the ive plugin supports backdrop setting,

and Text3D, FadeText inout :

1. in DataInputStream.cpp, add 1286--1293 lines;
2. in Text.cpp, add some code for text's Backdrop setting;
3. in IveVersion.h, add line 39,  increase the VERSION to VERSION_028(line 41)
4. in ReadWrite.h,  add line 146,147
5. add file FadeText.h, FadeText.cpp, Text3D.h, Text3D.cpp."
This commit is contained in:
Robert Osfield
2008-07-01 18:37:13 +00:00
parent 82ed445a31
commit dba344feba
9 changed files with 370 additions and 5 deletions

View File

@@ -0,0 +1,61 @@
/**********************************************************************
*
* FILE: FadeText.cpp
*
* DESCRIPTION: Read/Write osgText::FadeText in binary format to disk.
*
* CREATED BY: Auto generated by iveGenerator
* and later modified by Rune Schmidt Jensen.
*
* HISTORY: Created 27.3.2003
*
* Copyright 2003 VR-C
**********************************************************************/
#include "Exception.h"
#include "FadeText.h"
#include "Text.h"
#include "Drawable.h"
#include "Object.h"
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
#include <osg/Notify>
using namespace ive;
void FadeText::write(DataOutputStream* out){
// Write FadeText's identification.
out->writeInt(IVEFADETEXT);
// If the osg class is inherited by any other class we should also write this to file.
osgText::Text* text = dynamic_cast<osgText::Text*>(this);
if(text){
((ive::Text*)(text))->write(out);
}
else
throw Exception("FadeText::write(): Could not cast this osgText::FadeText to an osgText::Tex.");
// Write FadeText's properties.
out->writeFloat(getFadeSpeed());
}
void FadeText::read(DataInputStream* in){
// Read FadeText's identification.
int id = in->peekInt();
if(id == IVEFADETEXT){
id = in->readInt();
// If the osg class is inherited by any other class we should also read this from file.
osgText::Text* text = dynamic_cast<osgText::Text*>(this);
if(text){
((ive::Text*)(text))->read(in);
}
else
throw Exception("FadeText::read(): Could not cast this osgText::FadeText to an osgText::Text.");
setFadeSpeed(in->readFloat());
}
else{
throw Exception("FadeText::read(): Expected FadeText identification.");
}
}