OpenSceneGraph/src/osgPlugins/ive/AzimSector.cpp

46 lines
1.4 KiB
C++
Raw Normal View History

/**********************************************************************
*
2005-11-17 23:03:51 +08:00
* FILE: AzimSector.cpp
*
2005-11-17 23:03:51 +08:00
* DESCRIPTION: Read/Write osgSim::AzimSector in binary format to disk.
*
2005-11-17 23:03:51 +08:00
* CREATED BY: Auto generated by iveGenerator.exe
* and later modified by Rune Schmidt Jensen.
*
2005-11-17 23:03:51 +08:00
* HISTORY: Created 9.9.2003
*
**********************************************************************/
#include "Exception.h"
#include "AzimSector.h"
using namespace ive;
void AzimSector::write(DataOutputStream* out){
2005-11-17 23:03:51 +08:00
// Write AzimSector's identification.
out->writeInt(IVEAZIMSECTOR);
// Write AzimSector's properties.
float minAzimuth, maxAzimuth, fadeAngle;
getAzimuthRange(minAzimuth, maxAzimuth, fadeAngle);
2005-11-17 23:03:51 +08:00
out->writeFloat(minAzimuth);
out->writeFloat(maxAzimuth);
out->writeFloat(fadeAngle);
}
void AzimSector::read(DataInputStream* in){
2005-11-17 23:03:51 +08:00
// Peek on AzimSector's identification.
int id = in->peekInt();
if(id == IVEAZIMSECTOR){
// Read AzimSector's identification.
id = in->readInt();
// Read AzimSector's properties
float minAzimuth = in->readFloat();
float maxAzimuth = in->readFloat();
float fadeAngle = in->readFloat();
setAzimuthRange(minAzimuth, maxAzimuth, fadeAngle);
2005-11-17 23:03:51 +08:00
}
else{
throw Exception("AzimSector::read(): Expected AzimSector identification.");
}
}