Ignore:
Timestamp:
Jan 8, 2011, 8:13:43 PM (13 years ago)
Author:
Torben Dannhauer
Message:

XML configuration now works also with dataIO extLink

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/dataIO/visual_dataIO.cpp

    r185 r186  
    5454        viewer = viewer_;
    5555
    56         // Process XML configuration
     56        // Process XML configuration - all XML dependen initializations are performed in processXMLConfiguration()
    5757        this->configFileName = configFileName;
    58         xmlNode *extLinkConfig=NULL;
    59         if(!processXMLConfiguration(extLinkConfig))
     58        if(!processXMLConfiguration())
    6059                OSG_FATAL << "ERROR: visual_dataIO::init() - Failed to initialize dataIO via XML configuration!";
    6160
    62         // Create extLink.
    63         #ifdef USE_EXTLINK_DUMMY
    64                 extLink = new dataIO_extLinkDummy( dataSlots );
    65         #endif
    66         #ifdef USE_EXTLINK_VCL
    67                 extLink = new dataIO_extLinkVCL( dataSlots );
    68         #endif
    69         extLink->init();
    70 
    71        
    7261        // Install callbacks to perform DataIO activities every frame:
    7362        //// EventCallback at the absolute beginning of the frame
     
    8170}
    8271
    83 bool visual_dataIO::processXMLConfiguration(xmlNode* extLinkConfig_)
     72bool visual_dataIO::processXMLConfiguration()
    8473{
    8574        // Init XML
     
    8776        bool disabled;
    8877        xmlNode* config = util::getModuleXMLConfig( configFileName, "dataio", tmpDoc, disabled );
    89         xmlNode* clusterConfig = NULL;
     78        xmlNode* clusterConfig = NULL, *extLinkConfig = NULL;
    9079
    9180        if( disabled)
     
    147136                        if(cur_node->type == XML_ELEMENT_NODE && node_name == "extlink")
    148137                        {
    149                                 // Check Attributes to determine if the dummy implementation or any other implementation must be instantiated
    150 
    151                                 // Pass XML attributes to extlink to analyse and configure it by extLink itself
     138                                // Pass extLink configuration to the used extLink implementation.
     139                                // The implementation will use the configuration if it matches, otherwise falls back to dummy extLink
     140                                extLinkConfig = cur_node;
    152141                        }
    153142
    154143                }       // FOR all nodes END
    155 
    156144
    157145
     
    169157                }
    170158
     159                // Create extLink.
     160                #ifdef USE_EXTLINK_VCL
     161                        extLink = new dataIO_extLinkVCL( dataSlots );
     162                #endif
     163                if( !extLink.valid() || !extLinkConfig || !extLink->init(extLinkConfig) )
     164                {
     165                        extLink = new dataIO_extLinkDummy( dataSlots );
     166                        extLink->init(extLinkConfig);
     167                }
    171168
    172169
Note: See TracChangeset for help on using the changeset viewer.