93 lines
2.8 KiB
C++
93 lines
2.8 KiB
C++
#ifndef _HISTOGRAM_GRAPHWINDOW_HPP_
|
|
#define _HISTOGRAM_GRAPHWINDOW_HPP_
|
|
#ifndef _COMMON_WINDOW_HPP_
|
|
#include <common/window.hpp>
|
|
#endif
|
|
#ifndef _COMMON_SMARTPOINTER_HPP_
|
|
#include <common/pointer.hpp>
|
|
#endif
|
|
#ifndef _COMMON_PUREPALETTE_HPP_
|
|
#include <common/purepal.hpp>
|
|
#endif
|
|
//#ifndef _HISTOGRAM_GRAPH3D_HPP_
|
|
//#include <histogram/graph3d.hpp>
|
|
//#endif
|
|
//#ifndef _MUSIC_NOTE_HPP_
|
|
//#include <music/note.hpp>
|
|
//#endif
|
|
#ifndef _GUITAR_TABENTRY_HPP_
|
|
#include <guitar/TabEntry.hpp>
|
|
#endif
|
|
|
|
template <class T>
|
|
class Block;
|
|
template <class T>
|
|
class Callback;
|
|
//template <class T>
|
|
//class PureCheck;
|
|
class Graph3D;
|
|
class Rect3D;
|
|
class ColorRect;
|
|
class FloatPairs;
|
|
|
|
class GraphWindow : public Window
|
|
{
|
|
public:
|
|
GraphWindow(GUIWindow &parentWindow,const Rect &winRect);
|
|
virtual ~GraphWindow();
|
|
void showHistogram(TabEntries &entries);
|
|
// void showHistogram(Array<Note> ¬es);
|
|
// void showBalance(Block<PureCheck> &pureChecks);
|
|
private:
|
|
enum {MaxRotate=360,MinRotate=-360};
|
|
enum {ThetaDelta=10,ViewDelta=5,TurnDelta=20};
|
|
enum {LeftArrow=0x25,RightArrow=0x27,UpArrow=0x26,DownArrow=0x28,inKey=0x49,outKey=0x4F};
|
|
GraphWindow(const GraphWindow &someGraphWindow);
|
|
GraphWindow &operator=(const GraphWindow &someGraphWindow);
|
|
void registerClass(void)const;
|
|
void initializePalette(void);
|
|
void createWindow(GUIWindow &parentWindow,const Rect &winRect);
|
|
void clamp(Array<FloatPairs> &vector);
|
|
// void clamp(PureVector<FloatPairs> &vector);
|
|
void showHistogram(Array<int> &vectorInt,BYTE paletteIndex,int zDepth=0);
|
|
// void showBalance(int baseMonths,PureVector<int> &vectorInt,BYTE paletteIndex,int zDepth=0);
|
|
bool handleLeftArrow(void);
|
|
bool handleRightArrow(void);
|
|
bool handleUpArrow(void);
|
|
bool handleDownArrow(void);
|
|
void setPerspective(void);
|
|
bool shiftKeyPressed(void)const;
|
|
|
|
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType keyDownHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType leftButtonDownHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType dialogCodeHandler(CallbackData &someCallbackData);
|
|
|
|
Callback<GraphWindow> mPaintHandler;
|
|
Callback<GraphWindow> mCreateHandler;
|
|
Callback<GraphWindow> mDestroyHandler;
|
|
Callback<GraphWindow> mKeyDownHandler;
|
|
Callback<GraphWindow> mLeftButtonDownHandler;
|
|
Callback<GraphWindow> mDialogCodeHandler;
|
|
SmartPointer<Graph3D> mGraph3D;
|
|
Block<ColorRect> mGraphRects;
|
|
PurePalette mGraphPalette;
|
|
static char smszClassName[];
|
|
static char smszMenuName[];
|
|
};
|
|
|
|
inline
|
|
GraphWindow &GraphWindow::operator=(const GraphWindow &/*someGraphWindow*/)
|
|
{ // private implementation
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
bool GraphWindow::shiftKeyPressed(void)const
|
|
{
|
|
return ::GetKeyState(VK_SHIFT)&0x8000;
|
|
}
|
|
#endif
|