diff --git a/src/osgPlugins/Inventor/CMakeLists.txt b/src/osgPlugins/Inventor/CMakeLists.txt index b1ef35352..975a90d0d 100644 --- a/src/osgPlugins/Inventor/CMakeLists.txt +++ b/src/osgPlugins/Inventor/CMakeLists.txt @@ -1,5 +1,8 @@ INCLUDE(OsgMacroUtils) +INCLUDE_DIRECTORIES( ${INVENTOR_INCLUDE_DIR} ) + + SET(TARGET_SRC ConvertFromInventor.cpp GroupSoLOD.cpp diff --git a/src/osgPlugins/Inventor/ConvertFromInventor.cpp b/src/osgPlugins/Inventor/ConvertFromInventor.cpp index a5c1e47af..279a2abc1 100644 --- a/src/osgPlugins/Inventor/ConvertFromInventor.cpp +++ b/src/osgPlugins/Inventor/ConvertFromInventor.cpp @@ -36,14 +36,18 @@ #include #include #include -#include #include #include #include +#ifdef COIN_BASIC_H +#include +#endif + #include "GroupSoLOD.h" #include +#include #include #ifdef __linux #include @@ -91,8 +95,10 @@ osg::Node* ConvertFromInventor::convert(SoNode* rootIVNode) cbAction.addPreCallback(SoGroup::getClassTypeId(), preGroup, this); cbAction.addPostCallback(SoGroup::getClassTypeId(), postGroup, this); cbAction.addPreCallback(SoTexture2::getClassTypeId(), preTexture, this); +#ifdef COIN_BASIC_H cbAction.addPreCallback(SoVRMLImageTexture::getClassTypeId(), preVRMLImageTexture, this); +#endif cbAction.addPreCallback(SoLight::getClassTypeId(), preLight, this); cbAction.addPreCallback(SoRotor::getClassTypeId(), preRotor, this); cbAction.addPreCallback(SoPendulum::getClassTypeId(), prePendulum, this); @@ -690,10 +696,12 @@ ConvertFromInventor::convertIVTexToOSGTex(const SoNode* soNode, std::string fileName; if (soNode->isOfType(SoTexture2::getClassTypeId())) fileName = ((SoTexture2*)soNode)->filename.getValue().getString(); +#ifdef COIN_BASIC_H else if (soNode->isOfType(SoVRMLImageTexture::getClassTypeId())) fileName = ((SoVRMLImageTexture*)soNode)->url.getNum() >= 1 ? ((SoVRMLImageTexture*)soNode)->url.getValues(0)[0].getString() : ""; +#endif else osg::notify(osg::WARN) << "IV import warning: Unsupported texture type: " << soNode->getTypeId().getName().getString() << std::endl; @@ -725,6 +733,7 @@ ConvertFromInventor::convertIVTexToOSGTex(const SoNode* soNode, } // Set texture wrap mode +#ifdef COIN_BASIC_H if (soNode->isOfType(SoVRMLImageTexture::getClassTypeId())) { // It looks like there is a high probability of bug in Coin (investigated on version 2.4.6). // action->getTextureWrap() returns correct value on SoTexture2 (SoTexture2::CLAMP = 0x2900, @@ -736,7 +745,10 @@ ConvertFromInventor::convertIVTexToOSGTex(const SoNode* soNode, osg::Texture2D::REPEAT : osg::Texture2D::CLAMP_TO_EDGE); osgTex->setWrap(osg::Texture2D::WRAP_T, ((SoVRMLImageTexture*)soNode)->repeatT.getValue() ? osg::Texture2D::REPEAT : osg::Texture2D::CLAMP_TO_EDGE); - } else { + } + else +#endif + { // Proper way to determine wrap mode osgTex->setWrap(osg::Texture2D::WRAP_S, texWrapMap[action->getTextureWrapS()]); osgTex->setWrap(osg::Texture2D::WRAP_T, texWrapMap[action->getTextureWrapT()]); diff --git a/src/osgPlugins/Inventor/ReaderWriterIV.cpp b/src/osgPlugins/Inventor/ReaderWriterIV.cpp index a803a7bb2..a865d2aef 100644 --- a/src/osgPlugins/Inventor/ReaderWriterIV.cpp +++ b/src/osgPlugins/Inventor/ReaderWriterIV.cpp @@ -10,7 +10,10 @@ #include #include #include + +#ifdef COIN_BASIC_H #include +#endif #include "ConvertFromInventor.h" #include "GroupSoLOD.h" @@ -45,8 +48,10 @@ ReaderWriterIV::readNode(const std::string& file, // Initial GroupSoLOD node GroupSoLOD::initClass(); +#ifdef COIN_BASIC_H // Disable delayed loading of VRML textures SoVRMLImageTexture::setDelayFetchURL(FALSE); +#endif // Open the file SoInput input;