Show
Ignore:
Timestamp:
07/16/08 00:03:59 (6 years ago)
Author:
robert
Message:

Converted tabs to four spaces

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgwidgetframe/osgwidgetframe.cpp

    r8588 r8600  
    1010 
    1111int main(int argc, char** argv) { 
    12         osgViewer::Viewer viewer; 
     12    osgViewer::Viewer viewer; 
    1313 
    14         osgWidget::WindowManager* wm = new osgWidget::WindowManager( 
    15                 &viewer, 
    16                 1280.0f, 
    17                 1024.0f, 
    18                 MASK_2D, 
    19                 osgWidget::WindowManager::WM_PICK_DEBUG 
    20         ); 
    21          
    22         osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrame( 
    23                 "frame", 
    24                 32.0f, 
    25                 32.0f, 
    26                 300.0f, 
    27                 300.0f 
    28         ); 
    29          
    30         osgWidget::Table* table  = new osgWidget::Table("table", 2, 2); 
    31         osgWidget::Box*   bottom = new osgWidget::Box("panel", osgWidget::Box::HORIZONTAL); 
     14    osgWidget::WindowManager* wm = new osgWidget::WindowManager( 
     15        &viewer, 
     16        1280.0f, 
     17        1024.0f, 
     18        MASK_2D, 
     19        osgWidget::WindowManager::WM_PICK_DEBUG 
     20    ); 
     21     
     22    osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrame( 
     23        "frame", 
     24        32.0f, 
     25        32.0f, 
     26        300.0f, 
     27        300.0f 
     28    ); 
     29     
     30    osgWidget::Table* table  = new osgWidget::Table("table", 2, 2); 
     31    osgWidget::Box*   bottom = new osgWidget::Box("panel", osgWidget::Box::HORIZONTAL); 
    3232 
    33         table->addWidget(new osgWidget::Widget("red", 300.0f, 300.0f), 0, 0); 
    34         table->addWidget(new osgWidget::Widget("white", 300.0f, 300.0f), 0, 1); 
    35         table->addWidget(new osgWidget::Widget("yellow", 300.0f, 300.0f), 1, 0); 
    36         table->addWidget(new osgWidget::Widget("purple", 300.0f, 300.0f), 1, 1); 
    37         table->getByRowCol(0, 0)->setColor(1.0f, 0.0f, 0.0f, 1.0f); 
    38         table->getByRowCol(0, 1)->setColor(1.0f, 1.0f, 1.0f, 1.0f); 
    39         table->getByRowCol(1, 0)->setColor(1.0f, 1.0f, 0.0f, 1.0f); 
    40         table->getByRowCol(1, 1)->setColor(1.0f, 0.0f, 1.0f, 1.0f); 
    41         table->getByRowCol(0, 0)->setMinimumSize(100.0f, 100.0f); 
    42         table->getByRowCol(0, 1)->setMinimumSize(100.0f, 100.0f); 
    43         table->getByRowCol(1, 0)->setMinimumSize(100.0f, 100.0f); 
    44         table->getByRowCol(1, 1)->setMinimumSize(100.0f, 100.0f); 
     33    table->addWidget(new osgWidget::Widget("red", 300.0f, 300.0f), 0, 0); 
     34    table->addWidget(new osgWidget::Widget("white", 300.0f, 300.0f), 0, 1); 
     35    table->addWidget(new osgWidget::Widget("yellow", 300.0f, 300.0f), 1, 0); 
     36    table->addWidget(new osgWidget::Widget("purple", 300.0f, 300.0f), 1, 1); 
     37    table->getByRowCol(0, 0)->setColor(1.0f, 0.0f, 0.0f, 1.0f); 
     38    table->getByRowCol(0, 1)->setColor(1.0f, 1.0f, 1.0f, 1.0f); 
     39    table->getByRowCol(1, 0)->setColor(1.0f, 1.0f, 0.0f, 1.0f); 
     40    table->getByRowCol(1, 1)->setColor(1.0f, 0.0f, 1.0f, 1.0f); 
     41    table->getByRowCol(0, 0)->setMinimumSize(100.0f, 100.0f); 
     42    table->getByRowCol(0, 1)->setMinimumSize(100.0f, 100.0f); 
     43    table->getByRowCol(1, 0)->setMinimumSize(100.0f, 100.0f); 
     44    table->getByRowCol(1, 1)->setMinimumSize(100.0f, 100.0f); 
    4545 
    46         frame->setWindow(table); 
     46    frame->setWindow(table); 
    4747 
    48         // Give frame some nice textures. 
    49         // TODO: This has to be done after setWindow(); wtf? 
    50         frame->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); 
     48    // Give frame some nice textures. 
     49    // TODO: This has to be done after setWindow(); wtf? 
     50    frame->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); 
    5151 
    52         osgWidget::Widget* l = frame->getBorder(osgWidget::Frame::BORDER_LEFT); 
    53         osgWidget::Widget* r = frame->getBorder(osgWidget::Frame::BORDER_RIGHT); 
    54         osgWidget::Widget* t = frame->getBorder(osgWidget::Frame::BORDER_TOP); 
    55         osgWidget::Widget* b = frame->getBorder(osgWidget::Frame::BORDER_BOTTOM); 
     52    osgWidget::Widget* l = frame->getBorder(osgWidget::Frame::BORDER_LEFT); 
     53    osgWidget::Widget* r = frame->getBorder(osgWidget::Frame::BORDER_RIGHT); 
     54    osgWidget::Widget* t = frame->getBorder(osgWidget::Frame::BORDER_TOP); 
     55    osgWidget::Widget* b = frame->getBorder(osgWidget::Frame::BORDER_BOTTOM); 
    5656 
    57         l->setImage("../examples/osgwidgetframe/images/border-left.tga", true); 
    58         r->setImage("../examples/osgwidgetframe/images/border-right.tga", true); 
    59         t->setImage("../examples/osgwidgetframe/images/border-top.tga", true); 
    60         b->setImage("../examples/osgwidgetframe/images/border-bottom.tga", true); 
     57    l->setImage("../examples/osgwidgetframe/images/border-left.tga", true); 
     58    r->setImage("../examples/osgwidgetframe/images/border-right.tga", true); 
     59    t->setImage("../examples/osgwidgetframe/images/border-top.tga", true); 
     60    b->setImage("../examples/osgwidgetframe/images/border-bottom.tga", true); 
    6161 
    62         l->setTexCoordWrapVertical(); 
    63         r->setTexCoordWrapVertical(); 
    64         t->setTexCoordWrapHorizontal(); 
    65         b->setTexCoordWrapHorizontal(); 
     62    l->setTexCoordWrapVertical(); 
     63    r->setTexCoordWrapVertical(); 
     64    t->setTexCoordWrapHorizontal(); 
     65    b->setTexCoordWrapHorizontal(); 
    6666 
    67         // Create the bottom, XArt panel. 
    68         osgWidget::Widget* left   = new osgWidget::Widget("left", 512.0f, 256.0f); 
    69         osgWidget::Widget* center = new osgWidget::Widget("center", 256.0f, 256.0f); 
    70         osgWidget::Widget* right  = new osgWidget::Widget("right", 512.0f, 256.0f); 
     67    // Create the bottom, XArt panel. 
     68    osgWidget::Widget* left   = new osgWidget::Widget("left", 512.0f, 256.0f); 
     69    osgWidget::Widget* center = new osgWidget::Widget("center", 256.0f, 256.0f); 
     70    osgWidget::Widget* right  = new osgWidget::Widget("right", 512.0f, 256.0f); 
    7171 
    72         left->setImage("../examples/osgwidgetframe/images/panel-left.tga", true); 
    73         center->setImage("../examples/osgwidgetframe/images/panel-center.tga", true); 
    74         right->setImage("../examples/osgwidgetframe/images/panel-right.tga", true); 
     72    left->setImage("../examples/osgwidgetframe/images/panel-left.tga", true); 
     73    center->setImage("../examples/osgwidgetframe/images/panel-center.tga", true); 
     74    right->setImage("../examples/osgwidgetframe/images/panel-right.tga", true); 
    7575 
    76         center->setTexCoordWrapHorizontal(); 
     76    center->setTexCoordWrapHorizontal(); 
    7777 
    78         bottom->addWidget(left); 
    79         bottom->addWidget(center); 
    80         bottom->addWidget(right); 
    81         bottom->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); 
    82         bottom->setOrigin(0.0f, 1024.0f - 256.0f); 
     78    bottom->addWidget(left); 
     79    bottom->addWidget(center); 
     80    bottom->addWidget(right); 
     81    bottom->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); 
     82    bottom->setOrigin(0.0f, 1024.0f - 256.0f); 
    8383 
    84         // Add everything to the WindowManager. 
    85         wm->addChild(frame); 
    86         wm->addChild(bottom); 
     84    // Add everything to the WindowManager. 
     85    wm->addChild(frame); 
     86    wm->addChild(bottom); 
    8787 
    88         return osgWidget::createExample(viewer, wm); 
     88    return osgWidget::createExample(viewer, wm); 
    8989}