From d20f93d78adb6a8820a77c4e7fdc1222b5eb24c1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 25 Nov 2003 16:28:32 +0000 Subject: [PATCH] Added suport for osgSim::MultiSwitch to .ive plugin --- VisualStudio/osgPlugins/ive/ive.dsp | 8 ++++++++ src/osgPlugins/ive/DataInputStream.cpp | 6 ++++++ src/osgPlugins/ive/DataOutputStream.cpp | 5 +++++ src/osgPlugins/ive/GNUmakefile | 1 + src/osgPlugins/ive/ReadWrite.h | 3 ++- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/VisualStudio/osgPlugins/ive/ive.dsp b/VisualStudio/osgPlugins/ive/ive.dsp index 09c7eab92..9ed2b4d81 100755 --- a/VisualStudio/osgPlugins/ive/ive.dsp +++ b/VisualStudio/osgPlugins/ive/ive.dsp @@ -258,6 +258,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\Switch.cpp # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\MultiSwitch.cpp +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\TexEnv.cpp # End Source File # Begin Source File @@ -486,6 +490,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\Switch.h # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\MultiSwitch.h +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\StateSet.h # End Source File # Begin Source File diff --git a/src/osgPlugins/ive/DataInputStream.cpp b/src/osgPlugins/ive/DataInputStream.cpp index 092d152a0..6dafb6be4 100644 --- a/src/osgPlugins/ive/DataInputStream.cpp +++ b/src/osgPlugins/ive/DataInputStream.cpp @@ -41,7 +41,9 @@ #include "Switch.h" #include "OccluderNode.h" #include "Impostor.h" + #include "LightPointNode.h" +#include "MultiSwitch.h" #include "Geometry.h" @@ -668,6 +670,10 @@ osg::Node* DataInputStream::readNode() node = new osg::Switch(); ((ive::Switch*)(node))->read(this); } + else if(nodeTypeID== IVEMULTISWITCH){ + node = new osgSim::MultiSwitch(); + ((ive::MultiSwitch*)(node))->read(this); + } else if(nodeTypeID== IVEIMPOSTOR){ node = new osg::Impostor(); ((ive::Impostor*)(node))->read(this); diff --git a/src/osgPlugins/ive/DataOutputStream.cpp b/src/osgPlugins/ive/DataOutputStream.cpp index d6dec0ed2..03b52bd85 100644 --- a/src/osgPlugins/ive/DataOutputStream.cpp +++ b/src/osgPlugins/ive/DataOutputStream.cpp @@ -43,7 +43,9 @@ #include "Switch.h" #include "OccluderNode.h" #include "Impostor.h" + #include "LightPointNode.h" +#include "MultiSwitch.h" #include "Geometry.h" @@ -533,6 +535,9 @@ void DataOutputStream::writeNode(const osg::Node* node) else if(dynamic_cast(node)){ ((ive::Switch*)(node))->write(this); } + else if(dynamic_cast(node)){ + ((ive::MultiSwitch*)(node))->write(this); + } else if(dynamic_cast(node)){ ((ive::OccluderNode*)(node))->write(this); } diff --git a/src/osgPlugins/ive/GNUmakefile b/src/osgPlugins/ive/GNUmakefile index a2849b746..3df6f0c00 100644 --- a/src/osgPlugins/ive/GNUmakefile +++ b/src/osgPlugins/ive/GNUmakefile @@ -30,6 +30,7 @@ CXXFILES =\ LightSource.cpp\ Material.cpp\ MatrixTransform.cpp\ + MultiSwitch.cpp\ Node.cpp\ Object.cpp\ OccluderNode.cpp\ diff --git a/src/osgPlugins/ive/ReadWrite.h b/src/osgPlugins/ive/ReadWrite.h index 1242465f4..49251631a 100644 --- a/src/osgPlugins/ive/ReadWrite.h +++ b/src/osgPlugins/ive/ReadWrite.h @@ -68,12 +68,13 @@ namespace ive { // osgSim classes #define IVEBLINKSEQUENCE 0x00100001 -#define IVEAZIMELEVATIONSECTOR 0x00100002 +#define IVEAZIMELEVATIONSECTOR 0x00100002 #define IVEELEVATIONSECTOR 0x00100003 #define IVEAZIMSECTOR 0x00100004 #define IVECONESECTOR 0x00100005 #define IVELIGHTPOINT 0x00100006 #define IVELIGHTPOINTNODE 0x00100007 +#define IVEMULTISWITCH 0x00100008 class ReadWrite{