Changeset 10159

Show
Ignore:
Timestamp:
05/07/09 20:32:36 (5 years ago)
Author:
robert
Message:

Moved property code from ImageLayer? into Layer where it belongs

Location:
OpenSceneGraph/trunk/src/osgPlugins/osgVolume
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/osgVolume/ImageLayer.cpp

    r10136 r10159  
    3636    bool itrAdvanced = false; 
    3737     
    38     osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<osgVolume::Property>()); 
    39     if (readObject.valid()) itrAdvanced = true; 
    40  
    41     osgVolume::Property* property = dynamic_cast<osgVolume::Property*>(readObject.get()); 
    42     if (property) layer.addProperty(property); 
    43  
    4438    if (fr.matchSequence("file %w") || fr.matchSequence("file %s")) 
    4539    { 
     
    9488    const osgVolume::ImageLayer& layer = static_cast<const osgVolume::ImageLayer&>(obj); 
    9589     
    96     if (layer.getProperty()) 
    97     { 
    98         fw.writeObject(*layer.getProperty()); 
    99     } 
    100  
    10190    if (!layer.getFileName().empty()) 
    10291    { 
  • OpenSceneGraph/trunk/src/osgPlugins/osgVolume/Layer.cpp

    r9495 r10159  
    3535 
    3636    bool itrAdvanced = false; 
    37      
     37 
    3838    osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<osgVolume::Locator>()); 
    3939    osgVolume::Locator* locator = dynamic_cast<osgVolume::Locator*>(readObject.get()); 
    4040    if (locator) layer.setLocator(locator); 
    41      
     41 
     42    readObject = fr.readObjectOfType(osgDB::type_wrapper<osgVolume::Property>()); 
     43    if (readObject.valid()) itrAdvanced = true; 
     44 
     45    osgVolume::Property* property = dynamic_cast<osgVolume::Property*>(readObject.get()); 
     46    if (property) layer.addProperty(property); 
     47 
    4248    return itrAdvanced; 
    4349} 
     
    4652{ 
    4753    const osgVolume::Layer& layer = static_cast<const osgVolume::Layer&>(obj); 
    48      
     54 
    4955    if (layer.getLocator()) 
    5056    { 
    5157        fw.writeObject(*layer.getLocator()); 
    5258    } 
    53      
     59 
     60    if (layer.getProperty()) 
     61    { 
     62        fw.writeObject(*layer.getProperty()); 
     63    } 
     64 
    5465    return true; 
    5566}