Changeset 826


Ignore:
Timestamp:
04/26/06 13:23:34 (18 years ago)
Author:
gumbau
Message:

Modification Stripify for mesh discrimination.
Adds submesh operation type.

Location:
GTP/trunk/Lib/Geom/shared
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshStripifier.h

    r774 r826  
    5353                        Mesh *  GetMesh (); 
    5454 
     55                        // Sets what is the mesh that stores the leaves 
     56                        void setSubMeshLeaves(Geometry::Index); 
     57 
    5558                protected: 
    5659 
     
    6063                        //      Mesh object. 
    6164                        Geometry::Mesh          *mGeoMesh; 
     65 
     66                        //      Index of the submesh leaves. 
     67                        Geometry::Index mSubMeshLeaves; 
     68 
    6269        }; 
    6370 
     
    8895                        //      Set the progress bar function. 
    8996                        void    SetProgressFunc(Geometry::TIPOFUNC upb); 
     97 
     98                        // Sets what is the submesh that stores the leaves 
     99                        void SetSubMeshLeaves(size_t    submesh); 
    90100        }; 
    91101 
  • GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoSubMesh.h

    r774 r826  
    4646                size_t mStripCount; ///< number of Strips 
    4747 
     48                MeshType        mType;  ///<    Type of mesh 
     49 
    4850                //OSCAR 
    4951                std::vector <VertexBoneAssignment> mBones; 
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMesh.cpp

    r774 r826  
    3333                mSubMesh[i].mVertexBuffer->mVertexCount = objmesh.mSubMesh[i].mVertexBuffer->mVertexCount; 
    3434                mSubMesh[i].mVertexBuffer->mVertexInfo = objmesh.mSubMesh[i].mVertexBuffer->mVertexInfo; 
     35                mSubMesh[i].mType       =       objmesh.mSubMesh[i].mType; 
    3536                 
    3637                // De momento con esto se parte de un geomesh con vértices compartidos y se obtiene un geomesh sin vértices 
     
    143144                mSubMesh[i].mVertexBuffer->mVertexCount =       objmesh.mSubMesh[i].mVertexBuffer->mVertexCount; 
    144145                mSubMesh[i].mVertexBuffer->mVertexInfo  =       objmesh.mSubMesh[i].mVertexBuffer->mVertexInfo; 
     146                mSubMesh[i].mType       =       objmesh.mSubMesh[i].mType; 
    145147 
    146148                if (objmesh.mSubMesh[i].mSharedVertexBuffer && !copiados) 
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshStripifier.cpp

    r774 r826  
    4040        //      Sets the actual progress bar function. 
    4141        mUPB    =       NULL; 
     42 
     43        //      Initialize the leaves submesh index. 
     44        mSubMeshLeaves  =       -1; 
    4245} 
    4346 
     
    7578        float                                                   increment; 
    7679        float                                                   update; 
    77          
     80 
    7881        //      For each submesh. 
    7982        for (int        submesh =       0;      submesh < mGeoMesh->mSubMeshCount;      submesh++) 
    8083        { 
    81                 //      Gets the submesh. 
    82                 geosubmesh      =       &mGeoMesh->mSubMesh[submesh]; 
    83  
    84                 //      Free index vector. 
    85                 Indices.clear(); 
    86  
    87                 //      Progress bar increment. 
    88                 increment       =       20      /       mGeoMesh->mSubMeshCount; 
    89                 increment       =       increment       /       geosubmesh->mIndexCount; 
    90                 update          =       0.0; 
    91                  
    92                 //      For each index. 
    93                 for (int        index   =       0;      index   <       geosubmesh->mIndexCount;        index++) 
     84                //      If is not the Leaveas submesh. 
     85                if (submesh != mSubMeshLeaves) 
    9486                { 
    95                         //      Update progress bar. 
    96                         if (mUPB) 
     87 
     88                        //      Gets the submesh. 
     89                        geosubmesh      =       &mGeoMesh->mSubMesh[submesh]; 
     90 
     91                        //      Free index vector. 
     92                        Indices.clear(); 
     93 
     94                        //      Progress bar increment. 
     95                        increment       =       20      /       mGeoMesh->mSubMeshCount; 
     96                        increment       =       increment       /       geosubmesh->mIndexCount; 
     97                        update          =       0.0; 
     98 
     99                        //      For each index. 
     100                        for (int        index   =       0;      index   <       geosubmesh->mIndexCount;        index++) 
    97101                        { 
    98                                 update  =       update + increment; 
    99                                  
    100                                 if (update > 0.9) 
    101                                 { 
    102                                         mUPB(1.0); 
    103                                          
    104                                         update  =       0; 
    105                                 } 
     102                                //      Update progress bar. 
     103                                if (mUPB) 
     104                                { 
     105                                        update  =       update + increment; 
     106 
     107                                        if (update > 0.9) 
     108                                        { 
     109                                                mUPB(1.0); 
     110 
     111                                                update  =       0; 
     112                                        } 
     113                                } 
     114 
     115                                //      Add an index. 
     116                                Indices.push_back(geosubmesh->mIndex[index]); 
    106117                        } 
    107                          
    108                         //      Add an index. 
    109                         Indices.push_back(geosubmesh->mIndex[index]); 
    110                 } 
    111  
    112                 // we want to time the tri_stripper object destruction as well. 
    113                 tri_stripper TriStripper(Indices); 
    114  
    115                 //      Sets the progress bar function for stripper algorithm. 
    116                 TriStripper.SetProgressFunc(mUPB,60/mGeoMesh->mSubMeshCount); 
    117                  
    118                 TriStripper.SetMinStripSize(2); 
    119                 TriStripper.SetCacheSize(32); 
    120                 //TriStripper.SetBackwardSearch(false); 
    121  
    122                 TriStripper.Strip(&PrimitivesVector); 
    123  
    124                 //      Free submesh indices. 
    125                 delete  []      geosubmesh->mIndex; 
    126  
    127                 //      Initialize index count. 
    128                 geosubmesh->mIndexCount =       0; 
    129  
    130                 //      Initialize strip count. 
    131                 strip_count     =       0; 
    132                  
    133                 //      For each strip or triangle list. 
    134                 for (size_t i = 0; i < PrimitivesVector.size(); ++i) 
    135                 { 
    136                         if (PrimitivesVector[i].Type == TRIANGLE_STRIP) 
     118 
     119                        // we want to time the tri_stripper object destruction as well. 
     120                        tri_stripper TriStripper(Indices); 
     121 
     122                        //      Sets the progress bar function for stripper algorithm. 
     123                        TriStripper.SetProgressFunc(mUPB,60/mGeoMesh->mSubMeshCount); 
     124 
     125                        TriStripper.SetMinStripSize(2); 
     126                        TriStripper.SetCacheSize(32); 
     127                        //TriStripper.SetBackwardSearch(false); 
     128 
     129                        TriStripper.Strip(&PrimitivesVector); 
     130 
     131                        //      Free submesh indices. 
     132                        delete  []      geosubmesh->mIndex; 
     133 
     134                        //      Initialize index count. 
     135                        geosubmesh->mIndexCount =       0; 
     136 
     137                        //      Initialize strip count. 
     138                        strip_count     =       0; 
     139 
     140                        //      For each strip or triangle list. 
     141                        for (size_t i = 0; i < PrimitivesVector.size(); ++i) 
    137142                        { 
    138                                 strip_count++; 
    139                                 geosubmesh->mIndexCount +=      PrimitivesVector[i].Indices.size(); 
    140  
    141                                 //      Degenerate triangles. 
    142                                 geosubmesh->mIndexCount +=      2; 
     143                                if (PrimitivesVector[i].Type == TRIANGLE_STRIP) 
     144                                { 
     145                                        strip_count++; 
     146                                        geosubmesh->mIndexCount +=      PrimitivesVector[i].Indices.size(); 
     147 
     148                                        //      Degenerate triangles. 
     149                                        geosubmesh->mIndexCount +=      2; 
     150                                } 
     151                                else 
     152                                { 
     153                                        strip_count += PrimitivesVector[i].Indices.size()/3; 
     154 
     155                                        geosubmesh->mIndexCount +=      PrimitivesVector[i].Indices.size(); 
     156 
     157                                        //      Degenerate triangles. 
     158                                        geosubmesh->mIndexCount +=      2*(PrimitivesVector[i].Indices.size()/3); 
     159                                } 
     160 
    143161                        } 
    144                         else 
     162 
     163                        //      Reserve memory for strips list. 
     164                        geosubmesh->mStrip                      =       new     Index*[strip_count]; 
     165                        geosubmesh->mStripCount =       strip_count; 
     166 
     167                        //      Adjust the index count. 
     168                        geosubmesh->mIndexCount -=      2; 
     169 
     170                        //      Reserve memory for indices. 
     171                        geosubmesh->mIndex      =       new     Index[geosubmesh->mIndexCount]; 
     172 
     173                        //      Initialize index count. 
     174                        index_count     =       0; 
     175 
     176                        //      For each strip. 
     177                        for (size_t     strip   =       0; strip < PrimitivesVector.size();     strip++) 
    145178                        { 
    146                                 strip_count += PrimitivesVector[i].Indices.size()/3; 
    147                                  
    148                                 geosubmesh->mIndexCount +=      PrimitivesVector[i].Indices.size(); 
    149  
    150                                 //      Degenerate triangles. 
    151                                 geosubmesh->mIndexCount +=      2*(PrimitivesVector[i].Indices.size()/3); 
    152                         } 
    153                  
    154                 } 
    155  
    156                 //      Reserve memory for strips list. 
    157                 geosubmesh->mStrip                      =       new     Index*[strip_count]; 
    158                 geosubmesh->mStripCount =       strip_count; 
    159  
    160                 //      Adjust the index count. 
    161                 geosubmesh->mIndexCount -=      2; 
    162                  
    163                 //      Reserve memory for indices. 
    164                 geosubmesh->mIndex      =       new     Index[geosubmesh->mIndexCount]; 
    165  
    166                 //      Initialize index count. 
    167                 index_count     =       0; 
    168  
    169                 //      For each strip. 
    170                 for (size_t     strip   =       0; strip < PrimitivesVector.size();     strip++) 
    171                 { 
    172                         if (PrimitivesVector[strip].Type == TRIANGLE_STRIP) 
    173                         { 
    174                                 //      Asigns the beginning of the strip. 
    175                                 geosubmesh->mStrip[strip]       =       &geosubmesh->mIndex[index_count]; 
    176  
    177                                 //      If is not the first strip. 
    178                                 if (strip       != 0) 
    179                                 { 
    180                                         geosubmesh->mIndex[index_count++]       = PrimitivesVector[strip].Indices[0]; 
    181                                 } 
    182                                  
    183                                 //      Fill up the index array. 
    184                                 for (   size_t  index   =       0; 
     179                                if (PrimitivesVector[strip].Type == TRIANGLE_STRIP) 
     180                                { 
     181                                        //      Asigns the beginning of the strip. 
     182                                        geosubmesh->mStrip[strip]       =       &geosubmesh->mIndex[index_count]; 
     183 
     184                                        //      If is not the first strip. 
     185                                        if (strip       != 0) 
     186                                        { 
     187                                                geosubmesh->mIndex[index_count++]       = PrimitivesVector[strip].Indices[0]; 
     188                                        } 
     189 
     190                                        //      Fill up the index array. 
     191                                        for (   size_t  index   =       0; 
    185192                                                        index < PrimitivesVector[strip].Indices.size(); 
    186193                                                        index++) 
    187                                 { 
    188                                         geosubmesh->mIndex[index + index_count] =       PrimitivesVector[strip].Indices[index]; 
    189                                 } 
    190  
    191                                 //      Adds the current strip size to index count. 
    192                                 index_count     +=      PrimitivesVector[strip].Indices.size(); 
    193  
    194                                 if ((strip + 1) != strip_count) 
    195                                 { 
    196                                         //      Degenerate triangle. 
    197                                         geosubmesh->mIndex[index_count++]       =       geosubmesh->mIndex[index_count - 1]; 
    198                                 } 
    199                         } 
    200                         else 
    201                         { 
    202                                 //      For each index. 
    203                                 for (   size_t  itri    =       0; 
     194                                        { 
     195                                                geosubmesh->mIndex[index + index_count] =       PrimitivesVector[strip].Indices[index]; 
     196                                        } 
     197 
     198                                        //      Adds the current strip size to index count. 
     199                                        index_count     +=      PrimitivesVector[strip].Indices.size(); 
     200 
     201                                        if ((strip + 1) != strip_count) 
     202                                        { 
     203                                                //      Degenerate triangle. 
     204                                                geosubmesh->mIndex[index_count++]       =       geosubmesh->mIndex[index_count - 1]; 
     205                                        } 
     206                                } 
     207                                else 
     208                                { 
     209                                        //      For each index. 
     210                                        for (   size_t  itri    =       0; 
    204211                                                        itri    <       PrimitivesVector[strip].Indices.size() / 3; 
    205212                                                        itri ++) 
    206                                 { 
     213                                        { 
    207214                                                //      Asigns the beginning of the strip. 
    208215                                                geosubmesh->mStrip[strip + itri]        =       &geosubmesh->mIndex[index_count]; 
    209216 
    210217                                                //      Degenerate triangle. 
    211                                           geosubmesh->mIndex[index_count++]     =       PrimitivesVector[strip].Indices[itri*3+0]; 
     218                                                geosubmesh->mIndex[index_count++]       =       PrimitivesVector[strip].Indices[itri*3+0]; 
    212219 
    213220                                                //      Triangle indeces. 
     
    221228                                                        geosubmesh->mIndex[index_count++]       =       geosubmesh->mIndex[index_count - 1]; 
    222229                                                } 
    223                                 } 
    224                                  
     230                                        } 
     231 
     232                                } 
    225233                        } 
     234 
     235                        //      Sets the actual submesh type to triangle strips. 
     236                        geosubmesh->mType       =       GEO_TRIANGLE_STRIPS; 
     237 
    226238                } 
    227239        } 
     
    232244                mUPB(100); 
    233245        } 
    234          
    235         //      Sets the mesh type to triangle strips. 
    236         mGeoMesh->mType =       GEO_TRIANGLE_STRIPS; 
     246 
    237247 
    238248        //      All wright. 
     
    251261} 
    252262 
     263// Sets what is the submesh that stores the leaves. 
     264void CustomStripifier::SetSubMeshLeaves(size_t  submesh) 
     265{ 
     266        mSubMeshLeaves  =       submesh; 
     267} 
     268 
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoSubMesh.cpp

    r774 r826  
    44 
    55SubMesh::SubMesh(): 
    6         mIndex(0), mVertexBuffer(0), mIndexCount(0),mSharedVertexBuffer(false), mStrip(0), mStripCount(0) 
     6        mIndex(0), mVertexBuffer(0), mIndexCount(0),mSharedVertexBuffer(false), mStrip(0), mStripCount(0), mType(GEO_TRIANGLE_LIST) 
    77{ 
    88} 
  • GTP/trunk/Lib/Geom/shared/GeoTool

    • Property svn:ignore set to
      build
  • GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshLoader.h

    r774 r826  
    166166 
    167167                        //      Writes the strips list. 
    168                         Mesh* GeoMeshLoader::BuildStripsGeoSubMesh(Mesh* geoMesh); 
     168                        SubMesh* GeoMeshLoader::BuildStripsGeoSubMesh(SubMesh* geoSubMesh); 
    169169                         
    170170                public: 
  • GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshView.h

    r820 r826  
    203203        //      Paint the mesh object. 
    204204        void    drawGeoMesh(int selectedMesh); 
    205         void    drawTriangleList(int selectedMesh); 
    206         void    drawTriangleStrip(); 
     205        void    drawTriangleList(int submesh, bool selectedMesh); 
     206        void    drawTriangleStrip(int submesh); 
    207207        void    drawLodStrip(); 
    208208        void    enableColorStrips(); 
     
    236236        }; 
    237237 
    238         ColorElement    *mStripColors; 
    239  
     238        ColorElement    **mStripColors; 
     239        int                                             mStripColorsCount; 
     240         
    240241        //      Idetifier of Visualization List. 
    241242        GLuint  mIdVisualList; 
  • GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp

    r774 r826  
    374374 
    375375//      Read a submesh operation. 
    376 void GeoMeshLoader::readSubMeshOperation(FILE   *f, Mesh        *geoMesh, int option) 
     376void GeoMeshLoader::readSubMeshOperation(       FILE    *f, 
     377                                                                                                                                                                        Mesh    *geoMesh, 
     378                                                                                                                                                                        int     option) 
    377379{ 
    378380        unsigned        short   opType; 
     
    384386                if (opType == 5) 
    385387                { 
    386                         geoMesh->mType  =       GEO_TRIANGLE_STRIPS; 
     388                        geoMesh->mSubMesh[currentSubMesh].mType =       GEO_TRIANGLE_STRIPS; 
    387389                } 
    388390                else 
    389391                { 
    390                         geoMesh->mType  =       GEO_TRIANGLE_LIST; 
     392                        geoMesh->mSubMesh[currentSubMesh].mType =       GEO_TRIANGLE_LIST; 
    391393                } 
    392394        } 
     
    545547                                                                 
    546548                                        cout<<"M_SUBMESH_OPERATION\n"; 
     549 
    547550                                        readSubMeshOperation(f, geoMesh, option); 
     551                                         
    548552                                        break; 
    549553                                case M_SUBMESH_BONE_ASSIGNMENT: 
     
    761765                Allocate memory to the array of strips 
    762766*/ 
    763 Mesh* GeoMeshLoader::BuildStripsGeoSubMesh(Mesh* geoMesh) 
     767SubMesh* GeoMeshLoader::BuildStripsGeoSubMesh(SubMesh* geoSubMesh) 
    764768{ 
    765769        bool            head_found; 
     
    768772        int                     tailIndex; 
    769773        size_t  tail; 
    770         SubMesh *geoSubMesh; 
    771  
    772         //      For each submesh. 
    773         for (int submesh        =       0; submesh < geoMesh->mSubMeshCount; submesh++) 
    774         { 
    775                 //      Gets the actual submesh. 
    776                 geoSubMesh      =       &geoMesh->mSubMesh[submesh]; 
    777                  
    778                 head_found                                                      =       false; 
    779                 tail_found                                                      =       false; 
    780                 geoSubMesh->mStripCount =       1; 
    781          
    782                 //      Foreachone of the indices. 
    783                 //      Obtains the number of triangle strips. 
    784                 for (int i = 0; i < (geoSubMesh->mIndexCount - 1); i++) 
    785                 { 
    786                         if (geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i+1]) 
    787                         { 
    788                                 if (head_found) 
    789                                   { 
    790                                         tail_found      =       true; 
     774 
     775 
     776        head_found                                                      =       false; 
     777        tail_found                                                      =       false; 
     778        geoSubMesh->mStripCount =       1; 
     779 
     780        //      Foreachone of the indices. 
     781        //      Obtains the number of triangle strips. 
     782        for (int i = 0; i < (geoSubMesh->mIndexCount - 1); i++) 
     783        { 
     784                if (geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i+1]) 
     785                { 
     786                        if (head_found) 
     787                        { 
     788                                tail_found      =       true; 
     789                        } 
     790                        else 
     791                        { 
     792                                head_found      =       true; 
     793                        } 
     794 
     795                        //      Jump one index. 
     796                        i++; 
     797                } 
     798                else 
     799                { 
     800                        //      Increments the number of triangle strips. 
     801                        if (tail_found) 
     802                        { 
     803                                geoSubMesh->mStripCount++; 
     804                        } 
     805 
     806                        head_found      =       false; 
     807                        tail_found      =       false; 
     808                } 
     809        } 
     810 
     811        geoSubMesh->mStrip              =       (Index**) malloc(       sizeof(Index*) 
     812                        * 
     813                        geoSubMesh->mStripCount); 
     814 
     815        //      Number of strips. Initially there is one triangle strip. 
     816        strip_count     =       1; 
     817 
     818        head_found                                              =       false; 
     819        tail_found                                              =       false; 
     820 
     821        //      Initialize the fist triangle strip. 
     822        geoSubMesh->mStrip[0]   =       &geoSubMesh->mIndex[0]; 
     823 
     824        //      Foreachone of the indices. 
     825        //      Assigns the beginning of the triangle strips. 
     826        for(int i = 0;i < (geoSubMesh->mIndexCount - 1); i++) 
     827        { 
     828                if(geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i+1]) 
     829                { 
     830                        if(head_found) 
     831                        { 
     832                                if (!tail_found) 
     833                                { 
     834                                        tailIndex               =       i; 
    791835                                } 
    792                                 else 
    793                                 { 
    794                                         head_found      =       true; 
    795                                 } 
    796  
    797                                 //      Jump one index. 
    798                                 i++; 
     836 
     837                                tail_found      =       true; 
    799838                        } 
    800839                        else 
    801840                        { 
    802                                 //      Increments the number of triangle strips. 
    803                                 if (tail_found) 
    804                                 { 
    805                                         geoSubMesh->mStripCount++; 
    806                                 } 
    807  
    808                                 head_found      =       false; 
    809                                 tail_found      =       false; 
    810                         } 
    811                 } 
    812  
    813                 geoSubMesh->mStrip              =       (Index**) malloc(       sizeof(Index*) 
    814                                                                                                                                                                                         * 
    815                                                                                                                                                                                         geoSubMesh->mStripCount); 
    816  
    817                 //      Number of strips. Initially there is one triangle strip. 
    818                 strip_count     =       1; 
    819  
    820                 head_found                                              =       false; 
    821                 tail_found                                              =       false; 
    822  
    823                 //      Initialize the fist triangle strip. 
    824                 geoSubMesh->mStrip[0]   =       &geoSubMesh->mIndex[0]; 
    825  
    826                 //      Foreachone of the indices. 
    827                 //      Assigns the beginning of the triangle strips. 
    828                 for(int i = 0;i < (geoSubMesh->mIndexCount - 1); i++) 
    829                 { 
    830                         if(geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i+1]) 
    831                         { 
    832                                 if(head_found) 
    833                                 { 
    834                                         if (!tail_found) 
    835                                         { 
    836                                                 tailIndex               =       i; 
    837                                         } 
    838  
    839                                         tail_found      =       true; 
    840                                 } 
    841                                 else 
    842                                 { 
    843                                         head_found      =       true; 
    844                                 } 
    845  
    846                                 //      Jump one index. 
    847                                 i++; 
    848                         } 
    849                         else 
    850                         { 
    851                                 //      Increments the number of triangle strips. 
    852                                 if(tail_found) 
    853                                 { 
    854                                         geoSubMesh->mStrip[strip_count++]       =       &geoSubMesh->mIndex[tailIndex]; 
    855                                 } 
    856  
    857                                 head_found      =       false; 
    858                                 tail_found      =       false; 
    859                         } 
    860                 } 
    861         } 
    862  
    863         return  geoMesh; 
     841                                head_found      =       true; 
     842                        } 
     843 
     844                        //      Jump one index. 
     845                        i++; 
     846                } 
     847                else 
     848                { 
     849                        //      Increments the number of triangle strips. 
     850                        if(tail_found) 
     851                        { 
     852                                geoSubMesh->mStrip[strip_count++]       =       &geoSubMesh->mIndex[tailIndex]; 
     853                        } 
     854 
     855                        head_found      =       false; 
     856                        tail_found      =       false; 
     857                } 
     858        } 
     859 
     860        return  geoSubMesh; 
    864861} 
    865862 
     
    873870        FILE                                            *salida; 
    874871        FILE                                            *pFile; 
     872        SubMesh                                 *geosubmesh; 
    875873 
    876874        //      Initialize the current submesh; 
     
    971969        fclose(pFile); 
    972970         
    973         if (geoMesh->mType == Geometry::GEO_TRIANGLE_STRIPS) 
    974         { 
    975                 //      Fill the strips list. 
    976                 geoMesh =       BuildStripsGeoSubMesh(geoMesh); 
     971        for (int submesh = 0;   submesh < geoMesh->mSubMeshCount; submesh++) 
     972        { 
     973                //      Gets the actual submesh. 
     974                geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
     975                 
     976                if (geosubmesh->mType == Geometry::GEO_TRIANGLE_STRIPS) 
     977                { 
     978                        //      Fill the strips list. 
     979                        geosubmesh      =       BuildStripsGeoSubMesh(geosubmesh); 
     980                } 
    977981        } 
    978982         
  • GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshSaver.cpp

    r774 r826  
    288288 
    289289        //      If the mesh is in triangle strips. 
    290         if (mGeoMesh->mType     ==      GEO_TRIANGLE_STRIPS) 
     290        if (geoSubMesh->mType   ==      GEO_TRIANGLE_STRIPS) 
    291291        { 
    292292                opType  =       5; 
  • GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp

    r774 r826  
    225225void    GeoMeshView::setStripColors() 
    226226{ 
    227         int     total_strips; 
    228  
    229         total_strips    =       0; 
    230          
    231         //      Delete previous color strips. 
     227        SubMesh *geosubmesh; 
     228         
     229        //      Free memory of the strip colors array. 
     230        for (int submesh = 0; submesh < mStripColorsCount; submesh++) 
     231        { 
     232                delete  []mStripColors[submesh]; 
     233        } 
     234         
    232235        delete  []mStripColors; 
     236         
     237        //      Initialize the Colors array. 
     238        mStripColors    =       new     ColorElement*[geoMesh->mSubMeshCount]; 
    233239 
    234240        //      Count the total number of strips y the submeshes. 
    235         for (int i = 0; i < geoMesh->mSubMeshCount; i++) 
    236         { 
    237                 total_strips    =       total_strips + geoMesh->mSubMesh[i].mStripCount; 
    238         } 
    239  
    240         //      Initialize the Colors array. 
    241         mStripColors    =       new     ColorElement[total_strips]; 
     241        for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++) 
     242        { 
     243                //      Gets the actual submesh. 
     244                geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
     245                 
     246                if (geosubmesh->mType   == GEO_TRIANGLE_STRIPS) 
     247                { 
     248                        mStripColors[submesh]   =       new ColorElement[geosubmesh->mStripCount]; 
     249                } 
     250                else 
     251                { 
     252                        mStripColors[submesh]   =       NULL; 
     253                } 
     254        } 
     255 
    242256         
    243257        //      Sets random colors to each strip. 
    244         for (int i      = 0; i < total_strips; i++) 
    245         { 
    246                 mStripColors[i].r       =       rand()/((float)RAND_MAX); 
    247                 mStripColors[i].g       =       rand()/((float)RAND_MAX); 
    248                 mStripColors[i].b       =       rand()/((float)RAND_MAX); 
    249         } 
     258        for (int submesh        = 0; submesh < geoMesh->mSubMeshCount; submesh++) 
     259        { 
     260                //      Gets the actual submesh. 
     261                geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
     262 
     263                if (geosubmesh->mType   == GEO_TRIANGLE_STRIPS) 
     264                { 
     265                        for     (int strip = 0; strip   <       geosubmesh->mStripCount; strip++) 
     266                        { 
     267                                mStripColors[submesh][strip].r  =       rand()/((float)RAND_MAX); 
     268                                mStripColors[submesh][strip].g  =       rand()/((float)RAND_MAX); 
     269                                mStripColors[submesh][strip].b  =       rand()/((float)RAND_MAX); 
     270                        } 
     271                } 
     272        } 
     273 
     274        //      Sets the submesh count. 
     275        mStripColorsCount       =       geoMesh->mSubMeshCount; 
    250276} 
    251277 
     
    371397            : fltk::GlWindow(x,y,w,h,l) 
    372398{ 
    373                 mStripColors            =       NULL; 
    374                 mSharedPosArray =       NULL; 
    375                 mSharedNorArray =       NULL; 
    376                 mPosArray                               =       NULL; 
    377                 mNorArray                               =       NULL; 
    378                 mIndexArray                     =       NULL; 
    379     vAng                                                = 0.0; 
    380                 hAng                                            =       0.0; 
    381                 size                                            =       0.0; 
    382                 mSizeY                                  =       0; 
    383                 xshift                                  =       0.0; 
    384                 yshift                                  =       0.0; 
    385                 geoMesh                                 =       0; 
    386                 mRotate                                 =       true; 
    387                 mPan                                            =       false; 
    388                 mLodStrip                               =       false; 
    389                 mIdVisualList           =       0; 
    390                 mSubMeshCount           =       0; 
     399                mStripColors                    =       NULL; 
     400                mSharedPosArray         =       NULL; 
     401                mSharedNorArray         =       NULL; 
     402                mPosArray                                       =       NULL; 
     403                mNorArray                                       =       NULL; 
     404                mIndexArray                             =       NULL; 
     405    vAng                                                        = 0.0; 
     406                hAng                                                    =       0.0; 
     407                size                                                    =       0.0; 
     408                mSizeY                                          =       0; 
     409                xshift                                          =       0.0; 
     410                yshift                                          =       0.0; 
     411                geoMesh                                         =       0; 
     412                mRotate                                         =       true; 
     413                mPan                                                    =       false; 
     414                mLodStrip                                       =       false; 
     415                mIdVisualList                   =       0; 
     416                mSubMeshCount                   =       0; 
     417                mStripColorsCount       =       0; 
    391418                 
    392419                //      Initialize the model view. 
     
    522549 
    523550        }//     End for each submesh. 
    524          
     551 
     552        mSubMeshCount   =       geoMesh->mSubMeshCount; 
    525553} 
    526554 
     
    549577void GeoMeshView::drawGeoMesh(int selectedMesh) 
    550578{ 
     579        SubMesh *geosubmesh; 
     580        bool            submesh_selected; 
     581         
    551582        if (geoMesh) 
    552583        { 
     
    555586                        drawLodStrip(); 
    556587                } 
     588                else 
     589                { 
     590                        for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++) 
     591                        { 
     592                                //      Gets the actual submesh. 
     593                                geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
     594                                 
     595                                if (geosubmesh->mType   ==      GEO_TRIANGLE_LIST) 
     596                                { 
     597                                        if (selectedMesh == submesh) 
     598                                        { 
     599                                                submesh_selected        = true; 
     600                                        } 
     601                                        else 
     602                                        { 
     603                                                submesh_selected        =       false; 
     604                                        } 
     605                                         
     606                                        //      Draw the actual submesh in triangle list. 
     607                                        drawTriangleList(submesh,submesh_selected); 
     608                                } 
     609                                else 
     610                                { 
     611                                        //      Draw the actual submesh in triangle strip. 
     612                                        drawTriangleStrip(submesh); 
     613                                } 
     614                        }                
     615                } 
     616                /* 
    557617                //      Choose the render operation. 
    558618                else if (geoMesh->mType == GEO_TRIANGLE_LIST) 
     
    566626                        drawTriangleStrip(); 
    567627                } 
     628                */ 
    568629        } 
    569630}//     End drawGeoMesh. 
     
    572633//      Paint eah strip separately. 
    573634//--------------------------------------------------------------------------- 
    574 void GeoMeshView::drawTriangleStrip() 
     635void GeoMeshView::drawTriangleStrip(int submesh) 
    575636{ 
    576637        SubMesh                         *geosubmesh; 
     
    586647        color_index     =       0; 
    587648 
    588         //      For each submesh. 
    589         for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++) 
    590         { 
    591                 //      Gets the actual submesh. 
    592                 geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
    593  
    594                 //      For each one of the strips. 
    595                 for (int strip = 0; strip < geosubmesh->mStripCount; strip++) 
    596                 { 
    597                         //      Paint the current strip. 
    598                         glBegin(GL_TRIANGLE_STRIP); 
    599                          
    600                         //      First index of the strip. 
    601                         indexBegin      =       geosubmesh->mStrip[strip]; 
    602  
    603                         //      If the strips is not the first. 
    604                         //if (strip != 0) 
    605                         //{ 
    606                         //      indexBegin++; 
    607                         //} 
    608  
    609                         //      If is the final strip 
    610                         if (strip       == (geosubmesh->mStripCount - 1)) 
    611                         { 
    612                                 //      The end of the index array. 
    613                                 indexEnd        = &geosubmesh->mIndex[geosubmesh->mIndexCount]; 
    614                         } 
    615                         else 
    616                         { 
    617                                 //      The beginning of the next strip. 
    618                                 indexEnd        = geosubmesh->mStrip[strip + 1]; 
    619  
    620                                 //      Remove degenerated 
    621                                 //indexEnd--; 
    622                         } 
    623                          
    624                         int i; 
    625                         i       = 0; 
    626  
    627                         if (getColorStrips()) 
    628                         { 
    629                                 //      Gets the color of the strip. 
    630                                 r       =       mStripColors[color_index].r; 
    631                                 g       =       mStripColors[color_index].g; 
    632                                 b       =       mStripColors[color_index].b; 
    633                          
    634                                 //      Change to the next color. 
    635                                 color_index++; 
    636                          
    637                                 //      Paint a new color. 
    638                                 glColor3f(r,g,b); 
    639                         } 
    640  
    641                         //      For each index of the strip. 
    642                         for (index = indexBegin; index < indexEnd; index++) 
    643                         { 
    644                                 position        =       indexBegin[i]; 
    645  
    646                                 //      Gets the vertex normal. 
    647                                 vector3 =       geosubmesh->mVertexBuffer->mNormal[position]; 
    648  
    649                                 x                               =       vector3[0]; 
    650                                 y                               =       vector3[1]; 
    651                                 z                               =       vector3[2]; 
    652                                  
    653                                 //      Sets the vertex normal. 
    654                                 glNormal3f(x,y,z); 
    655                                  
    656                                 //      Gets the vertex coordinates. 
    657                                 vector3 =       geosubmesh->mVertexBuffer->mPosition[position]; 
    658                                  
    659                                 x                               =       vector3[0]; 
    660                                 y                               =       vector3[1]; 
    661                                 z                               =       vector3[2]; 
    662                                  
    663  
    664                                 //      Sets the vertex position. 
    665                                 glVertex3f(x,y,z); 
    666                                  
    667                                 //      Increments i. 
    668                                 i++; 
    669                         } 
    670                          
    671                         glEnd(); 
    672  
    673                 } 
    674         } 
    675          
     649        //      Gets the actual submesh. 
     650        geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
     651 
     652        //      For each one of the strips. 
     653        for (int strip = 0; strip < geosubmesh->mStripCount; strip++) 
     654        { 
     655                //      Paint the current strip. 
     656                glBegin(GL_TRIANGLE_STRIP); 
     657 
     658                //      First index of the strip. 
     659                indexBegin      =       geosubmesh->mStrip[strip]; 
     660 
     661                //      If the strips is not the first. 
     662                //if (strip != 0) 
     663                //{ 
     664                //      indexBegin++; 
     665                //} 
     666 
     667                //      If is the final strip 
     668                if (strip       == (geosubmesh->mStripCount - 1)) 
     669                { 
     670                        //      The end of the index array. 
     671                        indexEnd        = &geosubmesh->mIndex[geosubmesh->mIndexCount]; 
     672                } 
     673                else 
     674                { 
     675                        //      The beginning of the next strip. 
     676                        indexEnd        = geosubmesh->mStrip[strip + 1]; 
     677 
     678                        //      Remove degenerated 
     679                        //indexEnd--; 
     680                } 
     681 
     682                int i; 
     683                i       = 0; 
     684 
     685                if (getColorStrips()) 
     686                { 
     687                        //      Gets the color of the strip. 
     688                        r       =       mStripColors[submesh][color_index].r; 
     689                        g       =       mStripColors[submesh][color_index].g; 
     690                        b       =       mStripColors[submesh][color_index].b; 
     691 
     692                        //      Change to the next color. 
     693                        color_index++; 
     694 
     695                        //      Paint a new color. 
     696                        glColor3f(r,g,b); 
     697                } 
     698 
     699                //      For each index of the strip. 
     700                for (index = indexBegin; index < indexEnd; index++) 
     701                { 
     702                        position        =       indexBegin[i]; 
     703 
     704                        //      Gets the vertex normal. 
     705                        vector3 =       geosubmesh->mVertexBuffer->mNormal[position]; 
     706 
     707                        x                               =       vector3[0]; 
     708                        y                               =       vector3[1]; 
     709                        z                               =       vector3[2]; 
     710 
     711                        //      Sets the vertex normal. 
     712                        glNormal3f(x,y,z); 
     713 
     714                        //      Gets the vertex coordinates. 
     715                        vector3 =       geosubmesh->mVertexBuffer->mPosition[position]; 
     716 
     717                        x                               =       vector3[0]; 
     718                        y                               =       vector3[1]; 
     719                        z                               =       vector3[2]; 
     720 
     721 
     722                        //      Sets the vertex position. 
     723                        glVertex3f(x,y,z); 
     724 
     725                        //      Increments i. 
     726                        i++; 
     727                } 
     728 
     729                glEnd(); 
     730 
     731        } 
     732 
    676733}//End drawTriangleStrip. 
    677734 
     
    679736//      Paint the array of idices. 
    680737//--------------------------------------------------------------------------- 
    681 void GeoMeshView::drawTriangleList(int selectedMesh) 
     738void GeoMeshView::drawTriangleList(     int                     submesh, 
     739                                                                                                                                                bool            selectedSubMesh) 
    682740{ 
    683741        SubMesh *geosubmesh; 
     
    693751        //      Vertex offset. 
    694752        vrt_offset      =       0; 
    695          
    696         //      For each submesh. 
    697         for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++) 
    698         { 
    699                 //      Gets the actual submesh. 
    700                 geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
    701  
    702                 //      If a mesh is selected. 
    703                 if (selectedMesh >= 0) 
    704                 { 
    705                         //      If is a tree. 
    706                         if (leavesSubmesh >= 0) 
    707                         { 
    708                                 glColor3d(1.0, 0.5, 0.5); 
    709                                 GLfloat color_blanco[]  =       {1.0f,0.5f,0.5f,1.0f}; 
    710                                 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco); 
    711  
    712                                 //      For each index of the strip. 
    713                                 if (submesh == leavesSubmesh) 
    714                                 { 
    715                                         glColor3d(0.0,1.0,0.0); 
    716                                         GLfloat color_rojo[]    =       {0.0f,1.0f,0.0f,1.0f}; 
    717                                         glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_rojo); 
    718                                 } 
    719                         } 
    720                         //      If is NOT a tree. 
    721                         else 
    722                         { 
    723                                 //      Set white color to the object. 
    724                                 glColor3d(1.0, 1.0, 1.0); 
    725                                 GLfloat color_blanco[]  =       {1.0f,1.0f,1.0f,1.0f}; 
    726                                 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco); 
    727                         } 
    728  
    729                         //      For each index of the strip. 
    730                         if (submesh == selectedMesh) 
    731                         { 
    732                                 glColor3d(1.0,0.0,0.0); 
    733                                 GLfloat color_rojo[]    =       {1.0f,0.0f,0.0f,1.0f}; 
    734                                 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_rojo); 
    735                         } 
    736                 } 
    737                 else 
    738                 { 
    739                         //      If is a tree. 
    740                         if (leavesSubmesh >= 0) 
    741                         { 
    742                                 glColor3d(1.0, 0.5, 0.5); 
    743                                 GLfloat color_blanco[]  =       {1.0f,0.5f,0.5f,1.0f}; 
    744                                 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco); 
    745  
    746                                 //      For each index of the strip. 
    747                                 if (submesh == leavesSubmesh) 
    748                                 { 
    749                                         glColor3d(0.0,1.0,0.0); 
    750                                         GLfloat color_rojo[]    =       {0.0f,1.0f,0.0f,1.0f}; 
    751                                         glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_rojo); 
    752                                 } 
    753                         } 
    754                 } 
    755                  
    756                 //      Enable arrays. 
    757                 glEnableClientState(GL_VERTEX_ARRAY); 
    758                 glEnableClientState(GL_NORMAL_ARRAY); 
    759  
    760                 //      If the submesh is shared vertex. 
    761                 if (geosubmesh->mSharedVertexBuffer) 
    762                 { 
    763                         glVertexPointer(3, GL_FLOAT, 0, mSharedPosArray); 
    764                         glNormalPointer(GL_FLOAT, 0, mSharedNorArray); 
    765                 } 
    766                 else 
    767                 { 
    768                         glVertexPointer(3, GL_FLOAT, 0, mPosArray[submesh]); 
    769                         glNormalPointer(GL_FLOAT, 0, mNorArray[submesh]); 
    770                 } 
    771  
    772                 glDrawElements( GL_TRIANGLES, 
    773                                                                                 geosubmesh->mIndexCount, 
    774                                                                                 GL_UNSIGNED_INT, 
    775                                                                                 mIndexArray[submesh]); 
    776         } 
     753 
     754        //      Gets the actual submesh. 
     755        geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
     756         
     757        //      If a mesh is selected. 
     758        if (selectedSubMesh) 
     759        { 
     760                glColor3d(1.0,0.0,0.0); 
     761                GLfloat red[]   =       {1.0f,0.0f,0.0f,1.0f}; 
     762                glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,red); 
     763        } 
     764        //      If is a tree. 
     765        else if (leavesSubmesh >= 0) 
     766        { 
     767                glColor3d(1.0, 0.5, 0.5); 
     768                GLfloat brown[] =       {1.0f,0.5f,0.5f,1.0f}; 
     769                glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,brown); 
     770 
     771                //      For each index of the strip. 
     772                if (submesh == leavesSubmesh) 
     773                { 
     774                        glColor3d(0.0,1.0,0.0); 
     775                        GLfloat green[] =       {0.0f,1.0f,0.0f,1.0f}; 
     776                        glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,green); 
     777                } 
     778        } 
     779        //      If is NOT a tree. 
     780        else 
     781        { 
     782                //      Set white color to the object. 
     783                glColor3d(1.0, 1.0, 1.0); 
     784                GLfloat white[] =       {1.0f,1.0f,1.0f,1.0f}; 
     785                glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,white); 
     786        } 
     787 
     788 
     789        //      Enable arrays. 
     790        glEnableClientState(GL_VERTEX_ARRAY); 
     791        glEnableClientState(GL_NORMAL_ARRAY); 
     792 
     793        //      If the submesh is shared vertex. 
     794        if (geosubmesh->mSharedVertexBuffer) 
     795        { 
     796                glVertexPointer(3, GL_FLOAT, 0, mSharedPosArray); 
     797                glNormalPointer(GL_FLOAT, 0, mSharedNorArray); 
     798        } 
     799        else 
     800        { 
     801                glVertexPointer(3, GL_FLOAT, 0, mPosArray[submesh]); 
     802                glNormalPointer(GL_FLOAT, 0, mNorArray[submesh]); 
     803        } 
     804 
     805        glDrawElements( GL_TRIANGLES, 
     806                        geosubmesh->mIndexCount, 
     807                        GL_UNSIGNED_INT, 
     808                        mIndexArray[submesh]); 
    777809 
    778810}//End drawTriangleList 
     
    791823        int                                             current_strip; 
    792824 
    793         color_index     =       0; 
    794  
    795825        //      Initialize current strip. 
    796826        current_strip   =       0; 
    797                  
     827 
    798828        //      For each submesh. 
    799829        for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++) 
    800830        { 
     831                 
     832                color_index     =       0; 
     833 
    801834                //      Gets the actual submesh. 
    802835                geosubmesh      =       &geoMesh->mSubMesh[submesh]; 
     
    807840                        //      Paint the current strip. 
    808841                        glBegin(GL_TRIANGLE_STRIP); 
    809                                                  
     842 
    810843                        if (getColorStrips()) 
    811844                        { 
    812845                                //      Gets the color of the strip. 
    813                                 r       =       mStripColors[color_index].r; 
    814                                 g       =       mStripColors[color_index].g; 
    815                                 b       =       mStripColors[color_index].b; 
    816                          
     846                                r       =       mStripColors[submesh][color_index].r; 
     847                                g       =       mStripColors[submesh][color_index].g; 
     848                                b       =       mStripColors[submesh][color_index].b; 
     849 
    817850                                //      Change to the next color. 
    818851                                color_index++; 
    819                          
     852 
    820853                                //      Paint a new color. 
    821854                                glColor3f(r,g,b); 
     
    833866                                y                               =       vector3[1]; 
    834867                                z                               =       vector3[2]; 
    835                                  
     868 
    836869                                //      Sets the vertex normal. 
    837870                                glNormal3f(x,y,z); 
    838                                  
     871 
    839872                                //      Gets the vertex coordinates. 
    840873                                vector3 =       geosubmesh->mVertexBuffer->mPosition[position]; 
    841                                  
     874 
    842875                                x                               =       vector3[0]; 
    843876                                y                               =       vector3[1]; 
     
    847880                                glVertex3f(x,y,z); 
    848881                        } 
    849                          
     882 
    850883                        //      Increments current strip. 
    851884                        current_strip++; 
  • GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp

    r813 r826  
    14311431                        sprintf(cadena2, "Number of indexes: %d",mGeoMesh->mSubMesh[i].mIndexCount); 
    14321432                        fltk::Item *numberIndex = new fltk::Item(cadena2); 
    1433                         if (mGeoMesh->mType==Geometry::GEO_TRIANGLE_LIST) 
     1433                        if (mGeoMesh->mSubMesh[i].mType==Geometry::GEO_TRIANGLE_LIST) 
    14341434                        { 
    1435                                 fltk::Item *type = new fltk::Item("Triangle list"); 
     1435                                fltk::Item *type = new fltk::Item("Triangle List"); 
    14361436                        } 
    14371437                        else 
    14381438                        { 
    1439                                 fltk::Item *type = new fltk::Item("Triangle strips"); 
     1439                                fltk::Item *type = new fltk::Item("Triangle Strips"); 
    14401440                        } 
    14411441 
     
    17771777                geoStripifier->SetProgressFunc(progress_function); 
    17781778                 
     1779                //      Sets the leaves submesh if exists. 
     1780                geoStripifier->SetSubMeshLeaves(idMeshLeaves); 
     1781                 
    17791782                if (geoStripifier->Stripify()) 
    17801783                { 
     
    19961999 
    19972000                //      if the mesh is stripified. 
    1998                 if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS) 
    1999                 { 
    2000                         geoMeshView->setStripColors(); 
    2001                 } 
     2001                geoMeshView->setStripColors(); 
    20022002 
    20032003                //      Refresh geometry attributes. 
     
    23252325                                } 
    23262326 
    2327                                 //{ 
    2328                                 //      fltk::Item* o; 
    2329                                 //      o = menuSelectLeaves = new fltk::Item("Select leaves"); 
    2330                                 //      o->callback((fltk::Callback*)cb_menuSelectLeaves); 
    2331                                 //} 
     2327                                { 
     2328                                        fltk::Item* o; 
     2329                                        o = menuSelectLeaves = new fltk::Item("Select leaves"); 
     2330                                        o->callback((fltk::Callback*)cb_menuSelectLeaves); 
     2331                                } 
    23322332 
    23332333                                o->end(); 
     
    24142414                                } 
    24152415 
    2416                                 //{ 
    2417                                 //      fltk::Item* o; 
    2418                                 //      o = menuSimplifyLeavesCollapse = new fltk::Item("Leaves Simplification"); 
    2419                                 //      o->callback((fltk::Callback*)cb_menuSimplifyLeavesCollapse); 
    2420                                 //} 
     2416                                { 
     2417                                        fltk::Item* o; 
     2418                                        o = menuSimplifyLeavesCollapse = new fltk::Item("Leaves Simplification"); 
     2419                                        o->callback((fltk::Callback*)cb_menuSimplifyLeavesCollapse); 
     2420                                } 
    24212421 
    24222422                                o->end(); 
Note: See TracChangeset for help on using the changeset viewer.