Mercurial > hg > aimc
changeset 400:dd13c9834ceb
- Well, most of the graphics stuff at least compiles now. Next step is getting it running.
M Modules/Output/Graphics/GraphicsView.h
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.cc
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.h
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h
M Modules/Output/Graphics/Scale/ScaleLog.h
M Modules/Output/Graphics/Scale/ScaleERB.h
M Modules/Output/Graphics/Scale/ScaleLinear.h
M Modules/Output/Graphics/Scale/ScaleLogScaled.h
M Modules/Output/Graphics/Scale/Scale.cc
M Modules/Output/Graphics/Scale/Scale.h
M Support/Common.h
line wrap: on
line diff
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc Sat Oct 16 23:05:26 2010 +0000 @@ -55,7 +55,7 @@ * errors in the main Process()ing loop. */ if ( !OpenFile(0) ) { //! \todo Better error message that is more specific about the cause. - AIM_ERROR(_T("Could not open output directory '%s' using graphics format '%s'."), + LOG_ERROR(_T("Could not open output directory '%s' using graphics format '%s'."), m_sDir, m_pParam->GetString("output.img.format") ); return false; } @@ -121,7 +121,7 @@ strncpy(m_sFilename, m_sDir, sizeof(m_sFilename)/sizeof(m_sFilename[0])); char *pDot = strrchr(m_sFilename, '.'); if (!pDot) { - AIM_ERROR(_T("Please supply extension on filename when using 'auto' format: '%s'"), + LOG_ERROR(_T("Please supply extension on filename when using 'auto' format: '%s'"), m_sFilename); return false; }
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h Sat Oct 16 23:05:26 2010 +0000 @@ -27,6 +27,8 @@ #ifndef __GRAPHICS_OUTPUT_DEVICE_CAIRO_H__ #define __GRAPHICS_OUTPUT_DEVICE_CAIRO_H__ +#include <string> + #include <stdlib.h> #include <stdio.h> @@ -35,7 +37,7 @@ #include "Modules/Output/Graphics/Devices/GraphicsOutputDevice.h" namespace aimc { - +using std::string; /*! * \class GraphicsOutputDeviceCairo "Output/GraphicsOutputDeviceCairo.h" * \brief Output class for output to a graphics file using Cairo @@ -96,7 +98,7 @@ //! \brief The Cairo plotter int m_iPlotHandle; //! \brief Output directory - char m_sDir[PATH_MAX]; + char m_sDir[FILENAME_MAX]; //! \brief Current file number unsigned int m_iFileNumber; //! \brief true if this is the first vertex after gBegin() @@ -124,7 +126,7 @@ cairo_t *m_cCr; //! \brief Internal store for the input filename - char m_sFilename[PATH_MAX]; + char m_sFilename[FILENAME_MAX]; unsigned int m_iWidth; unsigned int m_iHeight;
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc Sat Oct 16 23:05:26 2010 +0000 @@ -46,8 +46,9 @@ #include <stdio.h> #include <string.h> +#include "Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h" -#include "Output/GraphicsOutputDeviceMovie.h" +namespace aimc { GraphicsOutputDeviceMovie::GraphicsOutputDeviceMovie(Parameters *pParam) : GraphicsOutputDeviceCairo(pParam) { // or GraphicsOutputDevicePlotutils @@ -63,7 +64,7 @@ // Check sound file exists if ((f = fopen(sSoundFile, "r")) == NULL) { - AIM_ERROR(_T("Couldn't open sound file '%s' for movie creation."), + LOG_ERROR(_T("Couldn't open sound file '%s' for movie creation."), sSoundFile); return false; } @@ -72,7 +73,7 @@ // Check movie output file can be made if ( (f=fopen(sMovieFile, "w"))==NULL ) { - aimERROR(_T("Couldn't open movie file '%s' to write to."), + LOG_ERROR(_T("Couldn't open movie file '%s' to write to."), sMovieFile); return false; } @@ -96,7 +97,7 @@ } else #endif { - AIM_ERROR(_T("Couldn't create a temporary directory for movie output.")); + LOG_ERROR(_T("Couldn't create a temporary directory for movie output.")); if (sTmpDir) free(sTmpDir); return false; } @@ -165,7 +166,7 @@ printf(sCmdLine); printf("\n"); if (system(sCmdLine)) { - AIM_ERROR(_T("Couldn't create movie output.")); + LOG_ERROR(_T("Couldn't create movie output.")); } #ifdef __WX__ @@ -178,7 +179,7 @@ WIN32_FIND_DATA FileData; snprintf(sCmdLine, sizeof(sCmdLine)/sizeof(sCmdLine[0]), "%s/*.*", m_sDir); if ((hList = FindFirstFile(sCmdLine, &FileData)) == INVALID_HANDLE_VALUE) { - AIM_ERROR(_T("Couldn't remove files from temporary directory.")); + LOG_ERROR(_T("Couldn't remove files from temporary directory.")); return; } bool bRMfinished = false; @@ -199,7 +200,7 @@ DIR *dir; struct dirent *dirent; if (!(dir = opendir(m_sDir))) { - AIM_ERROR(_T("Couldn't remove files in temporary directory.")); + LOG_ERROR(_T("Couldn't remove files in temporary directory.")); return; } while (dirent = readdir(dir)) { @@ -254,3 +255,4 @@ sStr); } } +} // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h Sat Oct 16 23:05:26 2010 +0000 @@ -27,10 +27,11 @@ #ifndef __GRAPHICS_OUTPUT_DEVICE_MOVIE_H__ #define __GRAPHICS_OUTPUT_DEVICE_MOVIE_H__ -#include "Support/util.h" //#include "Modules/Output/Graphics/Devices/GraphicsOutputDevicePlotutils.h" #include "Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h" +namespace aimc { + /*! * \class GraphicsOutputDeviceMovie "Output/GraphicsOutputDeviceMovie.h" * \brief Output class for output to a movie @@ -38,7 +39,7 @@ // GraphicsOutputDevicePlotutils is also possible here class GraphicsOutputDeviceMovie : public GraphicsOutputDeviceCairo { public: - GraphicsOutputDeviceMovie(AimParameters *pParam); + GraphicsOutputDeviceMovie(Parameters *pParam); virtual ~GraphicsOutputDeviceMovie() { }; /*! \brief Initializes this output device, prepares plotting tools. @@ -71,5 +72,5 @@ //! \brief Name of the movie file to produce char m_sMovieFile[PATH_MAX]; }; - +} // namespace aimc #endif /* __GRAPHICS_OUTPUT_DEVICE_MOVIE_H__ */
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.cc Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.cc Sat Oct 16 23:05:26 2010 +0000 @@ -31,8 +31,9 @@ #include <string.h> #include <math.h> -#include "Support/util.h" -#include "Output/GraphicsOutputDeviceMovieDirect.h" +#include "Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.h" + +namespace aimc { GraphicsOutputDeviceMovieDirect::GraphicsOutputDeviceMovieDirect(Parameters *params) : GraphicsOutputDeviceMovie(params) { @@ -394,3 +395,4 @@ int height) { memcpy((void*)&(pict->data[0][0]), (void*)pFrameBuffer, width*height*4); } +} // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.h Sat Oct 16 23:05:26 2010 +0000 @@ -34,6 +34,8 @@ #include <ffmpeg/swscale.h> } +namespace aimc { + /*! * \class LibavformatWriter "Output/GraphicsOutputDeviceMovieDirect.h" * \brief Helper class to use libavcodec to write a movie file @@ -85,5 +87,5 @@ private: LibavformatWriter* m_pOutputMovie; }; - +} // namespace aimc #endif /* __GRAPHICS_OUTPUT_DEVICE_MOVIE_DIRECT_H__ */
--- a/trunk/src/Modules/Output/Graphics/GraphicsView.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/GraphicsView.h Sat Oct 16 23:05:26 2010 +0000 @@ -131,21 +131,6 @@ */ virtual void PlotDataPointDirect(float x, float y, float val, float height); - /*! \brief Plot a strobe point - * \param x X-coordinate of centre (in OpenGL space) - * \param y Y-coordinate of centre (in OpenGL space) - * \param size Size of the block drawn - * \param colour_r Red colour intensity - * \param colour_g Green colour intensity - * \param colour_b Blue colour intensity - */ - virtual void PlotStrobePoint(float x, - float y, - float size, - float color_r, - float color_g, - float color_b); - //! \brief Where to plot to GraphicsOutputDevice *m_pDev;
--- a/trunk/src/Modules/Output/Graphics/Scale/Scale.cc Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Scale/Scale.cc Sat Oct 16 23:05:26 2010 +0000 @@ -16,6 +16,8 @@ #include "Modules/Output/Graphics/Scale/ScaleLog.h" #include "Modules/Output/Graphics/Scale/ScaleLogScaled.h" +namespace aimc { + Scale *Scale::Create(ScaleType iType, unsigned int min, unsigned int max, @@ -30,11 +32,11 @@ case SCALE_LOGSCALED: return static_cast<Scale*>(new ScaleLogScaled(min, max, density)); default: - aimASSERT(0); + AIM_ASSERT(0); break; } // Unreachable code - aimASSERT(0); + AIM_ASSERT(0); return NULL; } @@ -68,6 +70,7 @@ } void Scale::FromLinearScaledExtrema(Scale *pScale) { - aimASSERT(pScale); + AIM_ASSERT(pScale); FromLinearScaledExtrema(pScale->m_fMin, pScale->m_fMax); } +} // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/Scale/Scale.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Scale/Scale.h Sat Oct 16 23:05:26 2010 +0000 @@ -12,7 +12,7 @@ #ifndef __MODULE_SCALE_H__ #define __MODULE_SCALE_H__ -#include "Support/SignalBank.h" +namespace aimc { /*! * \class Scale "Modules/Scale/Scale.h" @@ -137,5 +137,5 @@ //! \brief Value used in FromLinearScaled float m_fScaledCurDiff; }; - +} // namespace aimc #endif /* __MODULE_SCALE_H__ */
--- a/trunk/src/Modules/Output/Graphics/Scale/ScaleERB.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Scale/ScaleERB.h Sat Oct 16 23:05:26 2010 +0000 @@ -14,7 +14,9 @@ #include <math.h> -#include "Modules/Scale/Scale.h" +#include "Modules/Output/Graphics/Scale/Scale.h" + +namespace aimc { /*! * \class ScaleERB "Modules/Scale/ScaleERB.h" @@ -39,5 +41,5 @@ return (pow(10, fFreq/21.4f) - 1.0f)/0.00437f; }; }; - +} // namespace aimc #endif /* __MODULE_SCALE_ERB_H__ */
--- a/trunk/src/Modules/Output/Graphics/Scale/ScaleLinear.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Scale/ScaleLinear.h Sat Oct 16 23:05:26 2010 +0000 @@ -12,7 +12,9 @@ #ifndef __MODULE_SCALE_LINEAR_H__ #define __MODULE_SCALE_LINEAR_H__ -#include "Modules/Scale/Scale.h" +#include "Modules/Output/Graphics/Scale/Scale.h" + +namespace aimc { /*! * \class ScaleLinear "Modules/Scale/ScaleLinear.h" @@ -35,5 +37,5 @@ return fFreq; }; }; - +} // namepspace aimc #endif /* __MODULE_SCALE_LINEAR_H__ */
--- a/trunk/src/Modules/Output/Graphics/Scale/ScaleLog.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Scale/ScaleLog.h Sat Oct 16 23:05:26 2010 +0000 @@ -14,7 +14,9 @@ #include <math.h> -#include "Modules/Scale/Scale.h" +#include "Modules/Output/Graphics/Scale/Scale.h" + +namespace aimc { /*! * \class ScaleLog "Modules/Scale/ScaleLog.h" @@ -38,5 +40,5 @@ return exp(fFreq); }; }; - +} // namespace aimc #endif /* __MODULE_SCALE_LOG_H__ */
--- a/trunk/src/Modules/Output/Graphics/Scale/ScaleLogScaled.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Scale/ScaleLogScaled.h Sat Oct 16 23:05:26 2010 +0000 @@ -14,7 +14,9 @@ #include <math.h> -#include "Modules/Scale/Scale.h" +#include "Modules/Output/Graphics/Scale/Scale.h" + +namespace aimc { /*! * \class ScaleERB "Modules/Scale/ScaleERB.h" @@ -39,5 +41,5 @@ return (pow(10, fFreq/21.4f))/0.00437f; }; }; - +} // namespace aimc #endif /* __MODULE_SCALE_ERB_H__ */
--- a/trunk/src/Support/Common.h Sat Oct 16 22:27:03 2010 +0000 +++ b/trunk/src/Support/Common.h Sat Oct 16 23:05:26 2010 +0000 @@ -32,6 +32,9 @@ #include <stdio.h> #include <stdarg.h> +#define AIM_NAME "AIM-C" +#define AIM_VERSION_STRING "version_number" + // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \