Show
Ignore:
Timestamp:
10/24/04 16:31:18 (10 years ago)
Author:
robert
Message:

fixes to tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ive/DrawArrayLengths.cpp

    r1980 r3525  
    11/********************************************************************** 
    22 * 
    3  *      FILE:                   DrawArrayLengths.cpp 
     3 *    FILE:            DrawArrayLengths.cpp 
    44 * 
    5  *      DESCRIPTION:    Read/Write osg::DrawArrayLengths in binary format to disk. 
     5 *    DESCRIPTION:    Read/Write osg::DrawArrayLengths in binary format to disk. 
    66 * 
    7  *      CREATED BY:             Auto generated by iveGenerated 
    8  *                                      and later modified by Rune Schmidt Jensen. 
     7 *    CREATED BY:        Auto generated by iveGenerated 
     8 *                    and later modified by Rune Schmidt Jensen. 
    99 * 
    10  *      HISTORY:                Created 20.3.2003 
     10 *    HISTORY:        Created 20.3.2003 
    1111 * 
    12  *      Copyright 2003 VR-C 
     12 *    Copyright 2003 VR-C 
    1313 **********************************************************************/ 
    1414 
     
    2020 
    2121void DrawArrayLengths::write(DataOutputStream* out){ 
    22         // Write DrawArrayLengths's identification. 
    23         out->writeInt(IVEDRAWARRAYLENGTHS); 
    24         // If the osg class is inherited by any other class we should also write this to file. 
    25         osg::PrimitiveSet*  prim = dynamic_cast<osg::PrimitiveSet*>(this); 
    26         if(prim){ 
    27                 ((ive::PrimitiveSet*)(prim))->write(out); 
    28         } 
    29         else 
    30                 throw Exception("DrawArrayLengths::write(): Could not cast this osg::DrawArrayLengths to an osg::PrimitiveSet."); 
     22    // Write DrawArrayLengths's identification. 
     23    out->writeInt(IVEDRAWARRAYLENGTHS); 
     24    // If the osg class is inherited by any other class we should also write this to file. 
     25    osg::PrimitiveSet*  prim = dynamic_cast<osg::PrimitiveSet*>(this); 
     26    if(prim){ 
     27        ((ive::PrimitiveSet*)(prim))->write(out); 
     28    } 
     29    else 
     30        throw Exception("DrawArrayLengths::write(): Could not cast this osg::DrawArrayLengths to an osg::PrimitiveSet."); 
    3131 
    32         // Write DrawArrayLengths's properties. 
    33         out->writeInt(getFirst()); 
     32    // Write DrawArrayLengths's properties. 
     33    out->writeInt(getFirst()); 
    3434 
    35         // Write array length and its elements. 
    36         out->writeInt(size()); 
    37         for(unsigned int i=0; i<size(); i++){ 
    38                 out->writeInt(((osg::VectorSizei)(*this))[i]); 
    39         } 
     35    // Write array length and its elements. 
     36    out->writeInt(size()); 
     37    for(unsigned int i=0; i<size(); i++){ 
     38        out->writeInt(((osg::VectorSizei)(*this))[i]); 
     39    } 
    4040 
    4141} 
    4242 
    4343void DrawArrayLengths::read(DataInputStream* in){ 
    44         // Read DrawArrayLengths's identification. 
    45         int id = in->peekInt(); 
    46         if(id == IVEDRAWARRAYLENGTHS){ 
    47                 // Code to read DrawArrayLengths's properties. 
    48                 id = in->readInt(); 
    49                 // If the osg class is inherited by any other class we should also read this from file. 
    50                 osg::PrimitiveSet*  prim = dynamic_cast<osg::PrimitiveSet*>(this); 
    51                 if(prim){ 
    52                         ((ive::PrimitiveSet*)(prim))->read(in); 
    53                 } 
    54                 else 
    55                         throw Exception("DrawArrayLengths::read(): Could not cast this osg::DrawArrayLengths to an osg::PrimtiveSet."); 
     44    // Read DrawArrayLengths's identification. 
     45    int id = in->peekInt(); 
     46    if(id == IVEDRAWARRAYLENGTHS){ 
     47        // Code to read DrawArrayLengths's properties. 
     48        id = in->readInt(); 
     49        // If the osg class is inherited by any other class we should also read this from file. 
     50        osg::PrimitiveSet*  prim = dynamic_cast<osg::PrimitiveSet*>(this); 
     51        if(prim){ 
     52            ((ive::PrimitiveSet*)(prim))->read(in); 
     53        } 
     54        else 
     55            throw Exception("DrawArrayLengths::read(): Could not cast this osg::DrawArrayLengths to an osg::PrimtiveSet."); 
    5656 
    57                 // Read properties 
    58                 setFirst(in->readInt()); 
    59          
    60                 // Read array length and its elements. 
    61                 int size = in->readInt(); 
    62                 for(int i=0; i<size; i++){ 
    63                         push_back(in->readInt()); 
    64                 } 
     57        // Read properties 
     58        setFirst(in->readInt()); 
     59     
     60        // Read array length and its elements. 
     61        int size = in->readInt(); 
     62        for(int i=0; i<size; i++){ 
     63            push_back(in->readInt()); 
     64        } 
    6565 
    66         } 
    67         else{ 
    68                 throw Exception("DrawArrayLengths::read(): Expected DrawArrayLengths identification."); 
    69         } 
     66    } 
     67    else{ 
     68        throw Exception("DrawArrayLengths::read(): Expected DrawArrayLengths identification."); 
     69    } 
    7070}