Changeset 198 for osgVisual/trunk/src


Ignore:
Timestamp:
Jan 13, 2011, 9:18:11 AM (13 years ago)
Author:
Torben Dannhauer
Message:

osgVisual now compiles and configure cloudlayer via XML.

todo at all:
cluster: channelname is currently not defined by XML. Should it be?
sky: precipitation has to be activated
XML: model configuration must be implemented
XML: only lowercase in attribute names
XML: cloudlayer should be crapped in a node called cloudlayers.

Location:
osgVisual/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/core/visual_core.cpp

    r195 r198  
    368368                if(cur_node->type == XML_ELEMENT_NODE && node_name == "cloudlayer")
    369369                {
    370                         /*
    371                         <cloudlayer slot="1" type="cumulusCongestus" enabled="true" fadetime="15">
    372                           <geometry baselength="50000" basewidth="50000" thickness="500" baseHeight="1700" density="0.3"></geometry>
    373                           <precipitation rate_mmPerHour_rain="5.0" rate_mmPerHour_drySnow="7.0" rate_mmPerHour_wetSnow="10.0" rate_mmPerHour_sleet="0.0"></precipitation>
    374                         </cloudlayer>
    375                         */
     370                        if(sky.valid())
     371                                sky->configureCloudlayerbyXML( cur_node );
    376372                }
    377373
     
    467463        if(sky.valid())
    468464        {
    469                 //sky->addCloudLayer( 0, 20000, 20000, 600.0, 1000.0, 0.5, CUMULONIMBUS_CAPPILATUS );
    470                 //sky->addCloudLayer( 1, 5000000, 5000000, 600.0, 7351.0, 0.2, CIRRUS_FIBRATUS );
    471                 //sky->addCloudLayer( 2, 50000, 50000, 600.0, 7351.0, 0.2, CIRROCUMULUS );
    472                 ///sky->addCloudLayer( 2, 100000, 100000, 600.0, 2351.0, 0.75, STRATUS );
    473                 sky->addCloudLayer( 3, 50000, 50000, 1300.0, 700.0, 0.07, CUMULUS_CONGESTUS );
    474                 //sky->addCloudLayer( 1, 100000, 100000, 3500.0, 2000.0, 0.30, STRATOCUMULUS );
    475 
    476                 //sky->setSlotPrecipitation( 1, 0.0, 0.0, 0.0, 25.0 );
     465
    477466        }
    478467
  • osgVisual/trunk/src/sky_Silverlining/visual_skySilverLining.cpp

    r197 r198  
    753753                float density = -1.0, rate_mmPerHour_rain = -1.0, rate_mmPerHour_drySnow = -1.0, rate_mmPerHour_wetSnow = -1.0, rate_mmPerHour_sleet = -1.0;
    754754                CloudTypes ctype = CUMULUS_CONGESTUS;
    755 
    756 
    757755
    758756                xmlAttr  *attr = cloudlayerNode_->properties;
     
    798796                }
    799797
    800                 cloudlayerNode_ = cloudlayerNode_->children;
    801                 if(!cloudlayerNode_)
     798                if(!cloudlayerNode_->children)
    802799                {
    803800                        OSG_NOTIFY( osg::ALWAYS ) << "ERROR - visual_skySilverLining::configureCloudlayerbyXML: Missing geometry specification for a cloudlayer." << std::endl;
     
    805802                }
    806803
    807                 for (xmlNode *cur_node = cloudlayerNode_; cur_node; cur_node = cur_node->next)
    808                 {
     804                for (xmlNode *cur_node = cloudlayerNode_->children; cur_node; cur_node = cur_node->next)
     805                {
     806                        node_name=reinterpret_cast<const char*>(cur_node->name);
    809807                        if(cur_node->type == XML_ELEMENT_NODE && node_name == "geometry")
    810808                        {
    811                                 xmlAttr  *attr = cloudlayerNode_->properties;
     809                                xmlAttr  *attr = cur_node->properties;
    812810                                while ( attr )
    813811                                {
     
    845843                        if(cur_node->type == XML_ELEMENT_NODE && node_name == "precipitation")
    846844                        {
    847                                 xmlAttr  *attr = cloudlayerNode_->properties;
     845                                xmlAttr  *attr = cur_node->properties;
    848846                                while ( attr )
    849847                                {
  • osgVisual/trunk/src/util/visual_util.cpp

    r192 r198  
    489489                        }
    490490                }
    491 
    492                 if(cur_node->type == XML_ELEMENT_NODE && node_name == "animationpath")
    493                 {
    494                         //<animationpath filename="salzburgerEcke.path"></animationpath>
    495                 }
    496491        }// FOR all nodes END
    497492
     
    530525                        }
    531526                }
    532 
    533 
    534527        }// FOR all nodes END
    535528
Note: See TracChangeset for help on using the changeset viewer.