Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Introduction to SSE Programming

, 10 Jul 2003 CPOL
An article describes programming floating-point calculations using Streaming SIMD Extensions
// Originator : Kris Jearakul
// Comment	: Use with your own risk !!

#ifndef _CHART_DOT_H
#define _CHART_DOT_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef MAX
#define MAX 1

#ifndef MIN
#define MIN 0

#define MAX_SERIES 60

class CPlotSerie 

public :
	CPlotSerie() ;
	BOOL bIsPlotAvailable ;
	double *dValueX ;
	double *dValueY ;
	COLORREF m_plotColor ;
	BOOL AllocSerie(UINT nPoint);
	BOOL FreeSerie();

	BOOL bBufferAllocated;
} ;

// Chart.h : header file

// CChart window
class CChart : public CWnd

	CBitmap m_BkBitmap;
	BOOL Create(DWORD dwStyle, CRect &rect, CWnd *pParent, UINT id);
	void SetChartLabel(CString strX,CString strY);
	void PrintChart(CDC *pDC, int x, int y);
	void ClearChart();
	void SetGridXYNumber(int gridx, int gridy);
	void SetChartTitle(CString str);
	//void MoveWindow(CRect &Rect);
	BOOL AllocSerie(int nSerie);
	BOOL SetXYValue(double x, double y, int index, int iSerieIdx );
	void SetAxisStyle(int iStyle);
	BOOL SetRange( double dMinX, double dMaxX, double dMinY, double dMaxY);
	CPoint Corrdinate(double x, double y);
	virtual void Invalidate(BOOL bErase = FALSE);
	virtual ~CChart();

	CPlotSerie mpSerie[MAX_SERIES] ;
	BOOL bLogScale ;
	int nSerieCount ;
	CRect  m_ctlRect ;
	CRect  m_clientRect ;
	COLORREF m_AxisColor ;
	COLORREF m_GridColor ;
	COLORREF m_TextTitleColor ;
	COLORREF m_TextLabelColor ;

	// Generated message map functions
	BOOL bFontIsCreate ;
	CBitmap *m_pOldBkBitmap;
	CDC memBkDC;
	void DrawBackGround(CDC *pDC);
	BOOL bBkNeedToUpdate;
	//void SetChartTitle(CDC *pDC);
	virtual void Plot(CDC *pDC);
	virtual void DrawBorder(CDC *pDC);
	virtual void DrawChartTitle(CDC *pDC);
	virtual void DrawGrid(CDC *pDC);
	virtual void DrawAxis(CDC *pDC);
	virtual void DrawGridLabel(CDC *pDC);
	virtual void CreateFont();
	void DrawLogGrid(CDC *pDC);
	void ResCalc();
	void CalcRect();

	CString strLabelX, strLabelY ;
	CString strChartTitle ;
	CFont *pLegendFontY ;
	CFont *pLegendFontX ;
	CFont *pTitleFont;
	CRect m_axisRect;
	int iChartType ;
	int nPointCount ;
	int nPlotIndex ;
	int nGridY, nGridX ;
	double dResY, dResX ;
	double dRangeY[2], dRangeX[2];
	BOOL bIsSerieAllocated ;

	afx_msg void OnPaint();


// Microsoft Visual C++ will insert additional declarations immediately before the previous line.


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Alex Fr
Software Developer
Israel Israel
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141220.1 | Last Updated 11 Jul 2003
Article Copyright 2003 by Alex Fr
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid