Show
Ignore:
Timestamp:
03/11/10 17:53:35 (3 years ago)
Author:
robert
Message:

From Sukender, "I had some conflicts when updating but they seem resolved now. Attached files (four files) are against rev. 11200. Changelog:
- Replaced exceptions with assert() or OSG_NOTIFY
- Replaced osg::notify() with OSG_NOTIFY
- Changed braces and tabs to fit OSG coding convention
- Cleaned a few things in code (names, added deallocations upon error)"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/3ds/WriterNodeVisitor.cpp

    r11194 r11203  
    2626void copyOsgMatrixToLib3dsMatrix(Lib3dsMatrix lib3ds_matrix, const osg::Matrix& osg_matrix) 
    2727{ 
    28     for(int row=0; row<4; ++row) { 
     28    for(int row=0; row<4; ++row) 
     29    { 
    2930        lib3ds_matrix[row][0] = osg_matrix.ptr()[row*4+0]; 
    3031        lib3ds_matrix[row][1] = osg_matrix.ptr()[row*4+1]; 
     
    3435} 
    3536 
    36 inline void copyOsgVectorToLib3dsVector(Lib3dsVector lib3ds_vector, const osg::Vec3f& osg_vector) { 
     37inline void copyOsgVectorToLib3dsVector(Lib3dsVector lib3ds_vector, const osg::Vec3f& osg_vector) 
     38{ 
    3739    lib3ds_vector[0] = osg_vector[0]; 
    3840    lib3ds_vector[1] = osg_vector[1]; 
    3941    lib3ds_vector[2] = osg_vector[2]; 
    4042} 
    41 inline void copyOsgVectorToLib3dsVector(Lib3dsVector lib3ds_vector, const osg::Vec3d& osg_vector) { 
     43inline void copyOsgVectorToLib3dsVector(Lib3dsVector lib3ds_vector, const osg::Vec3d& osg_vector) 
     44{ 
    4245    lib3ds_vector[0] = osg_vector[0]; 
    4346    lib3ds_vector[1] = osg_vector[1]; 
     
    4548} 
    4649 
    47 inline void copyOsgColorToLib3dsColor(Lib3dsVector lib3ds_vector, const osg::Vec4f& osg_vector) { 
     50inline void copyOsgColorToLib3dsColor(Lib3dsVector lib3ds_vector, const osg::Vec4f& osg_vector) 
     51{ 
    4852    lib3ds_vector[0] = osg_vector[0]; 
    4953    lib3ds_vector[1] = osg_vector[1]; 
    5054    lib3ds_vector[2] = osg_vector[2]; 
    5155} 
    52 inline void copyOsgColorToLib3dsColor(Lib3dsVector lib3ds_vector, const osg::Vec4d& osg_vector) { 
     56inline void copyOsgColorToLib3dsColor(Lib3dsVector lib3ds_vector, const osg::Vec4d& osg_vector) 
     57{ 
    5358    lib3ds_vector[0] = osg_vector[0]; 
    5459    lib3ds_vector[1] = osg_vector[1]; 
     
    5661} 
    5762 
    58 inline void copyOsgQuatToLib3dsQuat(float lib3ds_vector[4], const osg::Quat& osg_quat) { 
     63inline void copyOsgQuatToLib3dsQuat(float lib3ds_vector[4], const osg::Quat& osg_quat) 
     64{ 
    5965    //lib3ds_vector[0] = osg_quat[3];        // Not sure 
    6066    //lib3ds_vector[1] = osg_quat[0]; 
     
    7076} 
    7177 
    72 std::string getFileName(const std::string & path) { 
     78std::string getFileName(const std::string & path) 
     79{ 
    7380    unsigned int slashPos = path.find_last_of("/\\"); 
    7481    if (slashPos == std::string::npos) return path; 
     
    7885 
    7986/// Checks if a filename (\b not path) is 8.3 (an empty name is never 8.3, and a path is never 8.3). 
    80 bool is83(const std::string & s) { 
     87bool is83(const std::string & s) 
     88{ 
    8189    // 012345678901 
    8290    // ABCDEFGH.ABC 
     
    93101 
    94102/// Tests if the given string is a path supported by 3DS format (8.3, 63 chars max). 
    95 bool is3DSpath(const std::string & s, bool extendedFilePaths) { 
     103bool is3DSpath(const std::string & s, bool extendedFilePaths) 
     104{ 
    96105    unsigned int len = s.length(); 
    97106    if (len >= 64 || len == 0) return false; 
     
    113122 
    114123/** writes all primitives of a primitive-set out to a stream, decomposes quads to triangles, line-strips to lines etc */ 
    115 class PrimitiveIndexWriter : public osg::PrimitiveIndexFunctor { 
     124class PrimitiveIndexWriter : public osg::PrimitiveIndexFunctor 
     125{ 
    116126public: 
    117127      PrimitiveIndexWriter(osg::Geometry  *    geo,  
     
    341351        //break; 
    342352    default: 
    343         osg::notify(osg::WARN) << "3DS WriterNodeVisitor: can't handle mode " << mode << std::endl; 
     353        OSG_NOTIFY(osg::WARN) << "3DS WriterNodeVisitor: can't handle mode " << mode << std::endl; 
    344354        break; 
    345355    } 
     
    362372    //static unsigned int s_objmaterial_id = 0; 
    363373    //++s_objmaterial_id; 
    364     if (mat) { 
     374    if (mat) 
     375    { 
    365376        assert(stateset); 
    366377        diffuse = mat->getDiffuse(osg::Material::FRONT); 
     
    371382        name = writerNodeVisitor.getUniqueName(mat->getName(),"mat"); 
    372383        osg::StateAttribute * attribute = stateset->getAttribute(osg::StateAttribute::CULLFACE); 
    373         if (!attribute) { 
     384        if (!attribute) 
     385        { 
    374386            double_sided = true; 
    375         } else { 
     387        } 
     388        else 
     389        { 
    376390            assert(dynamic_cast<osg::CullFace *>(attribute)); 
    377391            osg::CullFace::Mode mode = static_cast<osg::CullFace *>(attribute)->getMode(); 
    378392            if (mode == osg::CullFace::BACK) double_sided = false; 
    379             else if (mode == osg::CullFace::FRONT) { 
    380                 osg::notify(osg::WARN) << "3DS Writer: Reversed face (culled FRONT) not supported yet." << std::endl; 
     393            else if (mode == osg::CullFace::FRONT) 
     394            { 
     395                OSG_NOTIFY(osg::WARN) << "3DS Writer: Reversed face (culled FRONT) not supported yet." << std::endl; 
    381396                double_sided = false; 
    382397            } 
    383             else { 
     398            else 
     399            { 
    384400                assert(mode == osg::CullFace::FRONT_AND_BACK); 
    385                 osg::notify(osg::WARN) << "3DS Writer: Invisible face (culled FRONT_AND_BACK) not supported yet." << std::endl; 
     401                OSG_NOTIFY(osg::WARN) << "3DS Writer: Invisible face (culled FRONT_AND_BACK) not supported yet." << std::endl; 
    386402                double_sided = false; 
    387403            } 
    388404        } 
    389405    } 
    390     if (tex) { 
     406    if (tex) 
     407    { 
    391408        osg::Image* img = tex->getImage(0); 
    392409        if(img) 
     
    398415    } 
    399416 
    400     if (name.empty()) { 
     417    if (name.empty()) 
     418    { 
    401419        std::stringstream ss; 
    402420        ss << "m" << index; 
     
    466484                const std::string & srcDirectory) : 
    467485    osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), 
    468     _suceedLastApply(true), 
     486    _succeeded(true), 
    469487    _srcDirectory(srcDirectory), 
    470488    file3ds(file3ds), 
     
    480498        _directory = options->getDatabasePathList().empty() ? osgDB::getFilePath(fileName) : options->getDatabasePathList().front(); 
    481499 
    482     if (options) { 
     500    if (options) 
     501    { 
    483502        std::istringstream iss(options->getOptionString()); 
    484503        std::string opt; 
     
    524543                    path = oss.str(); 
    525544                } 
    526                 else { 
     545                else 
     546                { 
    527547                    path = getPathRelative(_srcDirectory, mat.image->getFileName()); 
    528548                } 
    529549                path = convertExt(path, _extendedFilePaths); 
    530550 
    531                 if(!is3DSpath(path, _extendedFilePaths)) { 
     551                if(!is3DSpath(path, _extendedFilePaths)) 
     552                { 
    532553                    path = getUniqueName(path, "", true); 
    533554                    //path = osgDB::getSimpleFileName(path); 
     
    547568                if (mat.texture_no_tile) tex.flags |= LIB3DS_TEXTURE_NO_TILE; 
    548569            } 
    549             if (!suceedLastApply()) 
     570            if (!succeeded()) 
    550571                return; 
    551572            lib3ds_file_insert_material(file3ds, mat3ds, itr->second.index); 
    552573            break;        // Ugly thing (3) 
    553574        } 
    554         if (!found) throw "Implementation error";                // Ugly thing (4) 
    555     } 
    556 } 
    557  
    558  
    559 std::string WriterNodeVisitor::getUniqueName(const std::string& _defaultValue, const std::string & _defaultPrefix, bool nameIsPath) { 
    560     static const unsigned int MAX_PREFIX_LEGNTH = 4; 
    561     if (_defaultPrefix.length()>MAX_PREFIX_LEGNTH) throw "Default prefix is too long";            // Arbitrarily defined to 4 chars. 
     575        assert(found);        // Ugly thing (4) - Implementation error if !found 
     576    } 
     577} 
     578 
     579 
     580std::string WriterNodeVisitor::getUniqueName(const std::string& _defaultValue, const std::string & _defaultPrefix, bool nameIsPath) 
     581{ 
     582    static const unsigned int MAX_PREFIX_LEGNTH = 4;        // Arbitrarily defined to 4 chars 
     583    assert(_defaultPrefix.length()<=MAX_PREFIX_LEGNTH);        // Default prefix is too long (implementation error) 
    562584 
    563585    // Tests if default name is valid and unique 
    564586    bool defaultIs83 = is83(_defaultValue); 
    565587    bool defaultIsValid = nameIsPath ? is3DSpath(_defaultValue, _extendedFilePaths) : defaultIs83; 
    566     if (defaultIsValid && _nameMap.find(_defaultValue) == _nameMap.end()) { 
     588    if (defaultIsValid && _nameMap.find(_defaultValue) == _nameMap.end()) 
     589    { 
    567590        _nameMap.insert(_defaultValue); 
    568591        return _defaultValue; 
     
    611634 
    612635    unsigned int searchStart = 0; 
    613     if (pairPrefix != _mapPrefix.end()) { 
     636    if (pairPrefix != _mapPrefix.end()) 
     637    { 
    614638        searchStart = pairPrefix->second; 
    615639    } 
    616640 
    617     for(unsigned int i = searchStart; i <= max_val; ++i) { 
     641    for(unsigned int i = searchStart; i <= max_val; ++i) 
     642    { 
    618643        std::stringstream ss; 
    619644        ss << defaultPrefix << i; 
    620645        const std::string & res = ss.str(); 
    621         if (_nameMap.find(res) == _nameMap.end()) { 
    622             if (pairPrefix != _mapPrefix.end()) { 
     646        if (_nameMap.find(res) == _nameMap.end()) 
     647        { 
     648            if (pairPrefix != _mapPrefix.end()) 
     649            { 
    623650                pairPrefix->second = i + 1; 
    624             } else { 
     651            } else 
     652            { 
    625653                _mapPrefix.insert(std::pair<std::string, unsigned int>(defaultPrefix, i + 1)); 
    626654            } 
     
    635663    // Try with default prefix if not arleady done 
    636664    if (defaultPrefix != std::string("_")) return getUniqueName(_defaultValue, "_", nameIsPath); 
    637     throw "No more names available! Is default prefix too long?"; 
     665 
     666    // No more names 
     667    OSG_NOTIFY(osg::FATAL) << "No more names available!" << std::endl; 
     668    _succeeded = false; 
     669    return "ERROR"; 
    638670} 
    639671 
     
    641673{ 
    642674    MaterialMap::const_iterator itr = _materialMap.find(ss); 
    643     if (itr != _materialMap.end()) { 
     675    if (itr != _materialMap.end()) 
     676    { 
    644677        assert(itr->second.index>=0); 
    645678        return itr->second.index; 
     
    672705{ 
    673706    MapIndices::iterator itIndex = index_vert.find(std::pair<unsigned int, unsigned int>(index, drawable_n)); 
    674     if (itIndex == index_vert.end()) { 
     707    if (itIndex == index_vert.end()) 
     708    { 
    675709        unsigned int indexMesh = index_vert.size(); 
    676710        index_vert.insert(std::make_pair(std::pair<unsigned int, unsigned int>(index, drawable_n), indexMesh)); 
     
    688722                             Lib3dsMesh        * mesh) 
    689723{ 
    690     osg::notify(osg::DEBUG_INFO) << "Building Mesh" << std::endl; 
    691  
    692     if (!mesh) throw "Allocation error";        // TODO 
     724    OSG_NOTIFY(osg::DEBUG_INFO) << "Building Mesh" << std::endl; 
     725    assert(mesh); 
    693726 
    694727    // Write points 
     
    701734        assert(g->getVertexArray()); 
    702735        if (g->getVertexArray()->getType() != osg::Array::Vec3ArrayType) 
    703             throw "Vertex array is not Vec3. Not implemented";        // TODO 
     736        { 
     737            // TODO Handle double presision vertices by converting them to float with a warning 
     738            OSG_NOTIFY(osg::FATAL) << "Vertex array is not Vec3. Not implemented" << std::endl; 
     739            _succeeded = false; 
     740            return; 
     741        } 
    704742        const osg::Vec3Array & vecs= *static_cast<osg::Vec3Array *>(g->getVertexArray()); 
    705743        copyOsgVectorToLib3dsVector(mesh->vertices[it->second], vecs[it->first.first]*mat); 
     
    712750        { 
    713751            osg::Geometry *g = geo.getDrawable( it->first.second )->asGeometry(); 
    714             osg::Array * array = g->getTexCoordArray(0); 
    715             if(array) 
     752            osg::Array * texarray = g->getTexCoordArray(0); 
     753            if (texarray) 
    716754            { 
    717755                if (g->getTexCoordArray(0)->getType() != osg::Array::Vec2ArrayType) 
    718                     throw "Texture coords array is not Vec2. Not implemented";        // TODO 
    719                 const osg::Vec2Array & vecs= *static_cast<osg::Vec2Array *>(array); 
     756                { 
     757                    OSG_NOTIFY(osg::FATAL) << "Texture coords array is not Vec2. Not implemented" << std::endl; 
     758                    _succeeded = false; 
     759                    return; 
     760                } 
     761                const osg::Vec2Array & vecs= *static_cast<osg::Vec2Array *>(texarray); 
    720762                mesh->texcos[it->second][0] = vecs[it->first.first][0]; 
    721763                mesh->texcos[it->second][1] = vecs[it->first.first][1]; 
     
    739781        assert(g->getVertexArray()); 
    740782        if (g->getVertexArray()->getType() != osg::Array::Vec3ArrayType) 
    741             throw "Vertex array is not Vec3. Not implemented";        // TODO 
     783        { 
     784            // TODO Handle double presision vertices by converting them to float with a warning 
     785            OSG_NOTIFY(osg::FATAL) << "Vertex array is not Vec3. Not implemented" << std::endl; 
     786            _succeeded = false; 
     787            return 0; 
     788        } 
    742789        const osg::Vec3Array & vecs= *static_cast<osg::Vec3Array *>(g->getVertexArray()); 
    743790        numVertice += vecs.getNumElements(); 
     
    753800                              bool                texcoords) 
    754801{ 
    755     MapIndices index_vert; 
    756     Lib3dsMesh *mesh = lib3ds_mesh_new( getUniqueName(geo.getName().empty() ? geo.className() : geo.getName(), "geo").c_str() ); 
    757     if (!mesh) throw "Allocation error"; 
    758  
    759802    unsigned int nbTrianglesRemaining = listTriangles.size(); 
    760     unsigned int nbVerticesRemaining  = calcVertices(geo); 
     803    unsigned int nbVerticesRemaining  = calcVertices(geo);        // May set _succeded to false 
     804    if (!succeeded()) return; 
     805 
     806    std::string name( getUniqueName(geo.getName().empty() ? geo.className() : geo.getName(), "geo") ); 
     807    if (!succeeded()) return; 
     808    Lib3dsMesh *mesh = lib3ds_mesh_new( name.c_str() ); 
     809    if (!mesh) 
     810    { 
     811        OSG_NOTIFY(osg::FATAL) << "Allocation error" << std::endl; 
     812        _succeeded = false; 
     813        return; 
     814    } 
    761815 
    762816    lib3ds_mesh_resize_faces   (mesh, osg::minimum(nbTrianglesRemaining, MAX_FACES)); 
     
    766820    if (nbVerticesRemaining >= MAX_VERTICES || nbTrianglesRemaining >= MAX_FACES) 
    767821    { 
    768         osg::notify(osg::INFO) << "Sorting elements..." << std::endl; 
     822        OSG_NOTIFY(osg::INFO) << "Sorting elements..." << std::endl; 
    769823        WriterCompareTriangle cmp(geo, nbVerticesRemaining); 
    770824        std::sort(listTriangles.begin(), listTriangles.end(), cmp); 
    771825    } 
    772826 
     827    MapIndices index_vert; 
    773828    unsigned int numFace = 0;        // Current face index 
    774829    for (ListTriangle::iterator it = listTriangles.begin(); it != listTriangles.end(); ++it) //Go through the triangle list to define meshs 
     
    780835            lib3ds_mesh_resize_faces   (mesh, numFace); 
    781836            //lib3ds_mesh_resize_vertices() will be called in buildMesh() 
    782             buildMesh(geo, mat, index_vert, texcoords, mesh); 
     837            buildMesh(geo, mat, index_vert, texcoords, mesh);        // May set _succeded to false 
     838            if (!succeeded()) 
     839            { 
     840                lib3ds_mesh_free(mesh); 
     841                return; 
     842            } 
    783843 
    784844            // "Reset" values and start over a new mesh 
     
    790850 
    791851            mesh = lib3ds_mesh_new( getUniqueName(geo.getName().empty() ? geo.className() : geo.getName(), "geo").c_str()); 
    792             if (!mesh) throw "Allocation error"; 
     852            if (!mesh) 
     853            { 
     854                OSG_NOTIFY(osg::FATAL) << "Allocation error" << std::endl; 
     855                _succeeded = false; 
     856                return; 
     857            } 
    793858            lib3ds_mesh_resize_faces   (mesh, osg::minimum(nbTrianglesRemaining, MAX_FACES)); 
    794859            lib3ds_mesh_resize_vertices(mesh, osg::minimum(nbVerticesRemaining,  MAX_VERTICES), texcoords ? 0 : 1, 0);        // Not mandatory but will allocate once a big block 
     
    800865        face.material = it->first.material; 
    801866    } 
    802     buildMesh(geo, mat, index_vert, texcoords, mesh); //When a Mesh is completed without restriction of vertices number 
     867 
     868    buildMesh(geo, mat, index_vert, texcoords, mesh);        // May set _succeded to false 
     869    if (!succeeded()) 
     870    { 
     871        lib3ds_mesh_free(mesh); 
     872        return; 
     873    } 
    803874} 
    804875 
     
    812883    { 
    813884        if (geo->getVertexArray() && geo->getVertexArray()->getType() != osg::Array::Vec3ArrayType) 
    814             throw "Vertex array is not Vec3. Not implemented";        // TODO 
     885        { 
     886            // TODO Handle double presision vertices by converting them to float with a warning 
     887            OSG_NOTIFY(osg::FATAL) << "Vertex array is not Vec3. Not implemented" << std::endl; 
     888            _succeeded = false; 
     889            return; 
     890        } 
    815891        const osg::Vec3Array * vecs = geo->getVertexArray() ? static_cast<osg::Vec3Array *>(geo->getVertexArray()) : NULL; 
    816892        if (vecs)  
     
    819895            // Texture coords 
    820896            if (geo->getTexCoordArray(0) && geo->getTexCoordArray(0)->getType() != osg::Array::Vec2ArrayType) 
    821                 throw "Texture coords array is not Vec2. Not implemented";        // TODO 
     897            { 
     898                OSG_NOTIFY(osg::FATAL) << "Texture coords array is not Vec2. Not implemented" << std::endl; 
     899                _succeeded = false; 
     900                return; 
     901            } 
    822902            const osg::Vec2Array * texvecs = geo->getTexCoordArray(0) ? static_cast<osg::Vec2Array *>(geo->getTexCoordArray(0)) : NULL; 
    823903            if (texvecs)  
    824904            { 
    825905                unsigned int nb = geo->getTexCoordArray(0)->getNumElements(); 
    826                 if (nb != geo->getVertexArray()->getNumElements()) throw "There are more/less texture coords than vertices!"; 
     906                if (nb != geo->getVertexArray()->getNumElements()) 
     907                { 
     908                    OSG_NOTIFY(osg::FATAL) << "There are more/less texture coords than vertices (corrupted geometry)" << std::endl; 
     909                    _succeeded = false; 
     910                    return; 
     911                } 
    827912                texcoords = true; 
    828913            } 
     
    842927} 
    843928 
    844 bool WriterNodeVisitor::suceedLastApply() const 
    845 { 
    846     return _suceedLastApply; 
    847 } 
    848  
    849 void WriterNodeVisitor::failedApply() 
    850 { 
    851     _suceedLastApply = false; 
    852     osg::notify(osg::NOTICE) << "Error going through node" << std::endl; 
    853 } 
    854  
    855 void WriterNodeVisitor::apply( osg::Geode &node ) { 
     929void WriterNodeVisitor::apply( osg::Geode &node ) 
     930{ 
    856931    pushStateSet(node.getStateSet()); 
    857932    //_nameStack.push_back(node.getName()); 
     
    865940        { 
    866941            pushStateSet(g->getStateSet()); 
    867             createListTriangle(g, listTriangles, texcoords, i); 
     942            createListTriangle(g, listTriangles, texcoords, i);        // May set _succeded to false 
    868943            popStateSet(g->getStateSet()); 
    869         } 
    870     } 
    871     if (count > 0) 
     944            if (!succeeded()) break; 
     945        } 
     946    } 
     947    if (succeeded() && count > 0) 
    872948    { 
    873949        osg::Matrix mat( osg::computeLocalToWorld(getNodePath()) ); 
    874         buildFaces(node, mat, listTriangles, texcoords); 
     950        buildFaces(node, mat, listTriangles, texcoords);        // May set _succeded to false 
    875951    } 
    876952    popStateSet(node.getStateSet()); 
    877953    //_nameStack.pop_back(); 
    878     if (suceedLastApply()) 
     954    if (succeeded()) 
    879955        traverse(node); 
    880956} 
    881957 
    882 void WriterNodeVisitor::apply( osg::Billboard &node ) { 
     958void WriterNodeVisitor::apply( osg::Billboard &node ) 
     959{ 
    883960    // TODO Does not handle Billboards' points yet 
    884961 
     
    889966    ListTriangle listTriangles; 
    890967    bool texcoords = false; 
    891     osg::notify(osg::NOTICE) << "Warning: 3DS writer is incomplete for Billboards (rotation not implemented)." << std::endl; 
     968    OSG_NOTIFY(osg::NOTICE) << "Warning: 3DS writer is incomplete for Billboards (rotation not implemented)." << std::endl; 
    892969    osg::Matrix m( osg::computeLocalToWorld(getNodePath()) ); 
    893970    for ( unsigned int i = 0; i < count; i++ ) 
     
    901978            pushStateSet(g->getStateSet()); 
    902979            createListTriangle(g, listTriangles, texcoords, i); 
    903             popStateSet(g->getStateSet()); 
     980            popStateSet(g->getStateSet());        // May set _succeded to false 
     981            if (!succeeded()) break; 
    904982 
    905983            osg::Matrix currentBillBoardMat(osg::Matrix::translate(node.getPosition(i)) * m);        // TODO handle rotation 
    906984            apply3DSMatrixNode(node, currentBillBoardMat, "bil");        // Add a 3DS matrix node 
    907             buildFaces(node, currentBillBoardMat, listTriangles, texcoords); 
    908         } 
    909     } 
    910  
    911     if (suceedLastApply()) 
     985            buildFaces(node, currentBillBoardMat, listTriangles, texcoords);        // May set _succeded to false 
     986            if (!succeeded()) break; 
     987        } 
     988    } 
     989 
     990    if (succeeded()) 
    912991        traverse(node); 
    913992    _cur3dsNode = parent; 
     
    9221001    Lib3dsMeshInstanceNode * parent = _cur3dsNode; 
    9231002    apply3DSMatrixNode(node, osg::computeLocalToWorld(getNodePath()), "grp"); 
    924     if (suceedLastApply()) 
     1003    if (succeeded()) 
    9251004        traverse(node); 
    9261005    _cur3dsNode = parent; 
     
    9331012    Lib3dsMeshInstanceNode * parent = _cur3dsNode; 
    9341013    apply3DSMatrixNode(node, osg::computeLocalToWorld(getNodePath()), "mtx"); 
    935     if (suceedLastApply()) 
     1014    if (succeeded()) 
    9361015        traverse(node); 
    9371016    _cur3dsNode = parent;