Skip to content

Commit

Permalink
added: google sketchup detection -> invert transparency
Browse files Browse the repository at this point in the history
git-svn-id: https://opensg.vrsource.org/svn/trunk@2254 4683daeb-ad0f-0410-a623-93161e962ae5
  • Loading branch information
cneumann committed Dec 29, 2009
1 parent fdaf217 commit dfa79c9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
31 changes: 28 additions & 3 deletions Source/System/FileIO/Collada/OSGColladaCOLLADA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#ifdef OSG_WITH_COLLADA

#include "OSGColladaLog.h"
#include "OSGColladaGlobal.h"
#include "OSGColladaScene.h"

#include <dom/domCOLLADA.h>
Expand All @@ -66,10 +67,34 @@ ColladaCOLLADA::read(void)
{
OSG_COLLADA_LOG(("ColladaCOLLADA::read\n"));

domCOLLADARef collada = getDOMElementAs<domCOLLADA>();
domCOLLADA::domSceneRef scene = collada->getScene();
domCOLLADARef collada = getDOMElementAs<domCOLLADA>();
domAssetRef docAsset = collada->getAsset();

ColladaSceneRefPtr colScene = getUserDataAs<ColladaScene>(scene);
if(docAsset != NULL)
{
domAsset::domContributor_Array &domContrA =
docAsset->getContributor_array();

for(UInt32 i = 0; i < domContrA.getCount(); ++i)
{
domAsset::domContributor::domAuthoring_toolRef docAuthTool =
domContrA.get(i)->getAuthoring_tool();

if(osgStringNCaseCmp(docAuthTool->getValue(),
"Google SketchUp",
15 ) == 0)
{
SINFO << "ColladaCOLLADA::read: Detected Google SketchUp file "
<< "enabling transparency workaround." << std::endl;

getGlobal()->getOptions()->setInvertTransparency(true);
break;
}
}
}

domCOLLADA::domSceneRef scene = collada->getScene();
ColladaSceneRefPtr colScene = getUserDataAs<ColladaScene>(scene);

if(colScene == NULL)
{
Expand Down
10 changes: 5 additions & 5 deletions Source/System/FileIO/Collada/OSGColladaGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ class OSG_FILEIO_DLLMAPPING ColladaGlobal : public MemoryObject
/*! \name ElementStore */
/*! \{ */

inline const ElementStore &getElemStore (void ) const;
inline ElementStore &editElemStore (void );
inline const ElementStore &getElemStore (void ) const;
inline ElementStore &editElemStore(void );

void addElement (ColladaElement *elem );
void addElement (ColladaElement *elem );

ColladaElement *getElement (const daeURI &elemURI) const;
ColladaElement *getElement (const std::string &elemId ) const;
ColladaElement *getElement (const daeURI &elemURI) const;
ColladaElement *getElement (const std::string &elemId ) const;

/*! \} */
/*========================= PROTECTED ===============================*/
Expand Down

0 comments on commit dfa79c9

Please sign in to comment.