Browse Source

improved array iteration

Kolja Strohm 2 years ago
parent
commit
0a68f8de76
26 changed files with 504 additions and 470 deletions
  1. 28 5
      Array.h
  2. 14 14
      Bildschirm.cpp
  3. 9 11
      Dialog.cpp
  4. 3 3
      Errors.cpp
  5. 1 1
      Errors.h
  6. 10 10
      Fenster.cpp
  7. 2 0
      Framework Linux.vcxproj
  8. 6 0
      Framework Linux.vcxproj.filters
  9. 46 46
      InitDatei.cpp
  10. 15 15
      JSON.cpp
  11. 1 1
      JSON.h
  12. 4 4
      KSGTDatei.cpp
  13. 87 86
      Liste.cpp
  14. 3 3
      M3Datei.cpp
  15. 0 1
      M3Datei.h
  16. 103 98
      Model2D.cpp
  17. 82 82
      Model3D.cpp
  18. 5 5
      Model3DList.cpp
  19. 3 3
      TextFeld.cpp
  20. 1 1
      Textur2D.cpp
  21. 7 7
      TexturList.cpp
  22. 1 1
      Thread.cpp
  23. 25 24
      ToolTip.cpp
  24. 8 8
      Welt2D.cpp
  25. 5 4
      Welt3D.cpp
  26. 35 37
      XML.cpp

+ 28 - 5
Array.h

@@ -110,6 +110,11 @@ namespace Framework
             return next != 0;
         }
 
+        TYP operator*()
+        {
+            return current->var;
+        }
+
         Iterator< TYP > next()
         {
             if( !current )
@@ -204,6 +209,11 @@ namespace Framework
                 throw std::out_of_range( (char *)err );
             }
         }
+
+        bool operator!=( Iterator< TYP > &r )
+        {
+            return current != r.current;
+        }
     };
 #define _ val()
 
@@ -213,7 +223,7 @@ namespace Framework
     {
     private:
         ArrayEintrag< TYP > *entries;
-        ArrayEintrag< TYP > *end;
+        ArrayEintrag< TYP > *last;
         int count;
 
     public:
@@ -224,7 +234,7 @@ namespace Framework
             entries = new ArrayEintrag< TYP >();
             entries->set = 0;
             entries->next = 0;
-            end = entries;
+            last = entries;
             count = 0;
         }
 
@@ -292,7 +302,7 @@ namespace Framework
         //! \param i Der Index des Eintrages der gesetzt werden soll
         void set( TYP t, int i )
         {
-            if( i < || i >= count )
+            if( i < 0 || i >= count )
                 throwOutOfRange( __FILE__, __LINE__, i, count );
             ArrayEintrag< TYP > *e = entries;
             for( int a = 0; a < i; ++a )
@@ -357,6 +367,7 @@ namespace Framework
                 e->set = e->next->set;
             }
             else
+#pragma warning( once : 28182 )
                 e->set = 0;
             ArrayEintrag< TYP > *del = e->next;
             if( e->next )
@@ -439,11 +450,16 @@ namespace Framework
 
         //! Gibt einen Iterator zurück.
         //! Mit ++ kann durch die Liste iteriert werden
-        Iterator< TYP > getIterator() const
+        Iterator< TYP > begin() const
         {
             return Iterator< TYP >( entries );
         }
 
+        Iterator< TYP > end() const
+        {
+            return Iterator< TYP >( 0 );
+        }
+
         //! Gibt zurück, wie viele Elemente in der Liste sind
         int getEintragAnzahl() const
         {
@@ -461,6 +477,7 @@ namespace Framework
             ArrayEintrag< TYP > *e = entries;
             for( int a = 0; a < i && e; ++a )
                 e = e->next;
+#pragma warning( once : 6011 )
             return e->var;
         }
 
@@ -653,6 +670,7 @@ namespace Framework
             }
             else
             {
+#pragma warning( once : 28182 )
                 if( e->set && e->var )
                     e->var->release();
                 e->set = 0;
@@ -708,11 +726,16 @@ namespace Framework
 
         //! Gibt einen Iterator zurück.
         //! Mit ++ kann durch die Liste iteriert werden
-        Iterator< TYP * > getIterator() const
+        Iterator< TYP * > begin() const
         {
             return Iterator< TYP * >( entries );
         }
 
+        Iterator< TYP * > end() const
+        {
+            return Iterator< TYP * >( 0 );
+        }
+
         //! Gibt zurück, wie viele Elemente in der Liste sind
         int getEintragAnzahl() const
         {

+ 14 - 14
Bildschirm.cpp

@@ -171,7 +171,7 @@ void Bildschirm::tick( double tickval )
     {
         for( int i = 0; i < tipAnzahl; ++i )
             rend |= tips->z( i )->tick( tickval );
-        for( auto i = members->getIterator(); i; i++ )
+        for( Zeichnung *i : *members )
             rend |= i->tick( tickval );
     }
     else if( onTop )
@@ -282,7 +282,7 @@ Bild *Bildschirm::zRenderBild() const
 
 Iterator<Zeichnung *> Bildschirm::getMembers() const // gibt die Zeichnunge zurück
 {
-    return members->getIterator();
+    return members->begin();
 }
 
 int Bildschirm::getFillFarbe() const // gibt die Füll Farbe zurück
@@ -394,14 +394,14 @@ void Bildschirm2D::render() // Zeichnet das Bild
             if( renderOnTop && deckFarbe && ( deckFarbe & ( fillColor | 0xFF000000 ) ) == deckFarbe )
             {
                 ui->setAlpha( 255 - (unsigned char)( deckFarbe >> 24 ) );
-                for( auto i = members->getIterator(); i; i++ )
-                    i->render( *ui ); // zeichnen nach zwischenbuffer
+                for( Zeichnung *z : *members )
+                    z->render( *ui ); // zeichnen nach zwischenbuffer
                 ui->releaseAlpha();
             }
             else
             {
-                for( auto i = members->getIterator(); i; i++ )
-                    i->render( *ui ); // zeichnen nach zwischenbuffer
+                for( Zeichnung *z : *members )
+                    z->render( *ui ); // zeichnen nach zwischenbuffer
                 if( renderOnTop && deckFarbe )
                     ui->alphaRegion( 0, 0, ui->getBreite(), ui->getHeight(), deckFarbe );
             }
@@ -482,8 +482,8 @@ void Bildschirm3D::tick( double tickval )
 {
     lock();
     __super::tick( tickval );
-    for( auto i = kameras->getIterator(); i; i++ )
-        rend3D |= i->tick( tickval );
+    for( Kam3D *k : *kameras )
+        rend3D |= k->tick( tickval );
     unlock();
 }
 
@@ -517,8 +517,8 @@ void Bildschirm3D::render() // Zeichnet das Bild
     if( rend3D || !testRend || rend )
     {
         // Render 3d Objects
-        for( auto i = kameras->getIterator(); i; i++ )
-            api->renderKamera( i._ );
+        for( Kam3D *k : *kameras )
+            api->renderKamera( k );
         rend3D = 0;
     }
     // render User Interface
@@ -530,14 +530,14 @@ void Bildschirm3D::render() // Zeichnet das Bild
             if( renderOnTop && deckFarbe && ( deckFarbe & ( fillColor | 0xFF000000 ) ) == deckFarbe )
             {
                 ui->setAlpha( 255 - (unsigned char)( deckFarbe >> 24 ) );
-                for( auto i = members->getIterator(); i; i++ )
-                    i->render( *ui ); // zeichnen nach zwischenbuffer
+                for( Zeichnung *z : *members )
+                    z->render( *ui ); // zeichnen nach zwischenbuffer
                 ui->releaseAlpha();
             }
             else
             {
-                for( auto i = members->getIterator(); i; i++ )
-                    i->render( *ui ); // zeichnen nach zwischenbuffer
+                for( Zeichnung *z : *members )
+                    z->render( *ui ); // zeichnen nach zwischenbuffer
                 if( renderOnTop && deckFarbe )
                     ui->alphaRegion( 0, 0, ui->getBreite(), ui->getHeight(), deckFarbe );
             }

+ 9 - 11
Dialog.cpp

@@ -40,23 +40,22 @@ void *MultiplChoiceDialog::anzeigen( Schrift *zSchrift )
     WNDCLASS wc = F_Normal( 0 );
     wc.lpszClassName = "Dialog";
     WFenster *f = new WFenster();
-    f->setVSchließAktion( [&ex]( void *p, void *o )
-    {
+    f->setVSchließAktion( [&ex]( void *p, void *o ) {
         ex = true;
     } );
     f->setMausAktion( _ret1ME );
     f->setTastaturAktion( _ret1TE );
     f->erstellen( WS_OVERLAPPEDWINDOW, wc );
     f->setSize( 200, 200 );
-    f->setPosition( Bildschirmmitte( dynamic_cast<WFenster *>( f->getThis() ) ) );
+    f->setPosition( Bildschirmmitte( dynamic_cast<WFenster *>(f->getThis()) ) );
     f->setVerschiebbar( 1 );
     f->setAnzeigeModus( 1 );
-    Bildschirm *b = new Bildschirm2D( dynamic_cast<WFenster *>( f->getThis() ) );
-    f->setBildschirm( dynamic_cast<Bildschirm *>( b->getThis() ) );
+    Bildschirm *b = new Bildschirm2D( dynamic_cast<WFenster *>(f->getThis()) );
+    f->setBildschirm( dynamic_cast<Bildschirm *>(b->getThis()) );
     b->update();
 
     RenderTh *r = new RenderTh();
-    r->setBildschirm( dynamic_cast<Bildschirm *>( b->getThis() ) );
+    r->setBildschirm( dynamic_cast<Bildschirm *>(b->getThis()) );
     r->beginn();
 
     AuswahlBox *ab = new AuswahlBox();
@@ -75,8 +74,8 @@ void *MultiplChoiceDialog::anzeigen( Schrift *zSchrift )
     ab->setAuswAlphaFeldFarbe( 0x0000FF00 );
     ab->setAuswAlphaFeldStrength( -8 );
     ab->setStyle( AuswahlBox::Style::Normal );
-    ab->setSchriftZ( dynamic_cast<Schrift *>( zSchrift->getThis() ) );
-    for( auto i = entrys->getIterator(); i; i++ )
+    ab->setSchriftZ( dynamic_cast<Schrift *>(zSchrift->getThis()) );
+    for( Text *i : *entrys )
         ab->addEintrag( i->getText() );
     ab->setMausEreignis( _ret1ME );
     b->addMember( ab );
@@ -85,10 +84,9 @@ void *MultiplChoiceDialog::anzeigen( Schrift *zSchrift )
     ok->setStyle( Knopf::Style::Normal );
     ok->setPosition( 50, 150 );
     ok->setSize( 100, 20 );
-    ok->setSchriftZ( dynamic_cast<Schrift *>( zSchrift->getThis() ) );
+    ok->setSchriftZ( dynamic_cast<Schrift *>(zSchrift->getThis()) );
     ok->setText( "Ok" );
-    ok->setMausEreignis( [this, &ex, &result, ab]( void *p, void *o, MausEreignis me )
-    {
+    ok->setMausEreignis( [this, &ex, &result, ab]( void *p, void *o, MausEreignis me ) {
         if( me.id == ME_RLinks )
         {
             result = ids->get( ab->getAuswahl() );

+ 3 - 3
Errors.cpp

@@ -2,12 +2,12 @@
 #include "Text.h"
 #include <stdexcept>
 
-void Framework::throwOutOfRange( const char *file, const char *line, int index, int count )
+void Framework::throwOutOfRange( const char *file, int line, int index, int count )
 {
     Framework::Text err = "Index out of Range Exception File: ";
-    err += __FILE__;
+    err += file;
     err += " Line: ";
-    err += __LINE__;
+    err += line;
     err += " Index: ";
     err += index;
     err += " Element count: ";

+ 1 - 1
Errors.h

@@ -4,5 +4,5 @@
 
 namespace Framework
 {
-    DLLEXPORT void throwOutOfRange( const char *file, const char *line, int index, int count );
+    DLLEXPORT void throwOutOfRange( const char *file, int line, int index, int count );
 };

+ 10 - 10
Fenster.cpp

@@ -976,7 +976,7 @@ bool WFensterArray::sendVSchlie
     }
     if( !next )
         return ret;
-    return ret | next->sendVSchließMessage( hwnd );
+    return ret || next->sendVSchließMessage( hwnd );
 }
 
 bool WFensterArray::sendNSchließMessage( HWND hwnd )
@@ -991,7 +991,7 @@ bool WFensterArray::sendNSchlie
     }
     if( !next )
         return ret;
-    return ret | next->sendNSchließMessage( hwnd );
+    return ret || next->sendNSchließMessage( hwnd );
 }
 
 bool WFensterArray::sendMausMessage( HWND hwnd, MausEreignis &me )
@@ -1006,7 +1006,7 @@ bool WFensterArray::sendMausMessage( HWND hwnd, MausEreignis &me )
     }
     if( !next )
         return ret;
-    return ret | next->sendMausMessage( hwnd, me );
+    return ret || next->sendMausMessage( hwnd, me );
 }
 
 bool WFensterArray::sendTastaturMessage( HWND hwnd, TastaturEreignis &te )
@@ -1021,7 +1021,7 @@ bool WFensterArray::sendTastaturMessage( HWND hwnd, TastaturEreignis &te )
     }
     if( !next )
         return ret;
-    return ret | next->sendTastaturMessage( hwnd, te );
+    return ret || next->sendTastaturMessage( hwnd, te );
 }
 
 bool WFensterArray::sendRestoreMessage( HWND hwnd )
@@ -1036,7 +1036,7 @@ bool WFensterArray::sendRestoreMessage( HWND hwnd )
     }
     if( !next )
         return ret;
-    return ret | next->sendRestoreMessage( hwnd );
+    return ret || next->sendRestoreMessage( hwnd );
 }
 
 WFenster *WFensterArray::getThis()
@@ -1861,12 +1861,12 @@ bool Fenster::tick( double tickval ) // tick
 {
     if( members && hatStyle( Style::Sichtbar ) )
     {
-        for( auto i = members->getIterator(); i; i++ )
+        for( Zeichnung* i : *members )
             rend |= i->tick( tickval );
     }
     else if( members )
     {
-        for( auto i = members->getIterator(); i; i++ )
+        for( Zeichnung *i : *members )
             i->tick( tickval );
     }
     if( vScroll && hatStyle( Style::VScroll ) )
@@ -2026,13 +2026,13 @@ void Fenster::render( Bild &zRObj ) // zeichent nach zRObj
         {
             if( !vSc && !hSc )
             {
-                for( auto i = members->getIterator(); i; i++ )
+                for( Zeichnung *i : *members )
                     i->render( zRObj );
             }
             else
             {
                 zRObj.addScrollOffset( hSc ? hScroll->getScroll() : 0, vSc ? vScroll->getScroll() : 0 );
-                for( auto i = members->getIterator(); i; i++ )
+                for( Zeichnung *i : *members )
                     i->render( zRObj );
             }
         }
@@ -2392,7 +2392,7 @@ Iterator<Zeichnung *> Fenster::getMembers() const // gibt die Members zur
 {
     if( !members )
         return Iterator<Zeichnung *>( 0 );
-    return members->getIterator();
+    return members->begin();
 }
 
 // -- Kopie --

+ 2 - 0
Framework Linux.vcxproj

@@ -119,6 +119,7 @@
     <ClCompile Include="Diagramm.cpp" />
     <ClCompile Include="DLLRegister.cpp" />
     <ClCompile Include="DXBuffer.cpp" />
+    <ClCompile Include="Errors.cpp" />
     <ClCompile Include="Fenster.cpp" />
     <ClCompile Include="Fortschritt.cpp" />
     <ClCompile Include="Global.cpp" />
@@ -185,6 +186,7 @@
     <ClInclude Include="DreieckListe.h" />
     <ClInclude Include="DXBuffer.h" />
     <ClInclude Include="Ebene3D.h" />
+    <ClInclude Include="Errors.h" />
     <ClInclude Include="Fenster.h" />
     <ClInclude Include="Fortschritt.h" />
     <ClInclude Include="FrameworkMath.h" />

+ 6 - 0
Framework Linux.vcxproj.filters

@@ -306,6 +306,9 @@
     <ClInclude Include="HashMap.h">
       <Filter>Headerdateien\Framework\Data</Filter>
     </ClInclude>
+    <ClInclude Include="Errors.h">
+      <Filter>Headerdateien\Framework</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Prozess.cpp">
@@ -485,5 +488,8 @@
     <ClCompile Include="RCPointer.h">
       <Filter>Headerdateien\Framework\Data</Filter>
     </ClCompile>
+    <ClCompile Include="Errors.cpp">
+      <Filter>Quelldateien\Framework</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 46 - 46
InitDatei.cpp

@@ -13,7 +13,7 @@ InitDatei::InitDatei()
     wert( new RCArray< Text >() )
 {}
 
-InitDatei::InitDatei( Text *pfad )
+InitDatei::InitDatei( Text* pfad )
     : ReferenceCounter(),
     pfad( new Text() ),
     name( new RCArray< Text >() ),
@@ -22,7 +22,7 @@ InitDatei::InitDatei( Text *pfad )
     setPfad( pfad );
 }
 
-InitDatei::InitDatei( const char *pfad )
+InitDatei::InitDatei( const char* pfad )
     : ReferenceCounter(),
     pfad( new Text() ),
     name( new RCArray< Text >() ),
@@ -40,19 +40,19 @@ InitDatei::~InitDatei()
 }
 
 // nicht constant
-void InitDatei::setPfad( Text *pfad )
+void InitDatei::setPfad( Text* pfad )
 {
     this->pfad->setText( pfad );
 }
 
-void InitDatei::setPfad( const char *pfad )
+void InitDatei::setPfad( const char* pfad )
 {
     this->pfad->setText( pfad );
 }
 
 bool InitDatei::laden()
 {
-    Datei *dat = new Datei();
+    Datei* dat = new Datei();
     dat->setDatei( pfad->getText() );
     if( !dat->open( Datei::Style::lesen ) )
     {
@@ -60,15 +60,15 @@ bool InitDatei::laden()
         return 0;
     }
     removeAlle();
-    Text *zeile = dat->leseZeile();
+    Text* zeile = dat->leseZeile();
     while( zeile )
     {
         zeile->remove( "\r\n" );
         zeile->remove( "\n" );
-        Text *n = zeile->getTeilText( 0, zeile->positionVon( '=' ) );
-        Text *w = zeile->getTeilText( zeile->positionVon( '=' ) + 1 );
+        Text* n = zeile->getTeilText( 0, zeile->positionVon( '=' ) );
+        Text* w = zeile->getTeilText( zeile->positionVon( '=' ) + 1 );
         name->add( n );
-        wert->add( w);
+        wert->add( w );
         zeile->release();
         zeile = dat->leseZeile();
     }
@@ -77,7 +77,7 @@ bool InitDatei::laden()
     return 1;
 }
 
-bool InitDatei::addWert( Text *name, Text *wert )
+bool InitDatei::addWert( Text* name, Text* wert )
 {
     if( !wertExistiert( name->getText() ) )
     {
@@ -92,12 +92,12 @@ bool InitDatei::addWert( Text *name, Text *wert )
     return 0;
 }
 
-bool InitDatei::addWert( const char *name, const char *wert )
+bool InitDatei::addWert( const char* name, const char* wert )
 {
     return addWert( new Text( name ), new Text( wert ) );
 }
 
-bool InitDatei::setWert( Text *name, Text *wert )
+bool InitDatei::setWert( Text* name, Text* wert )
 {
     if( !wertExistiert( name->getText() ) )
     {
@@ -105,8 +105,8 @@ bool InitDatei::setWert( Text *name, Text *wert )
         wert->release();
         return 0;
     }
-    auto n = this->name->getIterator();
-    for( auto v = this->wert->getIterator(); v; v++, n++ )
+    auto n = this->name->begin();
+    for( auto v = this->wert->begin(); v; v++, n++ )
     {
         if( n->istGleich( name->getText() ) )
         {
@@ -121,19 +121,19 @@ bool InitDatei::setWert( Text *name, Text *wert )
     return 0;
 }
 
-bool InitDatei::setWert( const char *name, const char *wert )
+bool InitDatei::setWert( const char* name, const char* wert )
 {
     return setWert( new Text( name ), new Text( wert ) );
 }
 
-bool InitDatei::setWert( int num, Text *wert )
+bool InitDatei::setWert( int num, Text* wert )
 {
     bool result = setWert( num, wert->getText() );
     wert->release();
     return result;
 }
 
-bool InitDatei::setWert( int num, const char *wert )
+bool InitDatei::setWert( int num, const char* wert )
 {
     if( num >= name->getEintragAnzahl() )
         return 0;
@@ -141,14 +141,14 @@ bool InitDatei::setWert( int num, const char *wert )
     return 1;
 }
 
-bool InitDatei::removeWert( Text *name )
+bool InitDatei::removeWert( Text* name )
 {
     bool result = removeWert( name->getText() );
     name->release();
     return result;
 }
 
-bool InitDatei::removeWert( const char *name )
+bool InitDatei::removeWert( const char* name )
 {
     if( !wertExistiert( name ) )
         return 0;
@@ -184,7 +184,7 @@ void InitDatei::removeAlle()
 
 bool InitDatei::speichern()
 {
-    Datei *dat = new Datei();
+    Datei* dat = new Datei();
     dat->setDatei( pfad->getText() );
     if( !dat->existiert() )
         dat->erstellen();
@@ -193,10 +193,10 @@ bool InitDatei::speichern()
         dat->release();
         return 0;
     }
-    auto n = name->getIterator();
-    for( auto v = wert->getIterator(); v; v++, n++ )
+    auto n = name->begin();
+    for( auto v = wert->begin(); v; v++, n++ )
     {
-        Text *zeile = new Text( "" );
+        Text* zeile = new Text( "" );
         zeile->append( n->getText() );
         zeile->append( "=" );
         zeile->append( v->getText() );
@@ -215,16 +215,16 @@ int InitDatei::getWertAnzahl() const
     return name->getEintragAnzahl();
 }
 
-bool InitDatei::wertExistiert( Text *name )
+bool InitDatei::wertExistiert( Text* name )
 {
     bool result = wertExistiert( name->getText() );
     name->release();
     return result;
 }
 
-bool InitDatei::wertExistiert( const char *name )
+bool InitDatei::wertExistiert( const char* name )
 {
-    for( auto n = this->name->getIterator(); n; n++ )
+    for( Text* n : *this->name )
     {
         if( n->istGleich( name ) )
             return 1;
@@ -232,17 +232,17 @@ bool InitDatei::wertExistiert( const char *name )
     return 0;
 }
 
-int InitDatei::getWertNummer( Text *name )
+int InitDatei::getWertNummer( Text* name )
 {
     int result = getWertNummer( name->getText() );
     name->release();
     return result;
 }
 
-int InitDatei::getWertNummer( const char *name )
+int InitDatei::getWertNummer( const char* name )
 {
     int i = 0;
-    for( auto n = this->name->getIterator(); n; n++, i++ )
+    for( Text *n : *this->name )
     {
         if( n->istGleich( name ) )
             return i;
@@ -250,17 +250,17 @@ int InitDatei::getWertNummer( const char *name )
     return -1;
 }
 
-Text *InitDatei::getWert( Text *name )
+Text* InitDatei::getWert( Text* name )
 {
-    Text *result = getWert( name->getText() );
+    Text* result = getWert( name->getText() );
     name->release();
     return result;
 }
 
-Text *InitDatei::getWert( const char *name )
+Text* InitDatei::getWert( const char* name )
 {
-    auto v = wert->getIterator();
-    for( auto n = this->name->getIterator(); n; n++, v++ )
+    auto v = wert->begin();
+    for( auto n = this->name->begin(); n; n++, v++ )
     {
         if( n->istGleich( name ) )
             return dynamic_cast<Text*>(v->getThis());
@@ -268,24 +268,24 @@ Text *InitDatei::getWert( const char *name )
     return 0;
 }
 
-Text *InitDatei::getWert( int num )
+Text* InitDatei::getWert( int num )
 {
     if( num >= name->getEintragAnzahl() )
         return 0;
     return wert->get( num );
 }
 
-Text *InitDatei::zWert( Text *name )
+Text* InitDatei::zWert( Text* name )
 {
-    Text *result = zWert( name->getText() );
+    Text* result = zWert( name->getText() );
     name->release();
     return result;
 }
 
-Text *InitDatei::zWert( const char *name )
+Text* InitDatei::zWert( const char* name )
 {
-    auto v = wert->getIterator();
-    for( auto n = this->name->getIterator(); n; n++, v++ )
+    auto v = wert->begin();
+    for( auto n = this->name->begin(); n; n++, v++ )
     {
         if( n->istGleich( name ) )
             return v;
@@ -293,33 +293,33 @@ Text *InitDatei::zWert( const char *name )
     return 0;
 }
 
-Text *InitDatei::zWert( int num )
+Text* InitDatei::zWert( int num )
 {
     if( num >= wert->getEintragAnzahl() )
         return 0;
     return wert->z( num );
 }
 
-Text *InitDatei::getName( int num )
+Text* InitDatei::getName( int num )
 {
     if( num >= name->getEintragAnzahl() )
         return 0;
     return name->get( num );
 }
 
-Text *InitDatei::zName( int num )
+Text* InitDatei::zName( int num )
 {
     if( num >= name->getEintragAnzahl() )
         return 0;
     return name->z( num );
 }
 
-Text *InitDatei::getPfad() const
+Text* InitDatei::getPfad() const
 {
-    return dynamic_cast<Text *>(pfad->getThis());
+    return dynamic_cast<Text*>(pfad->getThis());
 }
 
-Text *InitDatei::zPfad() const
+Text* InitDatei::zPfad() const
 {
     return pfad;
 }

+ 15 - 15
JSON.cpp

@@ -7,7 +7,7 @@ using namespace JSON;
 JSONValue::JSONValue()
     : ReferenceCounter()
 {
-    this->type = NULL_;
+    this->type = JSONType::NULL_;
 }
 
 JSONValue::~JSONValue()
@@ -31,7 +31,7 @@ Text JSONValue::toString() const
 
 
 JSONBool::JSONBool( bool b )
-    : JSONValue( BOOLEAN )
+    : JSONValue( JSONType::BOOLEAN )
 {
     this->b = b;
 }
@@ -51,7 +51,7 @@ Text JSONBool::toString() const
 
 
 JSONNumber::JSONNumber( double num )
-    : JSONValue( NUMBER )
+    : JSONValue( JSONType::NUMBER )
 {
     number = num;
 }
@@ -68,7 +68,7 @@ Text JSONNumber::toString() const
 
 
 JSONString::JSONString( Text string )
-    : JSONValue( STRING )
+    : JSONValue( JSONType::STRING )
 {
     this->string = string;
 }
@@ -85,13 +85,13 @@ Text JSONString::toString() const
 
 
 JSONArray::JSONArray()
-    : JSONValue( ARRAY )
+    : JSONValue( JSONType::ARRAY )
 {
     array = new RCArray< JSONValue >();
 }
 
 JSONArray::JSONArray( Text string )
-    : JSONValue( ARRAY )
+    : JSONValue( JSONType::ARRAY )
 {
     array = new RCArray< JSONValue >();
     string = Parser::removeWhitespace( string );
@@ -111,7 +111,7 @@ JSONArray::JSONArray( Text string )
 }
 
 JSONArray::JSONArray( const JSONArray &arr )
-    : JSONValue( ARRAY )
+    : JSONValue( JSONType::ARRAY )
 {
     array = dynamic_cast<RCArray<JSONValue> *>( arr.array->getThis() );
 }
@@ -146,7 +146,7 @@ int JSONArray::getLength() const
 Text JSONArray::toString() const
 {
     Text str = "[";
-    for( auto i = array->getIterator(); i; i++ )
+    for( auto i = array->begin(); i; i++ )
     {
         str += i->toString();
         if( i.hasNext() )
@@ -158,14 +158,14 @@ Text JSONArray::toString() const
 
 
 JSONObject::JSONObject()
-    : JSONValue( OBJECT )
+    : JSONValue( JSONType::OBJECT )
 {
     fields = new Array< Text >();
     values = new RCArray< JSONValue >();
 }
 
 JSONObject::JSONObject( Text string )
-    : JSONValue( OBJECT )
+    : JSONValue( JSONType::OBJECT )
 {
     fields = new Array< Text >();
     values = new RCArray< JSONValue >();
@@ -193,7 +193,7 @@ JSONObject::JSONObject( Text string )
 }
 
 JSONObject::JSONObject( const JSONObject &obj )
-    : JSONValue( OBJECT )
+    : JSONValue( JSONType::OBJECT )
 {
     fields = dynamic_cast<Array<Text> *>( obj.fields->getThis() );
     values = dynamic_cast<RCArray<JSONValue> *>( obj.values->getThis() );
@@ -261,12 +261,12 @@ JSONValue *JSONObject::getValue( Text field )
 
 Iterator< Text > JSONObject::getFields()
 {
-    return fields->getIterator();
+    return fields->begin();
 }
 
 Iterator< JSONValue * > JSONObject::getValues()
 {
-    return values->getIterator();
+    return values->begin();
 }
 
 int JSONObject::getFieldCount() const
@@ -277,8 +277,8 @@ int JSONObject::getFieldCount() const
 Text JSONObject::toString() const
 {
     Text str = "{";
-    Iterator< Text > k = fields->getIterator();
-    for( auto v = values->getIterator(); k && v; k++, v++ )
+    Iterator< Text > k = fields->begin();
+    for( auto v = values->begin(); k && v; k++, v++ )
     {
         str += "\"";
         str += k._.getText();

+ 1 - 1
JSON.h

@@ -8,7 +8,7 @@ namespace Framework
 {
     namespace JSON
     {
-        enum JSONType
+        enum class JSONType
         {
             NULL_,
             BOOLEAN,

+ 4 - 4
KSGTDatei.cpp

@@ -102,7 +102,7 @@ bool KSGTDatei::addZeile( int feldAnzahl, RCArray< Text > *zWert )
 {
     auto line = new RCArray< Text >();
     data->add( line );
-    for( auto t = zWert->getIterator(); t; t++ )
+    for( Text *t : *zWert )
         line->add( (Text*)t ? new Text( t->getText() ) : 0 );
     return 1;
 }
@@ -114,7 +114,7 @@ bool KSGTDatei::setZeile( int zeile, int feldAnzahl, RCArray< Text > *zWert )
         return 0;
     auto line = new RCArray< Text >();
     data->set( line, zeile );
-    for( auto t = zWert->getIterator(); t; t++ )
+    for( Text* t : *zWert )
         line->add( t ? new Text( t->getText() ) : 0 );
     return 1;
 }
@@ -217,12 +217,12 @@ bool KSGTDatei::speichern()
         return 0;
     int zA = getZeilenAnzahl();
     int i = 0;
-    for( auto line = data->getIterator(); line; line++, i++ )
+    for( auto line = data->begin(); line; line++, i++ )
     {
         if( i )
             of.write( "\n", 1 );
         int f = 0;
-        for( auto field = line->getIterator(); field; field++, f++ )
+        for( auto field = line->begin(); field; field++, f++ )
         {
             if( f )
                 of.write( "\0", 1 );

+ 87 - 86
Liste.cpp

@@ -60,7 +60,7 @@ AuswahlListe::~AuswahlListe()
         schrift->release();
 }
 
-void AuswahlListe::doMausEreignis( MausEreignis &me, bool userRet )
+void AuswahlListe::doMausEreignis( MausEreignis& me, bool userRet )
 {
     if( !userRet || hatStyleNicht( Style::Erlaubt ) )
         return;
@@ -150,7 +150,7 @@ void AuswahlListe::update() // aktualisiert die Auswahl Liste
         bool FeldHBild = ZeichnungHintergrund::hatStyle( Style::FeldHBild );
         bool FeldHAlpha = ZeichnungHintergrund::hatStyle( Style::FeldHAlpha );
         bool FeldBuffer = ZeichnungHintergrund::hatStyle( Style::FeldBuffer );
-        for( auto tf = tfListe->getIterator(); tf; tf++ )
+        for( TextFeld* tf : *tfListe )
         {
             tf->setStyle( TextFeld::Style::Rahmen, FeldRahmen );
             tf->setStyle( TextFeld::Style::Hintergrund, FeldHintergrund );
@@ -158,13 +158,13 @@ void AuswahlListe::update() // aktualisiert die Auswahl Liste
             tf->setStyle( TextFeld::Style::HAlpha, FeldHAlpha );
             tf->setStyle( TextFeld::Style::Buffered, FeldBuffer );
             if( schrift )
-                tf->setSchriftZ( dynamic_cast<Schrift *>(schrift->getThis()) );
+                tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
         }
     }
     if( ZeichnungHintergrund::hatStyle( Style::MultiStyled ) && tfListe && styles )
     {
-        auto style = styles->getIterator();
-        for( auto tf = tfListe->getIterator(); tf; tf++, style++ )
+        auto style = styles->begin();
+        for( auto tf = tfListe->begin(); tf; tf++, style++ )
         {
             tf->setStyle( TextFeld::Style::Rahmen, hatStyle( style, Style::FeldRahmen ) );
             tf->setStyle( TextFeld::Style::Hintergrund, hatStyle( style, Style::FeldHintergrund ) );
@@ -176,9 +176,9 @@ void AuswahlListe::update() // aktualisiert die Auswahl Liste
     rend = 1;
 }
 
-void AuswahlListe::addEintrag( Text *txt ) // fügt einen Eintrag hinzu
+void AuswahlListe::addEintrag( Text* txt ) // fügt einen Eintrag hinzu
 {
-    TextFeld *tf = new TextFeld();
+    TextFeld* tf = new TextFeld();
     tf->setStyle( TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen );
     tf->setSchriftFarbe( 0xFFFFFFFF );
     tf->setRahmenBreite( 1 );
@@ -189,26 +189,26 @@ void AuswahlListe::addEintrag( Text *txt ) // f
     rend = 1;
 }
 
-void AuswahlListe::addEintrag( const char *txt )
+void AuswahlListe::addEintrag( const char* txt )
 {
-    Text *tx = new Text( txt );
+    Text* tx = new Text( txt );
     addEintrag( tx );
     rend = 1;
 }
 
-void AuswahlListe::addEintragZ( TextFeld *tf )
+void AuswahlListe::addEintragZ( TextFeld* tf )
 {
     if( !tfListe )
         tfListe = new RCArray< TextFeld >();
     if( schrift && (!tf->zSchrift() || hatStyleNicht( Style::MultiStyled )) )
-        tf->setSchriftZ( dynamic_cast<Schrift *>(schrift->getThis()) );
+        tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
     tfListe->add( tf );
     rend = 1;
 }
 
-void AuswahlListe::addEintrag( int pos, Text *txt ) // fügt einen Eintrag bei position pos ein
+void AuswahlListe::addEintrag( int pos, Text* txt ) // fügt einen Eintrag bei position pos ein
 {
-    TextFeld *tf = new TextFeld();
+    TextFeld* tf = new TextFeld();
     tf->setStyle( TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen );
     tf->setSchriftFarbe( 0xFFFFFFFF );
     tf->setRahmenBreite( 1 );
@@ -219,26 +219,26 @@ void AuswahlListe::addEintrag( int pos, Text *txt ) // f
     rend = 1;
 }
 
-void AuswahlListe::addEintrag( int pos, const char *txt )
+void AuswahlListe::addEintrag( int pos, const char* txt )
 {
-    Text *tx = new Text( txt );
+    Text* tx = new Text( txt );
     addEintrag( pos, tx );
     rend = 1;
 }
 
-void AuswahlListe::addEintragZ( int pos, TextFeld *tf )
+void AuswahlListe::addEintragZ( int pos, TextFeld* tf )
 {
     if( !tfListe )
         tfListe = new RCArray< TextFeld >();
     if( schrift && (!tf->zSchrift() || hatStyleNicht( Style::MultiStyled )) )
-        tf->setSchriftZ( dynamic_cast<Schrift *>(schrift->getThis()) );
+        tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
     tfListe->add( tf, pos );
     rend = 1;
 }
 
-void AuswahlListe::setEintrag( int pos, Text *txt ) // ändert den pos - ten Eintrag
+void AuswahlListe::setEintrag( int pos, Text* txt ) // ändert den pos - ten Eintrag
 {
-    TextFeld *tf = 0;
+    TextFeld* tf = 0;
     if( tfListe )
         tf = tfListe->z( pos );
     if( !tf )
@@ -258,19 +258,19 @@ void AuswahlListe::setEintrag( int pos, Text *txt ) // 
     rend = 1;
 }
 
-void AuswahlListe::setEintrag( int pos, unsigned char *txt )
+void AuswahlListe::setEintrag( int pos, unsigned char* txt )
 {
-    Text *tx = new Text( (const char *)txt );
+    Text* tx = new Text( (const char*)txt );
     setEintrag( pos, tx );
     rend = 1;
 }
 
-void AuswahlListe::setEintragZ( int pos, TextFeld *tf )
+void AuswahlListe::setEintragZ( int pos, TextFeld* tf )
 {
     if( !tfListe )
         tfListe = new RCArray< TextFeld >();
     if( schrift && (!tf->zSchrift() || hatStyleNicht( Style::MultiStyled )) )
-        tf->setSchriftZ( dynamic_cast<Schrift *>(schrift->getThis()) );
+        tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
     tfListe->set( tf, pos );
     rend = 1;
 }
@@ -300,7 +300,7 @@ void AuswahlListe::removeEintrag( int pos ) // l
     rend = 1;
 }
 
-void AuswahlListe::setSchriftZ( Schrift *schrift ) // legt die Schrift der Einträge fest
+void AuswahlListe::setSchriftZ( Schrift* schrift ) // legt die Schrift der Einträge fest
 {
     if( this->schrift )
         this->schrift->release();
@@ -326,13 +326,13 @@ void AuswahlListe::updateVScroll() // scrollt zur Curser Position oder nach Unte
     if( vertikalScrollBar )
     {
         int y = 0;
-        for( auto tf = tfListe->getIterator(); tf; tf++ )
-            y += (TextFeld *)tf ? tf->getHeight() : 0;
+        for( TextFeld* tf : *tfListe )
+            y += (TextFeld*)tf ? tf->getHeight() : 0;
         vertikalScrollBar->update( y, gr.y - ((rahmen && ZeichnungHintergrund::hatStyle( TextFeld::Style::Rahmen )) ? rahmen->getRBreite() : 0) );
     }
 }
 
-void AuswahlListe::setALRZ( Rahmen *rahmen ) // setzt einen Zeiger zum Auswahl Rahmen (nur ohne MulitStyled)
+void AuswahlListe::setALRZ( Rahmen* rahmen ) // setzt einen Zeiger zum Auswahl Rahmen (nur ohne MulitStyled)
 {
     if( aRahmen )
         aRahmen->release();
@@ -356,7 +356,7 @@ void AuswahlListe::setALRFarbe( int fc ) // setzt die Farbe des Auswahl Rahmens
     rend = 1;
 }
 
-void AuswahlListe::setAAFZ( AlphaFeld *buffer ) // setzt einen Zeiger zum Auswahl AlpaFeld (nur ohne MultiStyled)
+void AuswahlListe::setAAFZ( AlphaFeld* buffer ) // setzt einen Zeiger zum Auswahl AlpaFeld (nur ohne MultiStyled)
 {
     if( aBuffer )
         aBuffer->release();
@@ -380,13 +380,13 @@ void AuswahlListe::setAAFFarbe( int fc ) // setzt die Farbe des Auswahl Hintergr
     rend = 1;
 }
 
-void AuswahlListe::setAHBild( Bild *bild ) // setzt das Auswahl Hintergrund Bild (nur ohne MultiStyled)
+void AuswahlListe::setAHBild( Bild* bild ) // setzt das Auswahl Hintergrund Bild (nur ohne MultiStyled)
 {
     if( !ahBild )
         ahBild = new Bild();
     ahBild->neuBild( bild->getBreite(), bild->getHeight(), 0 );
-    int *buff1 = ahBild->getBuffer();
-    int *buff2 = bild->getBuffer();
+    int* buff1 = ahBild->getBuffer();
+    int* buff2 = bild->getBuffer();
     for( int i = 0; i < bild->getBreite() * bild->getHeight(); ++i )
         buff1[ i ] = buff2[ i ];
     bild->release();
@@ -399,7 +399,7 @@ void AuswahlListe::setAHFarbe( int f ) // setzt einen Zeiger zur Auswahl Hinterg
     rend = 1;
 }
 
-void AuswahlListe::setAHBildZ( Bild *b ) // setzt einen Zeiger zum Hintergrund Bild (nur ohne MultiStyled)
+void AuswahlListe::setAHBildZ( Bild* b ) // setzt einen Zeiger zum Hintergrund Bild (nur ohne MultiStyled)
 {
     if( ahBild )
         ahBild->release();
@@ -407,7 +407,7 @@ void AuswahlListe::setAHBildZ( Bild *b ) // setzt einen Zeiger zum Hintergrund B
     rend = 1;
 }
 
-void AuswahlListe::setALRZ( int pos, Rahmen *rahmen ) // setzt einen Zeiger zum Auswahl Rahmen (nur mit MulitStyled)
+void AuswahlListe::setALRZ( int pos, Rahmen* rahmen ) // setzt einen Zeiger zum Auswahl Rahmen (nur mit MulitStyled)
 {
     if( !aRahmenListe )
         aRahmenListe = new RCArray< Rahmen >();
@@ -435,7 +435,7 @@ void AuswahlListe::setALRFarbe( int pos, int fc ) // setzt die Farbe des Auswahl
     rend = 1;
 }
 
-void AuswahlListe::setAAFZ( int pos, AlphaFeld *buffer ) // setzt einen Zeiger zum Auswahl AlpaFeld (nur mit MultiStyled)
+void AuswahlListe::setAAFZ( int pos, AlphaFeld* buffer ) // setzt einen Zeiger zum Auswahl AlpaFeld (nur mit MultiStyled)
 {
     if( !aBufferListe )
         aBufferListe = new RCArray< AlphaFeld >();
@@ -463,15 +463,16 @@ void AuswahlListe::setAAFFarbe( int pos, int fc ) // setzt die Farbe des Auswahl
     rend = 1;
 }
 
-void AuswahlListe::setAHBild( int pos, Bild *bild ) // setzt das Auswahl Hintergrund Bild (nur mit MultiStyled)
+void AuswahlListe::setAHBild( int pos, Bild* bild ) // setzt das Auswahl Hintergrund Bild (nur mit MultiStyled)
 {
     if( ahBildListe )
         ahBildListe = new RCArray< Bild >();
+#pragma warning( once : 6011 )
     if( !ahBildListe->z( pos ) )
         ahBildListe->set( new Bild(), pos );
     ahBildListe->z( pos )->neuBild( bild->getBreite(), bild->getHeight(), 0 );
-    int *buff1 = ahBildListe->z( pos )->getBuffer();
-    int *buff2 = bild->getBuffer();
+    int* buff1 = ahBildListe->z( pos )->getBuffer();
+    int* buff2 = bild->getBuffer();
     for( int i = 0; i < bild->getBreite() * bild->getHeight(); ++i )
         buff1[ i ] = buff2[ i ];
     bild->release();
@@ -486,7 +487,7 @@ void AuswahlListe::setAHFarbe( int pos, int f ) // setzt einen Zeiger zur Auswah
     rend = 1;
 }
 
-void AuswahlListe::setAHBildZ( int pos, Bild *b ) // setzt einen Zeiger zum Hintergrund Bild (nur mit MultiStyled)
+void AuswahlListe::setAHBildZ( int pos, Bild* b ) // setzt einen Zeiger zum Hintergrund Bild (nur mit MultiStyled)
 {
     if( ahBildListe )
         ahBildListe = new RCArray< Bild >();
@@ -529,7 +530,7 @@ void AuswahlListe::removeMsStyle( int pos, __int64 style )
     rend = 1;
 }
 
-void AuswahlListe::doTastaturEreignis( TastaturEreignis &te )
+void AuswahlListe::doTastaturEreignis( TastaturEreignis& te )
 {
     bool ntakc = !te.verarbeitet;
     if( hatStyleNicht( Style::Fokus ) || !tak || te.verarbeitet )
@@ -589,7 +590,7 @@ void AuswahlListe::doTastaturEreignis( TastaturEreignis &te )
     release();
 }
 
-void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
+void AuswahlListe::render( Bild& zRObj ) // zeichnet nach zRObj
 {
     if( !ZeichnungHintergrund::hatStyle( Style::Sichtbar ) )
         return;
@@ -611,9 +612,9 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
         if( vertikalScrollBar && ZeichnungHintergrund::hatStyle( Style::VScroll ) )
             dy -= vertikalScrollBar->getScroll();
         int mdy = innenSize.y + rbr;
-        auto style = styles->getIterator();
+        auto style = styles->begin();
         int i = 0;
-        for( auto tf = tfListe->getIterator(); tf; tf++, style++, i++ )
+        for( auto tf = tfListe->begin(); tf; tf++, style++, i++ )
         {
             if( dy + tf->getHeight() > mdy && !(vertikalScrollBar && ZeichnungHintergrund::hatStyle( Style::VScroll )) )
                 break;
@@ -625,14 +626,14 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
                 selected = hatStyle( style, Style::Selected );
             else
                 selected = auswahl == i;
-            AlphaFeld *tmpBuffer = 0;
+            AlphaFeld* tmpBuffer = 0;
             bool tmpB = 0;
             int tmpHFarbe = 0;
             bool tmpH = 0;
-            Bild *tmpHBild = 0;
+            Bild* tmpHBild = 0;
             bool tmpHB = 0;
             bool tmpHAlpha = 0;
-            Rahmen *tmpRahmen = 0;
+            Rahmen* tmpRahmen = 0;
             bool tmpR = 0;
             if( selected )
             {
@@ -641,7 +642,7 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
                     if( ZeichnungHintergrund::hatStyle( Style::AuswahlBuffer ) && aBuffer )
                     {
                         tmpBuffer = tf->getAlphaFeld();
-                        tf->setAlphaFeldZ( dynamic_cast<AlphaFeld *>(aBuffer->getThis()) );
+                        tf->setAlphaFeldZ( dynamic_cast<AlphaFeld*>(aBuffer->getThis()) );
                         tmpB = tf->hatStyle( TextFeld::Style::Buffered );
                         tf->setStyle( TextFeld::Style::Buffered, ZeichnungHintergrund::hatStyle( Style::AuswahlBuffer ) );
                     }
@@ -654,7 +655,7 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
                         if( ZeichnungHintergrund::hatStyle( Style::AuswahlHBild ) && ahBild )
                         {
                             tmpHBild = tf->getHintergrundBild();
-                            tf->setHintergrundBildZ( dynamic_cast<Bild *>(ahBild->getThis()) );
+                            tf->setHintergrundBildZ( dynamic_cast<Bild*>(ahBild->getThis()) );
                             tmpHB = tf->hatStyle( TextFeld::Style::HBild );
                             tf->setStyle( TextFeld::Style::HBild, ZeichnungHintergrund::hatStyle( Style::HBild ) );
                         }
@@ -667,7 +668,7 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
                     if( ZeichnungHintergrund::hatStyle( Style::AuswahlRahmen ) && aRahmen )
                     {
                         tmpRahmen = tf->getRahmen();
-                        tf->setRahmenZ( dynamic_cast<Rahmen *>(aRahmen->getThis()) );
+                        tf->setRahmenZ( dynamic_cast<Rahmen*>(aRahmen->getThis()) );
                         tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
                         tf->setStyle( TextFeld::Style::Rahmen, ZeichnungHintergrund::hatStyle( Style::AuswahlRahmen ) );
                     }
@@ -784,7 +785,7 @@ int AuswahlListe::getKlickEintrag( int my )
     if( ZeichnungHintergrund::hatStyle( Style::VScroll ) && vertikalScrollBar )
         y -= vertikalScrollBar->getScroll();
     int i = 0;
-    for( auto tf = tfListe->getIterator(); tf; tf++, i++ )
+    for( auto tf = tfListe->begin(); tf; tf++, i++ )
     {
         y += tf->getHeight();
         if( y > my )
@@ -827,10 +828,10 @@ int AuswahlListe::getAuswahl() const // gibt den ersten ausgew
     return auswahl;
 }
 
-int AuswahlListe::getEintragPos( Text *eintragText ) // gibt die Position des eintrages mit dem entsprechenden Textes zurück
+int AuswahlListe::getEintragPos( Text* eintragText ) // gibt die Position des eintrages mit dem entsprechenden Textes zurück
 {
     int i = 0;
-    for( auto tf = tfListe->getIterator(); tf; tf++, i++ )
+    for( auto tf = tfListe->begin(); tf; tf++, i++ )
     {
         if( tf->zText()->istGleich( eintragText->getText() ) )
         {
@@ -841,31 +842,31 @@ int AuswahlListe::getEintragPos( Text *eintragText ) // gibt die Position des ei
     return -1;
 }
 
-TextFeld *AuswahlListe::getEintrag( int pos ) const // gibt den pos- ten Eintrag zurück
+TextFeld* AuswahlListe::getEintrag( int pos ) const // gibt den pos- ten Eintrag zurück
 {
     if( !tfListe )
         return 0;
-    TextFeld *ret = (TextFeld *)tfListe->get( pos );
+    TextFeld* ret = (TextFeld*)tfListe->get( pos );
     if( ret )
-        return dynamic_cast<TextFeld *>(ret->getThis());
+        return dynamic_cast<TextFeld*>(ret->getThis());
     return 0;
 }
 
-TextFeld *AuswahlListe::zEintrag( int pos ) const
+TextFeld* AuswahlListe::zEintrag( int pos ) const
 {
     if( !tfListe )
         return 0;
-    return (TextFeld *)tfListe->z( pos );
+    return (TextFeld*)tfListe->z( pos );
 }
 
-Rahmen *AuswahlListe::getARahmen() const // gibt den Auswahl Rahmen zurück (ohne MultiStyled)
+Rahmen* AuswahlListe::getARahmen() const // gibt den Auswahl Rahmen zurück (ohne MultiStyled)
 {
     if( aRahmen )
-        return dynamic_cast<Rahmen *>(aRahmen->getThis());
+        return dynamic_cast<Rahmen*>(aRahmen->getThis());
     return 0;
 }
 
-Rahmen *AuswahlListe::zARahmen() const
+Rahmen* AuswahlListe::zARahmen() const
 {
     return aRahmen;
 }
@@ -875,45 +876,45 @@ int AuswahlListe::getAHFarbe() const // gibt die Auswahl Hintergrund Farbe zur
     return ahFarbe;
 }
 
-Bild *AuswahlListe::getAHBild() const // gibt das Auswahl Hintergrund Bild zurück (ohne MultiStyled)
+Bild* AuswahlListe::getAHBild() const // gibt das Auswahl Hintergrund Bild zurück (ohne MultiStyled)
 {
     if( ahBild )
-        return dynamic_cast<Bild *>(ahBild->getThis());
+        return dynamic_cast<Bild*>(ahBild->getThis());
     return 0;
 }
 
-Bild *AuswahlListe::zAHBild() const
+Bild* AuswahlListe::zAHBild() const
 {
     return ahBild;
 }
 
-AlphaFeld *AuswahlListe::getABuffer() const // gibt den Auswahl Buffer zurück (ohne MultiStyled)
+AlphaFeld* AuswahlListe::getABuffer() const // gibt den Auswahl Buffer zurück (ohne MultiStyled)
 {
     if( aBuffer )
-        return dynamic_cast<AlphaFeld *>(aBuffer->getThis());
+        return dynamic_cast<AlphaFeld*>(aBuffer->getThis());
     return 0;
 }
 
-AlphaFeld *AuswahlListe::zABuffer() const
+AlphaFeld* AuswahlListe::zABuffer() const
 {
     return aBuffer;
 }
 
-Rahmen *AuswahlListe::getARahmen( int pos ) const // gibt den Auswahl Rahmen zurück (mit MultiStyled)
+Rahmen* AuswahlListe::getARahmen( int pos ) const // gibt den Auswahl Rahmen zurück (mit MultiStyled)
 {
-    Rahmen *ret = 0;
+    Rahmen* ret = 0;
     if( aRahmenListe )
-        ret = (Rahmen *)aRahmenListe->get( pos );
+        ret = (Rahmen*)aRahmenListe->get( pos );
     if( ret )
-        return dynamic_cast<Rahmen *>(ret->getThis());
+        return dynamic_cast<Rahmen*>(ret->getThis());
     return 0;
 }
 
-Rahmen *AuswahlListe::zARahmen( int pos ) const
+Rahmen* AuswahlListe::zARahmen( int pos ) const
 {
-    Rahmen *ret = 0;
+    Rahmen* ret = 0;
     if( aRahmenListe )
-        ret = (Rahmen *)aRahmenListe->z( pos );
+        ret = (Rahmen*)aRahmenListe->z( pos );
     return ret;
 }
 
@@ -924,39 +925,39 @@ int AuswahlListe::getAHFarbe( int pos ) const // gibt die Auswahl Hintergrund Fa
     return 0;
 }
 
-Bild *AuswahlListe::getAHBild( int pos ) const // gibt das Auswahl Hintergrund Bild zurück (mit MultiStyled)
+Bild* AuswahlListe::getAHBild( int pos ) const // gibt das Auswahl Hintergrund Bild zurück (mit MultiStyled)
 {
-    Bild *ret = 0;
+    Bild* ret = 0;
     if( ahBildListe )
-        ret = (Bild *)ahBildListe->get( pos );
+        ret = (Bild*)ahBildListe->get( pos );
     if( ret )
-        return dynamic_cast<Bild *>(ret->getThis());
+        return dynamic_cast<Bild*>(ret->getThis());
     return 0;
 }
 
-Bild *AuswahlListe::zAHBild( int pos ) const
+Bild* AuswahlListe::zAHBild( int pos ) const
 {
-    Bild *ret = 0;
+    Bild* ret = 0;
     if( ahBildListe )
-        ret = (Bild *)ahBildListe->z( pos );
+        ret = (Bild*)ahBildListe->z( pos );
     return ret;
 }
 
-AlphaFeld *AuswahlListe::getABuffer( int pos ) const // gibt den Auswahl Buffer zurück (mit MultiStyled)
+AlphaFeld* AuswahlListe::getABuffer( int pos ) const // gibt den Auswahl Buffer zurück (mit MultiStyled)
 {
-    AlphaFeld *ret = 0;
+    AlphaFeld* ret = 0;
     if( aBufferListe )
-        ret = (AlphaFeld *)aBufferListe->get( pos );
+        ret = (AlphaFeld*)aBufferListe->get( pos );
     if( ret )
-        return dynamic_cast<AlphaFeld *>(ret->getThis());
+        return dynamic_cast<AlphaFeld*>(ret->getThis());
     return 0;
 }
 
-AlphaFeld *AuswahlListe::zABuffer( int pos ) const
+AlphaFeld* AuswahlListe::zABuffer( int pos ) const
 {
-    AlphaFeld *ret = 0;
+    AlphaFeld* ret = 0;
     if( aBufferListe )
-        ret = (AlphaFeld *)aBufferListe->z( pos );
+        ret = (AlphaFeld*)aBufferListe->z( pos );
     return ret;
 }
 

+ 3 - 3
M3Datei.cpp

@@ -357,8 +357,8 @@ Model3DData *M3Datei::ladeModel( const char *name ) const
     if( !modelName || !pfad.getLength() )
         return 0;
     __int64 pos = -1;
-    auto p = modelPos->getIterator();
-    for( auto n = modelName->getIterator(); n && p; n++, p++ )
+    auto p = modelPos->begin();
+    for( auto n = modelName->begin(); n && p; n++, p++ )
     {
         if( n->istGleich( name ) )
         {
@@ -431,7 +431,7 @@ bool M3Datei::hatModel( const char *name ) const
 {
     if( !modelName || !pfad.getLength() )
         return 0;
-    for( auto n = modelName->getIterator(); n; n++ )
+    for( auto n = modelName->begin(); n; n++ )
     {
         if( n->istGleich( name ) )
             return 1;

+ 0 - 1
M3Datei.h

@@ -17,7 +17,6 @@ namespace Framework
         Text pfad;
         RCArray< Text > *modelName;
         Array< __int64 > *modelPos;
-        int ref;
 
         void saveKnochen( Knochen *k, Datei *zDat );
         Knochen *readKnochen( Datei *zDat ) const;

+ 103 - 98
Model2D.cpp

@@ -46,15 +46,15 @@ bool Model2DData::istPunktInnen( Vertex p, int polygonId ) const
     if( p < minP || p > maxP || !polygons )
         return 0;
     int num = 0;
-    auto outListP = outList.getIterator();
-    for( auto polygon = polygons->getIterator(); polygon; polygon++, num++, outListP++ )
+    auto outListP = outList.begin();
+    for( auto polygon = polygons->begin(); polygon; polygon++, num++, outListP++ )
     {
         if( polygonId >= 0 && num != polygonId )
             continue;
         int anz = polygon._.vertex->getEintragAnzahl();
         bool c = 0;
         int j = anz - 1;
-        for( auto outListPP = outListP->getIterator(); outListPP; outListPP++ )
+        for( auto outListPP = outListP->begin(); outListPP; outListPP++ )
         {
             Punkt out = outListPP;
             if( out.x < out.y && j > out.x && j < out.y )
@@ -62,11 +62,11 @@ bool Model2DData::istPunktInnen( Vertex p, int polygonId ) const
             if( out.x > out.y && ( j > out.x || j < out.y ) )
                 j = out.x;
         }
-        auto point = polygon._.vertex->getIterator();
+        auto point = polygon._.vertex->begin();
         for( int i = 0; i < anz; i++, point++ )
         {
             bool cont = 0;
-            for( auto outListPP = outListP->getIterator(); outListPP; outListPP++ )
+            for( auto outListPP = outListP->begin(); outListPP; outListPP++ )
             {
                 Punkt out = outListPP;
                 if( out.x < out.y && i > out.x && i < out.y )
@@ -404,15 +404,15 @@ bool Model2DData::calcHitPoint( Vertex pos, Vertex dir, const char *polygonName,
     if( dir.x == 0 && dir.y == 0 )
         return 0;
     bool ret = 0;
-    for( auto polygon = polygons->getIterator(); polygon; polygon++ )
+    for( Polygon2D polygon : *polygons )
     {
-        if( polygon._.name->istGleich( polygonName ) )
+        if( polygon.name->istGleich( polygonName ) )
         {
-            int anz = polygon._.vertex->getEintragAnzahl();
+            int anz = polygon.vertex->getEintragAnzahl();
             for( int i = 0; i < anz; i++ )
             {
-                Vertex a = polygon._.vertex->get( i );
-                Vertex b = polygon._.vertex->get( ( i + 1 ) % anz );
+                Vertex a = polygon.vertex->get( i );
+                Vertex b = polygon.vertex->get( ( i + 1 ) % anz );
                 b -= a;
                 float offset = 0;
                 if( dir.y != 0 && dir.x != 0 )
@@ -440,9 +440,9 @@ bool Model2DData::calcHitPoint( Vertex pos, Vertex dir, const char *polygonName,
                         Vertex normal = b.CW90().normalize();
                         Vertex kNorm = Vertex( dir ).normalize();
                         moveSpeed = normal * ( normal * kNorm ) * dir.getLength();
-                        normal = ( point - *polygon._.schwerpunkt ).CW90().normalize();
+                        normal = ( point - *polygon.schwerpunkt ).CW90().normalize();
                         Vertex rotKraft = normal * ( normal * kNorm ) * dir.getLength();
-                        rotSpeed = ( (float)sqrt( rotKraft.getLength() * ( point - *polygon._.schwerpunkt ).getLength() ) / 180.f ) * 3.14f * ( normal * kNorm );
+                        rotSpeed = ( (float)sqrt( rotKraft.getLength() * ( point - *polygon.schwerpunkt ).getLength() ) / 180.f ) * 3.14f * ( normal * kNorm );
                         hitpoint = point;
                         if( isnan( moveSpeed.x ) || isnan( moveSpeed.y ) || isnan( rotSpeed ) )
                             return 0;
@@ -460,15 +460,15 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
     Vertex originalDir = dir;
     bool ret = 0;
     int num = 0;
-    for( auto polygon = polygons->getIterator(); polygon; polygon++, num++ )
+    for( Polygon2D polygon : *polygons )
     {
-        if( polygon._.name->istGleich( polygonName ) )
+        if( polygon.name->istGleich( polygonName ) )
         {
             while( istPunktInnen( pos, num ) )
             {
                 pos -= dir;
             }
-            int anz = polygon._.vertex->getEintragAnzahl();
+            int anz = polygon.vertex->getEintragAnzahl();
             Vertex startPoint;
             Vertex texturSP;
             int leftI = 0;
@@ -476,13 +476,13 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
             Vertex txtChpPix( 0, 0 );
             for( int i = 0; i < anz; i++ )
             {
-                Vertex a = polygon._.vertex->get( i );
-                Vertex b = polygon._.vertex->get( ( i + 1 ) % anz );
+                Vertex a = polygon.vertex->get( i );
+                Vertex b = polygon.vertex->get( ( i + 1 ) % anz );
                 b -= a;
                 if( ( txtChpPix.x == 0 || txtChpPix.y == 0 ) && b.x != 0 && b.y != 0 )
                 {
-                    Vertex ta = polygon._.tKordinaten->get( i );
-                    Vertex tb = polygon._.tKordinaten->get( ( i + 1 ) % anz );
+                    Vertex ta = polygon.tKordinaten->get( i );
+                    Vertex tb = polygon.tKordinaten->get( ( i + 1 ) % anz );
                     tb -= ta;
                     txtChpPix = Vertex( tb.x / b.x, tb.y / b.y );
                 }
@@ -501,22 +501,22 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
                         leftI = i;
                         rightI = ( i + 1 ) % anz;
                         startPoint = point;
-                        texturSP = polygon._.tKordinaten->get( i ) + ( polygon._.tKordinaten->get( ( i + 1 ) % anz ) - polygon._.tKordinaten->get( i ) ) * offset;
+                        texturSP = polygon.tKordinaten->get( i ) + ( polygon.tKordinaten->get( ( i + 1 ) % anz ) - polygon.tKordinaten->get( i ) ) * offset;
                     }
                     ret = 1;
                 }
             }
             if( ret )
             {
-                partA.transparent = polygon._.transparent;
+                partA.transparent = polygon.transparent;
                 partA.schwerpunkt = new Vertex( 0, 0 );
                 partA.tKordinaten = new Array< Vertex >();
-                partA.name = new Text( polygon._.name->getText() );
+                partA.name = new Text( polygon.name->getText() );
                 partA.vertex = new Array< Vertex >();
-                partB.transparent = polygon._.transparent;
+                partB.transparent = polygon.transparent;
                 partB.schwerpunkt = new Vertex( 0, 0 );
                 partB.tKordinaten = new Array< Vertex >();
-                partB.name = new Text( polygon._.name->getText() );
+                partB.name = new Text( polygon.name->getText() );
                 partB.vertex = new Array< Vertex >();
                 *partA.schwerpunkt += startPoint;
                 *partB.schwerpunkt += startPoint;
@@ -540,8 +540,8 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
                     {
                         if( i == leftI )
                             continue;
-                        Vertex a = polygon._.vertex->get( i );
-                        Vertex b = polygon._.vertex->get( ( i + 1 ) % anz );
+                        Vertex a = polygon.vertex->get( i );
+                        Vertex b = polygon.vertex->get( ( i + 1 ) % anz );
                         b -= a;
                         float offset1 = 0;
                         if( dir.y != 0 && dir.x != 0 )
@@ -569,20 +569,20 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
                                 leftIE = i;
                                 rightIE = ( i + 1 ) % anz;
                                 startPoint = point;
-                                texturSP = polygon._.tKordinaten->get( i ) + ( polygon._.tKordinaten->get( ( i + 1 ) % anz ) - polygon._.tKordinaten->get( i ) ) * offset1;
+                                texturSP = polygon.tKordinaten->get( i ) + ( polygon.tKordinaten->get( ( i + 1 ) % anz ) - polygon.tKordinaten->get( i ) ) * offset1;
                             }
                             ret = 1;
                         }
                     }
                     if( needOne && !ret )
                     {
-                        Vertex a = polygon._.vertex->get( bestI );
-                        Vertex b = polygon._.vertex->get( ( bestI + 1 ) % anz );
+                        Vertex a = polygon.vertex->get( bestI );
+                        Vertex b = polygon.vertex->get( ( bestI + 1 ) % anz );
                         b -= a;
                         leftIE = bestI;
                         rightIE = ( bestI + 1 ) % anz;
                         startPoint = a + ( b * bo1 );
-                        texturSP = polygon._.tKordinaten->get( bestI ) + ( polygon._.tKordinaten->get( ( bestI + 1 ) % anz ) - polygon._.tKordinaten->get( bestI ) ) * bo1;
+                        texturSP = polygon.tKordinaten->get( bestI ) + ( polygon.tKordinaten->get( ( bestI + 1 ) % anz ) - polygon.tKordinaten->get( bestI ) ) * bo1;
                         ret = 1;
                     }
                     if( ret )
@@ -608,26 +608,26 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
                     i = i % anz;
                     if( i == leftI )
                         break;
-                    *partA.schwerpunkt += polygon._.vertex->get( i );
-                    partA.vertex->add( polygon._.vertex->get( i ) );
-                    partA.tKordinaten->add( polygon._.tKordinaten->get( i ) );
+                    *partA.schwerpunkt += polygon.vertex->get( i );
+                    partA.vertex->add( polygon.vertex->get( i ) );
+                    partA.tKordinaten->add( polygon.tKordinaten->get( i ) );
                 }
-                *partA.schwerpunkt += polygon._.vertex->get( leftI );
-                partA.vertex->add( polygon._.vertex->get( leftI ) );
-                partA.tKordinaten->add( polygon._.tKordinaten->get( leftI ) );
+                *partA.schwerpunkt += polygon.vertex->get( leftI );
+                partA.vertex->add( polygon.vertex->get( leftI ) );
+                partA.tKordinaten->add( polygon.tKordinaten->get( leftI ) );
                 for( int i = leftIE; i != rightI; i-- )
                 {
                     if( i < 0 )
                         i += anz;
                     if( i == rightI )
                         break;
-                    *partB.schwerpunkt += polygon._.vertex->get( i );
-                    partB.vertex->add( polygon._.vertex->get( i ) );
-                    partB.tKordinaten->add( polygon._.tKordinaten->get( i ) );
+                    *partB.schwerpunkt += polygon.vertex->get( i );
+                    partB.vertex->add( polygon.vertex->get( i ) );
+                    partB.tKordinaten->add( polygon.tKordinaten->get( i ) );
                 }
-                *partB.schwerpunkt += polygon._.vertex->get( rightI );
-                partB.vertex->add( polygon._.vertex->get( rightI ) );
-                partB.tKordinaten->add( polygon._.tKordinaten->get( rightI ) );
+                *partB.schwerpunkt += polygon.vertex->get( rightI );
+                partB.vertex->add( polygon.vertex->get( rightI ) );
+                partB.tKordinaten->add( polygon.tKordinaten->get( rightI ) );
                 *partA.schwerpunkt /= (float)partA.vertex->getEintragAnzahl();
                 *partB.schwerpunkt /= (float)partB.vertex->getEintragAnzahl();
                 posA = (Punkt)*partA.schwerpunkt;
@@ -640,6 +640,7 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
                 *partB.schwerpunkt = Vertex( 0, 0 );
             }
         }
+        num++;
     }
     return ret;
 }
@@ -647,20 +648,20 @@ bool Model2DData::split( Vertex pos, Vertex dir, char *polygonName, Polygon2D &p
 float Model2DData::getMasse() const
 {
     float m = 0;
-    for( auto p = polygons->getIterator(); p; p++ )
+    for( Polygon2D p : *polygons )
     {
-        if( p._.transparent )
+        if( p.transparent )
             continue;
-        int anz = p._.vertex->getEintragAnzahl();
+        int anz = p.vertex->getEintragAnzahl();
         if( anz < 3 )
             continue;
-        Vertex p1 = p._.vertex->get( anz - 1 );
-        Vertex p2 = p._.vertex->get( 0 );
+        Vertex p1 = p.vertex->get( anz - 1 );
+        Vertex p2 = p.vertex->get( 0 );
         m += ( p1.y + p2.y ) * ( p1.x - p2.x );
         for( int i = 1; i < anz; i++ )
         {
-            p1 = p._.vertex->get( i - 1 );
-            p2 = p._.vertex->get( i );
+            p1 = p.vertex->get( i - 1 );
+            p2 = p.vertex->get( i );
             m += ( p1.y + p2.y ) * ( p1.x - p2.x );
         }
     }
@@ -700,7 +701,7 @@ void Model2DObject::setTextur( Textur2D *t )
     int index = 0;
     if( rData )
     {
-        for( auto i = rData->polygons->getIterator(); i; i++ )
+        for( Polygon2D i : *rData->polygons )
             textur->set( dynamic_cast<Textur2D *>( t->getThis() ), index++ );
     }
     t->release();
@@ -718,9 +719,9 @@ void Model2DObject::impuls( Vertex start, Vertex speed, float strength )
         Vertex mSpeed;
         float rSpeed;
         float dist = INFINITY;
-        for( auto p = rData->polygons->getIterator(); p; p++ )
+        for( Polygon2D p : *rData->polygons )
         {
-            if( !p._.transparent && rData->calcHitPoint( start, speed, p._.name->getText(), hp, mSpeed, rSpeed ) )
+            if( !p.transparent && rData->calcHitPoint( start, speed, p.name->getText(), hp, mSpeed, rSpeed ) )
             {
                 float f = ( hp.x - start.x ) / speed.x;
                 if( !speed.x )
@@ -745,10 +746,11 @@ void Model2DObject::impuls( Vertex start, Vertex speed, float strength )
 void Model2DObject::setTextur( Textur2D *t, const char *polygonName )
 {
     int index = 0;
-    for( auto i = rData->polygons->getIterator(); i; i++, index++ )
+    for( Polygon2D i : *rData->polygons )
     {
-        if( i._.name->istGleich( polygonName ) )
+        if( i.name->istGleich( polygonName ) )
             textur->set( dynamic_cast<Textur2D *>( t->getThis() ), index );
+        index++;
     }
     t->release();
 }
@@ -758,15 +760,15 @@ void Model2DObject::render( Mat3< float > &kamMat, Bild &zRObj, const char *kamN
     if( !rData || !rData->polygons || !textur )
         return;
     int num = 0;
-    for( auto p = rData->vListen->getIterator(); p; p++, num++ )
+    for( auto p : *rData->vListen )
     {
         Mat3< float > mat = kamMat * getObjectMatrix();
         if( textur->z( num ) )
         {
             Bild *txt = textur->z( num )->zTextur();
-            for( auto i = p->getIterator(); i && txt; i++ )
+            for( auto i = p->begin(); i && txt; i++ )
             {
-                for( auto j = i->zListe()->getIterator(); j.hasNext() && j.next().hasNext(); j++ )
+                for( auto j = i->zListe()->begin(); j.hasNext() && j.next().hasNext(); j++ )
                 {
                     Vertex a = mat * *j->punkt;
                     Vertex b = mat * *j.next()->punkt;
@@ -778,6 +780,7 @@ void Model2DObject::render( Mat3< float > &kamMat, Bild &zRObj, const char *kamN
                 }
             }
         }
+        num++;
     }
     /* Draws 2D Mesh
     for( auto *p = &rData->vListen->getIterator(); p && p->set; p = p->next, num++ )
@@ -807,21 +810,20 @@ bool Model2DObject::istPunktInnen( Vertex p, bool ignoreTransparent ) const
     p -= position;
     if( p < Mat3< float >::scaling( size ) * rData->minP || p > Mat3< float >::scaling( size ) * rData->maxP || !rData->polygons )
         return 0;
-    int num = 0;
     Mat3< float > mat = Mat3< float >::rotation( -rotation ) * Mat3< float >::scaling( 1 / size );
     p = mat * p;
-    for( auto polygon = rData->polygons->getIterator(); polygon; polygon++, num++ )
+    for( Polygon2D polygon : *rData->polygons)
     {
-        if( polygon._.transparent && !ignoreTransparent )
+        if( polygon.transparent && !ignoreTransparent )
             continue;
         bool c = 0;
-        for( auto point = polygon._.vertex->getIterator(); point; point++ )
+        for( auto point = polygon.vertex->begin(); point; point++ )
         {
             Vertex a;
             if( point.next() )
                 a = point.next();
             else
-                a = polygon._.vertex->get( 0 );
+                a = polygon.vertex->get( 0 );
             Vertex b = point;
             if( ( ( a.y >= p.y ) != ( b.y >= p.y ) ) && ( p.x <= ( b.x - a.x ) * ( p.y - a.y ) / (float)( b.y - a.y ) + a.x ) )
                 c = !c;
@@ -885,17 +887,17 @@ bool Model2DObject::istModelInnen( const Object2D *zObj, Vertex *sp, bool end, b
             return 0;
     }
     Mat3< float > mat = getObjectMatrix();
-    for( auto polygon = rData->polygons->getIterator(); polygon; polygon++ )
+    for( Polygon2D polygon : *rData->polygons )
     {
-        if( polygon._.transparent && !ignoreTransparent )
+        if( polygon.transparent && !ignoreTransparent )
             continue;
-        int anz = polygon._.vertex->getEintragAnzahl();
+        int anz = polygon.vertex->getEintragAnzahl();
         for( int i = 0; i < anz; i++ )
         {
-            if( zObj->istPunktInnen( mat * polygon._.vertex->get( i ), ignoreTransparent ) )
+            if( zObj->istPunktInnen( mat * polygon.vertex->get( i ), ignoreTransparent ) )
             {
                 if( sp )
-                    *sp = mat * polygon._.vertex->get( i );
+                    *sp = mat * polygon.vertex->get( i );
                 return 1;
             }
         }
@@ -922,9 +924,9 @@ bool Model2DObject::calcHitPoint( Vertex pos, Vertex dir, Vertex &hitpoint ) con
     float dist = INFINITY;
     if( rData )
     {
-        for( auto p = rData->polygons->getIterator(); p; p++ )
+        for( Polygon2D p : *rData->polygons )
         {
-            if( !p._.transparent && rData->calcHitPoint( pos, dir, p._.name->getText(), hp, ms, rs ) )
+            if( !p.transparent && rData->calcHitPoint( pos, dir, p.name->getText(), hp, ms, rs ) )
             {
                 float f = ( hp.x - pos.x ) / dir.x;
                 if( !speed.x )
@@ -955,13 +957,13 @@ float Model2DObject::getLuftWiederstand() const
     Mat3< float > m = Mat3< float >::rotation( rotation + faktor * angle ) * Mat3< float >::scaling( size );
     float yMin = INFINITY;
     float yMax = -INFINITY;
-    for( auto p = rData->polygons->getIterator(); p; p++ )
+    for( Polygon2D p : *rData->polygons )
     {
-        if( p._.transparent )
+        if( p.transparent )
             continue;
-        for( auto point = p._.vertex->getIterator(); point; point++ )
+        for( Vertex point : *p.vertex )
         {
-            Vertex v = m * point._;
+            Vertex v = m * point;
             if( v.y > yMax )
                 yMax = v.y;
             if( v.y < yMin )
@@ -993,10 +995,11 @@ Textur2D *Model2DObject::getTextur() const
 Textur2D *Model2DObject::getTextur( const char *polygonName ) const
 {
     int index = 0;
-    for( auto i = rData->polygons->getIterator(); i; i++, index++ )
+    for( Polygon2D p : *rData->polygons )
     {
-        if( i._.name->istGleich( polygonName ) )
+        if( p.name->istGleich( polygonName ) )
             return textur->get( index );
+        index++;
     }
     return 0;
 }
@@ -1012,10 +1015,11 @@ Textur2D *Model2DObject::zTextur() const
 Textur2D *Model2DObject::zTextur( const char *polygonName ) const
 {
     int index = 0;
-    for( auto i = rData->polygons->getIterator(); i; i++, index++ )
+    for( Polygon2D p : *rData->polygons )
     {
-        if( i._.name->istGleich( polygonName ) )
+        if( p.name->istGleich( polygonName ) )
             return textur->z( index );
+        index++;
     }
     return 0;
 }
@@ -1098,7 +1102,7 @@ void Model2D::setTextur( Textur2D *t )
     int index = 0;
     if( rData )
     {
-        for( auto i = rData->polygons->getIterator(); i; i++ )
+        for( Polygon2D p : *rData->polygons )
             textur->set( dynamic_cast<Textur2D *>( t->getThis() ), index++ );
     }
     t->release();
@@ -1107,10 +1111,11 @@ void Model2D::setTextur( Textur2D *t )
 void Model2D::setTextur( Textur2D *t, const char *polygonName )
 {
     int index = 0;
-    for( auto i = rData->polygons->getIterator(); i; i++, index++ )
+    for( Polygon2D p : *rData->polygons )
     {
-        if( i._.name->istGleich( polygonName ) )
+        if( p.name->istGleich( polygonName ) )
             textur->set( dynamic_cast<Textur2D *>( t->getThis() ), index );
+        index++;
     }
     t->release();
 }
@@ -1132,16 +1137,16 @@ void Model2D::render( Bild &zRObj )
         return;
     Zeichnung::render( zRObj );
     int num = 0;
-    for( auto p = rData->vListen->getIterator(); p; p++, num++ )
+    for( auto p : *rData->vListen )
     {
         Mat3< float > mat = Mat3< float >::translation( pos ) * Mat3< float >::rotation( drehung ) * Mat3< float >::scaling( size );
         if( hatStyle( Model2D::Style::Textur ) )
         {
             if( !textur || !textur->z( num ) || !textur->z( num )->zTextur() || !rData->polygons->get( num ).tKordinaten )
             {
-                for( auto i = p->getIterator(); i; i++ )
+                for( auto i : *p )
                 {
-                    for( auto j = i->zListe()->getIterator(); j.hasNext() && j.next().hasNext(); j++ )
+                    for( auto j = i->zListe()->begin(); j.hasNext() && j.next().hasNext(); j++ )
                     {
                         Vertex a = mat * *j->punkt;
                         Vertex b = mat * *j.next()->punkt;
@@ -1156,9 +1161,9 @@ void Model2D::render( Bild &zRObj )
             else
             {
                 Bild *txt = textur->z( num )->zTextur();
-                for( auto i = p->getIterator(); i; i++ )
+                for( auto i : *p )
                 {
-                    for( auto j = i->zListe()->getIterator(); j.hasNext() && j.next().hasNext(); j++ )
+                    for( auto j = i->zListe()->begin(); j.hasNext() && j.next().hasNext(); j++ )
                     {
                         Vertex a = mat * *j->punkt;
                         Vertex b = mat * *j.next()->punkt;
@@ -1176,9 +1181,9 @@ void Model2D::render( Bild &zRObj )
         }
         if( hatStyle( Model2D::Style::Mesh ) )
         {
-            for( auto i = p->getIterator(); i; i++ )
+            for( auto i : *p )
             {
-                for( auto j = i->zListe()->getIterator(); j.hasNext() && j.next().hasNext(); j++ )
+                for( auto j = i->zListe()->begin(); j.hasNext() && j.next().hasNext(); j++ )
                 {
                     Vertex a = mat * *j->punkt;
                     Vertex b = mat * *j.next()->punkt;
@@ -1200,7 +1205,7 @@ void Model2D::render( Bild &zRObj )
         }
         if( hatStyle( Model2D::Style::Rahmen ) )
         {
-            auto beg = rData->polygons->get( num ).vertex->getIterator();
+            auto beg = rData->polygons->get( num ).vertex->begin();
             if( beg )
             {
                 Vertex letzter;
@@ -1221,6 +1226,7 @@ void Model2D::render( Bild &zRObj )
                 }
             }
         }
+        num++;
     }
 }
 
@@ -1249,19 +1255,18 @@ bool Model2D::istPunktInnen( Vertex p ) const
     p -= pos;
     if( p < Mat3< float >::scaling( size ) * rData->minP || p > Mat3< float >::scaling( size ) * rData->maxP || !rData->polygons )
         return 0;
-    int num = 0;
-    for( auto polygon = rData->polygons->getIterator(); polygon; polygon++, num++ )
+    for( Polygon2D polygon : *rData->polygons )
     {
-        if( polygon._.transparent )
+        if( polygon.transparent )
             continue;
         Mat3< float > mat = Mat3< float >::rotation( drehung ) * Mat3< float >::scaling( size );
-        int anz = polygon._.vertex->getEintragAnzahl();
+        int anz = polygon.vertex->getEintragAnzahl();
         bool c = 0;
         int j = anz - 1;
         for( int i = 0; i < anz; i++ )
         {
-            Vertex a = mat * polygon._.vertex->get( i );
-            Vertex b = mat * polygon._.vertex->get( j );
+            Vertex a = mat * polygon.vertex->get( i );
+            Vertex b = mat * polygon.vertex->get( j );
             if( ( ( a.y >= p.y ) != ( b.y >= p.y ) ) && ( p.x <= ( b.x - a.x ) * ( p.y - a.y ) / (float)( b.y - a.y ) + a.x ) )
                 c = !c;
             j = i;
@@ -1329,14 +1334,14 @@ bool Model2D::istModelInnen( const Model2D *zMdl, bool end ) const
             return 0;
     }
     Mat3< float > mat = Mat3< float >::translation( pos ) * Mat3< float >::rotation( drehung ) * Mat3< float >::scaling( size );
-    for( auto polygon = rData->polygons->getIterator(); polygon; polygon++ )
+    for( Polygon2D polygon : *rData->polygons )
     {
-        if( polygon._.transparent )
+        if( polygon.transparent )
             continue;
-        int anz = polygon._.vertex->getEintragAnzahl();
+        int anz = polygon.vertex->getEintragAnzahl();
         for( int i = 0; i < anz; i++ )
         {
-            if( zMdl->istPunktInnen( mat * polygon._.vertex->get( i ) ) )
+            if( zMdl->istPunktInnen( mat * polygon.vertex->get( i ) ) )
                 return 1;
         }
     }

+ 82 - 82
Model3D.cpp

@@ -36,21 +36,21 @@ Knochen::~Knochen()
 
 // Setzt die Position des Knochens relativ zum Model Ursprung
 //  pos: Die Position
-void Knochen::setPosition( Vec3< float > &pos )
+void Knochen::setPosition( Vec3< float >& pos )
 {
     this->pos = pos;
 }
 
 // Setzt die Drehung des Knochens relativ zum Model Ursprung
 //  winkel: Ein Vektor der die Drehung um die verschiedenen Achsen als Komponenten hat
-void Knochen::setDrehung( Vec3< float > &winkel )
+void Knochen::setDrehung( Vec3< float >& winkel )
 {
     this->winkel = winkel;
 }
 
 // Fügt dem Knochen ein Geschwister Knochen hinzu
 //  k: Der Knochen, der hinzugefügt werden soll
-void Knochen::addGeschwisterKnochen( Knochen *k )
+void Knochen::addGeschwisterKnochen( Knochen* k )
 {
     if( !geschwister )
         geschwister = k;
@@ -61,7 +61,7 @@ void Knochen::addGeschwisterKnochen( Knochen *k )
 // Fügt einem bestimmten Knochen ein Kind Knochen hinzu
 //  id: Die id des Knochens, wo der Knochen als Kind hinzugefügt werden soll
 //  k: Der Knochen, der hinzugefügt werden soll
-void Knochen::addKind( int id, Knochen *k )
+void Knochen::addKind( int id, Knochen* k )
 {
     if( this->id == id )
     {
@@ -82,7 +82,7 @@ void Knochen::addKind( int id, Knochen *k )
             err += __LINE__;
             err += "!";
             delete k;
-            throw std::out_of_range( (const char *)err );
+            throw std::out_of_range( (const char*)err );
         }
     }
 }
@@ -92,7 +92,7 @@ void Knochen::addKind( int id, Knochen *k )
 //  matBuffer: Ein Array, in dem alle berechneten Matrizen gespeichert werden sollen
 //  scaleFactor: Die Skallierung des Modells
 //  kamMatrix: Die vereiniegung der view und projektions Matrizen
-void Knochen::kalkulateMatrix( Mat4< float > &elternMat, Mat4< float > *matBuffer, float scaleFactor, Mat4< float > &kamMat )
+void Knochen::kalkulateMatrix( Mat4< float >& elternMat, Mat4< float >* matBuffer, float scaleFactor, Mat4< float >& kamMat )
 {
     if( geschwister )
         geschwister->kalkulateMatrix( elternMat, matBuffer, scaleFactor, kamMat );
@@ -103,20 +103,20 @@ void Knochen::kalkulateMatrix( Mat4< float > &elternMat, Mat4< float > *matBuffe
     matBuffer[ id ] = kamMat * matBuffer[ id ];
 }
 
-Knochen *Framework::Knochen::zGeschwister() const
+Knochen* Framework::Knochen::zGeschwister() const
 {
     return geschwister;
 }
 
-Knochen *Framework::Knochen::zKind() const
+Knochen* Framework::Knochen::zKind() const
 {
     return kinder;
 }
 
 // Kopiert den Knochen mit allen Geschwister Knochen und Kind Knochen
-Knochen *Knochen::kopiereKnochen() const
+Knochen* Knochen::kopiereKnochen() const
 {
-    Knochen *ret = new Knochen( id );
+    Knochen* ret = new Knochen( id );
     ret->pos = pos;
     ret->winkel = winkel;
     if( geschwister )
@@ -187,7 +187,7 @@ void Framework::Skelett::setNextKnochenId( int id )
 // Fügt dem Skellet einen Knochen hinzu
 //  k: Der Knochen
 //  elternId: Die Id des Eltern Knochens. Wenn der Knochen kein Elternknochen besitzt, kannder Parameter weggelassen werden.
-void Skelett::addKnochen( Knochen *k, int elternId )
+void Skelett::addKnochen( Knochen* k, int elternId )
 {
     if( !this->k )
         this->k = k;
@@ -203,7 +203,7 @@ void Skelett::addKnochen( Knochen *k, int elternId )
 //  scaleFactor: Die skallierung des Objektes
 //  kamMatrix: Die vereiniegung der view und projektions Matrizen
 //  return: gibt die Anzahl der verwendeten Matrizen zurück
-int Skelett::kalkulateMatrix( Mat4< float > &modelMatrix, Mat4< float > *matBuffer, float scaleFactor, Mat4< float > &kamMatrix )
+int Skelett::kalkulateMatrix( Mat4< float >& modelMatrix, Mat4< float >* matBuffer, float scaleFactor, Mat4< float >& kamMatrix )
 {
     k->kalkulateMatrix( modelMatrix, matBuffer, scaleFactor, kamMatrix );
     return nextId;
@@ -218,15 +218,15 @@ float Skelett::getRadius() const
 }
 
 // gibt den Wurzel Knochen zurück
-Knochen *Framework::Skelett::zKnochen() const
+Knochen* Framework::Skelett::zKnochen() const
 {
     return k;
 }
 
 // Kopiert das Skelett
-Skelett *Skelett::kopiereSkelett() const
+Skelett* Skelett::kopiereSkelett() const
 {
-    Skelett *ret = new Skelett();
+    Skelett* ret = new Skelett();
     ret->nextId = nextId;
     if( k )
         ret->addKnochen( k->kopiereKnochen() );
@@ -263,7 +263,7 @@ Model3DData::Model3DData()
     skelett = 0;
     vertexList = 0;
     vertexCount = 0;
-    polygons = new Array< Polygon3D * >();
+    polygons = new Array< Polygon3D* >();
     ambientFactor = 1.f;
     diffusFactor = 0.f;
     specularFactor = 0.f;
@@ -286,7 +286,7 @@ void Model3DData::clearModel()
     delete[] vertexList;
     vertexCount = 0;
     vertexList = 0;
-    for( auto i = polygons->getIterator(); i; i++ )
+    for( Polygon3D* i : *polygons )
         delete i;
     polygons->leeren();
     if( skelett )
@@ -304,7 +304,7 @@ void Model3DData::calculateNormals()
     for( int i = 0; i < vertexCount; i++ )
     {
         Vec3< float > normal( 0, 0, 0 );
-        for( auto p = polygons->getIterator(); p; p++ )
+        for( Polygon3D* p : *polygons )
         {
             int begin = 0;
             for( int j = 0; j < p->indexAnz; j++ )
@@ -316,7 +316,7 @@ void Model3DData::calculateNormals()
                     Vec3< float > a = vertexList[ p->indexList[ begin ] ].pos;
                     Vec3< float > b = vertexList[ p->indexList[ begin + 1 ] ].pos;
                     Vec3< float > c = vertexList[ p->indexList[ begin + 2 ] ].pos;
-                    normal += ( b - a ).crossProduct( c - a ).normalize();
+                    normal += (b - a).crossProduct( c - a ).normalize();
                     normal.normalize();
                 }
             }
@@ -330,11 +330,11 @@ void Model3DData::buildIndexBuffer()
 {
     delete[] indexBuffer;
     indexCount = 0;
-    for( auto p = polygons->getIterator(); p; p++ )
+    for( Polygon3D* p : *polygons )
         indexCount += p->indexAnz;
     indexBuffer = new int[ indexCount ];
     int current = 0;
-    for( auto p = polygons->getIterator(); p; p++ )
+    for( Polygon3D* p : *polygons )
     {
         memcpy( indexBuffer + current, p->indexList, sizeof( int ) * p->indexAnz );
         current += p->indexAnz;
@@ -343,7 +343,7 @@ void Model3DData::buildIndexBuffer()
 
 // Setzt den Zeiger auf ein standartmäßig verwendete Skelett
 //  s: Das Skelett, das verwendet werden soll
-void Model3DData::setSkelettZ( Skelett *s )
+void Model3DData::setSkelettZ( Skelett* s )
 {
     if( skelett )
         skelett->release();
@@ -353,7 +353,7 @@ void Model3DData::setSkelettZ( Skelett *s )
 // Setzt einen Zeiger auf eine Liste mit allen Vertecies des Models
 //  vertexList: Ein Array mit Vertecies
 //  anz: Die Anzahl der Vertecies im Array
-void Model3DData::setVertecies( Vertex3D *vertexList, int anz )
+void Model3DData::setVertecies( Vertex3D* vertexList, int anz )
 {
     delete[] this->vertexList;
     this->vertexList = vertexList;
@@ -369,7 +369,7 @@ void Model3DData::setVertecies( Vertex3D *vertexList, int anz )
 
 // Fügt ein Polygon zum Model hinzu
 //  polygon: Das Polygon, das hinzugefügt erden soll
-void Model3DData::addPolygon( Polygon3D *polygon )
+void Model3DData::addPolygon( Polygon3D* polygon )
 {
     polygons->add( polygon );
     buildIndexBuffer();
@@ -399,33 +399,33 @@ void Model3DData::setSpecularFactor( float f )
 // Konvertiert ein 2d Model zu 3D
 //  model: Das 2d Model, das zu 3d konvertiert werden soll
 //  z: Die z koordinate aller punkte des Models
-void Model3DData::copyModel2D( Model2DData *model, float z )
+void Model3DData::copyModel2D( Model2DData* model, float z )
 {
     if( model && model->vListen && model->polygons )
     {
         clearModel();
         int vAnz = 0;
-        for( auto i = model->polygons->getIterator(); i; i++ )
-            vAnz += i._.vertex->getEintragAnzahl();
+        for( Polygon2D p : *model->polygons )
+            vAnz += p.vertex->getEintragAnzahl();
         vertexList = new Vertex3D[ vAnz ];
         int index = 0;
-        for( auto i = model->vListen->getIterator(); i; i++ )
+        for( auto i : *model->vListen )
         {
-            Polygon3D *p = new Polygon3D();
+            Polygon3D* p = new Polygon3D();
             p->indexAnz = 0;
-            for( auto j = i->getIterator(); j; j++ )
+            for( auto j : *i )
             {
-                for( auto k = j->zListe()->getIterator(); k.hasNext() && k.next().hasNext(); k++ )
+                for( auto k = j->zListe()->begin(); k.hasNext() && k.next().hasNext(); k++ )
                     p->indexAnz += 3;
             }
             p->indexList = new int[ p->indexAnz ];
             p->indexAnz = 0;
-            for( auto j = i->getIterator(); j; j++ )
+            for( auto j : *i )
             {
-                for( auto k = j->zListe()->getIterator(); k; k++ )
+                for( auto k = j->zListe()->begin(); k; k++ )
                 {
                     vertexList[ index ].pos = Vec3< float >( k->punkt->x, k->punkt->y, z );
-                    vertexList[ index ].tPos = ( Vec2< float > ) * k->textur;
+                    vertexList[ index ].tPos = (Vec2< float >) * k->textur;
                     if( k.hasNext() && k.next().hasNext() )
                     {
                         p->indexList[ p->indexAnz ] = index;
@@ -460,7 +460,7 @@ void Model3DData::removePolygon( int index )
 //  scaleFactor: Die Skallierung des Modells
 //  kamMatrix: Die vereiniegung der view und projektions Matrizen
 //  return: gibt die Anzahl der verwendeten Matrizen zurück
-int Model3DData::kalkulateMatrix( Mat4< float > &modelMatrix, Mat4< float > *matBuffer, float scaleFactor, Mat4< float > &kamMatrix ) const
+int Model3DData::kalkulateMatrix( Mat4< float >& modelMatrix, Mat4< float >* matBuffer, float scaleFactor, Mat4< float >& kamMatrix ) const
 {
     if( !skelett )
         return 0;
@@ -475,7 +475,7 @@ int Model3DData::getPolygonAnzahl() const
 
 // Gibt ein bestimmtes Polygon zurück
 //  index: Der Index des Polygons
-Polygon3D *Model3DData::getPolygon( int index ) const
+Polygon3D* Model3DData::getPolygon( int index ) const
 {
     if( !polygons->hat( index ) )
         return 0;
@@ -483,9 +483,9 @@ Polygon3D *Model3DData::getPolygon( int index ) const
 }
 
 // Gibt einen Iterator zurück, mit dem sich die Polygons auflisten lassen
-Iterator< Polygon3D * > Model3DData::getPolygons() const
+Iterator< Polygon3D* > Model3DData::getPolygons() const
 {
-    return polygons->getIterator();
+    return polygons->begin();
 }
 
 // Gibt den radius einer Kugel zurück, die das gesammte Model umschließt
@@ -519,7 +519,7 @@ float Model3DData::getSpecularFactor() const
 }
 
 // Gibt eine Kopie des Skeletts zurück, welches für annimationen verwendet werden kann
-Skelett *Model3DData::copySkelett() const
+Skelett* Model3DData::copySkelett() const
 {
     return skelett ? skelett->kopiereSkelett() : 0;
 }
@@ -531,13 +531,13 @@ int Model3DData::getVertexAnzahl() const
 }
 
 // Gibt einen Buffer mit allen Vertecies des Models zurück
-const Vertex3D *Model3DData::zVertexBuffer() const
+const Vertex3D* Model3DData::zVertexBuffer() const
 {
     return vertexList;
 }
 
 //! Gibt eine refferenz auf den beginn des indexBuffers zurück
-const int *Model3DData::getIndexBuffer() const
+const int* Model3DData::getIndexBuffer() const
 {
     return indexBuffer;
 }
@@ -567,7 +567,7 @@ Model3DTextur::~Model3DTextur()
 // Legt fest, welche Textur für welches Polygon ist
 //  pI: Der Index des Polygons
 //  txt: Die Textur des Polygons
-void Model3DTextur::setPolygonTextur( int pI, Textur *txt )
+void Model3DTextur::setPolygonTextur( int pI, Textur* txt )
 {
     while( pI > textures->getLastIndex() )
         textures->add( 0 );
@@ -576,18 +576,18 @@ void Model3DTextur::setPolygonTextur( int pI, Textur *txt )
 
 // Gibt einen Zeiger auf die Textur eines Polygons zurück ohne erhöhten Reference Counter
 //  i: Der Index des Polygons
-Textur *Model3DTextur::zPolygonTextur( int i ) const
+Textur* Model3DTextur::zPolygonTextur( int i ) const
 {
     return textures->z( i );
 }
 
 // Inhalt der AnimationData Struktur
-Model3D::AnimationData *Model3D::AnimationData::getThis()
+Model3D::AnimationData* Model3D::AnimationData::getThis()
 {
     return this;
 }
 
-Model3D::AnimationData *Model3D::AnimationData::release()
+Model3D::AnimationData* Model3D::AnimationData::release()
 {
     a->release();
     delete this;
@@ -622,9 +622,9 @@ Model3D::~Model3D()
 
 // Fügt eine Animation hinzu
 //  a: Die neue Animation
-void Model3D::addAnimation( Animation3D *a, double speed )
+void Model3D::addAnimation( Animation3D* a, double speed )
 {
-    AnimationData *d = new AnimationData();
+    AnimationData* d = new AnimationData();
     d->a = a;
     d->speed = speed;
     d->offset = 0;
@@ -633,7 +633,7 @@ void Model3D::addAnimation( Animation3D *a, double speed )
 
 // Entfernt eine Animation
 //  zA: Die zu entfernende Animation
-void Model3D::removeAnimation( Animation3D *zA )
+void Model3D::removeAnimation( Animation3D* zA )
 {
     for( int i = 0; i < animations->getEintragAnzahl(); i++ )
     {
@@ -647,12 +647,12 @@ void Model3D::removeAnimation( Animation3D *zA )
 
 // Setzt die Daten des Models
 //  data: Die Daten
-void Model3D::setModelDaten( Model3DData *data )
+void Model3D::setModelDaten( Model3DData* data )
 {
     if( model )
         model->release();
     if( skelett )
-        skelett = (Skelett *)skelett->release();
+        skelett = (Skelett*)skelett->release();
     model = data;
     if( model )
     {
@@ -665,7 +665,7 @@ void Model3D::setModelDaten( Model3DData *data )
 
 // Setzt die zum Zeichnen zu benutzenden Texturen
 //  txt: Ein Liste mit Texturen zu den verschiedenen Polygonen zugeordnet
-void Model3D::setModelTextur( Model3DTextur *txt )
+void Model3D::setModelTextur( Model3DTextur* txt )
 {
     if( textur )
         textur->release();
@@ -697,7 +697,7 @@ void Framework::Model3D::setSpecularFactor( float f )
 //  viewProj: Die miteinander multiplizierten Kameramatrizen
 //  matBuffer: Ein Array mit Matrizen, der gefüllt werden soll
 //  return: Die Anzahl der Matrizen, die das Model benötigt
-int Model3D::errechneMatrizen( Mat4< float > &viewProj, Mat4< float > *matBuffer )
+int Model3D::errechneMatrizen( Mat4< float >& viewProj, Mat4< float >* matBuffer )
 {
     int ret = 0;
     if( skelett )
@@ -718,7 +718,7 @@ bool Model3D::tick( double tickval )
     if( skelett )
     {
         radius += skelett->getRadius();
-        for( auto i = animations->getIterator(); i && i._; i++ )
+        for( auto i = animations->begin(); i && i._; i++ )
         {
             rend = i->speed > 0;
             i->a->apply( skelett, i->offset, tickval * i->speed );
@@ -728,25 +728,25 @@ bool Model3D::tick( double tickval )
 }
 
 // Gibt die Textur zurück
-Model3DTextur *Model3D::getTextur()
+Model3DTextur* Model3D::getTextur()
 {
-    return textur ? dynamic_cast<Model3DTextur *>( textur->getThis() ) : 0;
+    return textur ? dynamic_cast<Model3DTextur*>(textur->getThis()) : 0;
 }
 
 // Gibt die Textur zurück (ohne erhöhten Reference Counter)
-Model3DTextur *Model3D::zTextur()
+Model3DTextur* Model3D::zTextur()
 {
     return textur;
 }
 
 // Gibt die ModelDaten zurück
-Model3DData *Model3D::getModelData()
+Model3DData* Model3D::getModelData()
 {
-    return model ? dynamic_cast<Model3DData *>( model->getThis() ) : 0;
+    return model ? dynamic_cast<Model3DData*>(model->getThis()) : 0;
 }
 
 // Gibt die ModelDaten zurück (ohne erhöhten Reference Counter)
-Model3DData *Model3D::zModelData()
+Model3DData* Model3D::zModelData()
 {
     return model;
 }
@@ -757,7 +757,7 @@ Model3DData *Model3D::zModelData()
 //  maxSqDist: Die maximale quadratische distanz die erlaubt ist
 //  pId: die Id des Polygons, zu dem der Schnittpunkt gehört
 //  return: den quadratischen Abstand des Schnittpunktes zum Ursprung des Strahls oder -1, wenn kein schnittpunkt existiert 
-float Model3D::traceRay( Vec3< float > &p, Vec3< float > &d, float maxSqDist, int &pId ) const
+float Model3D::traceRay( Vec3< float >& p, Vec3< float >& d, float maxSqDist, int& pId ) const
 {
     if( !model )
         return -1;
@@ -770,9 +770,9 @@ float Model3D::traceRay( Vec3< float > &p, Vec3< float > &d, float maxSqDist, in
     point.rotateX( -angle.x );
     point.rotateZ( -angle.z );
     point -= pos;
-    float nearest = ( -dir.x * point.x - dir.y * point.y - dir.z * point.z ) / ( dir.x * dir.x + dir.y * dir.y + dir.z * dir.z );
-    float dist = ( point + dir * nearest ).getLengthSq();
-    if( dist > ( radius * size ) * ( radius * size ) || ( dir * nearest ).getLength() - radius * size > sqrt( maxSqDist ) || ( nearest < 0 && ( dir * nearest ).getLengthSq() > radius * size * radius * size ) ) // es gibt kein schnittpunkt
+    float nearest = (-dir.x * point.x - dir.y * point.y - dir.z * point.z) / (dir.x * dir.x + dir.y * dir.y + dir.z * dir.z);
+    float dist = (point + dir * nearest).getLengthSq();
+    if( dist > (radius * size) * (radius * size) || (dir * nearest).getLength() - radius * size > sqrt( maxSqDist ) || (nearest < 0 && (dir * nearest).getLengthSq() > radius * size * radius * size) ) // es gibt kein schnittpunkt
         return -1;
     bool existsHit = 0;
     if( skelett )
@@ -791,16 +791,16 @@ float Model3D::traceRay( Vec3< float > &p, Vec3< float > &d, float maxSqDist, in
                     Vec3< float > a = model->zVertexBuffer()[ p->indexList[ j ] ].pos;
                     Vec3< float > b = model->zVertexBuffer()[ p->indexList[ j + 1 ] ].pos;
                     Vec3< float > c = model->zVertexBuffer()[ p->indexList[ j + 2 ] ].pos;
-                    Vec3< float > normal = ( b - a ).crossProduct( c - a ).normalize();
+                    Vec3< float > normal = (b - a).crossProduct( c - a ).normalize();
                     if( normal * dir < 0 ) // Prüfe ob die Normale in Richtung des Strahl ursprungs zeigt
                     {
-                        nearest = ( a * normal - point * normal ) / ( dir * normal );
+                        nearest = (a * normal - point * normal) / (dir * normal);
                         Vec3< float > hit = point + dir * nearest;
-                        if( ( b - a ).angle( hit - a ) <= ( b - a ).angle( c - a ) &&
-                            ( c - a ).angle( hit - a ) <= ( b - a ).angle( c - a ) &&
-                            ( a - b ).angle( hit - b ) <= ( a - b ).angle( c - b ) )
+                        if( (b - a).angle( hit - a ) <= (b - a).angle( c - a ) &&
+                            (c - a).angle( hit - a ) <= (b - a).angle( c - a ) &&
+                            (a - b).angle( hit - b ) <= (a - b).angle( c - b ) )
                         {
-                            maxSqDist = ( hit - point ).getLengthSq();
+                            maxSqDist = (hit - point).getLengthSq();
                             pId = index;
                             existsHit = 1;
                         }
@@ -818,7 +818,7 @@ float Model3D::traceRay( Vec3< float > &p, Vec3< float > &d, float maxSqDist, in
 //  dir: die Richtung des Strahls in Weltkoordinaten
 //  zWelt: die Welt, aus der der Strahl kommt
 //  return: die Farbe des Schnittpunktes 
-int Model3D::traceRay( Vec3< float > &p, Vec3< float > &d, int pId, Welt3D *zWelt ) const
+int Model3D::traceRay( Vec3< float >& p, Vec3< float >& d, int pId, Welt3D* zWelt ) const
 {
     Vec3< float > dir = d;
     dir.rotateY( -angle.y );
@@ -838,23 +838,23 @@ int Model3D::traceRay( Vec3< float > &p, Vec3< float > &d, int pId, Welt3D *zWel
             {
                 if( pId == 0 )
                 {
-                    const Vec3< float > &a = model->zVertexBuffer()[ p->indexList[ j ] ].pos;
-                    const Vec3< float > &b = model->zVertexBuffer()[ p->indexList[ j + 1 ] ].pos;
-                    const Vec3< float > &c = model->zVertexBuffer()[ p->indexList[ j + 2 ] ].pos;
+                    const Vec3< float >& a = model->zVertexBuffer()[ p->indexList[ j ] ].pos;
+                    const Vec3< float >& b = model->zVertexBuffer()[ p->indexList[ j + 1 ] ].pos;
+                    const Vec3< float >& c = model->zVertexBuffer()[ p->indexList[ j + 2 ] ].pos;
                     Vertex at = model->zVertexBuffer()[ p->indexList[ j ] ].tPos;
                     Vertex bt = model->zVertexBuffer()[ p->indexList[ j + 1 ] ].tPos;
                     Vertex ct = model->zVertexBuffer()[ p->indexList[ j + 2 ] ].tPos;
-                    Vec3< float > normal = ( b - a ).crossProduct( c - a ).normalize();
-                    float t = ( a * normal - point * normal ) / ( dir * normal );
+                    Vec3< float > normal = (b - a).crossProduct( c - a ).normalize();
+                    float t = (a * normal - point * normal) / (dir * normal);
                     Vec3< float > hit = point + dir * t;
-                    float a0 = ( a - b ).crossProduct( a - c ).getLength() / 2;
-                    float a1 = ( b - hit ).crossProduct( c - hit ).getLength() / 2 / a0;
-                    float a2 = ( c - hit ).crossProduct( a - hit ).getLength() / 2 / a0;
-                    float a3 = ( a - hit ).crossProduct( b - hit ).getLength() / 2 / a0;
+                    float a0 = (a - b).crossProduct( a - c ).getLength() / 2;
+                    float a1 = (b - hit).crossProduct( c - hit ).getLength() / 2 / a0;
+                    float a2 = (c - hit).crossProduct( a - hit ).getLength() / 2 / a0;
+                    float a3 = (a - hit).crossProduct( b - hit ).getLength() / 2 / a0;
                     Vertex ht = at * a1 + bt * a2 + ct * a3;
-                    Bild *tex = textur->zPolygonTextur( index )->zBild();
+                    Bild* tex = textur->zPolygonTextur( index )->zBild();
                     if( ht.x >= 0 && ht.y >= 0 && ht.x <= 1 && ht.y <= 1 )
-                        return tex->getPixel( (int)( ht.x * ( (float)tex->getBreite() - 1.f ) + 0.5f ), (int)( ht.y * ( (float)tex->getHeight() - 1.f ) + 0.5f ) );
+                        return tex->getPixel( (int)(ht.x * ((float)tex->getBreite() - 1.f) + 0.5f), (int)(ht.y * ((float)tex->getHeight() - 1.f) + 0.5f) );
                     return 0xFF000000;
                 }
                 pId--;
@@ -895,7 +895,7 @@ int Model3D::getVertexAnzahl() const
 }
 
 // Gibt einen Buffer mit allen Vertecies des Models zurück
-const Vertex3D *Model3D::zVertexBuffer() const
+const Vertex3D* Model3D::zVertexBuffer() const
 {
     return model ? model->zVertexBuffer() : 0;
 }

+ 5 - 5
Model3DList.cpp

@@ -31,7 +31,7 @@ Model3DList::~Model3DList()
 bool Model3DList::addModel( Model3DData *mdl, const char *name )
 {
     cs.lock();
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -53,7 +53,7 @@ void Model3DList::removeModel( const char *name )
 {
     cs.lock();
     int index = 0;
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -73,7 +73,7 @@ void Model3DList::removeModel( const char *name )
 bool Model3DList::hatModel( const char *name ) const
 {
     cs.lock();
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -91,7 +91,7 @@ Model3DData *Model3DList::getModel( const char *name ) const
 {
     cs.lock();
     int index = 0;
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -110,7 +110,7 @@ Model3DData *Model3DList::zModel( const char *name ) const
 {
     cs.lock();
     int index = 0;
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {

+ 3 - 3
TextFeld.cpp

@@ -225,7 +225,7 @@ TextFeld::TextStyle TextFeld::TextStyleManager::getTextStyle( int index ) const
 {
     TextStyle last = textStyle.get( 0 );
     int ind = 0;
-    for( auto i = textStyle.getIterator(); i && ind <= index; ind++ )
+    for( auto i = textStyle.begin(); i && ind <= index; ind++ )
     {
         if( i._.beginIndex <= ind )
         {
@@ -1721,8 +1721,8 @@ Zeichnung *TextFeld::dublizieren() const // Erzeugt eine Kopie des Zeichnungs
     obj->tm->renderer->release();
     obj->tm->renderer = dynamic_cast<RCArray<TextRenderer> *>( tm->renderer->getThis() );
     obj->tm->textStyle.leeren();
-    for( auto i = tm->textStyle.getIterator(); i; i++ )
-        obj->tm->textStyle.add( i._ );
+    for( auto i : tm->textStyle )
+        obj->tm->textStyle.add( i );
     obj->tm->index = tm->index;
     obj->tm->styleIndex = tm->styleIndex;
     obj->tm->current = tm->current;

+ 1 - 1
Textur2D.cpp

@@ -20,7 +20,7 @@ Textur2D::~Textur2D()
 {
     if( txt )
         txt->release();
-    for( auto i = animData->getIterator(); i; i++ )
+    for( auto i : *animData )
     {
         i->data->release();
         delete i;

+ 7 - 7
TexturList.cpp

@@ -38,7 +38,7 @@ __declspec( dllexport ) void TexturList::leeren()
 bool TexturList::addTextur( Textur *t, const char *name )
 {
     cs.lock();
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -60,7 +60,7 @@ void TexturList::removeTextur( const char *name )
 {
     cs.lock();
     int index = 0;
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -80,7 +80,7 @@ void TexturList::removeTextur( const char *name )
 bool TexturList::hatTextur( const char *name ) const
 {
     cs.lock();
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -98,7 +98,7 @@ Textur *TexturList::getTextur( const char *name ) const
 {
     cs.lock();
     int index = 0;
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -116,7 +116,7 @@ Textur *TexturList::getTextur( const char *name ) const
 Textur *TexturList::getTextur( int id ) const
 {
     cs.lock();
-    for( auto i = textures->getIterator(); i; i++ )
+    for( auto i : *textures )
     {
         if( i->getId() == id )
         {
@@ -134,7 +134,7 @@ Textur *TexturList::zTextur( const char *name ) const
 {
     cs.lock();
     int index = 0;
-    for( auto i = names->getIterator(); i; i++ )
+    for( auto i : *names )
     {
         if( i->istGleich( name ) )
         {
@@ -152,7 +152,7 @@ Textur *TexturList::zTextur( const char *name ) const
 Textur *TexturList::zTextur( int id ) const
 {
     cs.lock();
-    for( auto i = textures->getIterator(); i; i++ )
+    for( auto i : *textures )
     {
         if( i->getId() == id )
         {

+ 1 - 1
Thread.cpp

@@ -225,7 +225,7 @@ void ThreadRegister::addClosedThread( pthread_t handle )
 Thread *ThreadRegister::zThread( pthread_t handle )
 {
     EnterCriticalSection( &cs );
-    for( auto i = threads.getIterator(); i; i++ )
+    for( auto i : threads )
     {
         if( i->getThreadHandle() && GetThreadId( i->getThreadHandle() ) == GetThreadId( handle ) && GetThreadId( handle ) != 0 )
         {

+ 25 - 24
ToolTip.cpp

@@ -13,7 +13,7 @@ using namespace Framework;
 
 // Inhalt der ToolTip Klasse aus ToolTip.h
 // Konstruktor
-ToolTip::ToolTip( Bildschirm *zScreen )
+ToolTip::ToolTip( Bildschirm* zScreen )
     : ZeichnungHintergrund(),
     size( 0, 0 ),
     animationSpeed( 250 ),
@@ -31,7 +31,7 @@ ToolTip::ToolTip( Bildschirm *zScreen )
 {
     style = Style::MEIgnoreInside | Style::MEIgnoreParentInside | Style::MEIgnoreSichtbar | Style::MEIgnoreVerarbeitet | Style::Erlaubt;
     members = new RCArray< Zeichnung >();
-    bildschirm->addToolTip( dynamic_cast<ToolTip *>( this->getThis() ) );
+    bildschirm->addToolTip( dynamic_cast<ToolTip*>(this->getThis()) );
     setMausEreignis( _ret1ME );
 }
 
@@ -41,7 +41,7 @@ ToolTip::~ToolTip()
     members->release();
 }
 
-void ToolTip::doMausEreignis( MausEreignis &me, bool userRet )
+void ToolTip::doMausEreignis( MausEreignis& me, bool userRet )
 {
     if( !sichtbar )
         pos.x += me.mx, pos.y += me.my + 15;
@@ -95,7 +95,7 @@ void ToolTip::doMausEreignis( MausEreignis &me, bool userRet )
             me.my += vertikalScrollBar->getScroll();
         if( hatStyle( Style::HScroll ) && horizontalScrollBar )
             me.mx += horizontalScrollBar->getScroll();
-        for( auto z = members->getIterator(); z; z++ )
+        for( auto z : *members )
             z->doPublicMausEreignis( me );
         me.mx += rbr;
         me.my += rbr;
@@ -112,21 +112,22 @@ void ToolTip::doMausEreignis( MausEreignis &me, bool userRet )
 
 // Fügt eine Zeichnung zum Tooltip hinzu
 //  m: die neue Zeichnung
-void ToolTip::addMember( Zeichnung *m )
+void ToolTip::addMember( Zeichnung* m )
 {
     members->add( m );
 }
 
-void ToolTip::removeMember( Zeichnung *zM )
+void ToolTip::removeMember( Zeichnung* zM )
 {
     int index = 0;
-    for( auto i = members->getIterator(); i; i++, index++ )
+    for( auto i : *members )
     {
-        if( i._ == zM )
+        if( i == zM )
         {
             members->remove( index );
             return;
         }
+        index++;
     }
 }
 
@@ -139,14 +140,14 @@ void ToolTip::removeMember( int i )
 
 // setzt eine Funktion, die aufgerufen wird, sobald der Tooltip angezeigt wird
 //  onShow: Die Funktion
-void ToolTip::setShowEvent( std::function< void( ToolTip * ) > onShow )
+void ToolTip::setShowEvent( std::function< void( ToolTip* ) > onShow )
 {
     this->onShow = onShow;
 }
 
 // setzt eine Funktion, die aufgerufen wird, sobald der Tooltip nicht mehr angezeigt wird
 //  onShow: Die Funktion
-void ToolTip::setHideEvent( std::function< void( ToolTip * ) > onHide )
+void ToolTip::setHideEvent( std::function< void( ToolTip* ) > onHide )
 {
     this->onHide = onHide;
 }
@@ -186,7 +187,7 @@ void ToolTip::setZeichnen()
 
 bool ToolTip::tick( double tickVal )
 {
-    for( auto z = members->getIterator(); z; z++ )
+    for( auto z : *members )
     {
         size.x = MAX( size.x, z->getX() + z->getBreite() + 2 * getRahmenBreite() );
         size.y = MAX( size.y, z->getY() + z->getHeight() + 2 * getRahmenBreite() );
@@ -207,7 +208,7 @@ bool ToolTip::tick( double tickVal )
             if( alpha - val < 0 )
                 alpha = 0;
             else
-                alpha = (unsigned char)( alpha - val );
+                alpha = (unsigned char)(alpha - val);
             rend = 1;
         }
         if( mausIn )
@@ -246,16 +247,16 @@ bool ToolTip::tick( double tickVal )
     return ZeichnungHintergrund::tick( tickVal );
 }
 
-void ToolTip::render( Bild &zRObj )
+void ToolTip::render( Bild& zRObj )
 {
-    if( alpha && ( zeichnen || mausIn2 ) )
+    if( alpha && (zeichnen || mausIn2) )
     {
         zRObj.setAlpha( alpha );
         setPosition( pos );
         if( getX() + getBreite() > zRObj.getBreite() )
-            setPosition( getX() - ( getX() + getBreite() - zRObj.getBreite() ), getY() );
+            setPosition( getX() - (getX() + getBreite() - zRObj.getBreite()), getY() );
         if( getY() + getHeight() > zRObj.getHeight() )
-            setPosition( getX(), getY() - ( getY() + getHeight() - zRObj.getHeight() ) );
+            setPosition( getX(), getY() - (getY() + getHeight() - zRObj.getHeight()) );
         ZeichnungHintergrund::render( zRObj );
         Punkt p = pos;
         Punkt s = gr;
@@ -273,7 +274,7 @@ void ToolTip::render( Bild &zRObj )
         bool vSc = hatStyle( Style::VScroll ) && vertikalScrollBar;
         bool hSc = hatStyle( Style::HScroll ) && horizontalScrollBar;
         zRObj.addScrollOffset( hSc ? horizontalScrollBar->getScroll() : 0, vSc ? vertikalScrollBar->getScroll() : 0 );
-        for( auto z = members->getIterator(); z; z++ )
+        for( auto z : *members )
             z->render( zRObj );
         zRObj.releaseDrawOptions();
         zRObj.releaseAlpha();
@@ -282,21 +283,21 @@ void ToolTip::render( Bild &zRObj )
 }
 
 // constant
-Bildschirm *ToolTip::zBildschirm() const
+Bildschirm* ToolTip::zBildschirm() const
 {
     return bildschirm;
 }
 
 // Gibt ein bestimmten member zurück (ohne erhöhten Reference Counter)
 //  i: der Index des Members
-Zeichnung *ToolTip::zMember( int i ) const
+Zeichnung* ToolTip::zMember( int i ) const
 {
     return members->z( i );
 }
 
 // Gibt ein bestimmten member zurück
 //  i: der Index des Members
-Zeichnung *ToolTip::getMember( int i ) const
+Zeichnung* ToolTip::getMember( int i ) const
 {
     return members->get( i );
 }
@@ -308,9 +309,9 @@ int ToolTip::getMemberAnzahl() const
 }
 
 // Erzeugt eine komplette kopie eines tooltip
-Zeichnung *ToolTip::dublizieren() const
+Zeichnung* ToolTip::dublizieren() const
 {
-    ToolTip *ret = new ToolTip( bildschirm );
+    ToolTip* ret = new ToolTip( bildschirm );
     ret->size = size;
     ret->animationSpeed = animationSpeed;
     ret->warten = warten;
@@ -321,7 +322,7 @@ Zeichnung *ToolTip::dublizieren() const
     ret->sichtbar = sichtbar;
     ret->zeichnen = zeichnen;
     ret->mausIn2 = mausIn2;
-    for( auto z = members->getIterator(); z; z++ )
-        ret->addMember( dynamic_cast<Zeichnung *>( z->getThis() ) );
+    for( auto z : *members )
+        ret->addMember( dynamic_cast<Zeichnung*>(z->getThis()) );
     return ret;
 }

+ 8 - 8
Welt2D.cpp

@@ -290,10 +290,10 @@ void Welt2D::setCircular( bool circular )
 
 Object2D *Welt2D::zObjectAt( int x, int y, bool ignoreTransparentFlag )
 {
-    for( auto o = objects->getIterator(); o; o++ )
+    for( auto o : *objects )
     {
         if( o->istPunktInnen( Punkt( x, y ), ignoreTransparentFlag ) )
-            return o._;
+            return o;
     }
     return 0;
 }
@@ -330,7 +330,7 @@ void Welt2D::removeAll()
 void Welt2D::explosion( Vertex worldPos, float intensity, float maxRad )
 {
     maxRad = maxRad * maxRad;
-    for( auto obj = objects->getIterator(); obj; obj++ )
+    for( auto obj : *objects )
     {
         if( info.circular && info.hasSize && info.size.x && info.size.y )
         {
@@ -368,7 +368,7 @@ void Welt2D::impuls( Vertex worldPos, Vertex worldDir )
     Vertex hitPoint;
     float dist = INFINITY;
     Object2D *o = 0;
-    for( auto obj = objects->getIterator(); obj; obj++ )
+    for( auto obj : *objects )
     {
         if( obj->calcHitPoint( worldPos, worldDir, hitPoint ) )
         {
@@ -386,7 +386,7 @@ void Welt2D::impuls( Vertex worldPos, Vertex worldDir )
 bool Welt2D::tick( double zeit )
 {
     bool ret = 0;
-    for( auto obj = objects->getIterator(); obj; obj++ )
+    for( auto obj = objects->begin(); obj; obj++ )
     {
         if( obj.hasNext() && obj->canCollide() )
         {
@@ -403,7 +403,7 @@ bool Welt2D::tick( double zeit )
 
 void Welt2D::render( Mat3< float > &kamMat, Punkt size, Bild &zRObj, int xOffset, int yOffset, const char *kamName )
 {
-    for( auto obj = objects->getIterator(); obj; obj++ )
+    for( auto obj : *objects )
     {
         Rect2< float > bnd = obj->getBoundingBox();
         Vertex topRight = Vertex( bnd.bottomRight.x, bnd.topLeft.y );
@@ -429,7 +429,7 @@ void Welt2D::render( Mat3< float > &kamMat, Punkt size, Bild &zRObj, const char
 {
     if( !info.hasSize || !info.circular )
     {
-        for( auto obj = objects->getIterator(); obj; obj++ )
+        for( auto obj : *objects )
         {
             Rect2< float > bnd = obj->getBoundingBox();
             Vertex topRight = Vertex( bnd.topLeft.y, bnd.bottomRight.x );
@@ -470,5 +470,5 @@ const WeltInfo &Welt2D::getWorldInfo() const
 
 Iterator< Object2D * > Welt2D::getMembers()
 {
-    return objects->getIterator();
+    return objects->begin();
 }

+ 5 - 4
Welt3D.cpp

@@ -45,7 +45,7 @@ void Welt3D::unlock()
 void Welt3D::addZeichnung( Model3D *obj )
 {
     cs.lock();
-    for( auto i = members->getIterator(); i; i++ )
+    for( auto i : *members )
     {
         if( i == obj )
             throw std::exception();
@@ -131,7 +131,7 @@ void Welt3D::doMausEreignis( MausEreignis3D &me )
 bool Welt3D::tick( double tickval )
 {
     cs.lock();
-    for( auto m = members->getIterator(); m; m++ )
+    for( auto m : *members )
         rend |= m->tick( tickval );
     cs.unlock();
     bool tmp = rend;
@@ -149,7 +149,7 @@ int Welt3D::traceRay( Vec3< float > &point, Vec3< float > &dir )
     int minId = -1;
     int index = 0;
     int pId = 0;
-    for( auto m = members->getIterator(); m; m++, index++ )
+    for( auto m : *members )
     {
         float tmp = m->traceRay( point, dir, min, pId );
         if( min > tmp && tmp >= 0 )
@@ -157,6 +157,7 @@ int Welt3D::traceRay( Vec3< float > &point, Vec3< float > &dir )
             min = tmp;
             minId = index;
         }
+        index++;
     }
     if( minId >= 0 )
         return members->z( minId )->traceRay( point, dir, pId, this );
@@ -166,7 +167,7 @@ int Welt3D::traceRay( Vec3< float > &point, Vec3< float > &dir )
 // Gibt einen Iterator zurück, mit dem alle Members aufgezählt werden können
 Iterator< Model3D * > Welt3D::getMembers()
 {
-    return members->getIterator();
+    return members->begin();
 }
 
 int Framework::Welt3D::getPointLightCount() const

+ 35 - 37
XML.cpp

@@ -230,7 +230,7 @@ Element::~Element()
 //  value: Der Wert des Attributes
 void Element::setAttribute( Text attribut, Text value )
 {
-    for( auto i = attributes->getIterator(), j = attributeValues->getIterator(); i && j; i++, j++ )
+    for( auto i = attributes->begin(), j = attributeValues->begin(); i && j; i++, j++ )
     {
         if( i->istGleich( attribut ) )
         {
@@ -305,7 +305,7 @@ void Element::removeAllChilds()
 //  childs: alle Childs die entfernt werden sollen
 void Element::removeChilds( RCArray<Element> *childs )
 {
-    for( auto i = childs->getIterator(); i; i++ )
+    for( auto i : *childs )
         removeChild( dynamic_cast<XML::Element *>( i->getThis() ) );
     childs->release();
 }
@@ -363,7 +363,7 @@ Element *Element::zParent() const
 // gibt einen iterator zurück mit dem durch alle childs iteriert werden kann
 Iterator< Element * > Element::getChilds() const
 {
-    return children->getIterator();
+    return children->begin();
 }
 
 // gibt einen selector zurück der alle childs beinhaltet
@@ -377,7 +377,7 @@ Editor Element::selectChildren() const
 Editor Element::selectChildsByName( Text name ) const
 {
     RCArray< Element > *tmp = new RCArray< Element >();
-    for( auto i = children->getIterator(); i; i++ )
+    for( auto i : *children )
     {
         if( i->getName().istGleich( name ) )
             tmp->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -390,7 +390,7 @@ Editor Element::selectChildsByName( Text name ) const
 Editor Element::selectChildsByAttribute( Text attribute ) const
 {
     RCArray< Element > *tmp = new RCArray< Element >();
-    for( auto i = children->getIterator(); i; i++ )
+    for( auto i : *children )
     {
         if( i->hasAttribute( attribute ) )
             tmp->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -404,7 +404,7 @@ Editor Element::selectChildsByAttribute( Text attribute ) const
 Editor Element::selectChildsByAttribute( Text attribute, Text value ) const
 {
     RCArray< Element > *tmp = new RCArray< Element >();
-    for( auto i = children->getIterator(); i; i++ )
+    for( auto i : *children )
     {
         if( i->hasAttribute( attribute ) && i->getAttributeValue( attribute ).istGleich( value ) )
             tmp->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -415,7 +415,7 @@ Editor Element::selectChildsByAttribute( Text attribute, Text value ) const
 // gibt 1 zurück, falls ein Attribut Name existiert, 0 sonnst
 bool Element::hasAttribute( Text name ) const
 {
-    for( auto i = attributes->getIterator(); i; i++ )
+    for( auto i : *attributes )
     {
         if( i->istGleich( name ) )
             return 1;
@@ -445,7 +445,7 @@ Text Element::getAttributeValue( int i ) const
 //  attribut: Der Name des Attributes
 Text Element::getAttributeValue( Text attribut ) const
 {
-    for( auto i = attributes->getIterator(), j = attributeValues->getIterator(); i && j; i++, j++ )
+    for( auto i = attributes->begin(), j = attributeValues->begin(); i && j; i++, j++ )
     {
         if( i->istGleich( attribut ) )
             return j->getText();
@@ -456,13 +456,13 @@ Text Element::getAttributeValue( Text attribut ) const
 // gibt einen iterator zurück mit dem durch alle Attribut Namen iteriert werden kann
 Iterator< Text * > Element::getAttributeNames() const
 {
-    return attributes->getIterator();
+    return attributes->begin();
 }
 
 // gibt einen iterator zurück mit dem durch alle Attribut Werte iteriert werden kann
 Iterator< Text * > Element::getAttributeValues() const
 {
-    return attributeValues->getIterator();
+    return attributeValues->begin();
 }
 
 // gibt den Namen des Elementes zurück zurück
@@ -478,7 +478,7 @@ Text Element::toString() const
     ret += name->getText();
     if( attributes->getEintragAnzahl() )
         ret += " ";
-    for( auto i = attributes->getIterator(), j = attributeValues->getIterator(); i && j; i++, j++ )
+    for( auto i = attributes->begin(), j = attributeValues->begin(); i && j; i++, j++ )
     {
         ret += i->getText();
         if( j->getLength() )
@@ -508,7 +508,7 @@ Text Element::toString() const
         ret += ">";
         if( children->getEintragAnzahl() )
         {
-            for( auto i = children->getIterator(); i; i++ )
+            for( auto i : *children )
                 ret += i->toString();
         }
         else
@@ -534,7 +534,7 @@ Editor::Editor( RCArray< Element > *elements )
     : ReferenceCounter()
 {
     this->elements = new RCArray< Element >();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         this->elements->add( dynamic_cast<XML::Element *>( i->getThis() ) );
     elements->release();
 }
@@ -553,7 +553,7 @@ Editor::~Editor()
 //  value: Der Wert des Attributes
 void Editor::setAttribute( Text attribut, Text value )
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->setAttribute( attribut, value );
 }
 
@@ -561,7 +561,7 @@ void Editor::setAttribute( Text attribut, Text value )
 //  attribut: Der Name des Attributes
 void Editor::removeAttribute( Text attribut )
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->removeAttribute( attribut );
 }
 
@@ -569,7 +569,7 @@ void Editor::removeAttribute( Text attribut )
 //  child: Das neue Child Element
 void Editor::addChild( Element *child )
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->addChild( child->dublicate() );
     child->release();
 }
@@ -578,7 +578,7 @@ void Editor::addChild( Element *child )
 //  zChild: das zu entfernende Child
 void Editor::removeChild( Element *child )
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->removeChild( dynamic_cast<XML::Element *>( child->getThis() ) );
     child->release();
 }
@@ -587,14 +587,14 @@ void Editor::removeChild( Element *child )
 //  i: der Index des childs (bei 0 beginnend)
 void Editor::removeChild( int i )
 {
-    for( auto j = elements->getIterator(); j; j++ )
+    for( auto j : *elements )
         j->removeChild( i );
 }
 
 // entfernt alle childs (auf allen elementen in der Liste)
 void Editor::removeAllChilds()
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->removeAllChilds();
 }
 
@@ -602,7 +602,7 @@ void Editor::removeAllChilds()
 //  childs: alle Childs die entfernt werden sollen
 void Editor::removeChilds( RCArray<Element> *childs )
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->removeChilds( dynamic_cast<RCArray<XML::Element> *>( childs->getThis() ) );
     childs->release();
 }
@@ -610,7 +610,7 @@ void Editor::removeChilds( RCArray<Element> *childs )
 // entfernt dieses Element vom Eltern element (auf allen elementen in der Liste)
 void Editor::remove()
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->remove();
 }
 
@@ -618,21 +618,21 @@ void Editor::remove()
 //  text: dert Text
 void Editor::setText( Text text )
 {
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
         i->setText( text );
 }
 
 // Gibt ein Iterator durch alle Elemente zurück
 Iterator<Element *> Editor::getIterator()
 {
-    return elements->getIterator();
+    return elements->begin();
 }
 
 // gibt einen selector zurück der alle childs beinhaltet
 Editor Editor::selectChildren() const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         for( auto j = i->selectChildren().getIterator(); j; j++ )
         {
@@ -646,7 +646,7 @@ Editor Editor::selectChildren() const
 Editor Editor::selectParents() const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         if( i->parent )
             list->add( dynamic_cast<XML::Element *>( i->parent->getThis() ) );
@@ -659,7 +659,7 @@ Editor Editor::selectParents() const
 Editor Editor::whereNameEquals( Text name ) const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         if( i->getName().istGleich( name ) )
             list->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -672,7 +672,7 @@ Editor Editor::whereNameEquals( Text name ) const
 Editor Editor::whereChildWithNameExists( Text name ) const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         if( i->selectChildsByName( name ).elements->getEintragAnzahl() )
             list->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -685,7 +685,7 @@ Editor Editor::whereChildWithNameExists( Text name ) const
 Editor Editor::whereChildWithAttributeExists( Text attribute ) const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         if( i->selectChildsByAttribute( attribute ).elements->getEintragAnzahl() )
             list->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -699,7 +699,7 @@ Editor Editor::whereChildWithAttributeExists( Text attribute ) const
 Editor Editor::whereChildWithAttributeExists( Text attribute, Text value ) const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         if( i->selectChildsByAttribute( attribute, value ).elements->getEintragAnzahl() )
             list->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -712,7 +712,7 @@ Editor Editor::whereChildWithAttributeExists( Text attribute, Text value ) const
 Editor Editor::whereAttributeExists( Text attribute ) const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         if( i->hasAttribute( attribute ) )
             list->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -726,7 +726,7 @@ Editor Editor::whereAttributeExists( Text attribute ) const
 Editor Editor::whereAttributeEquals( Text attribute, Text value ) const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         if( i->hasAttribute( attribute ) && i->getAttributeValue( attribute ).istGleich( value ) )
             list->add( dynamic_cast<XML::Element *>( i->getThis() ) );
@@ -739,11 +739,11 @@ Editor Editor::whereAttributeEquals( Text attribute, Text value ) const
 Editor Editor::without( Editor e ) const
 {
     RCArray<Element> *list = new RCArray<Element>();
-    for( auto i = elements->getIterator(); i; i++ )
+    for( auto i : *elements )
     {
         bool found = 0;
-        for( auto j = e.elements->getIterator(); j; j++ )
-            found |= i._ == j._;
+        for( auto j : *e.elements )
+            found |= i == j;
         if( !found )
             list->add( dynamic_cast<XML::Element *>( i->getThis() ) );
     }
@@ -754,8 +754,6 @@ Editor Editor::without( Editor e ) const
 //  f: die funktion (nimmt als argument ein Element objekt ohne erhöhten reference Counter)
 void Editor::forEach( std::function< void( Element * ) > f ) const
 {
-    for( auto i = elements->getIterator(); i; i++ )
-    {
+    for( auto i : *elements )
         f( i );
-    }
 }