|
@@ -13,7 +13,8 @@ Rahmen::Rahmen()
|
|
|
: Zeichnung(),
|
|
|
br( 1 ),
|
|
|
farbe( 0xFF000000 ),
|
|
|
- alpha( 0 )
|
|
|
+ alpha( 0 ),
|
|
|
+ breaks( 0 )
|
|
|
{}
|
|
|
|
|
|
// Destruktor
|
|
@@ -27,6 +28,13 @@ void Rahmen::setRamenBreite( int br ) // setzt die Breite des Rahmens
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
+// wenn dieser Flag gesetzt wird, wird der Rahmen gestrichelt gezeichnet
|
|
|
+// br: 1 -> gestrichelt, 0 -> durchgehend
|
|
|
+void Rahmen::setBreaks( bool br )
|
|
|
+{
|
|
|
+ breaks = br;
|
|
|
+}
|
|
|
+
|
|
|
void Rahmen::setAlpha( bool a ) // Legt fest, ob der Alphawert der Farbe berücksichtigt werden soll
|
|
|
{
|
|
|
alpha = a;
|
|
@@ -54,6 +62,12 @@ int Rahmen::getRBreite() const // Gibt die Breite des Rahmens zur
|
|
|
return br;
|
|
|
}
|
|
|
|
|
|
+// Gibt 1 zurück, falls der Rahmen gestrichelt gezeichnet wird
|
|
|
+bool Rahmen::hasBreaks() const
|
|
|
+{
|
|
|
+ return breaks;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
// Inhalt der LRahmen Klasse aus Rahmen.h
|
|
|
// Konstruktor
|
|
@@ -72,24 +86,62 @@ void LRahmen::render( Bild &Obj ) // Zeichnet den Rahmen in das RenderZeichnung
|
|
|
int y = pos.y;
|
|
|
int b = x + gr.x - 1;
|
|
|
int h = y + gr.y - 1;
|
|
|
- if( alpha )
|
|
|
+ if( !breaks )
|
|
|
{
|
|
|
- for( int i = 0; i < br; ++i )
|
|
|
+ if( alpha )
|
|
|
+ {
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
+ Obj.drawLinieVAlpha( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, h - i, gr.x - i * 2 - 1, farbe );
|
|
|
+ Obj.drawLinieVAlpha( x + i, y + i, gr.y - i * 2, farbe );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- Obj.drawLinieHAlpha( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
- Obj.drawLinieVAlpha( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
- Obj.drawLinieHAlpha( x + i + 1, h - i, gr.x - i * 2 - 1, farbe );
|
|
|
- Obj.drawLinieVAlpha( x + i, y + i, gr.y - i * 2, farbe );
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ Obj.drawLinieH( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
+ Obj.drawLinieV( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
+ Obj.drawLinieH( x + i + 1, h - i, gr.x - i * 2 - 1, farbe );
|
|
|
+ Obj.drawLinieV( x + i, y + i, gr.y - i * 2, farbe );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- for( int i = 0; i < br; ++i )
|
|
|
+ if( alpha )
|
|
|
+ {
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ for( int x = pos.x; x < gr.x; x += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, y + i, min( 10, gr.x - i * 2 - 1 ), farbe );
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, h - i, min( 10, gr.x - i * 2 - 1 ), farbe );
|
|
|
+ }
|
|
|
+ for( int y = pos.y; y < gr.y; y += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieVAlpha( b - i, y + i + 1, min( 10, gr.y - i * 2 - 2 ), farbe );
|
|
|
+ Obj.drawLinieVAlpha( x + i, y + i, min( 10, gr.y - i * 2 ), farbe );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- Obj.drawLinieH( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
- Obj.drawLinieV( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
- Obj.drawLinieH( x + i + 1, h - i, gr.x - i * 2 - 1, farbe );
|
|
|
- Obj.drawLinieV( x + i, y + i, gr.y - i * 2, farbe );
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ for( int x = pos.x; x < gr.x; x += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieH( x + i + 1, y + i, min( 10, gr.x - i * 2 - 1 ), farbe );
|
|
|
+ Obj.drawLinieH( x + i + 1, h - i, min( 10, gr.x - i * 2 - 1 ), farbe );
|
|
|
+ }
|
|
|
+ for( int y = pos.y; y < gr.y; y += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieV( b - i, y + i + 1, min( 10, gr.y - i * 2 - 2 ), farbe );
|
|
|
+ Obj.drawLinieV( x + i, y + i, min( 10, gr.y - i * 2 ), farbe );
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -134,24 +186,62 @@ void Rahmen3D::render( Bild &Obj ) // Zeichnet den Rahmen in das RenderZeichnung
|
|
|
int b = x + gr.x - 1;
|
|
|
int h = y + gr.y - 1;
|
|
|
int fcomp = ( farbe & 0xFF000000 ) | ( ~farbe & 0x00FFFFFF );
|
|
|
- if( alpha )
|
|
|
+ if( !breaks )
|
|
|
{
|
|
|
- for( int i = 0; i < br; ++i )
|
|
|
+ if( alpha )
|
|
|
{
|
|
|
- Obj.drawLinieHAlpha( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
- Obj.drawLinieVAlpha( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
- Obj.drawLinieHAlpha( x + i + 1, h - i, gr.x - i * 2 - 1, fcomp );
|
|
|
- Obj.drawLinieVAlpha( x + i, y + i, gr.y - i * 2, fcomp );
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
+ Obj.drawLinieVAlpha( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, h - i, gr.x - i * 2 - 1, fcomp );
|
|
|
+ Obj.drawLinieVAlpha( x + i, y + i, gr.y - i * 2, fcomp );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ Obj.drawLinieH( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
+ Obj.drawLinieV( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
+ Obj.drawLinieH( x + i + 1, h - i, gr.x - i * 2 - 1, fcomp );
|
|
|
+ Obj.drawLinieV( x + i, y + i, gr.y - i * 2, fcomp );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- for( int i = 0; i < br; ++i )
|
|
|
+ if( alpha )
|
|
|
+ {
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ for( int x = pos.x; x < gr.x; x += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, y + i, min( 10, gr.x - i * 2 - 1 ), farbe );
|
|
|
+ Obj.drawLinieHAlpha( x + i + 1, h - i, min( 10, gr.x - i * 2 - 1 ), fcomp );
|
|
|
+ }
|
|
|
+ for( int y = pos.y; y < gr.y; y += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieVAlpha( b - i, y + i + 1, min( 10, gr.y - i * 2 - 2 ), farbe );
|
|
|
+ Obj.drawLinieVAlpha( x + i, y + i, min( 10, gr.y - i * 2 ), fcomp );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- Obj.drawLinieH( x + i + 1, y + i, gr.x - i * 2 - 1, farbe );
|
|
|
- Obj.drawLinieV( b - i, y + i + 1, gr.y - i * 2 - 2, farbe );
|
|
|
- Obj.drawLinieH( x + i + 1, h - i, gr.x - i * 2 - 1, fcomp );
|
|
|
- Obj.drawLinieV( x + i, y + i, gr.y - i * 2, fcomp );
|
|
|
+ for( int i = 0; i < br; ++i )
|
|
|
+ {
|
|
|
+ for( int x = pos.x; x < gr.x; x += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieH( x + i + 1, y + i, min( 10, gr.x - i * 2 - 1 ), farbe );
|
|
|
+ Obj.drawLinieH( x + i + 1, h - i, min( 10, gr.x - i * 2 - 1 ), fcomp );
|
|
|
+ }
|
|
|
+ for( int y = pos.y; y < gr.y; y += 20 )
|
|
|
+ {
|
|
|
+ Obj.drawLinieV( b - i, y + i + 1, min( 10, gr.y - i * 2 - 2 ), farbe );
|
|
|
+ Obj.drawLinieV( x + i, y + i, min( 10, gr.y - i * 2 ), fcomp );
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|