Converted .ive plugin from using C++ exceptions to using a local equivelant, enabling the build on embedded systems.
This commit is contained in:
@@ -27,7 +27,7 @@ void AlphaFunc::write(DataOutputStream* out){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
else
|
||||
throw Exception("AlphaFunc::write(): Could not cast this osg::AlphaFunc to an osg::Object.");
|
||||
out_THROW_EXCEPTION("AlphaFunc::write(): Could not cast this osg::AlphaFunc to an osg::Object.");
|
||||
|
||||
// write AlphaFunc's properties
|
||||
out->writeInt(getFunction());
|
||||
@@ -48,7 +48,7 @@ void AlphaFunc::read(DataInputStream* in){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
else
|
||||
throw Exception("AlphaFunc::read(): Could not cast this osg::AlphaFunc to an osg::Object.");
|
||||
in_THROW_EXCEPTION("AlphaFunc::read(): Could not cast this osg::AlphaFunc to an osg::Object.");
|
||||
|
||||
// Read AlphaFunc's properties
|
||||
osg::AlphaFunc::ComparisonFunction comparison_funtion = osg::AlphaFunc::ComparisonFunction(in->readInt());
|
||||
@@ -56,6 +56,6 @@ void AlphaFunc::read(DataInputStream* in){
|
||||
setFunction(comparison_funtion, reference_value);
|
||||
}
|
||||
else{
|
||||
throw Exception("AlphaFunc::read(): Expected AlphaFunc identification.");
|
||||
in_THROW_EXCEPTION("AlphaFunc::read(): Expected AlphaFunc identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void AnimationPath::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("AnimationPath::write(): Could not cast this osg::AnimationPath to an osg::Object.");
|
||||
out_THROW_EXCEPTION("AnimationPath::write(): Could not cast this osg::AnimationPath to an osg::Object.");
|
||||
// Write AnimationPath's properties.
|
||||
|
||||
// Write loopmode
|
||||
@@ -55,7 +55,7 @@ void AnimationPath::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("AnimationPath::read(): Could not cast this osg::AnimationPath to an osg::Object.");
|
||||
in_THROW_EXCEPTION("AnimationPath::read(): Could not cast this osg::AnimationPath to an osg::Object.");
|
||||
// Read AnimationPath's properties
|
||||
|
||||
// Read loopmode
|
||||
@@ -71,6 +71,6 @@ void AnimationPath::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("AnimationPath::read(): Expected AnimationPath identification.");
|
||||
in_THROW_EXCEPTION("AnimationPath::read(): Expected AnimationPath identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void AnimationPathCallback::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("AnimationPathCallback::write(): Could not cast this osg::AnimationPathCallback to an osg::Object.");
|
||||
out_THROW_EXCEPTION("AnimationPathCallback::write(): Could not cast this osg::AnimationPathCallback to an osg::Object.");
|
||||
// Write AnimationPathCallback's properties.
|
||||
|
||||
out->writeVec3(_pivotPoint);
|
||||
@@ -38,14 +38,14 @@ void AnimationPathCallback::write(DataOutputStream* out){
|
||||
out->writeDouble(_pauseTime);
|
||||
// Write animationpath if any
|
||||
if(getAnimationPath())
|
||||
{
|
||||
out->writeInt(1); // true we have an animation path.
|
||||
{
|
||||
out->writeInt(1); // true we have an animation path.
|
||||
((ive::AnimationPath*)(getAnimationPath()))->write(out);
|
||||
}
|
||||
else
|
||||
{
|
||||
out->writeInt(0); // false we don't have an animation path.
|
||||
}
|
||||
else
|
||||
{
|
||||
out->writeInt(0); // false we don't have an animation path.
|
||||
}
|
||||
}
|
||||
|
||||
void AnimationPathCallback::read(DataInputStream* in){
|
||||
@@ -60,7 +60,8 @@ void AnimationPathCallback::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("AnimationPathCallback::read(): Could not cast this osg::AnimationPathCallback to an osg::Object.");
|
||||
in_THROW_EXCEPTION("AnimationPathCallback::read(): Could not cast this osg::AnimationPathCallback to an osg::Object.");
|
||||
|
||||
// Read AnimationPathCallback's properties
|
||||
_pivotPoint = in->readVec3();
|
||||
_timeOffset = in->readDouble();
|
||||
@@ -69,13 +70,13 @@ void AnimationPathCallback::read(DataInputStream* in){
|
||||
_pauseTime = in->readDouble();
|
||||
// Read animationpath if any
|
||||
if(in->readInt())
|
||||
{
|
||||
{
|
||||
osg::AnimationPath* path = new osg::AnimationPath();
|
||||
((ive::AnimationPath*)(path))->read(in);
|
||||
setAnimationPath(path);
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("AnimationPathCallback::read(): Expected AnimationPathCallback identification.");
|
||||
in_THROW_EXCEPTION("AnimationPathCallback::read(): Expected AnimationPathCallback identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void AnisotropicLighting::write(DataOutputStream* out){
|
||||
((ive::Effect*)(effect))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("AnisotropicLighting::write(): Could not cast this osgFX::AnisotropicLighting to an osgFX::Effect.");
|
||||
out_THROW_EXCEPTION("AnisotropicLighting::write(): Could not cast this osgFX::AnisotropicLighting to an osgFX::Effect.");
|
||||
|
||||
// Write AnisotropicLighting's properties.
|
||||
out->writeImage(getLightingMap());
|
||||
@@ -45,13 +45,13 @@ void AnisotropicLighting::read(DataInputStream* in){
|
||||
((ive::Effect*)(effect))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("AnisotropicLighting::read(): Could not cast this osgFX::AnisotropicLighting to an osgFX::Effect.");
|
||||
in_THROW_EXCEPTION("AnisotropicLighting::read(): Could not cast this osgFX::AnisotropicLighting to an osgFX::Effect.");
|
||||
|
||||
// Read AnisotropicLighting's properties
|
||||
setLightingMap(in->readImage());
|
||||
setLightNumber(in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("AnisotropicLighting::read(): Expected AnisotropicLighting identification.");
|
||||
in_THROW_EXCEPTION("AnisotropicLighting::read(): Expected AnisotropicLighting identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void AutoTransform::write(DataOutputStream* out){
|
||||
((ive::Transform*)(trans))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("AutoTransform::write(): Could not cast this osg::AutoTransform to an osg::Transform.");
|
||||
out_THROW_EXCEPTION("AutoTransform::write(): Could not cast this osg::AutoTransform to an osg::Transform.");
|
||||
// Write AutoTransform's properties.
|
||||
|
||||
out->writeVec3(getPosition());
|
||||
@@ -61,7 +61,7 @@ void AutoTransform::read(DataInputStream* in){
|
||||
((ive::Transform*)(trans))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("AutoTransform::read(): Could not cast this osg::AutoTransform to an osg::Transform.");
|
||||
in_THROW_EXCEPTION("AutoTransform::read(): Could not cast this osg::AutoTransform to an osg::Transform.");
|
||||
// Read AutoTransform's properties
|
||||
|
||||
setPosition(in->readVec3());
|
||||
@@ -85,6 +85,6 @@ void AutoTransform::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("AutoTransform::read(): Expected AutoTransform identification.");
|
||||
in_THROW_EXCEPTION("AutoTransform::read(): Expected AutoTransform identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,6 @@ void AzimElevationSector::read(DataInputStream* in){
|
||||
setAzimuthRange(minAzimuth, maxAzimuth, fadeAngle);
|
||||
}
|
||||
else{
|
||||
throw Exception("AzimElevationSector::read(): Expected AzimElevationSector identification.");
|
||||
in_THROW_EXCEPTION("AzimElevationSector::read(): Expected AzimElevationSector identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,6 @@ void AzimSector::read(DataInputStream* in){
|
||||
setAzimuthRange(minAzimuth, maxAzimuth, fadeAngle);
|
||||
}
|
||||
else{
|
||||
throw Exception("AzimSector::read(): Expected AzimSector identification.");
|
||||
in_THROW_EXCEPTION("AzimSector::read(): Expected AzimSector identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void Billboard::write(DataOutputStream* out){
|
||||
((ive::Geode*)(geode))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Billboard::write(): Could not cast this osg::Billboard to an osg::Geode.");
|
||||
out_THROW_EXCEPTION("Billboard::write(): Could not cast this osg::Billboard to an osg::Geode.");
|
||||
// Write Billboard's properties.
|
||||
|
||||
// Write mode
|
||||
@@ -56,7 +56,7 @@ void Billboard::read(DataInputStream* in){
|
||||
((ive::Geode*)(geode))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Billboard::read(): Could not cast this osg::Billboard to an osg::Geode.");
|
||||
in_THROW_EXCEPTION("Billboard::read(): Could not cast this osg::Billboard to an osg::Geode.");
|
||||
// Read Billboard's properties
|
||||
|
||||
// Read mode
|
||||
@@ -73,6 +73,6 @@ void Billboard::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("Billboard::read(): Expected Billboard identification.");
|
||||
in_THROW_EXCEPTION("Billboard::read(): Expected Billboard identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void BlendColor::write(DataOutputStream* out)
|
||||
if (obj) {
|
||||
((ive::Object*)(obj))->write(out);
|
||||
} else {
|
||||
throw Exception("BlendColor::write(): Could not cast this osg::BlendColor to an osg::Object.");
|
||||
out_THROW_EXCEPTION("BlendColor::write(): Could not cast this osg::BlendColor to an osg::Object.");
|
||||
}
|
||||
// Write BlendColor's properties.
|
||||
|
||||
@@ -51,7 +51,7 @@ void BlendColor::read(DataInputStream* in)
|
||||
if (obj) {
|
||||
((ive::Object*)(obj))->read(in);
|
||||
} else {
|
||||
throw Exception("BlendColor::read(): Could not cast this osg::BlendColor to an osg::Object.");
|
||||
in_THROW_EXCEPTION("BlendColor::read(): Could not cast this osg::BlendColor to an osg::Object.");
|
||||
}
|
||||
// Read BlendColor's properties
|
||||
|
||||
@@ -59,6 +59,6 @@ void BlendColor::read(DataInputStream* in)
|
||||
setConstantColor(in->readVec4());
|
||||
|
||||
} else {
|
||||
throw Exception("BlendColor::read(): Expected BlendColor identification.");
|
||||
in_THROW_EXCEPTION("BlendColor::read(): Expected BlendColor identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void BlendEquation::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("BlendEquation::write(): Could not cast this osg::BlendEquation to an osg::Object.");
|
||||
out_THROW_EXCEPTION("BlendEquation::write(): Could not cast this osg::BlendEquation to an osg::Object.");
|
||||
// Write BlendEquation's properties.
|
||||
|
||||
// Write source
|
||||
@@ -56,7 +56,7 @@ void BlendEquation::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("BlendEquation::read(): Could not cast this osg::BlendEquation to an osg::Object.");
|
||||
in_THROW_EXCEPTION("BlendEquation::read(): Could not cast this osg::BlendEquation to an osg::Object.");
|
||||
// Read BlendEquation's properties
|
||||
|
||||
// Read source
|
||||
@@ -71,6 +71,6 @@ void BlendEquation::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("BlendEquation::read(): Expected BlendEquation identification.");
|
||||
in_THROW_EXCEPTION("BlendEquation::read(): Expected BlendEquation identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ void BlendFunc::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("BlendFunc::write(): Could not cast this osg::BlendFunc to an osg::Object.");
|
||||
out_THROW_EXCEPTION("BlendFunc::write(): Could not cast this osg::BlendFunc to an osg::Object.");
|
||||
// Write BlendFunc's properties.
|
||||
|
||||
// Write source
|
||||
@@ -59,7 +59,7 @@ void BlendFunc::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("BlendFunc::read(): Could not cast this osg::BlendFunc to an osg::Object.");
|
||||
in_THROW_EXCEPTION("BlendFunc::read(): Could not cast this osg::BlendFunc to an osg::Object.");
|
||||
// Read BlendFunc's properties
|
||||
|
||||
// Read source
|
||||
@@ -78,6 +78,6 @@ void BlendFunc::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("BlendFunc::read(): Expected BlendFunc identification.");
|
||||
in_THROW_EXCEPTION("BlendFunc::read(): Expected BlendFunc identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void BlinkSequence::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("BlinkSequence::write(): Could not cast this osgSim::BlinkSequence to an osg::Object.");
|
||||
out_THROW_EXCEPTION("BlinkSequence::write(): Could not cast this osgSim::BlinkSequence to an osg::Object.");
|
||||
|
||||
// Write BlinkSequence's properties.
|
||||
|
||||
@@ -62,7 +62,7 @@ void BlinkSequence::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("BlinkSequence::read(): Could not cast this osgSim::BlinkSequence to an osg::Object.");
|
||||
in_THROW_EXCEPTION("BlinkSequence::read(): Could not cast this osgSim::BlinkSequence to an osg::Object.");
|
||||
// Read BlinkSequence's properties
|
||||
|
||||
// Read in pulse data.
|
||||
@@ -81,6 +81,6 @@ void BlinkSequence::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("BlinkSequence::read(): Expected BlinkSequence identification.");
|
||||
in_THROW_EXCEPTION("BlinkSequence::read(): Expected BlinkSequence identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void BumpMapping::write(DataOutputStream* out){
|
||||
((ive::Effect*)(effect))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("BumpMapping::write(): Could not cast this osgFX::BumpMapping to an osgFX::Effect.");
|
||||
out_THROW_EXCEPTION("BumpMapping::write(): Could not cast this osgFX::BumpMapping to an osgFX::Effect.");
|
||||
|
||||
// Write BumpMapping's properties.
|
||||
out->writeInt(getLightNumber());
|
||||
@@ -53,7 +53,7 @@ void BumpMapping::read(DataInputStream* in){
|
||||
((ive::Effect*)(effect))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("BumpMapping::read(): Could not cast this osgFX::BumpMapping to an osgFX::Effect.");
|
||||
in_THROW_EXCEPTION("BumpMapping::read(): Could not cast this osgFX::BumpMapping to an osgFX::Effect.");
|
||||
|
||||
// Read BumpMapping's properties
|
||||
setLightNumber(in->readInt());
|
||||
@@ -69,6 +69,6 @@ void BumpMapping::read(DataInputStream* in){
|
||||
setOverrideNormalMapTexture(tex);
|
||||
}
|
||||
else{
|
||||
throw Exception("BumpMapping::read(): Expected BumpMapping identification.");
|
||||
in_THROW_EXCEPTION("BumpMapping::read(): Expected BumpMapping identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void Camera::write(DataOutputStream* out){
|
||||
((ive::Transform*)(transform))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Camera::write(): Could not cast this osg::Camera to an osg::Group.");
|
||||
out_THROW_EXCEPTION("Camera::write(): Could not cast this osg::Camera to an osg::Group.");
|
||||
|
||||
|
||||
out->writeVec4(getClearColor());
|
||||
@@ -103,7 +103,7 @@ void Camera::read(DataInputStream* in)
|
||||
((ive::Transform*)(transform))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Camera::read(): Could not cast this osg::Camera to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Camera::read(): Could not cast this osg::Camera to an osg::Group.");
|
||||
|
||||
setClearColor(in->readVec4());
|
||||
setClearMask(in->readUInt());
|
||||
@@ -177,6 +177,6 @@ void Camera::read(DataInputStream* in)
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("Camera::read(): Expected Camera identification");
|
||||
in_THROW_EXCEPTION("Camera::read(): Expected Camera identification");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void CameraView::write(DataOutputStream* out)
|
||||
((ive::Transform*)(trans))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("CameraView::write(): Could not cast this osg::CameraView to an osg::Transform.");
|
||||
out_THROW_EXCEPTION("CameraView::write(): Could not cast this osg::CameraView to an osg::Transform.");
|
||||
|
||||
// Write CameraView's properties.
|
||||
out->writeVec3(getPosition());
|
||||
@@ -53,7 +53,7 @@ void CameraView::read(DataInputStream* in){
|
||||
((ive::Transform*)(trans))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("CameraView::read(): Could not cast this osg::CameraView to an osg::Transform.");
|
||||
in_THROW_EXCEPTION("CameraView::read(): Could not cast this osg::CameraView to an osg::Transform.");
|
||||
|
||||
// Read CameraView's properties
|
||||
setPosition(in->readVec3());
|
||||
@@ -64,6 +64,6 @@ void CameraView::read(DataInputStream* in){
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("CameraView::read(): Expected CameraView identification.");
|
||||
in_THROW_EXCEPTION("CameraView::read(): Expected CameraView identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void Cartoon::write(DataOutputStream* out){
|
||||
((ive::Effect*)(effect))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Cartoon::write(): Could not cast this osgFX::Cartoon to an osgFX::Effect.");
|
||||
out_THROW_EXCEPTION("Cartoon::write(): Could not cast this osgFX::Cartoon to an osgFX::Effect.");
|
||||
|
||||
// Write Cartoon's properties.
|
||||
out->writeVec4(getOutlineColor());
|
||||
@@ -46,7 +46,7 @@ void Cartoon::read(DataInputStream* in){
|
||||
((ive::Effect*)(effect))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Cartoon::read(): Could not cast this osgFX::Cartoon to an osgFX::Effect.");
|
||||
in_THROW_EXCEPTION("Cartoon::read(): Could not cast this osgFX::Cartoon to an osgFX::Effect.");
|
||||
|
||||
// Read Cartoon's properties
|
||||
setOutlineColor(in->readVec4());
|
||||
@@ -54,6 +54,6 @@ void Cartoon::read(DataInputStream* in){
|
||||
setLightNumber(in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("Cartoon::read(): Expected Cartoon identification.");
|
||||
in_THROW_EXCEPTION("Cartoon::read(): Expected Cartoon identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void ClipNode::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ClipNode::write(): Could not cast this osg::ClipNode to an osg::Group.");
|
||||
out_THROW_EXCEPTION("ClipNode::write(): Could not cast this osg::ClipNode to an osg::Group.");
|
||||
// Write ClipNode's properties.
|
||||
|
||||
if ( out->getVersion() >= VERSION_0037 )
|
||||
@@ -58,7 +58,7 @@ void ClipNode::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ClipNode::read(): Could not cast this osg::ClipNode to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ClipNode::read(): Could not cast this osg::ClipNode to an osg::Object.");
|
||||
// Read ClipNode's properties
|
||||
|
||||
if ( in->getVersion() >= VERSION_0037 )
|
||||
@@ -77,6 +77,6 @@ void ClipNode::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("ClipNode::read(): Expected ClipNode identification.");
|
||||
in_THROW_EXCEPTION("ClipNode::read(): Expected ClipNode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void ClipPlane::write(DataOutputStream* out){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
else
|
||||
throw Exception("ClipPlane::write(): Could not cast this osg::ClipPlane to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ClipPlane::write(): Could not cast this osg::ClipPlane to an osg::Object.");
|
||||
|
||||
// write ClipPlane's properties
|
||||
|
||||
@@ -51,13 +51,13 @@ void ClipPlane::read(DataInputStream* in){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
else
|
||||
throw Exception("ClipPlane::read(): Could not cast this osg::ClipPlane to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ClipPlane::read(): Could not cast this osg::ClipPlane to an osg::Object.");
|
||||
|
||||
setClipPlane(in->readVec4d());
|
||||
|
||||
setClipPlaneNum(in->readUInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("ClipPlane::read(): Expected ClipPlane identification.");
|
||||
in_THROW_EXCEPTION("ClipPlane::read(): Expected ClipPlane identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void ClusterCullingCallback::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ClusterCullingCallback::write(): Could not cast this osg::ClusterCullingCallback to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ClusterCullingCallback::write(): Could not cast this osg::ClusterCullingCallback to an osg::Object.");
|
||||
// Write ClusterCullingCallback's properties.
|
||||
|
||||
out->writeVec3(_controlPoint);
|
||||
@@ -53,7 +53,7 @@ void ClusterCullingCallback::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ClusterCullingCallback::read(): Could not cast this osg::ClusterCullingCallback to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ClusterCullingCallback::read(): Could not cast this osg::ClusterCullingCallback to an osg::Object.");
|
||||
|
||||
// Read ClusterCullingCallback's properties
|
||||
|
||||
@@ -65,6 +65,6 @@ void ClusterCullingCallback::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("ClusterCullingCallback::read(): Expected ClusterCullingCallback identification.");
|
||||
in_THROW_EXCEPTION("ClusterCullingCallback::read(): Expected ClusterCullingCallback identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void ColorMask::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ColorMask::write(): Could not cast this osg::ColorMask to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ColorMask::write(): Could not cast this osg::ColorMask to an osg::Object.");
|
||||
|
||||
// Write ColorMask's properties.
|
||||
out->writeBool(getRedMask());
|
||||
@@ -48,7 +48,7 @@ void ColorMask::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ColorMask::read(): Could not cast this osg::ColorMask to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ColorMask::read(): Could not cast this osg::ColorMask to an osg::Object.");
|
||||
|
||||
// Read ColorMask's properties
|
||||
setRedMask(in->readBool());
|
||||
@@ -57,6 +57,6 @@ void ColorMask::read(DataInputStream* in){
|
||||
setAlphaMask(in->readBool());
|
||||
}
|
||||
else{
|
||||
throw Exception("ColorMask::read(): Expected ColorMask identification.");
|
||||
in_THROW_EXCEPTION("ColorMask::read(): Expected ColorMask identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void CompositeLayer::write(DataOutputStream* out)
|
||||
if (layer)
|
||||
((ive::Layer*)(layer))->write(out);
|
||||
else
|
||||
throw Exception("CompositeLayer::write(): Could not cast this osgLayer::CompositeLayer to an osgTerrain::Layer.");
|
||||
out_THROW_EXCEPTION("CompositeLayer::write(): Could not cast this osgLayer::CompositeLayer to an osgTerrain::Layer.");
|
||||
|
||||
LayerHelper helper;
|
||||
|
||||
@@ -52,7 +52,7 @@ void CompositeLayer::read(DataInputStream* in)
|
||||
// Peek on Layer's identification.
|
||||
int id = in->peekInt();
|
||||
if (id != IVECOMPOSITELAYER)
|
||||
throw Exception("CompositeLayer::read(): Expected CompositeLayer identification.");
|
||||
in_THROW_EXCEPTION("CompositeLayer::read(): Expected CompositeLayer identification.");
|
||||
|
||||
// Read Layer's identification.
|
||||
id = in->readInt();
|
||||
@@ -62,7 +62,7 @@ void CompositeLayer::read(DataInputStream* in)
|
||||
if (layer)
|
||||
((ive::Layer*)(layer))->read(in);
|
||||
else
|
||||
throw Exception("CompositeLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
in_THROW_EXCEPTION("CompositeLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
|
||||
LayerHelper helper;
|
||||
|
||||
|
||||
@@ -38,6 +38,6 @@ void ConeSector::read(DataInputStream* in){
|
||||
setAngle(angle, fadeangle);
|
||||
}
|
||||
else{
|
||||
throw Exception("ConeSector::read(): Expected ConeSector identification.");
|
||||
in_THROW_EXCEPTION("ConeSector::read(): Expected ConeSector identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void ConvexPlanarOccluder::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ConvexPlanarOccluder::write(): Could not cast this osg::ConvexPlanarOccluder to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ConvexPlanarOccluder::write(): Could not cast this osg::ConvexPlanarOccluder to an osg::Object.");
|
||||
// Write ConvexPlanarOccluder's properties.
|
||||
|
||||
// Write planar polygon occluder.
|
||||
@@ -55,7 +55,7 @@ void ConvexPlanarOccluder::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ConvexPlanarOccluder::read(): Could not cast this osg::ConvexPlanarOccluder to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ConvexPlanarOccluder::read(): Could not cast this osg::ConvexPlanarOccluder to an osg::Object.");
|
||||
// Read ConvexPlanarOccluder's properties
|
||||
|
||||
// Read planar polygon occluder.
|
||||
@@ -72,6 +72,6 @@ void ConvexPlanarOccluder::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("ConvexPlanarOccluder::read(): Expected ConvexPlanarOccluder identification.");
|
||||
in_THROW_EXCEPTION("ConvexPlanarOccluder::read(): Expected ConvexPlanarOccluder identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void ConvexPlanarPolygon::write(DataOutputStream* out){
|
||||
// ((ive::Object*)(obj))->write(out);
|
||||
//}
|
||||
//else
|
||||
// throw Exception("ConvexPlanarPolygon::write(): Could not cast this osg::ConvexPlanarPolygon to an osg::Object.");
|
||||
// in_THROW_EXCEPTION("ConvexPlanarPolygon::write(): Could not cast this osg::ConvexPlanarPolygon to an osg::Object.");
|
||||
// Write ConvexPlanarPolygon's properties.
|
||||
|
||||
// Write Vertex list
|
||||
@@ -51,7 +51,7 @@ void ConvexPlanarPolygon::read(DataInputStream* in){
|
||||
// ((ive::Object*)(obj))->read(in);
|
||||
//}
|
||||
//else
|
||||
// throw Exception("ConvexPlanarPolygon::read(): Could not cast this osg::ConvexPlanarPolygon to an osg::Object.");
|
||||
// in_THROW_EXCEPTION("ConvexPlanarPolygon::read(): Could not cast this osg::ConvexPlanarPolygon to an osg::Object.");
|
||||
// Read ConvexPlanarPolygon's properties
|
||||
|
||||
// Read Vertex list
|
||||
@@ -62,6 +62,6 @@ void ConvexPlanarPolygon::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("ConvexPlanarPolygon::read(): Expected ConvexPlanarPolygon identification.");
|
||||
in_THROW_EXCEPTION("ConvexPlanarPolygon::read(): Expected ConvexPlanarPolygon identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,17 +29,17 @@ void CoordinateSystemNode::write(DataOutputStream* out)
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("CoordinateSystemNode::write(): Could not cast this osg::CoordinateSystemNode to an osg::Group.");
|
||||
out_THROW_EXCEPTION("CoordinateSystemNode::write(): Could not cast this osg::CoordinateSystemNode to an osg::Group.");
|
||||
// Write CoordinateSystemNode's properties.
|
||||
|
||||
out->writeString(getFormat());
|
||||
out->writeString(getCoordinateSystem());
|
||||
out->writeString(getFormat());
|
||||
out->writeString(getCoordinateSystem());
|
||||
|
||||
out->writeBool(getEllipsoidModel()!=0);
|
||||
if(getEllipsoidModel())
|
||||
{
|
||||
((ive::EllipsoidModel*)(getEllipsoidModel()))->write(out);
|
||||
}
|
||||
out->writeBool(getEllipsoidModel()!=0);
|
||||
if(getEllipsoidModel())
|
||||
{
|
||||
((ive::EllipsoidModel*)(getEllipsoidModel()))->write(out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void CoordinateSystemNode::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("CoordinateSystemNode::read(): Could not cast this osg::CoordinateSystemNode to an osg::Group.");
|
||||
in_THROW_EXCEPTION("CoordinateSystemNode::read(): Could not cast this osg::CoordinateSystemNode to an osg::Group.");
|
||||
// Read CoordinateSystemNode's properties
|
||||
|
||||
// Read format string
|
||||
@@ -75,6 +75,6 @@ void CoordinateSystemNode::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("CoordinateSystemNode::read(): Expected CoordinateSystemNode identification.");
|
||||
in_THROW_EXCEPTION("CoordinateSystemNode::read(): Expected CoordinateSystemNode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void CullFace::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("CullFace::write(): Could not cast this osg::CullFace to an osg::Object.");
|
||||
out_THROW_EXCEPTION("CullFace::write(): Could not cast this osg::CullFace to an osg::Object.");
|
||||
// Write CullFace's properties.
|
||||
out->writeInt(getMode());
|
||||
}
|
||||
@@ -44,11 +44,11 @@ void CullFace::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("CullFace::read(): Could not cast this osg::CullFace to an osg::Object.");
|
||||
in_THROW_EXCEPTION("CullFace::read(): Could not cast this osg::CullFace to an osg::Object.");
|
||||
// Read CullFace's properties
|
||||
setMode((osg::CullFace::Mode)in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("CullFace::read(): Expected CullFace identification.");
|
||||
in_THROW_EXCEPTION("CullFace::read(): Expected CullFace identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void DOFTransform::write(DataOutputStream* out){
|
||||
((ive::Transform*)(trans))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("DOFTransform::write(): Could not cast this osg::DOFTransform to an osg::Transform.");
|
||||
out_THROW_EXCEPTION("DOFTransform::write(): Could not cast this osg::DOFTransform to an osg::Transform.");
|
||||
|
||||
// Write DOFTransform's properties.
|
||||
out->writeMatrixd(getPutMatrix());
|
||||
@@ -67,7 +67,7 @@ void DOFTransform::read(DataInputStream* in){
|
||||
((ive::Transform*)(trans))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("DOFTransform::read(): Could not cast this osg::DOFTransform to an osg::Transform.");
|
||||
in_THROW_EXCEPTION("DOFTransform::read(): Could not cast this osg::DOFTransform to an osg::Transform.");
|
||||
|
||||
// Read DOFTransform's properties
|
||||
setPutMatrix(in->readMatrixd());
|
||||
@@ -97,6 +97,6 @@ void DOFTransform::read(DataInputStream* in){
|
||||
setAnimationOn(in->readBool());
|
||||
}
|
||||
else{
|
||||
throw Exception("DOFTransform::read(): Expected DOFTransform identification.");
|
||||
in_THROW_EXCEPTION("DOFTransform::read(): Expected DOFTransform identification.");
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -137,6 +137,10 @@ public:
|
||||
|
||||
bool uncompress(std::istream& fin, std::string& destination) const;
|
||||
|
||||
void throwException(const std::string& message) { _exception = new Exception(message); }
|
||||
void throwException(Exception* exception) { _exception = exception; }
|
||||
const Exception* getException() const { return _exception.get(); }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -161,7 +165,7 @@ private:
|
||||
|
||||
osg::ref_ptr<const osgDB::ReaderWriter::Options> _options;
|
||||
|
||||
|
||||
osg::ref_ptr<Exception> _exception;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -205,7 +205,10 @@ DataOutputStream::DataOutputStream(std::ostream * ostream, const osgDB::ReaderWr
|
||||
_output_ostream = _ostream = ostream;
|
||||
|
||||
if(!_ostream)
|
||||
throw Exception("DataOutputStream::DataOutputStream(): null pointer exception in argument.");
|
||||
{
|
||||
throwException("DataOutputStream::DataOutputStream(): null pointer exception in argument.");
|
||||
return;
|
||||
}
|
||||
|
||||
writeUInt(ENDIAN_TYPE) ;
|
||||
writeUInt(getVersion());
|
||||
@@ -489,7 +492,7 @@ void DataOutputStream::writeBinding(osg::Geometry::AttributeBinding b){
|
||||
case osg::Geometry::BIND_PER_PRIMITIVE: writeChar((char) 2); break;
|
||||
case osg::Geometry::BIND_PER_PRIMITIVE_SET: writeChar((char) 3); break;
|
||||
case osg::Geometry::BIND_PER_VERTEX: writeChar((char) 4); break;
|
||||
default: throw Exception("Unknown binding in DataOutputStream::writeBinding()");
|
||||
default: throwException("Unknown binding in DataOutputStream::writeBinding()");
|
||||
}
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeBinding() ["<<b<<"]"<<std::endl;
|
||||
@@ -569,7 +572,7 @@ void DataOutputStream::writeArray(const osg::Array* a){
|
||||
writeChar((char)17);
|
||||
writeVec4dArray(static_cast<const osg::Vec4dArray*>(a));
|
||||
break;
|
||||
default: throw Exception("Unknown array type in DataOutputStream::writeArray()");
|
||||
default: throwException("Unknown array type in DataOutputStream::writeArray()");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1107,7 +1110,7 @@ void DataOutputStream::writeStateAttribute(const osg::StateAttribute* attribute)
|
||||
|
||||
else{
|
||||
std::string className = attribute->className();
|
||||
throw Exception(std::string("StateSet::write(): Unknown StateAttribute: ").append(className));
|
||||
throwException(std::string("StateSet::write(): Unknown StateAttribute: ").append(className));
|
||||
}
|
||||
if (_verboseOutput) std::cout<<"read/writeStateAttribute() ["<<id<<"]"<<std::endl;
|
||||
}
|
||||
@@ -1200,7 +1203,7 @@ void DataOutputStream::writeDrawable(const osg::Drawable* drawable)
|
||||
((ive::Text*)(drawable))->write(this);
|
||||
else
|
||||
{
|
||||
throw Exception("Unknown drawable in DataOutputStream::writeDrawable()");
|
||||
throwException("Unknown drawable in DataOutputStream::writeDrawable()");
|
||||
}
|
||||
if (_verboseOutput) std::cout<<"read/writeDrawable() ["<<id<<"]"<<std::endl;
|
||||
}
|
||||
@@ -1241,7 +1244,7 @@ void DataOutputStream::writeShape(const osg::Shape* shape)
|
||||
((ive::HeightField*)(shape))->write(this);
|
||||
else
|
||||
{
|
||||
throw Exception("Unknown shape in DataOutputStream::writeShape()");
|
||||
throwException("Unknown shape in DataOutputStream::writeShape()");
|
||||
}
|
||||
if (_verboseOutput) std::cout<<"read/writeShape() ["<<id<<"]"<<std::endl;
|
||||
}
|
||||
@@ -1378,7 +1381,7 @@ void DataOutputStream::writeNode(const osg::Node* node)
|
||||
((ive::LightPointNode*)(node))->write(this);
|
||||
}
|
||||
else
|
||||
throw Exception("Unknown node in Group::write()");
|
||||
throwException("Unknown node in Group::write()");
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeNode() ["<<id<<"]"<<std::endl;
|
||||
}
|
||||
@@ -1528,7 +1531,7 @@ void DataOutputStream::writeImage(IncludeImageMode mode, osg::Image *image)
|
||||
writeInt(0);
|
||||
break;
|
||||
default:
|
||||
throw Exception("DataOutputStream::writeImage(): Invalid IncludeImageMode value.");
|
||||
throwException("DataOutputStream::writeImage(): Invalid IncludeImageMode value.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1591,7 +1594,7 @@ void DataOutputStream::writeLayer(const osgTerrain::Layer* layer)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Unknown layer in DataOutputStream::writeLayer()");
|
||||
throwException("Unknown layer in DataOutputStream::writeLayer()");
|
||||
}
|
||||
if (_verboseOutput) std::cout<<"read/writeLayer() ["<<id<<"]"<<std::endl;
|
||||
}
|
||||
@@ -1670,7 +1673,7 @@ void DataOutputStream::writeVolumeLayer(const osgVolume::Layer* layer)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Unknown layer in DataOutputStream::writeLayer()");
|
||||
throwException("Unknown layer in DataOutputStream::writeLayer()");
|
||||
}
|
||||
if (_verboseOutput) std::cout<<"read/writeLayer() ["<<id<<"]"<<std::endl;
|
||||
}
|
||||
@@ -1782,7 +1785,7 @@ void DataOutputStream::writeVolumeProperty(const osgVolume::Property* property)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Unknown layer in DataOutputStream::writVolumeProperty()");
|
||||
throwException("Unknown layer in DataOutputStream::writVolumeProperty()");
|
||||
}
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeVolumeProperty() ["<<id<<"]"<<std::endl;
|
||||
|
||||
@@ -142,7 +142,11 @@ public:
|
||||
void setExternalFileWritten(const std::string& filename, bool hasBeenWritten=true);
|
||||
bool getExternalFileWritten(const std::string& filename) const;
|
||||
|
||||
private:
|
||||
void throwException(const std::string& message) { _exception = new Exception(message); }
|
||||
void throwException(Exception* exception) { _exception = exception; }
|
||||
const Exception* getException() const { return _exception.get(); }
|
||||
|
||||
private:
|
||||
|
||||
std::ostream* _ostream;
|
||||
std::ostream* _output_ostream;
|
||||
@@ -189,6 +193,8 @@ private:
|
||||
|
||||
typedef std::map<std::string, bool> ExternalFileWrittenMap;
|
||||
ExternalFileWrittenMap _externalFileWritten;
|
||||
|
||||
osg::ref_ptr<Exception> _exception;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void Depth::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Depth::write(): Could not cast this osg::Depth to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Depth::write(): Could not cast this osg::Depth to an osg::Object.");
|
||||
// Write Depth's properties.
|
||||
out->writeInt(getFunction());
|
||||
out->writeBool(getWriteMask());
|
||||
@@ -45,7 +45,7 @@ void Depth::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Depth::read(): Could not cast this osg::Depth to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Depth::read(): Could not cast this osg::Depth to an osg::Object.");
|
||||
// Read CullFace's properties
|
||||
setFunction((osg::Depth::Function)in->readInt());
|
||||
setWriteMask(in->readBool());
|
||||
@@ -53,7 +53,7 @@ void Depth::read(DataInputStream* in){
|
||||
setZFar(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("Depth::read(): Expected Depth identification.");
|
||||
in_THROW_EXCEPTION("Depth::read(): Expected Depth identification.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,6 @@ void DirectionalSector::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("DirectionalSector::read(): Expected DirectionalSector identification.");
|
||||
in_THROW_EXCEPTION("DirectionalSector::read(): Expected DirectionalSector identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void DrawArrayLengths::write(DataOutputStream* out){
|
||||
((ive::PrimitiveSet*)(prim))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawArrayLengths::write(): Could not cast this osg::DrawArrayLengths to an osg::PrimitiveSet.");
|
||||
out_THROW_EXCEPTION("DrawArrayLengths::write(): Could not cast this osg::DrawArrayLengths to an osg::PrimitiveSet.");
|
||||
|
||||
// Write DrawArrayLengths's properties.
|
||||
out->writeInt(getFirst());
|
||||
@@ -52,7 +52,7 @@ void DrawArrayLengths::read(DataInputStream* in){
|
||||
((ive::PrimitiveSet*)(prim))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawArrayLengths::read(): Could not cast this osg::DrawArrayLengths to an osg::PrimitiveSet.");
|
||||
in_THROW_EXCEPTION("DrawArrayLengths::read(): Could not cast this osg::DrawArrayLengths to an osg::PrimitiveSet.");
|
||||
|
||||
// Read properties
|
||||
setFirst(in->readInt());
|
||||
@@ -65,6 +65,6 @@ void DrawArrayLengths::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("DrawArrayLengths::read(): Expected DrawArrayLengths identification.");
|
||||
in_THROW_EXCEPTION("DrawArrayLengths::read(): Expected DrawArrayLengths identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void DrawArrays::write(DataOutputStream* out){
|
||||
((ive::PrimitiveSet*)(prim))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawArrays::write(): Could not cast this osg::DrawArrays to an osg::PrimitiveSet.");
|
||||
out_THROW_EXCEPTION("DrawArrays::write(): Could not cast this osg::DrawArrays to an osg::PrimitiveSet.");
|
||||
|
||||
|
||||
// Write DrawArrays's properties.
|
||||
@@ -47,7 +47,7 @@ void DrawArrays::read(DataInputStream* in){
|
||||
((ive::PrimitiveSet*)(prim))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawArrays::read(): Could not cast this osg::DrawArrays to an osg::PrimitiveSet.");
|
||||
in_THROW_EXCEPTION("DrawArrays::read(): Could not cast this osg::DrawArrays to an osg::PrimitiveSet.");
|
||||
|
||||
|
||||
// Read DrawArrays properties
|
||||
@@ -55,6 +55,6 @@ void DrawArrays::read(DataInputStream* in){
|
||||
setCount(in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("DrawArrays::read(): Expected DrawArrays identification.");
|
||||
in_THROW_EXCEPTION("DrawArrays::read(): Expected DrawArrays identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void DrawElementsUByte::write(DataOutputStream* out){
|
||||
((ive::PrimitiveSet*)(prim))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawElementsUByte::write(): Could not cast this osg::DrawElementsUByte to an osg::PrimitiveSet.");
|
||||
out_THROW_EXCEPTION("DrawElementsUByte::write(): Could not cast this osg::DrawElementsUByte to an osg::PrimitiveSet.");
|
||||
// Write DrawElementsUByte's properties.
|
||||
|
||||
// Write array length and its elements.
|
||||
@@ -48,7 +48,7 @@ void DrawElementsUByte::read(DataInputStream* in){
|
||||
((ive::PrimitiveSet*)(prim))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawElementsUByte::read(): Could not cast this osg::DrawElementsUByte to an osg::PrimitiveSet.");
|
||||
in_THROW_EXCEPTION("DrawElementsUByte::read(): Could not cast this osg::DrawElementsUByte to an osg::PrimitiveSet.");
|
||||
|
||||
// Read array length and its elements.
|
||||
int size = in->readInt();
|
||||
@@ -57,6 +57,6 @@ void DrawElementsUByte::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("DrawElementsUByte::read(): Expected DrawElementsUByte identification.");
|
||||
in_THROW_EXCEPTION("DrawElementsUByte::read(): Expected DrawElementsUByte identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void DrawElementsUInt::write(DataOutputStream* out){
|
||||
((ive::PrimitiveSet*)(prim))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawElementsUInt::write(): Could not cast this osg::DrawElementsUInt to an osg::PrimitiveSet.");
|
||||
out_THROW_EXCEPTION("DrawElementsUInt::write(): Could not cast this osg::DrawElementsUInt to an osg::PrimitiveSet.");
|
||||
// Write DrawElementsUInt's properties.
|
||||
|
||||
// Write array length and its elements.
|
||||
@@ -50,7 +50,7 @@ void DrawElementsUInt::read(DataInputStream* in)
|
||||
((ive::PrimitiveSet*)(prim))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawElementsUInt::read(): Could not cast this osg::DrawElementsUInt to an osg::PrimitiveSet.");
|
||||
in_THROW_EXCEPTION("DrawElementsUInt::read(): Could not cast this osg::DrawElementsUInt to an osg::PrimitiveSet.");
|
||||
|
||||
// Read array length and its elements.
|
||||
int size = in->readInt();
|
||||
@@ -66,6 +66,6 @@ void DrawElementsUInt::read(DataInputStream* in)
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("DrawElementsUInt::read(): Expected DrawElementsUInt identification.");
|
||||
in_THROW_EXCEPTION("DrawElementsUInt::read(): Expected DrawElementsUInt identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void DrawElementsUShort::write(DataOutputStream* out){
|
||||
((ive::PrimitiveSet*)(prim))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawElementsUShort::write(): Could not cast this osg::DrawElementsUShort to an osg::PrimitiveSet.");
|
||||
out_THROW_EXCEPTION("DrawElementsUShort::write(): Could not cast this osg::DrawElementsUShort to an osg::PrimitiveSet.");
|
||||
// Write DrawElementsUShort's properties.
|
||||
|
||||
// Write array length and its elements.
|
||||
@@ -49,7 +49,7 @@ void DrawElementsUShort::read(DataInputStream* in){
|
||||
((ive::PrimitiveSet*)(prim))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("DrawElementsUShort::read(): Could not cast this osg::DrawElementsUShort to an osg::PrimitiveSet.");
|
||||
in_THROW_EXCEPTION("DrawElementsUShort::read(): Could not cast this osg::DrawElementsUShort to an osg::PrimitiveSet.");
|
||||
|
||||
// Read array length and its elements.
|
||||
int size = in->readInt();
|
||||
@@ -65,6 +65,6 @@ void DrawElementsUShort::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("DrawElementsUShort::read(): Expected DrawElementsUShort identification.");
|
||||
in_THROW_EXCEPTION("DrawElementsUShort::read(): Expected DrawElementsUShort identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void Drawable::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Drawable::write(): Could not cast this osg::Drawable to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Drawable::write(): Could not cast this osg::Drawable to an osg::Object.");
|
||||
|
||||
// Write Drawable's properties.
|
||||
|
||||
@@ -90,7 +90,7 @@ void Drawable::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Drawable::read(): Could not cast this osg::Drawable to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Drawable::read(): Could not cast this osg::Drawable to an osg::Object.");
|
||||
|
||||
// Read in drawable's properties
|
||||
|
||||
@@ -134,6 +134,6 @@ void Drawable::read(DataInputStream* in)
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("Drawable::read(): Expected Drawable identification.");
|
||||
in_THROW_EXCEPTION("Drawable::read(): Expected Drawable identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void Effect::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Effect::write(): Could not cast this osgFX::Effect to an osg::Group.");
|
||||
out_THROW_EXCEPTION("Effect::write(): Could not cast this osgFX::Effect to an osg::Group.");
|
||||
|
||||
// Write Effect's properties.
|
||||
out->writeBool(getEnabled());
|
||||
@@ -46,7 +46,7 @@ void Effect::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Effect::read(): Could not cast this osgFX::Effect to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Effect::read(): Could not cast this osgFX::Effect to an osg::Group.");
|
||||
|
||||
// Read Effect's properties
|
||||
setEnabled(in->readBool());
|
||||
@@ -54,6 +54,6 @@ void Effect::read(DataInputStream* in){
|
||||
selectTechnique(in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("Effect::read(): Expected Effect identification.");
|
||||
in_THROW_EXCEPTION("Effect::read(): Expected Effect identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,6 @@ void ElevationSector::read(DataInputStream* in){
|
||||
setElevationRange(minElevation, maxElevation, fadeAngle);
|
||||
}
|
||||
else{
|
||||
throw Exception("ElevationSector::read(): Expected ElevationSector identification.");
|
||||
in_THROW_EXCEPTION("ElevationSector::read(): Expected ElevationSector identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void EllipsoidModel::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("EllipsoidModel::write(): Could not cast this osg::EllipsoidModel to an osg::Object.");
|
||||
out_THROW_EXCEPTION("EllipsoidModel::write(): Could not cast this osg::EllipsoidModel to an osg::Object.");
|
||||
// Write EllipsoidModel's properties.
|
||||
|
||||
out->writeDouble(getRadiusEquator());
|
||||
@@ -48,7 +48,7 @@ void EllipsoidModel::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("EllipsoidModel::read(): Could not cast this osg::EllipsoidModel to an osg::Object.");
|
||||
in_THROW_EXCEPTION("EllipsoidModel::read(): Could not cast this osg::EllipsoidModel to an osg::Object.");
|
||||
// Read EllipsoidModel's properties
|
||||
|
||||
setRadiusEquator(in->readDouble());
|
||||
@@ -57,6 +57,6 @@ void EllipsoidModel::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("EllipsoidModel::read(): Expected EllipsoidModel identification.");
|
||||
in_THROW_EXCEPTION("EllipsoidModel::read(): Expected EllipsoidModel identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,20 @@
|
||||
#define IVE_EXCEPTION 1
|
||||
|
||||
#include <string>
|
||||
#include <osg/Referenced>
|
||||
|
||||
namespace ive{
|
||||
|
||||
class Exception{
|
||||
#define THROW_EXCEPTION(str) { throwException(new Exception(str)); return; }
|
||||
#define in_THROW_EXCEPTION(str) { in->throwException(new Exception(str)); return; }
|
||||
#define out_THROW_EXCEPTION(str) { out->throwException(new Exception(str)); return; }
|
||||
|
||||
class Exception : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
Exception(std::string error);
|
||||
~Exception();
|
||||
std::string getError(){return _error;};
|
||||
const std::string& getError() const { return _error; };
|
||||
private:
|
||||
std::string _error;
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ void FadeText::write(DataOutputStream* out){
|
||||
((ive::Text*)(text))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("FadeText::write(): Could not cast this osgText::FadeText to an osgText::Tex.");
|
||||
out_THROW_EXCEPTION("FadeText::write(): Could not cast this osgText::FadeText to an osgText::Tex.");
|
||||
|
||||
// Write FadeText's properties.
|
||||
out->writeFloat(getFadeSpeed());
|
||||
@@ -51,11 +51,11 @@ void FadeText::read(DataInputStream* in){
|
||||
((ive::Text*)(text))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("FadeText::read(): Could not cast this osgText::FadeText to an osgText::Text.");
|
||||
in_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.");
|
||||
in_THROW_EXCEPTION("FadeText::read(): Expected FadeText identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void Fog::write(DataOutputStream* out){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
else
|
||||
throw Exception("Fog::write(): Could not cast this osg::Fog to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Fog::write(): Could not cast this osg::Fog to an osg::Object.");
|
||||
|
||||
// write Fog's properties
|
||||
out->writeInt(getMode());
|
||||
@@ -51,7 +51,7 @@ void Fog::read(DataInputStream* in){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
else
|
||||
throw Exception("Fog::read(): Could not cast this osg::Fog to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Fog::read(): Could not cast this osg::Fog to an osg::Object.");
|
||||
|
||||
// Read Fog's properties
|
||||
setMode(osg::Fog::Mode(in->readInt()));
|
||||
@@ -62,6 +62,6 @@ void Fog::read(DataInputStream* in){
|
||||
setFogCoordinateSource(in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("Fog::read(): Expected Fog identification.");
|
||||
in_THROW_EXCEPTION("Fog::read(): Expected Fog identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ void FragmentProgram::write( DataOutputStream* out )
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Material::write(): Could not cast this osg::FragmentProgram to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Material::write(): Could not cast this osg::FragmentProgram to an osg::Object.");
|
||||
}
|
||||
|
||||
// Write FragmentProgram properties.
|
||||
@@ -62,7 +62,7 @@ void FragmentProgram::read(DataInputStream* in){
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception( "Material::read(): Could not cast this osg::FragmentProgram to an osg::Object." );
|
||||
in_THROW_EXCEPTION( "Material::read(): Could not cast this osg::FragmentProgram to an osg::Object." );
|
||||
}
|
||||
|
||||
// Read data
|
||||
@@ -80,6 +80,6 @@ void FragmentProgram::read(DataInputStream* in){
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("FragmentProgram::read(): Expected FragmentProgram identification.");
|
||||
in_THROW_EXCEPTION("FragmentProgram::read(): Expected FragmentProgram identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void FrontFace::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("FrontFace::write(): Could not cast this osg::FrontFace to an osg::Object.");
|
||||
out_THROW_EXCEPTION("FrontFace::write(): Could not cast this osg::FrontFace to an osg::Object.");
|
||||
// Write FrontFace's properties.
|
||||
|
||||
// Write mode
|
||||
@@ -46,7 +46,7 @@ void FrontFace::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("FrontFace::read(): Could not cast this osg::FrontFace to an osg::Object.");
|
||||
in_THROW_EXCEPTION("FrontFace::read(): Could not cast this osg::FrontFace to an osg::Object.");
|
||||
// Read FrontFace's properties
|
||||
|
||||
// Read mode
|
||||
@@ -54,7 +54,7 @@ void FrontFace::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("FrontFace::read(): Expected FrontFace identification.");
|
||||
in_THROW_EXCEPTION("FrontFace::read(): Expected FrontFace identification.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ void Geode::write(DataOutputStream* out){
|
||||
((ive::Node*)(node))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Geode::write(): Could not cast this osg::Geode to an osg::Node.");
|
||||
out_THROW_EXCEPTION("Geode::write(): Could not cast this osg::Geode to an osg::Node.");
|
||||
|
||||
|
||||
// Write Geode's properties.
|
||||
@@ -45,7 +45,7 @@ void Geode::write(DataOutputStream* out){
|
||||
if(dynamic_cast<osg::Geometry*>(drawable))
|
||||
((ive::Geometry*)(drawable))->write(out);
|
||||
else{
|
||||
throw Exception("Unknown drawable in Geode::write()");
|
||||
in_THROW_EXCEPTION("Unknown drawable in Geode::write()");
|
||||
}
|
||||
#else
|
||||
out->writeDrawable(drawable);
|
||||
@@ -65,7 +65,7 @@ void Geode::read(DataInputStream* in){
|
||||
((ive::Node*)(node))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Geode::read(): Could not cast this osg::Geode to an osg::Node.");
|
||||
in_THROW_EXCEPTION("Geode::read(): Could not cast this osg::Geode to an osg::Node.");
|
||||
|
||||
|
||||
// Read number of drawables.
|
||||
@@ -81,13 +81,13 @@ void Geode::read(DataInputStream* in){
|
||||
addDrawable(drawable);
|
||||
}
|
||||
else
|
||||
throw Exception("Unknown drawable identification in Geode::read()");
|
||||
in_THROW_EXCEPTION("Unknown drawable identification in Geode::read()");
|
||||
#else
|
||||
addDrawable(in->readDrawable());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("Geode::read(): Expected Geode identification.");
|
||||
in_THROW_EXCEPTION("Geode::read(): Expected Geode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void Geometry::write(DataOutputStream* out){
|
||||
((ive::Drawable*)(drawable))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Geometry::write(): Could not cast this osg::Geometry to an osg::Drawable.");
|
||||
out_THROW_EXCEPTION("Geometry::write(): Could not cast this osg::Geometry to an osg::Drawable.");
|
||||
|
||||
|
||||
// Write Geometry's properties.
|
||||
@@ -53,7 +53,7 @@ void Geometry::write(DataOutputStream* out){
|
||||
else if(dynamic_cast<osg::DrawElementsUInt*>(getPrimitiveSet(i)))
|
||||
((ive::DrawElementsUInt*)(getPrimitiveSet(i)))->write(out);
|
||||
else
|
||||
throw Exception("Unknown PrimitivSet in Geometry::write()");
|
||||
out_THROW_EXCEPTION("Unknown PrimitivSet in Geometry::write()");
|
||||
}
|
||||
|
||||
// Write vertex array if any
|
||||
@@ -178,7 +178,7 @@ void Geometry::read(DataInputStream* in){
|
||||
((ive::Drawable*)(drawable))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Geometry::read(): Could not cast this osg::Geometry to an osg::Drawable.");
|
||||
in_THROW_EXCEPTION("Geometry::read(): Could not cast this osg::Geometry to an osg::Drawable.");
|
||||
|
||||
|
||||
// Read geoemtry properties
|
||||
@@ -215,7 +215,7 @@ void Geometry::read(DataInputStream* in){
|
||||
addPrimitiveSet(prim);
|
||||
}
|
||||
else{
|
||||
throw Exception("Unknown PrimitiveSet in Geometry::read()");
|
||||
in_THROW_EXCEPTION("Unknown PrimitiveSet in Geometry::read()");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,6 +314,6 @@ void Geometry::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("Geometry::read(): Expected Geometry identification.");
|
||||
in_THROW_EXCEPTION("Geometry::read(): Expected Geometry identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void Group::write(DataOutputStream* out){
|
||||
static_cast<ive::Node*>(node)->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Group::write(): Could not cast this osg::Group to an osg::Node.");
|
||||
out_THROW_EXCEPTION("Group::write(): Could not cast this osg::Group to an osg::Node.");
|
||||
|
||||
// Write Group's properties.
|
||||
|
||||
@@ -61,7 +61,7 @@ void Group::read(DataInputStream* in){
|
||||
((ive::Node*)(node))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Group::read(): Could not cast this osg::Group to an osg::Node.");
|
||||
in_THROW_EXCEPTION("Group::read(): Could not cast this osg::Group to an osg::Node.");
|
||||
|
||||
|
||||
// Read groups properties.
|
||||
@@ -75,6 +75,6 @@ void Group::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("Group::read(): Expected Group identification");
|
||||
in_THROW_EXCEPTION("Group::read(): Expected Group identification");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ void HeightFieldLayer::write(DataOutputStream* out)
|
||||
if (layer)
|
||||
((ive::Layer*)(layer))->write(out);
|
||||
else
|
||||
throw Exception("HeightFieldLayer::write(): Could not cast this osgLayer::HeightFieldLayer to an osgTerrain::Layer.");
|
||||
out_THROW_EXCEPTION("HeightFieldLayer::write(): Could not cast this osgLayer::HeightFieldLayer to an osgTerrain::Layer.");
|
||||
|
||||
|
||||
if (getFileName().empty() && getHeightField())
|
||||
@@ -87,7 +87,7 @@ void HeightFieldLayer::read(DataInputStream* in)
|
||||
// Peek on Layer's identification.
|
||||
int id = in->peekInt();
|
||||
if (id != IVEHEIGHTFIELDLAYER)
|
||||
throw Exception("HeightFieldLayer::read(): Expected HeightFieldLayer identification.");
|
||||
in_THROW_EXCEPTION("HeightFieldLayer::read(): Expected HeightFieldLayer identification.");
|
||||
|
||||
// Read Layer's identification.
|
||||
id = in->readInt();
|
||||
@@ -97,7 +97,7 @@ void HeightFieldLayer::read(DataInputStream* in)
|
||||
if (layer)
|
||||
((ive::Layer*)(layer))->read(in);
|
||||
else
|
||||
throw Exception("HeightFieldLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
in_THROW_EXCEPTION("HeightFieldLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
|
||||
|
||||
bool useInlineHeightField = in->readBool();
|
||||
|
||||
@@ -30,7 +30,7 @@ void Image::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Image::write(): Could not cast this osg::Image to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Image::write(): Could not cast this osg::Image to an osg::Object.");
|
||||
// Write Image's properties.
|
||||
|
||||
// Write name
|
||||
@@ -90,7 +90,7 @@ void Image::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Image::read(): Could not cast this osg::Image to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Image::read(): Could not cast this osg::Image to an osg::Object.");
|
||||
// Read Image's properties.
|
||||
|
||||
// Read name
|
||||
@@ -144,7 +144,7 @@ void Image::read(DataInputStream* in)
|
||||
//char* data = (char*)malloc (dataSize);
|
||||
char* data = new char[dataSize];
|
||||
if(!data)
|
||||
throw Exception("Image::read(): Unable to allocate memory for image data.");
|
||||
in_THROW_EXCEPTION("Image::read(): Unable to allocate memory for image data.");
|
||||
in->readCharArray(data,dataSize);
|
||||
setImage(is, it, ir, internalTextureFormat, pixelFormat,
|
||||
dataType, (unsigned char* ) data, osg::Image::USE_NEW_DELETE, packing);
|
||||
@@ -153,6 +153,6 @@ void Image::read(DataInputStream* in)
|
||||
_mipmapData.swap(mipmapData);
|
||||
}
|
||||
else{
|
||||
throw Exception("Image::read(): Expected Image identification.");
|
||||
in_THROW_EXCEPTION("Image::read(): Expected Image identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void ImageLayer::write(DataOutputStream* out)
|
||||
if (layer)
|
||||
((ive::Layer*)(layer))->write(out);
|
||||
else
|
||||
throw Exception("ImageLayer::write(): Could not cast this osgLayer::ImageLayer to an osgTerrain::Layer.");
|
||||
out_THROW_EXCEPTION("ImageLayer::write(): Could not cast this osgLayer::ImageLayer to an osgTerrain::Layer.");
|
||||
|
||||
|
||||
IncludeImageMode imMode = out->getIncludeImageMode(getImage());
|
||||
@@ -48,7 +48,7 @@ void ImageLayer::read(DataInputStream* in)
|
||||
// Peek on Layer's identification.
|
||||
int id = in->peekInt();
|
||||
if (id != IVEIMAGELAYER)
|
||||
throw Exception("ImageLayer::read(): Expected ImageLayer identification.");
|
||||
in_THROW_EXCEPTION("ImageLayer::read(): Expected ImageLayer identification.");
|
||||
|
||||
// Read Layer's identification.
|
||||
id = in->readInt();
|
||||
@@ -58,7 +58,7 @@ void ImageLayer::read(DataInputStream* in)
|
||||
if (layer)
|
||||
((ive::Layer*)(layer))->read(in);
|
||||
else
|
||||
throw Exception("ImageLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
in_THROW_EXCEPTION("ImageLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
|
||||
|
||||
bool deferExternalLayerLoading = osgTerrain::TerrainTile::getTileLoadedCallback().valid() ?
|
||||
|
||||
@@ -30,7 +30,7 @@ void ImageSequence::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ImageSequence::write(): Could not cast this osg::ImageSequence to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ImageSequence::write(): Could not cast this osg::ImageSequence to an osg::Object.");
|
||||
// Write ImageSequence's properties.
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ void ImageSequence::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ImageSequence::read(): Could not cast this osg::ImageSequence to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ImageSequence::read(): Could not cast this osg::ImageSequence to an osg::Object.");
|
||||
// Read ImageSequence's properties.
|
||||
|
||||
|
||||
@@ -97,6 +97,6 @@ void ImageSequence::read(DataInputStream* in)
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("ImageSequence::read(): Expected ImageSequence identification.");
|
||||
in_THROW_EXCEPTION("ImageSequence::read(): Expected ImageSequence identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void Impostor::write(DataOutputStream* out){
|
||||
((ive::LOD*)(lod))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Impostor::write(): Could not cast this osg::Impostor to an osg::LOD.");
|
||||
out_THROW_EXCEPTION("Impostor::write(): Could not cast this osg::Impostor to an osg::LOD.");
|
||||
// Write Impostor's properties.
|
||||
out->writeFloat(getImpostorThreshold());
|
||||
}
|
||||
@@ -44,11 +44,11 @@ void Impostor::read(DataInputStream* in){
|
||||
((ive::LOD*)(lod))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Impostor::read(): Could not cast this osg::Impostor to an osg::LOD.");
|
||||
in_THROW_EXCEPTION("Impostor::read(): Could not cast this osg::Impostor to an osg::LOD.");
|
||||
// Read Impostor's properties
|
||||
setImpostorThreshold(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("Impostor::read(): Expected Impostor identification.");
|
||||
in_THROW_EXCEPTION("Impostor::read(): Expected Impostor identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void LOD::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("LOD::write(): Could not cast this osg::LOD to an osg::Group.");
|
||||
out_THROW_EXCEPTION("LOD::write(): Could not cast this osg::LOD to an osg::Group.");
|
||||
// Write LOD's properties.
|
||||
|
||||
out->writeFloat(getRadius());
|
||||
@@ -60,7 +60,7 @@ void LOD::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("LOD::read(): Could not cast this osg::LOD to an osg::Group.");
|
||||
in_THROW_EXCEPTION("LOD::read(): Could not cast this osg::LOD to an osg::Group.");
|
||||
// Read LOD's properties
|
||||
|
||||
if ( in->getVersion() > VERSION_0002 )
|
||||
@@ -82,6 +82,6 @@ void LOD::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("LOD::read(): Expected LOD identification.");
|
||||
in_THROW_EXCEPTION("LOD::read(): Expected LOD identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void Layer::write(DataOutputStream* out)
|
||||
if (object)
|
||||
((ive::Object*)(object))->write(out);
|
||||
else
|
||||
throw Exception("Layer::write(): Could not cast this osgLayer::Layer to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Layer::write(): Could not cast this osgLayer::Layer to an osg::Object.");
|
||||
|
||||
|
||||
if (out->getVersion() >= VERSION_0023)
|
||||
@@ -74,7 +74,7 @@ void Layer::read(DataInputStream* in)
|
||||
// Peek on Layer's identification.
|
||||
int id = in->peekInt();
|
||||
if (id != IVELAYER)
|
||||
throw Exception("Layer::read(): Expected Layer identification.");
|
||||
in_THROW_EXCEPTION("Layer::read(): Expected Layer identification.");
|
||||
|
||||
// Read Layer's identification.
|
||||
id = in->readInt();
|
||||
@@ -84,7 +84,7 @@ void Layer::read(DataInputStream* in)
|
||||
if(object)
|
||||
((ive::Object*)(object))->read(in);
|
||||
else
|
||||
throw Exception("Layer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Layer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
|
||||
if (in->getVersion() >= VERSION_0023)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ void Light::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Light::write(): Could not cast this osg::Light to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Light::write(): Could not cast this osg::Light to an osg::Object.");
|
||||
// Write Light's properties.
|
||||
out->writeInt(getLightNum());
|
||||
out->writeVec4(getAmbient());
|
||||
@@ -55,7 +55,7 @@ void Light::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Light::read(): Could not cast this osg::Light to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Light::read(): Could not cast this osg::Light to an osg::Object.");
|
||||
// Read Light's properties
|
||||
setLightNum(in->readInt());
|
||||
setAmbient(in->readVec4());
|
||||
@@ -70,6 +70,6 @@ void Light::read(DataInputStream* in){
|
||||
setSpotCutoff(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("Light::read(): Expected Light identification.");
|
||||
in_THROW_EXCEPTION("Light::read(): Expected Light identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void LightModel::write(DataOutputStream* out){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
else
|
||||
throw Exception("LightModel::write(): Could not cast this osg::LightModel to an osg::Object.");
|
||||
out_THROW_EXCEPTION("LightModel::write(): Could not cast this osg::LightModel to an osg::Object.");
|
||||
|
||||
// write LightModel's properties
|
||||
out->writeBool(getTwoSided());
|
||||
@@ -50,7 +50,7 @@ void LightModel::read(DataInputStream* in){
|
||||
if(obj)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
else
|
||||
throw Exception("LightModel::read(): Could not cast this osg::LightModel to an osg::Object.");
|
||||
in_THROW_EXCEPTION("LightModel::read(): Could not cast this osg::LightModel to an osg::Object.");
|
||||
|
||||
// Read LightModel's properties
|
||||
setTwoSided(in->readBool());
|
||||
@@ -59,6 +59,6 @@ void LightModel::read(DataInputStream* in){
|
||||
setColorControl((ColorControl)in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("LightModel::read(): Expected LightModel identification.");
|
||||
in_THROW_EXCEPTION("LightModel::read(): Expected LightModel identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void LightPoint::write(DataOutputStream* out){
|
||||
((ive::DirectionalSector*)(_sector.get()))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Unknown sector in LightPoint::write()");
|
||||
out_THROW_EXCEPTION("Unknown sector in LightPoint::write()");
|
||||
}
|
||||
|
||||
// Write out osgSim::BlinkSequence.
|
||||
@@ -109,7 +109,7 @@ void LightPoint::read(DataInputStream* in){
|
||||
_sector = sector;
|
||||
}
|
||||
else
|
||||
throw Exception("Unknown sector in LightPoint::read()");
|
||||
in_THROW_EXCEPTION("Unknown sector in LightPoint::read()");
|
||||
}
|
||||
|
||||
// Read in osgSim::BlinkSequence.
|
||||
@@ -123,6 +123,6 @@ void LightPoint::read(DataInputStream* in){
|
||||
_blendingMode = (osgSim::LightPoint::BlendingMode)in->readInt();
|
||||
}
|
||||
else{
|
||||
throw Exception("LightPoint::read(): Expected LightPoint identification.");
|
||||
in_THROW_EXCEPTION("LightPoint::read(): Expected LightPoint identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void LightPointNode::write(DataOutputStream* out){
|
||||
((ive::Node*)(node))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("LightPointNode::write(): Could not cast this osgSim::LightPointNode to an osg::Node.");
|
||||
out_THROW_EXCEPTION("LightPointNode::write(): Could not cast this osgSim::LightPointNode to an osg::Node.");
|
||||
|
||||
// Write LightPointNode's properties.
|
||||
out->writeFloat(getMinPixelSize());
|
||||
@@ -59,7 +59,7 @@ void LightPointNode::read(DataInputStream* in){
|
||||
((ive::Node*)(node))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("LightPointNode::read(): Could not cast this osgSim::LightPointNode to an osg::Object.");
|
||||
in_THROW_EXCEPTION("LightPointNode::read(): Could not cast this osgSim::LightPointNode to an osg::Object.");
|
||||
// Read LightPointNode's properties
|
||||
setMinPixelSize(in->readFloat());
|
||||
setMaxPixelSize(in->readFloat());
|
||||
@@ -79,6 +79,6 @@ void LightPointNode::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("LightPointNode::read(): Expected LightPointNode identification.");
|
||||
in_THROW_EXCEPTION("LightPointNode::read(): Expected LightPointNode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void LightSource::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("LightSource::write(): Could not cast this osg::LightSource to an osg::Group.");
|
||||
out_THROW_EXCEPTION("LightSource::write(): Could not cast this osg::LightSource to an osg::Group.");
|
||||
// Write LightSource's properties.
|
||||
|
||||
// Write out light
|
||||
@@ -54,7 +54,7 @@ void LightSource::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("LightSource::read(): Could not cast this osg::LightSource to an osg::Object.");
|
||||
in_THROW_EXCEPTION("LightSource::read(): Could not cast this osg::LightSource to an osg::Object.");
|
||||
// Read LightSource's properties
|
||||
|
||||
// Read light
|
||||
@@ -68,6 +68,6 @@ void LightSource::read(DataInputStream* in){
|
||||
setReferenceFrame((osg::LightSource::ReferenceFrame) in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("LightSource::read(): Expected LightSource identification.");
|
||||
in_THROW_EXCEPTION("LightSource::read(): Expected LightSource identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void LineStipple::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("LineStipple::write(): Could not cast this osg::LineStipple to an osg::Object.");
|
||||
out_THROW_EXCEPTION("LineStipple::write(): Could not cast this osg::LineStipple to an osg::Object.");
|
||||
// Write LineStipple's properties.
|
||||
out->writeUShort(getPattern());
|
||||
out->writeInt(getFactor());
|
||||
@@ -45,12 +45,12 @@ void LineStipple::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("LineStipple::read(): Could not cast this osg::LineStipple to an osg::Object.");
|
||||
in_THROW_EXCEPTION("LineStipple::read(): Could not cast this osg::LineStipple to an osg::Object.");
|
||||
// Read LineStipple's properties
|
||||
setPattern(in->readUShort());
|
||||
setFactor(in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("LineStipple::read(): Expected LineStipple identification.");
|
||||
in_THROW_EXCEPTION("LineStipple::read(): Expected LineStipple identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void LineWidth::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("LineWidth::write(): Could not cast this osg::LineWidth to an osg::Object.");
|
||||
out_THROW_EXCEPTION("LineWidth::write(): Could not cast this osg::LineWidth to an osg::Object.");
|
||||
// Write LineWidth's properties.
|
||||
out->writeFloat(getWidth());
|
||||
}
|
||||
@@ -44,11 +44,11 @@ void LineWidth::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("LineWidth::read(): Could not cast this osg::LineWidth to an osg::Object.");
|
||||
in_THROW_EXCEPTION("LineWidth::read(): Could not cast this osg::LineWidth to an osg::Object.");
|
||||
// Read LineWidth's properties
|
||||
setWidth(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("LineWidth::read(): Expected LineWidth identification.");
|
||||
in_THROW_EXCEPTION("LineWidth::read(): Expected LineWidth identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void Locator::write(DataOutputStream* out)
|
||||
if (object)
|
||||
((ive::Object*)(object))->write(out);
|
||||
else
|
||||
throw Exception("Layer::write(): Could not cast this osgLayer::Layer to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Layer::write(): Could not cast this osgLayer::Layer to an osg::Object.");
|
||||
|
||||
out->writeInt(getCoordinateSystemType());
|
||||
out->writeString(getFormat());
|
||||
@@ -52,7 +52,7 @@ void Locator::read(DataInputStream* in)
|
||||
int id = in->peekInt();
|
||||
if(id != IVELOCATOR)
|
||||
{
|
||||
throw Exception("Locator::read(): Expected Locator identification.");
|
||||
in_THROW_EXCEPTION("Locator::read(): Expected Locator identification.");
|
||||
}
|
||||
|
||||
// Read Locator's identification.
|
||||
@@ -63,7 +63,7 @@ void Locator::read(DataInputStream* in)
|
||||
if(object)
|
||||
((ive::Object*)(object))->read(in);
|
||||
else
|
||||
throw Exception("Locator::read(): Could not cast this osgLocator::Locator to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Locator::read(): Could not cast this osgLocator::Locator to an osg::Group.");
|
||||
|
||||
setCoordinateSystemType(static_cast<osgTerrain::Locator::CoordinateSystemType>(in->readInt()));
|
||||
setFormat(in->readString());
|
||||
|
||||
@@ -27,7 +27,7 @@ void Material::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Material::write(): Could not cast this osg::Material to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Material::write(): Could not cast this osg::Material to an osg::Object.");
|
||||
// Write Material's properties.
|
||||
|
||||
// Write color mode
|
||||
@@ -67,7 +67,7 @@ void Material::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Material::read(): Could not cast this osg::Material to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Material::read(): Could not cast this osg::Material to an osg::Object.");
|
||||
|
||||
// Read color mode.
|
||||
_colorMode = (osg::Material::ColorMode)in->readInt();
|
||||
@@ -93,6 +93,6 @@ void Material::read(DataInputStream* in){
|
||||
_shininessBack = in->readFloat();
|
||||
}
|
||||
else{
|
||||
throw Exception("Material::read(): Expected Material identification.");
|
||||
in_THROW_EXCEPTION("Material::read(): Expected Material identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void MatrixTransform::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("MatrixTransform::write(): Could not cast this osg::MatrixTransform to an osg::Group.");
|
||||
out_THROW_EXCEPTION("MatrixTransform::write(): Could not cast this osg::MatrixTransform to an osg::Group.");
|
||||
|
||||
|
||||
// Write MatrixTransform's properties.
|
||||
@@ -47,12 +47,12 @@ void MatrixTransform::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("MatrixTransform::read(): Could not cast this osg::MatrixTransform to an osg::Group.");
|
||||
in_THROW_EXCEPTION("MatrixTransform::read(): Could not cast this osg::MatrixTransform to an osg::Group.");
|
||||
|
||||
// Read matrix
|
||||
setMatrix(in->readMatrixd());
|
||||
}
|
||||
else{
|
||||
throw Exception("MatrixTransform::read(): Expected MatrixTransform identification");
|
||||
in_THROW_EXCEPTION("MatrixTransform::read(): Expected MatrixTransform identification");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void MultiSwitch::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Switch::write(): Could not cast this osg::Switch to an osg::Group.");
|
||||
out_THROW_EXCEPTION("Switch::write(): Could not cast this osg::Switch to an osg::Group.");
|
||||
// Write Switch's properties.
|
||||
|
||||
out->writeBool(getNewChildDefaultValue());
|
||||
@@ -57,7 +57,7 @@ void MultiSwitch::read(DataInputStream* in)
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Switch::read(): Could not cast this osg::Switch to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Switch::read(): Could not cast this osg::Switch to an osg::Group.");
|
||||
// Read Switch's properties
|
||||
|
||||
setNewChildDefaultValue(in->readBool());
|
||||
@@ -73,6 +73,6 @@ void MultiSwitch::read(DataInputStream* in)
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("Switch::read(): Expected Switch identification.");
|
||||
in_THROW_EXCEPTION("Switch::read(): Expected Switch identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void MultiTextureControl::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("MultiTextureControl::write(): Could not cast this osg::MultiTextureControl to an osg::Group.");
|
||||
out_THROW_EXCEPTION("MultiTextureControl::write(): Could not cast this osg::MultiTextureControl to an osg::Group.");
|
||||
// Write MultiTextureControl's properties.
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ void MultiTextureControl::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("MultiTextureControl::read(): Could not cast this osg::MultiTextureControl to an osg::Group.");
|
||||
in_THROW_EXCEPTION("MultiTextureControl::read(): Could not cast this osg::MultiTextureControl to an osg::Group.");
|
||||
// Read MultiTextureControl's properties
|
||||
|
||||
|
||||
@@ -66,6 +66,6 @@ void MultiTextureControl::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("MultiTextureControl::read(): Expected MultiTextureControl identification.");
|
||||
in_THROW_EXCEPTION("MultiTextureControl::read(): Expected MultiTextureControl identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void Multisample::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Multisample::write(): Could not cast this osg::Multisample to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Multisample::write(): Could not cast this osg::Multisample to an osg::Object.");
|
||||
// Write Multisample's properties.
|
||||
out->writeFloat(getCoverage());
|
||||
out->writeBool(getInvert());
|
||||
@@ -45,13 +45,13 @@ void Multisample::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Multisample::read(): Could not cast this osg::Multisample to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Multisample::read(): Could not cast this osg::Multisample to an osg::Object.");
|
||||
// Read Multisample's properties
|
||||
setCoverage(in->readFloat());
|
||||
setInvert(in->readBool());
|
||||
setHint((Mode) in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("Multisample::read(): Expected Multisample identification.");
|
||||
in_THROW_EXCEPTION("Multisample::read(): Expected Multisample identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void Node::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Node::write(): Could not cast this osg::Node to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Node::write(): Could not cast this osg::Node to an osg::Object.");
|
||||
|
||||
|
||||
// Write osg::node properties.
|
||||
@@ -115,7 +115,7 @@ void Node::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Node::read(): Could not cast this osg::Node to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Node::read(): Could not cast this osg::Node to an osg::Object.");
|
||||
|
||||
if ( in->getVersion() < VERSION_0012 )
|
||||
{
|
||||
@@ -167,7 +167,7 @@ void Node::read(DataInputStream* in){
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Unknown event callback identification in Node::read()");
|
||||
in_THROW_EXCEPTION("Unknown event callback identification in Node::read()");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -188,6 +188,6 @@ void Node::read(DataInputStream* in){
|
||||
setNodeMask(in->readUInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("Node::read(): Expected Node identification");
|
||||
in_THROW_EXCEPTION("Node::read(): Expected Node identification");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,6 @@ void Object::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("Object::read(): Expected Object identification");
|
||||
in_THROW_EXCEPTION("Object::read(): Expected Object identification");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void OccluderNode::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("OccluderNode::write(): Could not cast this osg::OccluderNode to an osg::Group.");
|
||||
out_THROW_EXCEPTION("OccluderNode::write(): Could not cast this osg::OccluderNode to an osg::Group.");
|
||||
// Write OccluderNode's properties.
|
||||
out->writeBool(getOccluder()!=0);
|
||||
if(getOccluder())
|
||||
@@ -49,7 +49,7 @@ void OccluderNode::read(DataInputStream* in)
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("OccluderNode::read(): Could not cast this osg::OccluderNode to an osg::Group.");
|
||||
in_THROW_EXCEPTION("OccluderNode::read(): Could not cast this osg::OccluderNode to an osg::Group.");
|
||||
// Read OccluderNode's properties
|
||||
if(in->readBool()){
|
||||
osg::ConvexPlanarOccluder* cpo = new osg::ConvexPlanarOccluder();
|
||||
@@ -58,6 +58,6 @@ void OccluderNode::read(DataInputStream* in)
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("OccluderNode::read(): Expected OccluderNode identification.");
|
||||
in_THROW_EXCEPTION("OccluderNode::read(): Expected OccluderNode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void OcclusionQueryNode::write( DataOutputStream* out )
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("OcclusionQueryNode::write(): Could not cast this osg::OcclusionQueryNode to an osg::Group.");
|
||||
out_THROW_EXCEPTION("OcclusionQueryNode::write(): Could not cast this osg::OcclusionQueryNode to an osg::Group.");
|
||||
|
||||
// Write OcclusionQueryNode's properties.
|
||||
out->writeBool( getQueriesEnabled() );
|
||||
@@ -52,7 +52,7 @@ void OcclusionQueryNode::read( DataInputStream* in )
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("OcclusionQueryNode::read(): Could not cast this osg::OcclusionQueryNode to an osg::Group.");
|
||||
in_THROW_EXCEPTION("OcclusionQueryNode::read(): Could not cast this osg::OcclusionQueryNode to an osg::Group.");
|
||||
|
||||
// Read OcclusionQueryNode's properties
|
||||
setQueriesEnabled( in->readBool() );
|
||||
@@ -61,6 +61,6 @@ void OcclusionQueryNode::read( DataInputStream* in )
|
||||
setDebugDisplay( in->readBool() );
|
||||
}
|
||||
else{
|
||||
throw Exception("OcclusionQueryNode::read(): Expected OcclusionQueryNode identification.");
|
||||
in_THROW_EXCEPTION("OcclusionQueryNode::read(): Expected OcclusionQueryNode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void PagedLOD::write(DataOutputStream* out)
|
||||
static_cast<ive::Node*>(node)->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("PagedLOD::write(): Could not cast this osg::PagedLOD to an osg::Node.");
|
||||
out_THROW_EXCEPTION("PagedLOD::write(): Could not cast this osg::PagedLOD to an osg::Node.");
|
||||
|
||||
out->writeString(getDatabasePath());
|
||||
out->writeFloat(getRadius());
|
||||
@@ -123,7 +123,7 @@ void PagedLOD::read(DataInputStream* in)
|
||||
((ive::Node*)(node))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("PagedLOD::read(): Could not cast this osg::PagedLOD to an osg::Node.");
|
||||
in_THROW_EXCEPTION("PagedLOD::read(): Could not cast this osg::PagedLOD to an osg::Node.");
|
||||
|
||||
|
||||
if ( in->getVersion() >= VERSION_0006 )
|
||||
@@ -203,6 +203,6 @@ void PagedLOD::read(DataInputStream* in)
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("LOD::read(): Expected LOD identification.");
|
||||
in_THROW_EXCEPTION("LOD::read(): Expected LOD identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void Point::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Point::write(): Could not cast this osg::Point to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Point::write(): Could not cast this osg::Point to an osg::Object.");
|
||||
// Write Point's properties.
|
||||
out->writeFloat(getSize());
|
||||
out->writeFloat(getFadeThresholdSize());
|
||||
@@ -48,7 +48,7 @@ void Point::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Point::read(): Could not cast this osg::Point to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Point::read(): Could not cast this osg::Point to an osg::Object.");
|
||||
// Read Point's properties
|
||||
setSize(in->readFloat());
|
||||
setFadeThresholdSize(in->readFloat());
|
||||
@@ -57,6 +57,6 @@ void Point::read(DataInputStream* in){
|
||||
setMaxSize(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("Point::read(): Expected Point identification.");
|
||||
in_THROW_EXCEPTION("Point::read(): Expected Point identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void PointSprite::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("PointSprite::write(): Could not cast this osg::PointSprite to an osg::Object.");
|
||||
out_THROW_EXCEPTION("PointSprite::write(): Could not cast this osg::PointSprite to an osg::Object.");
|
||||
// Write PointSprite's properties.
|
||||
|
||||
// Write mode
|
||||
@@ -46,7 +46,7 @@ void PointSprite::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("PointSprite::read(): Could not cast this osg::PointSprite to an osg::Object.");
|
||||
in_THROW_EXCEPTION("PointSprite::read(): Could not cast this osg::PointSprite to an osg::Object.");
|
||||
// Read PointSprite's properties
|
||||
|
||||
// Read mode
|
||||
@@ -54,7 +54,7 @@ void PointSprite::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("PointSprite::read(): Expected PointSprite identification.");
|
||||
in_THROW_EXCEPTION("PointSprite::read(): Expected PointSprite identification.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ void PolygonMode::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("PolygonMode::write(): Could not cast this osg::PolygonMode to an osg::Object.");
|
||||
out_THROW_EXCEPTION("PolygonMode::write(): Could not cast this osg::PolygonMode to an osg::Object.");
|
||||
// Write PolygonMode's properties.
|
||||
out->writeInt(getMode(osg::PolygonMode::FRONT));
|
||||
out->writeInt(getMode(osg::PolygonMode::BACK));
|
||||
@@ -45,13 +45,13 @@ void PolygonMode::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("PolygonMode::read(): Could not cast this osg::PolygonMode to an osg::Object.");
|
||||
in_THROW_EXCEPTION("PolygonMode::read(): Could not cast this osg::PolygonMode to an osg::Object.");
|
||||
// Read PolygonMode's properties
|
||||
setMode(osg::PolygonMode::FRONT,(Mode)in->readInt());
|
||||
setMode(osg::PolygonMode::BACK,(Mode)in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("PolygonMode::read(): Expected PolygonMode identification.");
|
||||
in_THROW_EXCEPTION("PolygonMode::read(): Expected PolygonMode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ void PolygonOffset::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("PolygonOffset::write(): Could not cast this osg::PolygonOffset to an osg::Object.");
|
||||
out_THROW_EXCEPTION("PolygonOffset::write(): Could not cast this osg::PolygonOffset to an osg::Object.");
|
||||
// Write PolygonOffset's properties.
|
||||
out->writeFloat(getFactor());
|
||||
out->writeFloat(getUnits());
|
||||
@@ -45,12 +45,12 @@ void PolygonOffset::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("PolygonOffset::read(): Could not cast this osg::PolygonOffset to an osg::Object.");
|
||||
in_THROW_EXCEPTION("PolygonOffset::read(): Could not cast this osg::PolygonOffset to an osg::Object.");
|
||||
// Read PolygonOffset's properties
|
||||
setFactor(in->readFloat());
|
||||
setUnits(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("PolygonOffset::read(): Expected PolygonOffset identification.");
|
||||
in_THROW_EXCEPTION("PolygonOffset::read(): Expected PolygonOffset identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void PolygonStipple::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("PolygonStipple::write(): Could not cast this osg::PolygonStipple to an osg::Object.");
|
||||
out_THROW_EXCEPTION("PolygonStipple::write(): Could not cast this osg::PolygonStipple to an osg::Object.");
|
||||
// Write PolygonStipple's properties.
|
||||
out->writeUByteArray(new osg::UByteArray(128,const_cast<GLubyte*>(getMask())));
|
||||
}
|
||||
@@ -44,11 +44,11 @@ void PolygonStipple::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("PolygonStipple::read(): Could not cast this osg::PolygonStipple to an osg::Object.");
|
||||
in_THROW_EXCEPTION("PolygonStipple::read(): Could not cast this osg::PolygonStipple to an osg::Object.");
|
||||
// Read PolygonStipple's properties
|
||||
setMask((GLubyte *)in->readUByteArray()->getDataPointer());
|
||||
}
|
||||
else{
|
||||
throw Exception("PolygonStipple::read(): Expected PolygonStipple identification.");
|
||||
in_THROW_EXCEPTION("PolygonStipple::read(): Expected PolygonStipple identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void PositionAttitudeTransform::write(DataOutputStream* out){
|
||||
((ive::Transform*)(trans))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("PositionAttitudeTransform::write(): Could not cast this osg::PositionAttitudeTransform to an osg::Transform.");
|
||||
out_THROW_EXCEPTION("PositionAttitudeTransform::write(): Could not cast this osg::PositionAttitudeTransform to an osg::Transform.");
|
||||
// Write PositionAttitudeTransform's properties.
|
||||
|
||||
out->writeVec3(getPosition());
|
||||
@@ -48,7 +48,7 @@ void PositionAttitudeTransform::read(DataInputStream* in){
|
||||
((ive::Transform*)(trans))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("PositionAttitudeTransform::read(): Could not cast this osg::PositionAttitudeTransform to an osg::Transform.");
|
||||
in_THROW_EXCEPTION("PositionAttitudeTransform::read(): Could not cast this osg::PositionAttitudeTransform to an osg::Transform.");
|
||||
// Read PositionAttitudeTransform's properties
|
||||
setPosition(in->readVec3());
|
||||
setAttitude(in->readQuat());
|
||||
@@ -57,6 +57,6 @@ void PositionAttitudeTransform::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("PositionAttitudeTransform::read(): Expected PositionAttitudeTransform identification.");
|
||||
in_THROW_EXCEPTION("PositionAttitudeTransform::read(): Expected PositionAttitudeTransform identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void PrimitiveSet::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("PrimitiveSet::write(): Could not cast this osg::PrimitiveSet to an osg::Object.");
|
||||
out_THROW_EXCEPTION("PrimitiveSet::write(): Could not cast this osg::PrimitiveSet to an osg::Object.");
|
||||
|
||||
|
||||
if ( out->getVersion() >= VERSION_0038 )
|
||||
@@ -51,7 +51,7 @@ void PrimitiveSet::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("PrimitiveSet::read(): Could not cast this osg::PrimitiveSet to an osg::Object.");
|
||||
in_THROW_EXCEPTION("PrimitiveSet::read(): Could not cast this osg::PrimitiveSet to an osg::Object.");
|
||||
|
||||
|
||||
if ( in->getVersion() >= VERSION_0038 )
|
||||
@@ -63,6 +63,6 @@ void PrimitiveSet::read(DataInputStream* in){
|
||||
setMode(in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("PrimitiveSet::read(): Expected PrimitiveSet identification.");
|
||||
in_THROW_EXCEPTION("PrimitiveSet::read(): Expected PrimitiveSet identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void Program::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Program::write(): Could not cast this osg::Program to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Program::write(): Could not cast this osg::Program to an osg::Object.");
|
||||
|
||||
if ( out->getVersion() >= VERSION_0030 )
|
||||
{
|
||||
@@ -70,12 +70,12 @@ void Program::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Program::read(): Could not cast this osg::Program to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Program::read(): Could not cast this osg::Program to an osg::Object.");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Program::read(): Expected Program identification.");
|
||||
in_THROW_EXCEPTION("Program::read(): Expected Program identification.");
|
||||
}
|
||||
|
||||
if ( in->getVersion() >= VERSION_0030 )
|
||||
|
||||
@@ -57,7 +57,7 @@ void ProxyNode::write(DataOutputStream* out)
|
||||
static_cast<ive::Node*>(node)->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ProxyNode::write(): Could not cast this osg::ProxyNode to an osg::Node.");
|
||||
out_THROW_EXCEPTION("ProxyNode::write(): Could not cast this osg::ProxyNode to an osg::Node.");
|
||||
|
||||
out->writeFloat(getRadius());
|
||||
out->writeInt(getCenterMode());
|
||||
@@ -156,7 +156,7 @@ void ProxyNode::read(DataInputStream* in)
|
||||
((ive::Node*)(node))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ProxyNode::read(): Could not cast this osg::ProxyNode to an osg::Node.");
|
||||
in_THROW_EXCEPTION("ProxyNode::read(): Could not cast this osg::ProxyNode to an osg::Node.");
|
||||
|
||||
if (in->getOptions() && !in->getOptions()->getDatabasePathList().empty())
|
||||
{
|
||||
@@ -208,6 +208,6 @@ void ProxyNode::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("ProxyNode::read(): Expected ProxyNode identification.");
|
||||
in_THROW_EXCEPTION("ProxyNode::read(): Expected ProxyNode identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,28 +80,25 @@ class ReaderWriterIVE : public ReaderWriter
|
||||
|
||||
virtual ReadResult readImage(std::istream& fin, const Options* options) const
|
||||
{
|
||||
try{
|
||||
ive::DataInputStream in(&fin, options);
|
||||
return in.readImage(ive::IMAGE_INCLUDE_DATA);
|
||||
}
|
||||
catch(ive::Exception e)
|
||||
ive::DataInputStream in(&fin, options);
|
||||
if (in.getException())
|
||||
{
|
||||
return e.getError();
|
||||
return in.getException()->getError();
|
||||
}
|
||||
|
||||
return in.readImage(ive::IMAGE_INCLUDE_DATA);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(std::istream& fin, const Options* options) const
|
||||
{
|
||||
try{
|
||||
// Create datainputstream.
|
||||
ive::DataInputStream in(&fin, options);
|
||||
|
||||
return in.readNode();
|
||||
}
|
||||
catch(ive::Exception e)
|
||||
// Create datainputstream.
|
||||
ive::DataInputStream in(&fin, options);
|
||||
if (in.getException())
|
||||
{
|
||||
return e.getError();
|
||||
return in.getException()->getError();
|
||||
}
|
||||
|
||||
return in.readNode();
|
||||
}
|
||||
|
||||
virtual WriteResult writeObject(const Object& object,const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
@@ -157,38 +154,31 @@ class ReaderWriterIVE : public ReaderWriter
|
||||
|
||||
virtual WriteResult writeImage(const Image& image,std::ostream& fout, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
try
|
||||
ive::DataOutputStream out(&fout, options);
|
||||
out.writeImage(ive::IMAGE_INCLUDE_DATA, const_cast<osg::Image*>(&image));
|
||||
if (fout.fail()) return WriteResult::ERROR_IN_WRITING_FILE;
|
||||
if (out.getException())
|
||||
{
|
||||
ive::DataOutputStream out(&fout, options);
|
||||
out.writeImage(ive::IMAGE_INCLUDE_DATA, const_cast<osg::Image*>(&image));
|
||||
if (fout.fail()) return WriteResult::ERROR_IN_WRITING_FILE;
|
||||
return WriteResult::FILE_SAVED;
|
||||
osg::notify(osg::WARN)<<"Error writing IVE image: "<< out.getException()->getError() << std::endl;
|
||||
return WriteResult::FILE_NOT_HANDLED;
|
||||
}
|
||||
catch(ive::Exception e)
|
||||
{
|
||||
osg::notify(osg::WARN)<<"Error writing IVE image: "<< e.getError() << std::endl;
|
||||
}
|
||||
return WriteResult::FILE_NOT_HANDLED;
|
||||
return WriteResult::FILE_SAVED;
|
||||
}
|
||||
|
||||
virtual WriteResult writeNode(const Node& node,std::ostream& fout, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
try
|
||||
ive::DataOutputStream out(&fout, options);
|
||||
|
||||
out.writeNode(const_cast<osg::Node*>(&node));
|
||||
|
||||
if ( fout.fail() ) return WriteResult::ERROR_IN_WRITING_FILE;
|
||||
if (out.getException())
|
||||
{
|
||||
ive::DataOutputStream out(&fout, options);
|
||||
|
||||
out.writeNode(const_cast<osg::Node*>(&node));
|
||||
|
||||
if ( fout.fail() ) return WriteResult::ERROR_IN_WRITING_FILE;
|
||||
|
||||
return WriteResult::FILE_SAVED;
|
||||
osg::notify(osg::WARN)<<"Error writing IVE image: "<< out.getException()->getError() << std::endl;
|
||||
return WriteResult::FILE_NOT_HANDLED;
|
||||
}
|
||||
catch(ive::Exception e)
|
||||
{
|
||||
osg::notify(osg::WARN)<<"Error writing IVE file: "<< e.getError() << std::endl;
|
||||
}
|
||||
return WriteResult::FILE_NOT_HANDLED;
|
||||
|
||||
return WriteResult::FILE_SAVED;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ void Scissor::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Scissor::write(): Could not cast this osg::Scissor to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Scissor::write(): Could not cast this osg::Scissor to an osg::Object.");
|
||||
// Write Scissor's properties.
|
||||
|
||||
out->writeInt(x());
|
||||
@@ -48,7 +48,7 @@ void Scissor::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Scissor::read(): Could not cast this osg::Scissor to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Scissor::read(): Could not cast this osg::Scissor to an osg::Object.");
|
||||
|
||||
// Read Scissor's properties
|
||||
x() = (GLenum)in->readInt();
|
||||
@@ -58,6 +58,6 @@ void Scissor::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("Scissor::read(): Expected Scissor identification.");
|
||||
in_THROW_EXCEPTION("Scissor::read(): Expected Scissor identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void Scribe::write(DataOutputStream* out){
|
||||
((ive::Effect*)(effect))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Scribe::write(): Could not cast this osgFX::Scribe to an osgFX::Effect.");
|
||||
out_THROW_EXCEPTION("Scribe::write(): Could not cast this osgFX::Scribe to an osgFX::Effect.");
|
||||
|
||||
// Write Scribe's properties.
|
||||
out->writeVec4(getWireframeColor());
|
||||
@@ -45,13 +45,13 @@ void Scribe::read(DataInputStream* in){
|
||||
((ive::Effect*)(effect))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Scribe::read(): Could not cast this osgFX::Scribe to an osgFX::Effect.");
|
||||
in_THROW_EXCEPTION("Scribe::read(): Could not cast this osgFX::Scribe to an osgFX::Effect.");
|
||||
|
||||
// Read Scribe's properties
|
||||
setWireframeColor(in->readVec4());
|
||||
setWireframeLineWidth(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("Scribe::read(): Expected Scribe identification.");
|
||||
in_THROW_EXCEPTION("Scribe::read(): Expected Scribe identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ void Sequence::write(DataOutputStream* out)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Sequence::write(): Could not cast this osg::Sequence to an osg::Group.");
|
||||
out_THROW_EXCEPTION("Sequence::write(): Could not cast this osg::Sequence to an osg::Group.");
|
||||
}
|
||||
|
||||
// Write Sequence's properties.
|
||||
@@ -104,7 +104,7 @@ void Sequence::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Sequence::read(): Could not cast this osg::Sequence to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Sequence::read(): Could not cast this osg::Sequence to an osg::Group.");
|
||||
}
|
||||
|
||||
// Read Sequence's properties
|
||||
@@ -153,6 +153,6 @@ void Sequence::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Sequence::read(): Expected Sequence identification.");
|
||||
in_THROW_EXCEPTION("Sequence::read(): Expected Sequence identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void ShadeModel::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ShadeModel::write(): Could not cast this osg::ShadeModel to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ShadeModel::write(): Could not cast this osg::ShadeModel to an osg::Object.");
|
||||
// Write ShadeModel's properties.
|
||||
out->writeInt(getMode());
|
||||
}
|
||||
@@ -44,11 +44,11 @@ void ShadeModel::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ShadeModel::read(): Could not cast this osg::ShadeModel to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ShadeModel::read(): Could not cast this osg::ShadeModel to an osg::Object.");
|
||||
// Read ShadeModel's properties
|
||||
setMode((Mode)in->readInt());
|
||||
}
|
||||
else{
|
||||
throw Exception("ShadeModel::read(): Expected ShadeModel identification.");
|
||||
in_THROW_EXCEPTION("ShadeModel::read(): Expected ShadeModel identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void Shader::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Shader::write(): Could not cast this osg::Shader to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Shader::write(): Could not cast this osg::Shader to an osg::Object.");
|
||||
|
||||
if ( out->getVersion() < VERSION_0012 )
|
||||
{
|
||||
@@ -54,12 +54,12 @@ void Shader::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Shader::read(): Could not cast this osg::Shader to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Shader::read(): Could not cast this osg::Shader to an osg::Object.");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Shader::read(): Expected Shader identification.");
|
||||
in_THROW_EXCEPTION("Shader::read(): Expected Shader identification.");
|
||||
}
|
||||
|
||||
if ( in->getVersion() < VERSION_0012 )
|
||||
|
||||
@@ -36,7 +36,7 @@ void Sphere::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Sphere::write(): Could not cast this osg::Sphere to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Sphere::write(): Could not cast this osg::Sphere to an osg::Object.");
|
||||
|
||||
// Write Sphere's properties.
|
||||
out->writeVec3(getCenter());
|
||||
@@ -58,7 +58,7 @@ void Sphere::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Sphere::read(): Could not cast this osg::Sphere to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Sphere::read(): Could not cast this osg::Sphere to an osg::Object.");
|
||||
|
||||
// Read Sphere's properties
|
||||
setCenter(in->readVec3());
|
||||
@@ -67,7 +67,7 @@ void Sphere::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Sphere::read(): Expected Sphere identification.");
|
||||
in_THROW_EXCEPTION("Sphere::read(): Expected Sphere identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void Box::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Box::write(): Could not cast this osg::Box to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Box::write(): Could not cast this osg::Box to an osg::Object.");
|
||||
|
||||
// Write Box's properties.
|
||||
out->writeVec3(getCenter());
|
||||
@@ -110,7 +110,7 @@ void Box::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Box::read(): Could not cast this osg::Box to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Box::read(): Could not cast this osg::Box to an osg::Object.");
|
||||
|
||||
// Read Box's properties
|
||||
setCenter(in->readVec3());
|
||||
@@ -120,7 +120,7 @@ void Box::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Box::read(): Expected Box identification.");
|
||||
in_THROW_EXCEPTION("Box::read(): Expected Box identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ void Cone::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Cone::write(): Could not cast this osg::Cone to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Cone::write(): Could not cast this osg::Cone to an osg::Object.");
|
||||
|
||||
// Write Cone's properties.
|
||||
out->writeVec3(getCenter());
|
||||
@@ -164,7 +164,7 @@ void Cone::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Cone::read(): Could not cast this osg::Cone to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Cone::read(): Could not cast this osg::Cone to an osg::Object.");
|
||||
|
||||
// Read Cone's properties
|
||||
setCenter(in->readVec3());
|
||||
@@ -175,7 +175,7 @@ void Cone::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Cone::read(): Expected Cone identification.");
|
||||
in_THROW_EXCEPTION("Cone::read(): Expected Cone identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ void Cylinder::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Cylinder::write(): Could not cast this osg::Cylinder to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Cylinder::write(): Could not cast this osg::Cylinder to an osg::Object.");
|
||||
|
||||
// Write Cylinder's properties.
|
||||
out->writeVec3(getCenter());
|
||||
@@ -219,7 +219,7 @@ void Cylinder::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Cylinder::read(): Could not cast this osg::Cylinder to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Cylinder::read(): Could not cast this osg::Cylinder to an osg::Object.");
|
||||
|
||||
// Read Cylinder's properties
|
||||
setCenter(in->readVec3());
|
||||
@@ -230,7 +230,7 @@ void Cylinder::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Cylinder::read(): Expected Cylinder identification.");
|
||||
in_THROW_EXCEPTION("Cylinder::read(): Expected Cylinder identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ void Capsule::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Capsule::write(): Could not cast this osg::Capsule to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Capsule::write(): Could not cast this osg::Capsule to an osg::Object.");
|
||||
|
||||
// Write Capsule's properties.
|
||||
out->writeVec3(getCenter());
|
||||
@@ -274,7 +274,7 @@ void Capsule::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Capsule::read(): Could not cast this osg::Capsule to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Capsule::read(): Could not cast this osg::Capsule to an osg::Object.");
|
||||
|
||||
// Read Capsule's properties
|
||||
setCenter(in->readVec3());
|
||||
@@ -285,7 +285,7 @@ void Capsule::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("Capsule::read(): Expected Capsule identification.");
|
||||
in_THROW_EXCEPTION("Capsule::read(): Expected Capsule identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ void HeightField::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("HeightField::write(): Could not cast this osg::HeightField to an osg::Object.");
|
||||
out_THROW_EXCEPTION("HeightField::write(): Could not cast this osg::HeightField to an osg::Object.");
|
||||
|
||||
// Write HeightField's properties.
|
||||
out->writeUInt(getNumColumns());
|
||||
@@ -344,7 +344,7 @@ void HeightField::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("HeightField::read(): Could not cast this osg::HeightField to an osg::Object.");
|
||||
in_THROW_EXCEPTION("HeightField::read(): Could not cast this osg::HeightField to an osg::Object.");
|
||||
|
||||
// Read HeightField's properties
|
||||
//setColor(in->readVec4());
|
||||
@@ -363,7 +363,7 @@ void HeightField::read(DataInputStream* in)
|
||||
unsigned int size = in->readUInt();
|
||||
in->_istream->read((char*)&(getHeightList()[0]), FLOATSIZE*size);
|
||||
if (in->_istream->rdstate() & in->_istream->failbit)
|
||||
throw Exception("HeightField::read(): Failed to read height array.");
|
||||
in_THROW_EXCEPTION("HeightField::read(): Failed to read height array.");
|
||||
if (in->_byteswap) {
|
||||
float *ptr = (float*)&(getHeightList()[0]) ;
|
||||
for (unsigned int i = 0 ; i < size ; i++ ) {
|
||||
@@ -374,7 +374,7 @@ void HeightField::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("HeightField::read(): Expected HeightField identification.");
|
||||
in_THROW_EXCEPTION("HeightField::read(): Expected HeightField identification.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ void ShapeAttributeList::read(DataInputStream* in)
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("ShapeAttributeList::read(): Expected ShapeAttributeList identification.");
|
||||
in_THROW_EXCEPTION("ShapeAttributeList::read(): Expected ShapeAttributeList identification.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void ShapeDrawable::write(DataOutputStream* out)
|
||||
((ive::Drawable*)(drawable))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ShapeDrawable::write(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ShapeDrawable::write(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
|
||||
}
|
||||
else
|
||||
@@ -42,7 +42,7 @@ void ShapeDrawable::write(DataOutputStream* out)
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("ShapeDrawable::write(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
out_THROW_EXCEPTION("ShapeDrawable::write(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
}
|
||||
|
||||
// Write ShapeDrawable's properties.
|
||||
@@ -76,7 +76,7 @@ void ShapeDrawable::read(DataInputStream* in)
|
||||
((ive::Drawable*)(drawable))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ShapeDrawable::read(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ShapeDrawable::read(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -86,7 +86,7 @@ void ShapeDrawable::read(DataInputStream* in)
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("ShapeDrawable::read(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
in_THROW_EXCEPTION("ShapeDrawable::read(): Could not cast this osg::ShapeDrawable to an osg::Object.");
|
||||
}
|
||||
|
||||
// Read ShapeDrawable's properties
|
||||
@@ -100,6 +100,6 @@ void ShapeDrawable::read(DataInputStream* in)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception("ShapeDrawable::read(): Expected ShapeDrawable identification.");
|
||||
in_THROW_EXCEPTION("ShapeDrawable::read(): Expected ShapeDrawable identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void SpecularHighlights::write(DataOutputStream* out){
|
||||
((ive::Effect*)(effect))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("SpecularHighlights::write(): Could not cast this osgFX::SpecularHighlights to an osgFX::Effect.");
|
||||
out_THROW_EXCEPTION("SpecularHighlights::write(): Could not cast this osgFX::SpecularHighlights to an osgFX::Effect.");
|
||||
|
||||
// Write SpecularHighlights's properties.
|
||||
out->writeInt(getLightNumber());
|
||||
@@ -47,7 +47,7 @@ void SpecularHighlights::read(DataInputStream* in){
|
||||
((ive::Effect*)(effect))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("SpecularHighlights::read(): Could not cast this osgFX::SpecularHighlights to an osgFX::Effect.");
|
||||
in_THROW_EXCEPTION("SpecularHighlights::read(): Could not cast this osgFX::SpecularHighlights to an osgFX::Effect.");
|
||||
|
||||
// Read SpecularHighlights's properties
|
||||
setLightNumber(in->readInt());
|
||||
@@ -56,6 +56,6 @@ void SpecularHighlights::read(DataInputStream* in){
|
||||
setSpecularExponent(in->readFloat());
|
||||
}
|
||||
else{
|
||||
throw Exception("SpecularHighlights::read(): Expected SpecularHighlights identification.");
|
||||
in_THROW_EXCEPTION("SpecularHighlights::read(): Expected SpecularHighlights identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ void StateSet::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("StateSet::write(): Could not cast this osg::StateSet to an osg::Object.");
|
||||
out_THROW_EXCEPTION("StateSet::write(): Could not cast this osg::StateSet to an osg::Object.");
|
||||
|
||||
// Write render bin bin details.
|
||||
switch(getRenderBinMode()){
|
||||
case osg::StateSet::INHERIT_RENDERBIN_DETAILS: out->writeChar((char)0);break;
|
||||
case osg::StateSet::USE_RENDERBIN_DETAILS: out->writeChar((char)1);break;
|
||||
case osg::StateSet::OVERRIDE_RENDERBIN_DETAILS: out->writeChar((char)2);break;
|
||||
default: throw Exception("Unknown RenderBinMode in StateSet::write()");
|
||||
default: out_THROW_EXCEPTION("Unknown RenderBinMode in StateSet::write()");
|
||||
}
|
||||
out->writeInt(getBinNumber());
|
||||
out->writeString(getBinName());
|
||||
@@ -113,7 +113,7 @@ void StateSet::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);;
|
||||
}
|
||||
else
|
||||
throw Exception("StateSet::read(): Could not cast this osg::StateSet to an osg::Object.");
|
||||
in_THROW_EXCEPTION("StateSet::read(): Could not cast this osg::StateSet to an osg::Object.");
|
||||
|
||||
// Read render bin details.
|
||||
char c = in->readChar();
|
||||
@@ -132,7 +132,7 @@ void StateSet::read(DataInputStream* in){
|
||||
case 3:
|
||||
setRenderBinDetails(num, name, osg::StateSet::USE_RENDERBIN_DETAILS);
|
||||
break;
|
||||
default: throw Exception("Unknown RenderBinMode in StateSet::read()");
|
||||
default: in_THROW_EXCEPTION("Unknown RenderBinMode in StateSet::read()");
|
||||
}
|
||||
|
||||
// Read stateset modes.
|
||||
@@ -187,6 +187,6 @@ void StateSet::read(DataInputStream* in){
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("StateSet::read(): Expected StateSet identification");
|
||||
in_THROW_EXCEPTION("StateSet::read(): Expected StateSet identification");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void Stencil::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Stencil::write(): Could not cast this osg::Stencil to an osg::Object.");
|
||||
out_THROW_EXCEPTION("Stencil::write(): Could not cast this osg::Stencil to an osg::Object.");
|
||||
// Write Stencil's properties.
|
||||
|
||||
out->writeInt(getFunction());
|
||||
@@ -56,7 +56,7 @@ void Stencil::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Stencil::read(): Could not cast this osg::Stencil to an osg::Object.");
|
||||
in_THROW_EXCEPTION("Stencil::read(): Could not cast this osg::Stencil to an osg::Object.");
|
||||
|
||||
setFunction((Function)in->readInt());
|
||||
setFunctionRef(in->readInt());
|
||||
@@ -70,6 +70,6 @@ void Stencil::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("Stencil::read(): Expected Stencil identification.");
|
||||
in_THROW_EXCEPTION("Stencil::read(): Expected Stencil identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void Switch::write(DataOutputStream* out){
|
||||
((ive::Group*)(group))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("Switch::write(): Could not cast this osg::Switch to an osg::Group.");
|
||||
out_THROW_EXCEPTION("Switch::write(): Could not cast this osg::Switch to an osg::Group.");
|
||||
// Write Switch's properties.
|
||||
|
||||
// Write childrens value.
|
||||
@@ -48,7 +48,7 @@ void Switch::read(DataInputStream* in){
|
||||
((ive::Group*)(group))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("Switch::read(): Could not cast this osg::Switch to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Switch::read(): Could not cast this osg::Switch to an osg::Group.");
|
||||
// Read Switch's properties
|
||||
|
||||
// Read childrens value.
|
||||
@@ -57,6 +57,6 @@ void Switch::read(DataInputStream* in){
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("Switch::read(): Expected Switch identification.");
|
||||
in_THROW_EXCEPTION("Switch::read(): Expected Switch identification.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void SwitchLayer::write(DataOutputStream* out)
|
||||
if (layer)
|
||||
((ive::CompositeLayer*)(layer))->write(out);
|
||||
else
|
||||
throw Exception("SwitchLayer::write(): Could not cast this osgLayer::SwitchLayer to an osgTerrain::Layer.");
|
||||
out_THROW_EXCEPTION("SwitchLayer::write(): Could not cast this osgLayer::SwitchLayer to an osgTerrain::Layer.");
|
||||
|
||||
|
||||
out->writeInt(getActiveLayer());
|
||||
@@ -38,7 +38,7 @@ void SwitchLayer::read(DataInputStream* in)
|
||||
// Peek on Layer's identification.
|
||||
int id = in->peekInt();
|
||||
if (id != IVESWITCHLAYER)
|
||||
throw Exception("SwitchLayer::read(): Expected SwitchLayer identification.");
|
||||
in_THROW_EXCEPTION("SwitchLayer::read(): Expected SwitchLayer identification.");
|
||||
|
||||
// Read Layer's identification.
|
||||
id = in->readInt();
|
||||
@@ -48,7 +48,7 @@ void SwitchLayer::read(DataInputStream* in)
|
||||
if (layer)
|
||||
((ive::CompositeLayer*)(layer))->read(in);
|
||||
else
|
||||
throw Exception("SwitchLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
in_THROW_EXCEPTION("SwitchLayer::read(): Could not cast this osgLayer::Layer to an osg::Group.");
|
||||
|
||||
setActiveLayer(in->readInt());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void TerrainTile::write(DataOutputStream* out)
|
||||
if(group)
|
||||
((ive::Group*)(group))->write(out);
|
||||
else
|
||||
throw Exception("Terrain::write(): Could not cast this osgTerrain::Terrain to an osg::Group.");
|
||||
out_THROW_EXCEPTION("Terrain::write(): Could not cast this osgTerrain::Terrain to an osg::Group.");
|
||||
|
||||
if (out->getVersion() >= VERSION_0026)
|
||||
{
|
||||
@@ -73,7 +73,7 @@ void TerrainTile::read(DataInputStream* in)
|
||||
{
|
||||
// Peek on Terrain's identification.
|
||||
int id = in->peekInt();
|
||||
if (id != IVETERRAINTILE) throw Exception("TerrainTile::read(): Expected Terrain identification.");
|
||||
if (id != IVETERRAINTILE) in_THROW_EXCEPTION("TerrainTile::read(): Expected Terrain identification.");
|
||||
|
||||
// Read Terrain's identification.
|
||||
id = in->readInt();
|
||||
@@ -82,7 +82,7 @@ void TerrainTile::read(DataInputStream* in)
|
||||
if(group)
|
||||
((ive::Group*)(group))->read(in);
|
||||
else
|
||||
throw Exception("Terrain::read(): Could not cast this osgTerrain::Terrain to an osg::Group.");
|
||||
in_THROW_EXCEPTION("Terrain::read(): Could not cast this osgTerrain::Terrain to an osg::Group.");
|
||||
|
||||
if (in->getVersion() >= VERSION_0026)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ void TexEnv::write(DataOutputStream* out){
|
||||
((ive::Object*)(obj))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("TexEnv::write(): Could not cast this osg::TexEnv to an osg::Object.");
|
||||
out_THROW_EXCEPTION("TexEnv::write(): Could not cast this osg::TexEnv to an osg::Object.");
|
||||
// Write TexEnv's properties.
|
||||
|
||||
// Write mode
|
||||
@@ -48,7 +48,7 @@ void TexEnv::read(DataInputStream* in){
|
||||
((ive::Object*)(obj))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("TexEnv::read(): Could not cast this osg::TexEnv to an osg::Object.");
|
||||
in_THROW_EXCEPTION("TexEnv::read(): Could not cast this osg::TexEnv to an osg::Object.");
|
||||
// Read TexEnv's properties
|
||||
|
||||
// Read mode
|
||||
@@ -57,6 +57,6 @@ void TexEnv::read(DataInputStream* in){
|
||||
setColor(in->readVec4());
|
||||
}
|
||||
else{
|
||||
throw Exception("TexEnv::read(): Expected TexEnv identification.");
|
||||
in_THROW_EXCEPTION("TexEnv::read(): Expected TexEnv identification.");
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user