00001 #ifndef Impala_Visualization_LogoWnd_h
00002 #define Impala_Visualization_LogoWnd_h
00003
00004 #include "Core/Array/Arrays.h"
00005 #include "OglGui/Window.h"
00006
00007 namespace Impala
00008 {
00009 namespace Visualization
00010 {
00011
00012
00013 class LogoWindow : public Window
00014 {
00015 public:
00016 typedef Core::Array::Array2dVec3UInt8 Array2dVec3UInt8;
00017
00018 LogoWindow(int x, int y, Array2dVec3UInt8* logoIm, bool logoAnim,
00019 int aWidth=-1, int aHeight=-1) :
00020 Window(x, y, CompWidth(logoIm, logoAnim, aHeight),
00021 CompHeight(logoIm, logoAnim, aHeight), !logoAnim)
00022 {
00023 Init2(logoIm, logoAnim);
00024 }
00025
00026 LogoWindow(OglGui::Window* parent, Array2dVec3UInt8* logoIm,
00027 bool logoAnim, int aWidth=-1, int aHeight=-1) :
00028 Window(parent, CompWidth(logoIm, logoAnim, aHeight),
00029 CompHeight(logoIm, logoAnim, aHeight), !logoAnim)
00030 {
00031 Init2(logoIm, logoAnim);
00032 }
00033
00034 LogoWindow(OglGui::Window* parent, int x, int y, bool xyUpperRight,
00035 Array2dVec3UInt8* logoIm, bool logoAnim, int aWidth=-1,
00036 int aHeight=-1) :
00037 Window(parent, x, y, 50, 50, !logoAnim)
00038 {
00039 int width = CompWidth(logoIm, logoAnim, aHeight);
00040 int height = CompHeight(logoIm, logoAnim, aHeight);
00041 SetDimensions(CompX(x, xyUpperRight, width),
00042 CompY(y, xyUpperRight, height), width, height);
00043 Init2(logoIm, logoAnim);
00044 }
00045
00046
00047 LogoWindow(OglGui::Window* parent, bool trans, int x, int y, int w, int h,
00048 Array2dVec3UInt8* logoIm, bool logoAnim) :
00049 Window(parent, x, y, w, h, !logoAnim)
00050 {
00051 Init2(logoIm, logoAnim);
00052 if (trans)
00053 SetBackground(0x0);
00054 }
00055
00056 private:
00057
00058 int
00059 CompWidth(Array2dVec3UInt8* logoIm, bool logoAnim, int aWidth)
00060 {
00061 if (logoAnim)
00062 {
00063 if (aWidth != -1)
00064 return aWidth;
00065 }
00066 if (logoIm)
00067 return logoIm->CW()+2;
00068 return 200;
00069 }
00070
00071 int
00072 CompHeight(Array2dVec3UInt8* logoIm, bool logoAnim, int aHeight)
00073 {
00074 if (logoAnim)
00075 {
00076 if (aHeight != -1)
00077 return aHeight;
00078 }
00079 if (logoIm)
00080 return logoIm->CH()+2;
00081 return 200;
00082 }
00083
00084 int
00085 CompX(int x, bool xyUpperRight, int width)
00086 {
00087 if (xyUpperRight)
00088 return x - width;
00089 return x;
00090 }
00091
00092 int
00093 CompY(int y, bool xyUpperRight, int height)
00094 {
00095 if (xyUpperRight)
00096 return y - height;
00097 return y;
00098 }
00099
00100 void
00101 Init2(Array2dVec3UInt8* logoIm, bool logoAnim)
00102 {
00103
00104 if (logoAnim)
00105 {
00106 MNAnimFuncs(GetOGLWND());
00107 }
00108 else
00109 {
00110 SetAllowRepositionViewers(false);
00111 if (logoIm)
00112 {
00113 UpdateView(0, logoIm, "Direct", 1.0, 0);
00114 int x = WndWidth() / 2 - (logoIm->CW() / 2);
00115 int y = WndHeight() / 2 - (logoIm->CH() / 2);
00116 GetView(0)->SetDimensions2D(x, y, RETAIN, RETAIN);
00117 }
00118 }
00119 }
00120
00121 };
00122
00123 }
00124 }
00125
00126 #endif