Changeset 198


Ignore:
Timestamp:
Jan 13, 2011, 9:18:11 AM (14 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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/bin/osgVisualConfig.xml

    r197 r198  
    5252    <datetime day="0" month="0" year="0" hour="12" minute="30"></datetime>
    5353    <visibility range="50000" turbidity="2.2" ></visibility>
    54     <cloudlayer slot="1" type="cumulusCongestus" enabled="true" fadetime="15">
    55       <geometry baselength="50000" basewidth="50000" thickness="500" baseHeight="1700" density="0.3"></geometry>
     54   
     55    <!--<cloudlayer slot="0" type="CUMULONIMBUS_CAPPILATUS" enabled="true" fadetime="15">
     56      <geometry baselength="20000" basewidth="20000" thickness="600" baseHeight="1000" density="0.5"></geometry>
     57    </cloudlayer>-->
     58    <cloudlayer slot="1" type="CUMULUS_CONGESTUS" enabled="true" fadetime="15">
     59      <geometry baselength="50000" basewidth="50000" thickness="1600" baseHeight="1000" density="0.07"></geometry>
    5660      <precipitation rate_mmPerHour_rain="5.0" rate_mmPerHour_drySnow="7.0" rate_mmPerHour_wetSnow="10.0" rate_mmPerHour_sleet="0.0"></precipitation>
    5761    </cloudlayer>
     62    <cloudlayer slot="2" type="CUMULUS_MEDIOCRIS" enabled="true" fadetime="15">
     63      <geometry baselength="50000" basewidth="50000" thickness="1600" baseHeight="1000" density="0.07"></geometry>
     64    </cloudlayer>
     65    <!--<cloudlayer slot="3" type="CIRRUS_FIBRATUS" enabled="true" fadetime="15">
     66      <geometry baselength="5000000" basewidth="5000000" thickness="600" baseHeight="7351" density="0.2"></geometry>
     67    </cloudlayer>-->
     68    <!--<cloudlayer slot="4" type="CIRROCUMULUS" enabled="true" fadetime="15">
     69      <geometry baselength="50000" basewidth="50000" thickness="600" baseHeight="7351" density="0.2"></geometry>
     70    </cloudlayer>-->
     71    <!--<cloudlayer slot="5" type="STRATOCUMULUS" enabled="true" fadetime="15">
     72      <geometry baselength="100000" basewidth="100000" thickness="2500" baseHeight="2000" density="0.3"></geometry>
     73    </cloudlayer>-->
     74    <!--<cloudlayer slot="6" type="STRATUS" enabled="true" fadetime="15">
     75      <geometry baselength="50000" basewidth="50000" thickness="1500" baseHeight="1500" density="0.3"></geometry>
     76    </cloudlayer>-->
     77
    5878    <windlayer bottom="500.0" top="700." speed="25.0" direction="90.0"></windlayer>
    5979  </scenery>
  • osgVisual/trunk/include/sky_Silverlining/visual_skySilverLining.h

    r197 r198  
    3939#include <libxml/parser.h>
    4040#include <libxml/tree.h>
    41 
    42 #include <string.h>
    43 #include <iostream>
     41#include <sstream>
    4442
    4543namespace osgVisual
  • 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.