Mercurial > hg > aimc
comparison src/Modules/Output/Graphics/Devices/GraphicsOutputDevicePlotutils.h @ 228:82e0dc3dfd16
- All \t to two spaces (style guide compliance)
author | tomwalters |
---|---|
date | Fri, 15 Oct 2010 05:46:53 +0000 |
parents | 73c6d61440ad |
children |
comparison
equal
deleted
inserted
replaced
227:73c6d61440ad | 228:82e0dc3dfd16 |
---|---|
45 class GraphicsOutputDevicePlotutils : public GraphicsOutputDevice { | 45 class GraphicsOutputDevicePlotutils : public GraphicsOutputDevice { |
46 public: | 46 public: |
47 GraphicsOutputDevicePlotutils(Parameters *pParam); | 47 GraphicsOutputDevicePlotutils(Parameters *pParam); |
48 virtual ~GraphicsOutputDevicePlotutils(); | 48 virtual ~GraphicsOutputDevicePlotutils(); |
49 | 49 |
50 /*! \brief Initializes this output device, prepares plotting tools. | 50 /*! \brief Initializes this output device, prepares plotting tools. |
51 * \param sDir Directory or filename where to put images, max length | 51 * \param sDir Directory or filename where to put images, max length |
52 * is _MAX_PATH. Must end with slash!!! | 52 * is _MAX_PATH. Must end with slash!!! |
53 * \return true on success, false on failure. | 53 * \return true on success, false on failure. |
54 * | 54 * |
55 * sDir can be either a filename, in which case the output will be | 55 * sDir can be either a filename, in which case the output will be |
56 * to that file, or a directory, in which case it will be filled | 56 * to that file, or a directory, in which case it will be filled |
57 * with 6-digit numbered files. A new file is then created at every | 57 * with 6-digit numbered files. A new file is then created at every |
58 * call to gGrab(). | 58 * call to gGrab(). |
59 * | 59 * |
60 * As usual, make sure to call this function before any other. If this | 60 * As usual, make sure to call this function before any other. If this |
61 * Initialize() failed, you shouldn't try the other functions either. | 61 * Initialize() failed, you shouldn't try the other functions either. |
62 */ | 62 */ |
63 bool Initialize(const char *sDir); | 63 bool Initialize(const char *sDir); |
64 bool Initialize(); | 64 bool Initialize(); |
65 | 65 |
66 void gGrab(); | 66 void gGrab(); |
67 void gBeginLineStrip(); | 67 void gBeginLineStrip(); |
68 void gBeginQuadStrip(); | 68 void gBeginQuadStrip(); |
69 using GraphicsOutputDevice::gVertex3f; // Because we overload it | 69 using GraphicsOutputDevice::gVertex3f; // Because we overload it |
70 void gVertex3f(float x, float y, float z); | 70 void gVertex3f(float x, float y, float z); |
71 void gColor3f(float r, float g, float b); | 71 void gColor3f(float r, float g, float b); |
72 void gEnd(); | 72 void gEnd(); |
73 void gText3f(float x, float y, float z, const char *sStr, bool bRotated = false); | 73 void gText3f(float x, float y, float z, const char *sStr, bool bRotated = false); |
74 void gRelease(); | 74 void gRelease(); |
75 char* GetBuffer(); | 75 char* GetBuffer(); |
76 protected: | 76 protected: |
77 /*! \brief Open the file with given index for output | 77 /*! \brief Open the file with given index for output |
78 * \param index File number to open | 78 * \param index File number to open |
79 * \return true on success, false on error | 79 * \return true on success, false on error |
80 * | 80 * |
81 * This opens a file for output and sets up the plotting library. | 81 * This opens a file for output and sets up the plotting library. |
82 */ | 82 */ |
83 bool OpenFile(unsigned int index); | 83 bool OpenFile(unsigned int index); |
84 | 84 |
85 //! \brief Closes a plot output file, if any is open. | 85 //! \brief Closes a plot output file, if any is open. |
86 void CloseFile(); | 86 void CloseFile(); |
87 | 87 |
88 //! \brief Internal initialisation function called by overloaded variants of Initialize() | 88 //! \brief Internal initialisation function called by overloaded variants of Initialize() |
89 void Init(); | 89 void Init(); |
90 | 90 |
91 //! \brief The current output file's handle | 91 //! \brief The current output file's handle |
92 FILE *m_pOutputFile; | 92 FILE *m_pOutputFile; |
93 //! \brief The plotutils plotter | 93 //! \brief The plotutils plotter |
94 int m_iPlotHandle; | 94 int m_iPlotHandle; |
95 //! \brief Output directory | 95 //! \brief Output directory |
96 char m_sDir[PATH_MAX]; | 96 char m_sDir[PATH_MAX]; |
97 //! \brief Current file number | 97 //! \brief Current file number |
98 unsigned int m_iFileNumber; | 98 unsigned int m_iFileNumber; |
99 //! \brief true if this is the first vertex after gBegin() | 99 //! \brief true if this is the first vertex after gBegin() |
100 bool m_bIsFirstVertex; | 100 bool m_bIsFirstVertex; |
101 | 101 |
102 enum VertexType { | 102 enum VertexType { |
103 VertexTypeNone, | 103 VertexTypeNone, |
104 VertexTypeLine, | 104 VertexTypeLine, |
105 VertexTypeQuad | 105 VertexTypeQuad |
106 }; | 106 }; |
107 //! \brief The current vertex type | 107 //! \brief The current vertex type |
108 VertexType m_iVertexType; | 108 VertexType m_iVertexType; |
109 //! \brief Begin vertex of current quad | 109 //! \brief Begin vertex of current quad |
110 float m_aPrevX[3], m_aPrevY[3]; | 110 float m_aPrevX[3], m_aPrevY[3]; |
111 //! \brief Current number of quad vertices stored | 111 //! \brief Current number of quad vertices stored |
112 unsigned int m_iPrevVertexCount; | 112 unsigned int m_iPrevVertexCount; |
113 | 113 |
114 //! \brief Whether to invert the colors or not | 114 //! \brief Whether to invert the colors or not |
115 bool m_bInvertColors; | 115 bool m_bInvertColors; |
116 | 116 |
117 //! \brief The size of the memory bitmap buffer as provided by open_memstream | 117 //! \brief The size of the memory bitmap buffer as provided by open_memstream |
118 size_t m_sMemoryBufferSize; | 118 size_t m_sMemoryBufferSize; |
119 | 119 |
120 //! \brief Are we using a memory buffer for writing to (as opposed to a file)? | 120 //! \brief Are we using a memory buffer for writing to (as opposed to a file)? |
121 bool m_bUseMemoryBuffer; | 121 bool m_bUseMemoryBuffer; |
122 | 122 |
123 //! \brief Pointer to the memory buffer in question | 123 //! \brief Pointer to the memory buffer in question |
124 char *m_pMemoryBuffer; | 124 char *m_pMemoryBuffer; |
125 | 125 |
126 //! \brief Width of the bitmap | 126 //! \brief Width of the bitmap |
127 unsigned int m_uWidth; | 127 unsigned int m_uWidth; |
128 | 128 |
129 //! \brief Height of the bitmap | 129 //! \brief Height of the bitmap |
130 unsigned int m_uHeight; | 130 unsigned int m_uHeight; |
131 }; | 131 }; |
132 | 132 |
133 #endif /* __GRAPHICS_OUTPUT_DEVICE_PLOTUTILS_H__ */ | 133 #endif /* __GRAPHICS_OUTPUT_DEVICE_PLOTUTILS_H__ */ |