|
@@ -97,7 +97,7 @@ Vertex VertexData::getTPos() const
|
|
|
|
|
|
// Inhalt der PolygonData Klasse aus KEDModel2DEditor.h
|
|
|
// Konstruktor
|
|
|
-PolygonData::PolygonData( Polygon2D &pg )
|
|
|
+PolygonData::PolygonData( Polygon2D& pg )
|
|
|
: ReferenceCounter()
|
|
|
{
|
|
|
name = pg.name->getText();
|
|
@@ -136,31 +136,31 @@ void PolygonData::removeVertex( int num )
|
|
|
|
|
|
void PolygonData::nachLinks( float num )
|
|
|
{
|
|
|
- for( auto i = vd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *vd )
|
|
|
i->nachLinks( num );
|
|
|
}
|
|
|
|
|
|
void PolygonData::nachOben( float num )
|
|
|
{
|
|
|
- for( auto i = vd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *vd )
|
|
|
i->nachOben( num );
|
|
|
}
|
|
|
|
|
|
void PolygonData::saveTextur( Punkt tPos, Punkt tGr )
|
|
|
{
|
|
|
- for( auto i = vd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *vd )
|
|
|
i->saveTextur( tPos, tGr );
|
|
|
}
|
|
|
|
|
|
void PolygonData::select( Punkt p1, Punkt p2 )
|
|
|
{
|
|
|
- for( auto i = vd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *vd )
|
|
|
i->select( p1, p2 );
|
|
|
}
|
|
|
|
|
|
void PolygonData::deSelect()
|
|
|
{
|
|
|
- for( auto i = vd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *vd )
|
|
|
i->deSelect();
|
|
|
}
|
|
|
|
|
@@ -174,13 +174,13 @@ void PolygonData::setTransparent( bool t )
|
|
|
transparent = t;
|
|
|
}
|
|
|
|
|
|
-void PolygonData::setName( const char *name )
|
|
|
+void PolygonData::setName( const char* name )
|
|
|
{
|
|
|
this->name = name;
|
|
|
}
|
|
|
|
|
|
// constant
|
|
|
-const char *PolygonData::getName() const
|
|
|
+const char* PolygonData::getName() const
|
|
|
{
|
|
|
return name;
|
|
|
}
|
|
@@ -190,7 +190,7 @@ bool PolygonData::istSichtbar() const
|
|
|
return sichtbar;
|
|
|
}
|
|
|
|
|
|
-VertexData *PolygonData::zVertex( int num ) const
|
|
|
+VertexData* PolygonData::zVertex( int num ) const
|
|
|
{
|
|
|
return vd->z( num );
|
|
|
}
|
|
@@ -200,7 +200,7 @@ int PolygonData::getVertexAnzahl() const
|
|
|
return vd->getEintragAnzahl();
|
|
|
}
|
|
|
|
|
|
-void PolygonData::getM2( Polygon2D &pd, bool textur ) const
|
|
|
+void PolygonData::getM2( Polygon2D& pd, bool textur ) const
|
|
|
{
|
|
|
int anz = vd->getEintragAnzahl();
|
|
|
if( !pd.name )
|
|
@@ -225,7 +225,7 @@ bool PolygonData::istTransparent() const
|
|
|
|
|
|
// Inhalt der Data Klasse aus KEDModel2DEditor.h
|
|
|
// Konstruktor
|
|
|
-Data::Data( Model2DData *mdl )
|
|
|
+Data::Data( Model2DData* mdl )
|
|
|
: ReferenceCounter()
|
|
|
{
|
|
|
pd = new RCArray< PolygonData >();
|
|
@@ -234,7 +234,7 @@ Data::Data( Model2DData *mdl )
|
|
|
textur = 0;
|
|
|
rTextur = 0;
|
|
|
sp = -1;
|
|
|
- int anz = ( mdl && mdl->polygons ) ? mdl->polygons->getEintragAnzahl() : 0;
|
|
|
+ int anz = (mdl && mdl->polygons) ? mdl->polygons->getEintragAnzahl() : 0;
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
if( mdl->polygons->hat( i ) )
|
|
@@ -279,13 +279,13 @@ void Data::selectPolygon( int num )
|
|
|
|
|
|
void Data::nachLinks( float num )
|
|
|
{
|
|
|
- for( auto i = pd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *pd )
|
|
|
i->nachLinks( num );
|
|
|
}
|
|
|
|
|
|
void Data::nachOben( float num )
|
|
|
{
|
|
|
- for( auto i = pd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *pd )
|
|
|
i->nachOben( num );
|
|
|
}
|
|
|
|
|
@@ -317,11 +317,11 @@ void Data::saveTextur()
|
|
|
{
|
|
|
if( !rTextur )
|
|
|
return;
|
|
|
- for( auto i = pd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *pd )
|
|
|
i->saveTextur( tPos, textur->getSize() );
|
|
|
}
|
|
|
|
|
|
-void Data::setTextur( Bild *t )
|
|
|
+void Data::setTextur( Bild* t )
|
|
|
{
|
|
|
if( textur )
|
|
|
textur->release();
|
|
@@ -338,18 +338,18 @@ void Data::setTextur( Bild *t )
|
|
|
|
|
|
void Data::select( Punkt p1, Punkt p2 )
|
|
|
{
|
|
|
- for( auto i = pd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *pd )
|
|
|
i->select( p1, p2 );
|
|
|
}
|
|
|
|
|
|
void Data::deSelect()
|
|
|
{
|
|
|
- for( auto i = pd->getIterator(); i; i++ )
|
|
|
+ for( auto i : *pd )
|
|
|
i->deSelect();
|
|
|
}
|
|
|
|
|
|
// constant
|
|
|
-PolygonData *Data::zPolygon( int num ) const
|
|
|
+PolygonData* Data::zPolygon( int num ) const
|
|
|
{
|
|
|
return pd->z( num );
|
|
|
}
|
|
@@ -364,10 +364,10 @@ int Data::getSelectedPolygon() const
|
|
|
return sp;
|
|
|
}
|
|
|
|
|
|
-Model2DData *Data::getM2() const
|
|
|
+Model2DData* Data::getM2() const
|
|
|
{
|
|
|
int anz = pd->getEintragAnzahl();
|
|
|
- Array< Polygon2D > *polygons = new Array< Polygon2D >();
|
|
|
+ Array< Polygon2D >* polygons = new Array< Polygon2D >();
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
Polygon2D pd = { 0, 0, 0, 0, 0 };
|
|
@@ -375,12 +375,12 @@ Model2DData *Data::getM2() const
|
|
|
pd.transparent = this->pd->z( i )->istTransparent();
|
|
|
polygons->add( pd );
|
|
|
}
|
|
|
- Model2DData *ret = new Model2DData();
|
|
|
+ Model2DData* ret = new Model2DData();
|
|
|
ret->erstelleModell( polygons );
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-Bild *Data::zTextur() const
|
|
|
+Bild* Data::zTextur() const
|
|
|
{
|
|
|
return rTextur ? textur : 0;
|
|
|
}
|
|
@@ -402,9 +402,9 @@ EditorListe::EditorListe()
|
|
|
ram->setSize( 150, 480 );
|
|
|
ram->setPosition( 720, 10 );
|
|
|
scroll = new VScrollBar();
|
|
|
- tr = new TextRenderer( dynamic_cast<Schrift *>( uiFactory.initParam.schrift->getThis() ) );
|
|
|
+ tr = new TextRenderer( dynamic_cast<Schrift*>(uiFactory.initParam.schrift->getThis()) );
|
|
|
pName = initTextFeld( 0, 0, 70, 20, TextFeld::Style::TextFeld, "" );
|
|
|
- koordF = initFenster( 10, 10, 150, 140, ( Fenster::Style::normal | Fenster::Style::TitelHintergrund | Fenster::Style::BodyHintergrund ) & ~Fenster::Style::Sichtbar, "Koordinaten" );
|
|
|
+ koordF = initFenster( 10, 10, 150, 140, (Fenster::Style::normal | Fenster::Style::TitelHintergrund | Fenster::Style::BodyHintergrund) & ~Fenster::Style::Sichtbar, "Koordinaten" );
|
|
|
koordF->setKBgFarbe( 0xFF000000 );
|
|
|
koordF->setTBgFarbe( 0xFF000000 );
|
|
|
koordF->setClosingMe( _closeFensterME );
|
|
@@ -416,22 +416,20 @@ EditorListe::EditorListe()
|
|
|
tkyT = initTextFeld( 10, 100, 30, 20, TextFeld::Style::Text, "ty:" );
|
|
|
tkx = initTextFeld( 40, 70, 90, 20, TextFeld::Style::TextFeld, "" );
|
|
|
tky = initTextFeld( 40, 100, 90, 20, TextFeld::Style::TextFeld, "" );
|
|
|
- int *polIP = &polI, *verIP = &verI;
|
|
|
- TextFeld *kxTmp = kx;
|
|
|
- TextFeld *kyTmp = ky;
|
|
|
- auto saveK = [polIP, verIP, kxTmp, kyTmp]( void *p, void *o, TastaturEreignis te )
|
|
|
- {
|
|
|
- Data *data = (Data *)p;
|
|
|
+ int* polIP = &polI, * verIP = &verI;
|
|
|
+ TextFeld* kxTmp = kx;
|
|
|
+ TextFeld* kyTmp = ky;
|
|
|
+ auto saveK = [polIP, verIP, kxTmp, kyTmp]( void* p, void* o, TastaturEreignis te ) {
|
|
|
+ Data* data = (Data*)p;
|
|
|
data->zPolygon( *polIP )->zVertex( *verIP )->setPosition( Vertex( (float)(double)*kxTmp->zText(), (float)(double)*kyTmp->zText() ) );
|
|
|
return 1;
|
|
|
};
|
|
|
kx->setNTastaturEreignis( saveK );
|
|
|
ky->setNTastaturEreignis( saveK );
|
|
|
- TextFeld *tkxTmp = tkx;
|
|
|
- TextFeld *tkyTmp = tky;
|
|
|
- auto saveTK = [polIP, verIP, tkxTmp, tkyTmp]( void *p, void *o, TastaturEreignis te )
|
|
|
- {
|
|
|
- Data *data = (Data *)p;
|
|
|
+ TextFeld* tkxTmp = tkx;
|
|
|
+ TextFeld* tkyTmp = tky;
|
|
|
+ auto saveTK = [polIP, verIP, tkxTmp, tkyTmp]( void* p, void* o, TastaturEreignis te ) {
|
|
|
+ Data* data = (Data*)p;
|
|
|
data->zPolygon( *polIP )->zVertex( *verIP )->setTextur( Vertex( (float)(double)*tkxTmp->zText(), (float)(double)*tkyTmp->zText() ) );
|
|
|
return 1;
|
|
|
};
|
|
@@ -439,14 +437,14 @@ EditorListe::EditorListe()
|
|
|
tky->setNTastaturEreignis( saveTK );
|
|
|
#pragma warning(push)
|
|
|
#pragma warning(disable : 4436)
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( kxT->getThis() ) );
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( kyT->getThis() ) );
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( kx->getThis() ) );
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( ky->getThis() ) );
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( tkxT->getThis() ) );
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( tkyT->getThis() ) );
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( tkx->getThis() ) );
|
|
|
- koordF->addMember( dynamic_cast<Zeichnung *>( tky->getThis() ) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(kxT->getThis()) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(kyT->getThis()) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(kx->getThis()) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(ky->getThis()) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(tkxT->getThis()) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(tkyT->getThis()) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(tkx->getThis()) );
|
|
|
+ koordF->addMember( dynamic_cast<Zeichnung*>(tky->getThis()) );
|
|
|
#pragma warning(pop)
|
|
|
polI = 0;
|
|
|
verI = 0;
|
|
@@ -474,14 +472,14 @@ EditorListe::~EditorListe()
|
|
|
}
|
|
|
|
|
|
// nicht constant
|
|
|
-void EditorListe::setDataZ( Data *d )
|
|
|
+void EditorListe::setDataZ( Data* d )
|
|
|
{
|
|
|
if( data )
|
|
|
data->release();
|
|
|
data = d;
|
|
|
}
|
|
|
|
|
|
-void EditorListe::doPublicMausEreignis( MausEreignis &me )
|
|
|
+void EditorListe::doPublicMausEreignis( MausEreignis& me )
|
|
|
{
|
|
|
koordF->doPublicMausEreignis( me );
|
|
|
me.mx -= ram->getX();
|
|
@@ -530,7 +528,7 @@ void EditorListe::doPublicMausEreignis( MausEreignis &me )
|
|
|
data->selectPolygon( -1 );
|
|
|
rend = 1;
|
|
|
}
|
|
|
- PolygonData *pd = data->zPolygon( i );
|
|
|
+ PolygonData* pd = data->zPolygon( i );
|
|
|
if( pd && ausgeklappt.hat( i ) && ausgeklappt.get( i ) )
|
|
|
{
|
|
|
int vAnz = pd->getVertexAnzahl();
|
|
@@ -578,7 +576,7 @@ void EditorListe::doPublicMausEreignis( MausEreignis &me )
|
|
|
me.my += ram->getY();
|
|
|
}
|
|
|
|
|
|
-void EditorListe::doTastaturEreignis( TastaturEreignis &te )
|
|
|
+void EditorListe::doTastaturEreignis( TastaturEreignis& te )
|
|
|
{
|
|
|
koordF->doTastaturEreignis( te );
|
|
|
if( data && data->getSelectedPolygon() >= 0 )
|
|
@@ -595,7 +593,7 @@ bool EditorListe::tick( double zeit )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-void EditorListe::render( Bild &zRObj )
|
|
|
+void EditorListe::render( Bild& zRObj )
|
|
|
{
|
|
|
ram->render( zRObj );
|
|
|
if( !zRObj.setDrawOptions( ram->getPosition() + Punkt( 1, 1 ), ram->getSize() - Punkt( 2, 2 ) ) )
|
|
@@ -612,11 +610,10 @@ void EditorListe::render( Bild &zRObj )
|
|
|
{
|
|
|
pName->setPosition( 20, y );
|
|
|
pName->setText( data->zPolygon( data->getSelectedPolygon() )->getName() );
|
|
|
- Data *tmpData = data;
|
|
|
- pName->setNTastaturEreignis( [tmpData]( void *p, void *o, TastaturEreignis te ) -> bool
|
|
|
- {
|
|
|
+ Data* tmpData = data;
|
|
|
+ pName->setNTastaturEreignis( [tmpData]( void* p, void* o, TastaturEreignis te ) -> bool {
|
|
|
if( tmpData->getSelectedPolygon() >= 0 )
|
|
|
- tmpData->zPolygon( tmpData->getSelectedPolygon() )->setName( ( (TextFeld *)o )->zText()->getText() );
|
|
|
+ tmpData->zPolygon( tmpData->getSelectedPolygon() )->setName( ((TextFeld*)o)->zText()->getText() );
|
|
|
return 1;
|
|
|
} );
|
|
|
zRObj.fillRegion( 0, y, 133, 20, 0xFF002000 );
|
|
@@ -647,7 +644,7 @@ void EditorListe::render( Bild &zRObj )
|
|
|
if( ausgeklappt.hat( i ) && ausgeklappt.get( i ) )
|
|
|
{
|
|
|
zRObj.drawDreieck( Punkt( 10, 4 + y ), Punkt( 4, 16 + y ), Punkt( 16, 16 + y ), 0xFFFFFFFF );
|
|
|
- PolygonData *pd = data->zPolygon( i );
|
|
|
+ PolygonData* pd = data->zPolygon( i );
|
|
|
if( pd )
|
|
|
{
|
|
|
int vAnz = pd->getVertexAnzahl();
|
|
@@ -711,7 +708,7 @@ Editor2D::Editor2D()
|
|
|
select = new LRahmen();
|
|
|
select->setFarbe( 0xFF5050FF );
|
|
|
select->setRamenBreite( 1 );
|
|
|
- tr = new TextRenderer( dynamic_cast<Schrift *>( uiFactory.initParam.schrift->getThis() ) );
|
|
|
+ tr = new TextRenderer( dynamic_cast<Schrift*>(uiFactory.initParam.schrift->getThis()) );
|
|
|
addV = Vertex( 0, 0 );
|
|
|
mausIn = 0;
|
|
|
größe = 1;
|
|
@@ -728,14 +725,14 @@ Editor2D::~Editor2D()
|
|
|
}
|
|
|
|
|
|
// nicht constant
|
|
|
-void Editor2D::setDataZ( Data *d )
|
|
|
+void Editor2D::setDataZ( Data* d )
|
|
|
{
|
|
|
if( data )
|
|
|
data->release();
|
|
|
data = d;
|
|
|
}
|
|
|
|
|
|
-void Editor2D::doPublicMausEreignis( MausEreignis &me )
|
|
|
+void Editor2D::doPublicMausEreignis( MausEreignis& me )
|
|
|
{
|
|
|
me.mx -= pos.x;
|
|
|
me.my -= pos.y;
|
|
@@ -771,15 +768,15 @@ void Editor2D::doPublicMausEreignis( MausEreignis &me )
|
|
|
}
|
|
|
if( getMausStand( M_Rechts ) )
|
|
|
{
|
|
|
- data->nachLinks( ( mausPos.x - me.mx ) / größe );
|
|
|
- data->nachOben( ( mausPos.y - me.my ) / größe );
|
|
|
+ data->nachLinks( (mausPos.x - me.mx) / größe );
|
|
|
+ data->nachOben( (mausPos.y - me.my) / größe );
|
|
|
mausPos.x = me.mx;
|
|
|
mausPos.y = me.my;
|
|
|
}
|
|
|
if( getMausStand( M_Mitte ) )
|
|
|
{
|
|
|
- data->tNachLinks( (int)( ( mausPos.x - me.mx ) / größe ) );
|
|
|
- data->tNachOben( (int)( ( mausPos.y - me.my ) / größe ) );
|
|
|
+ data->tNachLinks( (int)((mausPos.x - me.mx) / größe) );
|
|
|
+ data->tNachOben( (int)((mausPos.y - me.my) / größe) );
|
|
|
mausPos.x = me.mx;
|
|
|
mausPos.y = me.my;
|
|
|
}
|
|
@@ -788,7 +785,7 @@ void Editor2D::doPublicMausEreignis( MausEreignis &me )
|
|
|
{
|
|
|
if( !getTastenStand( T_Shift ) )
|
|
|
data->deSelect();
|
|
|
- data->select( ( Vec2<float> )select->getPosition() / größe + offs, ( Vec2<float> )( select->getPosition() + select->getSize() ) / größe + offs );
|
|
|
+ data->select( (Vec2<float>)select->getPosition() / größe + offs, (Vec2<float>)(select->getPosition() + select->getSize()) / größe + offs );
|
|
|
select->setSize( 0, 0 );
|
|
|
select->setPosition( 0, 0 );
|
|
|
}
|
|
@@ -802,11 +799,11 @@ void Editor2D::doPublicMausEreignis( MausEreignis &me )
|
|
|
me.my += pos.y;
|
|
|
}
|
|
|
|
|
|
-void Editor2D::doTastaturEreignis( TastaturEreignis &te )
|
|
|
+void Editor2D::doTastaturEreignis( TastaturEreignis& te )
|
|
|
{
|
|
|
if( te.id == TE_Release && te.taste == T_Enter && mausIn )
|
|
|
{
|
|
|
- PolygonData *pd = data->zPolygon( data->getSelectedPolygon() );
|
|
|
+ PolygonData* pd = data->zPolygon( data->getSelectedPolygon() );
|
|
|
if( pd )
|
|
|
{
|
|
|
pd->addVertex( addV, Punkt( 0, 0 ) );
|
|
@@ -880,7 +877,7 @@ bool Editor2D::tick( double zeit )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-void Editor2D::render( Bild &zRObj )
|
|
|
+void Editor2D::render( Bild& zRObj )
|
|
|
{
|
|
|
if( !zRObj.setDrawOptions( pos, ram->getSize() ) )
|
|
|
return;
|
|
@@ -893,53 +890,53 @@ void Editor2D::render( Bild &zRObj )
|
|
|
if( data->zTextur() )
|
|
|
{
|
|
|
Punkt tPos = data->getTPos();
|
|
|
- zRObj.alphaBildSkall( (int)( ( tPos.x - offs.x ) * größe ), (int)( ( tPos.y - offs.y ) * größe ),
|
|
|
- (int)( data->zTextur()->getBreite() * größe ), (int)( data->zTextur()->getHeight() * größe ), *data->zTextur() );
|
|
|
+ zRObj.alphaBildSkall( (int)((tPos.x - offs.x) * größe), (int)((tPos.y - offs.y) * größe),
|
|
|
+ (int)(data->zTextur()->getBreite() * größe), (int)(data->zTextur()->getHeight() * größe), *data->zTextur() );
|
|
|
}
|
|
|
// Raster mahlen
|
|
|
- int xanz = (int)( ram->getBreite() / ( 50 * größe ) );
|
|
|
- int yanz = (int)( ram->getHeight() / ( 50 * größe ) );
|
|
|
- int xStart = ( 50 - abs( offs.x ) % 50 );
|
|
|
+ int xanz = (int)(ram->getBreite() / (50 * größe));
|
|
|
+ int yanz = (int)(ram->getHeight() / (50 * größe));
|
|
|
+ int xStart = (50 - abs( offs.x ) % 50);
|
|
|
if( offs.x < 0 )
|
|
|
xStart = -offs.x % 50;
|
|
|
if( offs.x == 0 )
|
|
|
xStart = 0;
|
|
|
- int yStart = ( 50 - abs( offs.y ) % 50 );
|
|
|
+ int yStart = (50 - abs( offs.y ) % 50);
|
|
|
if( offs.y < 0 )
|
|
|
yStart = -offs.y % 50;
|
|
|
if( offs.y == 0 )
|
|
|
yStart = 0;
|
|
|
- for( float x = xStart * größe, y = yStart * größe; !( x > ram->getBreite() && y > ram->getHeight() ); x += 50 * größe, y += 50 * größe )
|
|
|
+ for( float x = xStart * größe, y = yStart * größe; !(x > ram->getBreite() && y > ram->getHeight()); x += 50 * größe, y += 50 * größe )
|
|
|
{
|
|
|
zRObj.drawLinieH( 0, (int)y, ram->getBreite(), 0xFF505050 );
|
|
|
zRObj.drawLinieV( (int)x, 0, ram->getHeight(), 0xFF505050 );
|
|
|
}
|
|
|
Text xPos = "";
|
|
|
- xPos = offs.x + (int)( xStart + 50 * ( xanz / 2 ) );
|
|
|
- tr->renderText( (int)( xStart * größe + 50 * größe * ( xanz / 2 ) ), 0, xPos, zRObj, 0xFF505050 );
|
|
|
- xPos = offs.y + (int)( yStart + 50 * ( yanz / 2 ) );
|
|
|
- tr->renderText( 0, (int)( yStart * größe + 50 * größe * ( yanz / 2 ) ), xPos, zRObj, 0xFF505050 );
|
|
|
+ xPos = offs.x + (int)(xStart + 50 * (xanz / 2));
|
|
|
+ tr->renderText( (int)(xStart * größe + 50 * größe * (xanz / 2)), 0, xPos, zRObj, 0xFF505050 );
|
|
|
+ xPos = offs.y + (int)(yStart + 50 * (yanz / 2));
|
|
|
+ tr->renderText( 0, (int)(yStart * größe + 50 * größe * (yanz / 2)), xPos, zRObj, 0xFF505050 );
|
|
|
// Model mahlen
|
|
|
int pAnz = data->getPolygonAnzahl();
|
|
|
for( int i = 0; i < pAnz; i++ )
|
|
|
{
|
|
|
- PolygonData *p = data->zPolygon( i );
|
|
|
+ PolygonData* p = data->zPolygon( i );
|
|
|
if( !p->istSichtbar() )
|
|
|
continue;
|
|
|
if( data->getSelectedPolygon() == i && mausIn )
|
|
|
{
|
|
|
int vAnz = p->getVertexAnzahl();
|
|
|
VertexData tmp = VertexData( addV, Punkt() );
|
|
|
- VertexData *l = p->zVertex( vAnz - 1 );
|
|
|
+ VertexData* l = p->zVertex( vAnz - 1 );
|
|
|
for( int j = -1; j < vAnz && vAnz > 0; j++ )
|
|
|
{
|
|
|
- VertexData *v = j < 0 ? &tmp : p->zVertex( j );
|
|
|
+ VertexData* v = j < 0 ? &tmp : p->zVertex( j );
|
|
|
if( l && v )
|
|
|
{
|
|
|
if( l->istSichtbar() && v->istSichtbar() )
|
|
|
- zRObj.drawLinie( ( ( l->getPos() - offs ) * größe ), ( ( v->getPos() - offs ) * größe ), 0xFFA0A0A0 );
|
|
|
+ zRObj.drawLinie( ((l->getPos() - offs) * größe), ((v->getPos() - offs) * größe), 0xFFA0A0A0 );
|
|
|
else
|
|
|
- zRObj.drawLinie( ( ( l->getPos() - offs ) * größe ), ( ( v->getPos() - offs ) * größe ), 0xFF606060 );
|
|
|
+ zRObj.drawLinie( ((l->getPos() - offs) * größe), ((v->getPos() - offs) * größe), 0xFF606060 );
|
|
|
}
|
|
|
if( !l->istSichtbar() )
|
|
|
{
|
|
@@ -947,13 +944,13 @@ void Editor2D::render( Bild &zRObj )
|
|
|
continue;
|
|
|
}
|
|
|
if( j == 0 )
|
|
|
- zRObj.fillRegion( (int)( ( l->getPos().x - offs.x ) * größe ) - 5, (int)( ( l->getPos().y - offs.y ) * größe ) - 5, 10, 10, 0xFF50FF50 );
|
|
|
+ zRObj.fillRegion( (int)((l->getPos().x - offs.x) * größe) - 5, (int)((l->getPos().y - offs.y) * größe) - 5, 10, 10, 0xFF50FF50 );
|
|
|
else
|
|
|
{
|
|
|
if( !l->istAusgewählt() )
|
|
|
- zRObj.fillRegion( (int)( ( l->getPos().x - offs.x ) * größe ) - 5, (int)( ( l->getPos().y - offs.y ) * größe ) - 5, 10, 10, 0xFF5050FF );
|
|
|
+ zRObj.fillRegion( (int)((l->getPos().x - offs.x) * größe) - 5, (int)((l->getPos().y - offs.y) * größe) - 5, 10, 10, 0xFF5050FF );
|
|
|
else
|
|
|
- zRObj.fillRegion( (int)( ( l->getPos().x - offs.x ) * größe ) - 5, (int)( ( l->getPos().y - offs.y ) * größe ) - 5, 10, 10, 0xFFFF5050 );
|
|
|
+ zRObj.fillRegion( (int)((l->getPos().x - offs.x) * größe) - 5, (int)((l->getPos().y - offs.y) * größe) - 5, 10, 10, 0xFFFF5050 );
|
|
|
}
|
|
|
l = v;
|
|
|
}
|
|
@@ -961,16 +958,16 @@ void Editor2D::render( Bild &zRObj )
|
|
|
else
|
|
|
{
|
|
|
int vAnz = p->getVertexAnzahl();
|
|
|
- VertexData *l = p->zVertex( vAnz - 1 );
|
|
|
+ VertexData* l = p->zVertex( vAnz - 1 );
|
|
|
for( int j = 0; j < vAnz; j++ )
|
|
|
{
|
|
|
- VertexData *v = p->zVertex( j );
|
|
|
+ VertexData* v = p->zVertex( j );
|
|
|
if( l && v )
|
|
|
{
|
|
|
if( l->istSichtbar() && v->istSichtbar() )
|
|
|
- zRObj.drawLinie( ( ( l->getPos() - offs ) * größe ), ( ( v->getPos() - offs ) * größe ), 0xFFA0A0A0 );
|
|
|
+ zRObj.drawLinie( ((l->getPos() - offs) * größe), ((v->getPos() - offs) * größe), 0xFFA0A0A0 );
|
|
|
else
|
|
|
- zRObj.drawLinie( ( ( l->getPos() - offs ) * größe ), ( ( v->getPos() - offs ) * größe ), 0xFF606060 );
|
|
|
+ zRObj.drawLinie( ((l->getPos() - offs) * größe), ((v->getPos() - offs) * größe), 0xFF606060 );
|
|
|
}
|
|
|
if( l )
|
|
|
{
|
|
@@ -980,9 +977,9 @@ void Editor2D::render( Bild &zRObj )
|
|
|
continue;
|
|
|
}
|
|
|
if( !l->istAusgewählt() )
|
|
|
- zRObj.fillRegion( (int)( ( l->getPos().x - offs.x ) * größe ) - 5, (int)( ( l->getPos().y - offs.y ) * größe ) - 5, 10, 10, 0xFF5050FF );
|
|
|
+ zRObj.fillRegion( (int)((l->getPos().x - offs.x) * größe) - 5, (int)((l->getPos().y - offs.y) * größe) - 5, 10, 10, 0xFF5050FF );
|
|
|
else
|
|
|
- zRObj.fillRegion( (int)( ( l->getPos().x - offs.x ) * größe ) - 5, (int)( ( l->getPos().y - offs.y ) * größe ) - 5, 10, 10, 0xFFFF5050 );
|
|
|
+ zRObj.fillRegion( (int)((l->getPos().x - offs.x) * größe) - 5, (int)((l->getPos().y - offs.y) * größe) - 5, 10, 10, 0xFFFF5050 );
|
|
|
}
|
|
|
l = v;
|
|
|
}
|
|
@@ -1006,9 +1003,9 @@ GUI::GUI()
|
|
|
texturLaden = initKnopf( 230, 500, 100, 20, Knopf::Style::Sichtbar, "Textur Laden" );
|
|
|
data = new Data( 0 );
|
|
|
editor = new Editor2D();
|
|
|
- editor->setDataZ( dynamic_cast<Data *>( data->getThis() ) );
|
|
|
+ editor->setDataZ( dynamic_cast<Data*>(data->getThis()) );
|
|
|
liste = new EditorListe();
|
|
|
- liste->setDataZ( dynamic_cast<Data *>( data->getThis() ) );
|
|
|
+ liste->setDataZ( dynamic_cast<Data*>(data->getThis()) );
|
|
|
importDialog = 0;
|
|
|
aktion = 0;
|
|
|
alpha = 0;
|
|
@@ -1036,16 +1033,16 @@ void GUI::setSichtbar( bool s )
|
|
|
sichtbar = s;
|
|
|
}
|
|
|
|
|
|
-void GUI::setModel( Model2DData *data )
|
|
|
+void GUI::setModel( Model2DData* data )
|
|
|
{
|
|
|
if( this->data )
|
|
|
this->data->release();
|
|
|
this->data = new Data( data );
|
|
|
- editor->setDataZ( dynamic_cast<Data *>( this->data->getThis() ) );
|
|
|
- liste->setDataZ( dynamic_cast<Data *>( this->data->getThis() ) );
|
|
|
+ editor->setDataZ( dynamic_cast<Data*>(this->data->getThis()) );
|
|
|
+ liste->setDataZ( dynamic_cast<Data*>(this->data->getThis()) );
|
|
|
}
|
|
|
|
|
|
-void GUI::doPublicMausEreignis( MausEreignis &me )
|
|
|
+void GUI::doPublicMausEreignis( MausEreignis& me )
|
|
|
{
|
|
|
if( !sichtbar )
|
|
|
return;
|
|
@@ -1088,7 +1085,7 @@ void GUI::doPublicMausEreignis( MausEreignis &me )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void GUI::doTastaturEreignis( TastaturEreignis &te )
|
|
|
+void GUI::doTastaturEreignis( TastaturEreignis& te )
|
|
|
{
|
|
|
if( !sichtbar )
|
|
|
return;
|
|
@@ -1102,13 +1099,13 @@ bool GUI::tick( double zeit )
|
|
|
{
|
|
|
if( !importDialog->isRunning() )
|
|
|
{
|
|
|
- Text *importPfad = importDialog->getPfad();
|
|
|
- importDialog = (DateiDialogTh *)importDialog->release();
|
|
|
+ Text* importPfad = importDialog->getPfad();
|
|
|
+ importDialog = (DateiDialogTh*)importDialog->release();
|
|
|
if( sichtbar && importPfad )
|
|
|
{
|
|
|
importPfad->ersetzen( "\\", "/" );
|
|
|
- Text *err = new Text();
|
|
|
- Bild *b = ladeBild( importPfad->getText(), err );
|
|
|
+ Text* err = new Text();
|
|
|
+ Bild* b = ladeBild( importPfad->getText(), err );
|
|
|
if( !b )
|
|
|
nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), err, new Text( "Ok" ) );
|
|
|
else
|
|
@@ -1126,7 +1123,7 @@ bool GUI::tick( double zeit )
|
|
|
if( alpha + zeit * 200 > 255 )
|
|
|
alpha = 255;
|
|
|
else
|
|
|
- alpha += (unsigned char)( zeit * 200 );
|
|
|
+ alpha += (unsigned char)(zeit * 200);
|
|
|
rend = 1;
|
|
|
}
|
|
|
else if( !sichtbar && alpha )
|
|
@@ -1134,7 +1131,7 @@ bool GUI::tick( double zeit )
|
|
|
if( alpha - zeit * 200 < 0 )
|
|
|
alpha = 0;
|
|
|
else
|
|
|
- alpha -= (unsigned char)( zeit * 200 );
|
|
|
+ alpha -= (unsigned char)(zeit * 200);
|
|
|
rend = 1;
|
|
|
}
|
|
|
if( sichtbar )
|
|
@@ -1151,7 +1148,7 @@ bool GUI::tick( double zeit )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-void GUI::render( Bild &zRObj )
|
|
|
+void GUI::render( Bild& zRObj )
|
|
|
{
|
|
|
zRObj.setAlpha( alpha );
|
|
|
editor->render( zRObj );
|
|
@@ -1172,7 +1169,7 @@ int GUI::getAktion()
|
|
|
}
|
|
|
|
|
|
// const
|
|
|
-Model2DData *GUI::getM2Data() const
|
|
|
+Model2DData* GUI::getM2Data() const
|
|
|
{
|
|
|
return data->getM2();
|
|
|
}
|