Changeset 13

Show
Ignore:
Timestamp:
04/23/08 16:54:32
Author:
robert
Message:

Introduced <title-settings> and <text-settings> tags which allow one to set the defaults used for the result of the presentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/ReaderWriterXML.cpp

    r12 r13  
    12681268 
    12691269    SlideShowConstructor constructor; 
    1270      
     1270           
    12711271    bool readSlide = false; 
    12721272     
     
    12751275    while (cur != NULL) { 
    12761276 
    1277 /* 
    1278         if ((!xmlStrcmp(cur->name, (const xmlChar *)"env"))) 
    1279         { 
    1280             key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); 
    1281             if (key) 
    1282             { 
    1283                 osg::notify(osg::NOTICE)<<"putenv("<<(char*)key<<")"<<std::endl; 
    1284                 putenv((char*)key); 
    1285             } 
    1286             xmlFree(key); 
    1287         } 
    1288 */ 
     1277 
    12891278        if ((!xmlStrcmp(cur->name, (const xmlChar *)"name"))) 
    12901279        { 
     
    12931282            else constructor.setPresentationName(""); 
    12941283            xmlFree(key); 
     1284        } 
     1285        else if ((!xmlStrcmp(cur->name, (const xmlChar *)"title-settings"))) 
     1286        { 
     1287            bool fontRead = getProperties(cur,constructor.getTitleFontDataDefault()); 
     1288            if (fontRead)  
     1289            { 
     1290                osg::notify(osg::NOTICE)<<"Title font details read"<<std::endl; 
     1291            } 
     1292        } 
     1293        else if ((!xmlStrcmp(cur->name, (const xmlChar *)"text-settings"))) 
     1294        { 
     1295            bool fontRead = getProperties(cur,constructor.getTextFontDataDefault()); 
     1296            if (fontRead)  
     1297            { 
     1298                osg::notify(osg::NOTICE)<<"Text font details read"<<std::endl; 
     1299            } 
    12951300        } 
    12961301        /*else if ((!xmlStrcmp(cur->name, (const xmlChar *)"ratio"))) 
  • trunk/src/SlideShowConstructor.cpp

    r9 r13  
    9393    _titleFontDataDefault.alignment = osgText::Text::CENTER_BASE_LINE; 
    9494    _titleFontDataDefault.axisAlignment = osgText::Text::XZ_PLANE; 
     95    _titleFontDataDefault.characterSize = 0.06f; 
     96    _titleFontDataDefault.maximumWidth = 0.9f; 
    9597 
    9698    _titlePositionDataDefault.position.set(0.5f,0.92f,0.0f); 
     
    102104    _textFontDataDefault.alignment = osgText::Text::LEFT_BASE_LINE; 
    103105    _textFontDataDefault.axisAlignment = osgText::Text::XZ_PLANE; 
     106    _textFontDataDefault.characterSize = 0.04f; 
     107    _textFontDataDefault.maximumWidth = 0.8f; 
    104108 
    105109    _textPositionDataDefault.position.set(0.1f,0.85f,0.0f); 
     
    132136    _slideOrigin.set(-_slideWidth*0.5f,_slideDistance,-_slideHeight*0.5f); 
    133137 
     138#if 0 
    134139    _titleFontDataDefault.characterSize = 0.06f; 
    135140    _titleFontDataDefault.maximumWidth = 0.9f; 
     
    137142    _textFontDataDefault.characterSize = 0.04f; 
    138143    _textFontDataDefault.maximumWidth = 0.8f; 
     144#endif 
    139145     
    140146    osg::notify(osg::INFO)<<"_titlePositionDataDefault.position="<<_titlePositionDataDefault.position<<std::endl;