Show
Ignore:
Timestamp:
03/21/12 18:36:20 (2 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/dae/daeReader.cpp

    r12791 r13041  
    22 * Copyright 2006 Sony Computer Entertainment Inc. 
    33 * 
    4  * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this  
     4 * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this 
    55 * file except in compliance with the License. You may obtain a copy of the License at: 
    66 * http://research.scea.com/scea_shared_source_license.html 
    77 * 
    8  * Unless required by applicable law or agreed to in writing, software distributed under the License  
    9  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
    10  * implied. See the License for the specific language governing permissions and limitations under the  
    11  * License.  
     8 * Unless required by applicable law or agreed to in writing, software distributed under the License 
     9 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
     10 * implied. See the License for the specific language governing permissions and limitations under the 
     11 * License. 
    1212 */ 
    1313 
     
    5252} 
    5353 
    54 bool daeReader::convert( const std::string &fileURI )  
     54bool daeReader::convert( const std::string &fileURI ) 
    5555{ 
    5656    // Clear caches 
     
    6060 
    6161    daeElement *colladaElement; 
    62      
     62 
    6363 
    6464    daeInt count, result; 
    6565 
    6666    _document = _dae->open(fileURI); 
    67      
    68     if (!_document)  
     67 
     68    if (!_document) 
    6969    { 
    7070        OSG_WARN << "Load failed in COLLADA DOM" << std::endl; 
     
    7373    OSG_INFO << "URI loaded: " << fileURI << std::endl; 
    7474 
    75     if ( !_document->getScene() || !_document->getScene()->getInstance_visual_scene() )  
     75    if ( !_document->getScene() || !_document->getScene()->getInstance_visual_scene() ) 
    7676    { 
    7777        OSG_WARN << "No scene found!" << std::endl; 
     
    121121    domInstanceWithExtra *ivs = _document->getScene()->getInstance_visual_scene(); 
    122122    _visualScene = daeSafeCast< domVisual_scene >( getElementFromURI( ivs->getUrl() ) ); 
    123     if ( _visualScene == NULL )  
     123    if ( _visualScene == NULL ) 
    124124    { 
    125125        OSG_WARN << "Unable to locate visual scene!" << std::endl; 
     
    127127    } 
    128128 
    129     if (daeDatabase* database = _dae->getDatabase())  
     129    if (daeDatabase* database = _dae->getDatabase()) 
    130130    { 
    131131        _invertTransparency = findInvertTransparency(database); 
    132132 
    133         // build a std::map for lookup if Group or PositionAttitudeTransform should be created,  
     133        // build a std::map for lookup if Group or PositionAttitudeTransform should be created, 
    134134        // i.e, make it easy to check if a instance_rigid_body targets a visual node 
    135135        domInstance_rigid_body *pDomInstanceRigidBody; 
    136136        count = database->getElementCount(NULL, COLLADA_TYPE_INSTANCE_RIGID_BODY, NULL); 
    137         for (int i=0; i<count; i++)  
     137        for (int i=0; i<count; i++) 
    138138        { 
    139139            result = database->getElement(&colladaElement, i, NULL, COLLADA_TYPE_INSTANCE_RIGID_BODY); 
    140140 
    141             if (result == DAE_OK)  
     141            if (result == DAE_OK) 
    142142            { 
    143143                pDomInstanceRigidBody = daeSafeCast<domInstance_rigid_body>(colladaElement); 
    144                 if (pDomInstanceRigidBody)  
     144                if (pDomInstanceRigidBody) 
    145145                { 
    146146                    domNode *node = daeSafeCast<domNode>(pDomInstanceRigidBody->getTarget().getElement()); 
    147                     if (node && node->getId())  
    148                     { 
    149                         _targetMap[ std::string(node->getId()) ] = true;           
     147                    if (node && node->getId()) 
     148                    { 
     149                        _targetMap[ std::string(node->getId()) ] = true; 
    150150                    } 
    151151                } 
     
    155155        // Build a map of elements that are targetted by animations 
    156156        count = database->getElementCount(NULL, COLLADA_TYPE_CHANNEL, NULL); 
    157         for (int i=0; i<count; i++)  
     157        for (int i=0; i<count; i++) 
    158158        { 
    159159            result = database->getElement(&colladaElement, i, NULL, COLLADA_TYPE_CHANNEL); 
    160160 
    161             if (result == DAE_OK)  
     161            if (result == DAE_OK) 
    162162            { 
    163163                domChannel* pDomChannel = daeSafeCast<domChannel>(colladaElement); 
    164                 if (pDomChannel)  
     164                if (pDomChannel) 
    165165                { 
    166166                    std::string target = pDomChannel->getTarget(); 
     
    186186        std::vector<domInstance_controller*> instanceControllers; 
    187187        database->typeLookup(instanceControllers); 
    188         for (size_t i = 0; i < instanceControllers.size(); ++i)  
     188        for (size_t i = 0; i < instanceControllers.size(); ++i) 
    189189        { 
    190190            domInstance_controller* pInstanceController = instanceControllers[i]; 
     
    223223            const domInputLocal_Array& inputURIs = pJoints->getInput_array(); 
    224224 
    225             domSource* pDomJointsSource = NULL;  
     225            domSource* pDomJointsSource = NULL; 
    226226            for (size_t i=0; i < inputURIs.getCount(); i++) 
    227227            { 
     
    275275        _rootNode->addUpdateCallback(pOsgAnimationManager); 
    276276    } 
    277      
     277 
    278278    return true; 
    279279} 
     
    300300{ 
    301301    osg::PositionAttitudeTransform* pat = NULL; 
    302      
     302 
    303303    // If not Z axis up we need to rotate scene to bring the Z axis up 
    304304    if (_assetUp_axis != UPAXISTYPE_Z_UP) 
     
    321321osg::Group* daeReader::processVisualScene( domVisual_scene *scene ) 
    322322{ 
    323     osg::Group *retVal;  
     323    osg::Group *retVal; 
    324324    _rootStateSet = new osg::StateSet(); 
    325325 
     
    333333    else 
    334334    { 
    335         retVal = turnZUp();  
     335        retVal = turnZUp(); 
    336336 
    337337        if (!retVal) 
     
    523523    // See if it is targeted by an animation 
    524524    bool targeted = false; 
    525     if (node->getId())  
     525    if (node->getId()) 
    526526    { 
    527527        targeted = _targetMap[std::string(node->getId())]; 
     
    533533    bool isBone = skeleton || isJoint(node); 
    534534 
    535     if (coordcount > 0 || targeted || isBone)  
     535    if (coordcount > 0 || targeted || isBone) 
    536536    { 
    537537        // TODO 
     
    574574    // 0..* <instance_camera> 
    575575    const domInstance_camera_Array& cameraInstanceArray = node->getInstance_camera_array(); 
    576     for ( size_t i = 0; i < cameraInstanceArray.getCount(); i++ )  
     576    for ( size_t i = 0; i < cameraInstanceArray.getCount(); i++ ) 
    577577    { 
    578578        daeElement *el = getElementFromURI( cameraInstanceArray[i]->getUrl()); 
     
    587587    // 0..* <instance_controller> 
    588588    const domInstance_controller_Array& controllerInstanceArray = node->getInstance_controller_array(); 
    589     for ( size_t i = 0; i < controllerInstanceArray.getCount(); i++ )  
     589    for ( size_t i = 0; i < controllerInstanceArray.getCount(); i++ ) 
    590590    { 
    591591        osg::Node* pOsgNode = processInstanceController( controllerInstanceArray[i]); 
    592          
    593         // A skin controller may return NULL,  since the RigGeometry is added as  
     592 
     593        // A skin controller may return NULL,  since the RigGeometry is added as 
    594594        // child of the skeleton and the skeleton already is added to the scenegraph 
    595595        if (pOsgNode) 
     
    601601    // 0..* <instance_geometry> 
    602602    const domInstance_geometry_Array& geometryInstanceArray = node->getInstance_geometry_array(); 
    603     for ( size_t i = 0; i < geometryInstanceArray.getCount(); i++ )  
     603    for ( size_t i = 0; i < geometryInstanceArray.getCount(); i++ ) 
    604604    { 
    605605        addChild(attachTo, processInstanceGeometry( geometryInstanceArray[i] )); 
     
    608608    // 0..* <instance_light> 
    609609    const domInstance_light_Array& lightInstanceArray = node->getInstance_light_array(); 
    610     for ( size_t i = 0; i < lightInstanceArray.getCount(); i++ )  
     610    for ( size_t i = 0; i < lightInstanceArray.getCount(); i++ ) 
    611611    { 
    612612        daeElement *el = getElementFromURI( lightInstanceArray[i]->getUrl()); 
    613613        domLight *pDomLight = daeSafeCast< domLight >( el ); 
    614          
     614 
    615615        if (pDomLight) 
    616616            addChild(attachTo, processLight(pDomLight)); 
     
    621621    // 0..* <instance_node> 
    622622    const domInstance_node_Array& nodeInstanceArray = node->getInstance_node_array(); 
    623     for ( size_t i = 0; i < nodeInstanceArray.getCount(); i++ )  
     623    for ( size_t i = 0; i < nodeInstanceArray.getCount(); i++ ) 
    624624    { 
    625625        daeElement *el = getElementFromURI( nodeInstanceArray[i]->getUrl()); 
     
    635635    // 0..* <node> 
    636636    const domNode_Array& nodeArray = node->getNode_array(); 
    637     for ( size_t i = 0; i < nodeArray.getCount(); i++ )  
     637    for ( size_t i = 0; i < nodeArray.getCount(); i++ ) 
    638638    { 
    639639        // Recursive call