XTube.h
上传用户:yokoluohf
上传日期:2013-02-25
资源大小:769k
文件大小:3k
- #pragma once
- #include <Gdiplus.h>
- using namespace Gdiplus;
- #include <vector>
- using namespace std;
- #include "XSpot.h"
- class XTube
- {
- friend class XSpot;
- protected:
- REAL lineWidth;
- Color lineColor;
- Color outlineColor;
- Color defLeftColor;
- Color defRightColor;
- Color defStartColor;
- Color defEndColor;
- Color defCircleFillColor;
- Color defCircleOutlineColor;
- vector<XSpot> spots;
- Color defFontColor;
- CString defFontFace;
- REAL defFontHeight;
- int defFontStyle;
- Font* defFont;
- public:
- XTube (REAL width = 10.0, Color lColor = Color (255, 0, 0, 0), Color oColor = Color (255, 0, 0, 0));
- XTube (const XTube& obj);
- virtual ~XTube ();
- XTube& operator= (const XTube& obj);
- vector<XSpot>& GetSpots () {return spots;}
- void SetSpots(vector<XSpot>& vSpots){spots = vSpots;}
- void SetLineWidth (REAL vLineWidth) {lineWidth = vLineWidth;}
- REAL GetLineWidth () {return lineWidth;}
- void SetLineColor (Color vColor) {lineColor = vColor;}
- Color GetLineColor () {return lineColor;}
- void SetOutlineColor (Color vColor) {outlineColor = vColor;}
- Color GetOutlineColor () {return outlineColor;}
- void SetLeftColor (Color vColor) {defLeftColor = vColor;}
- Color GetLeftColor () {return defLeftColor;}
- void SetRightColor (Color vColor) {defRightColor = vColor;}
- Color GetRightColor () {return defRightColor;}
- void SetStartColor (Color vColor) {defStartColor = vColor;}
- Color GetStartColor () {return defStartColor;}
- void SetEndColor (Color vColor) {defEndColor = vColor;}
- Color GetEndColor () {return defEndColor;}
- void SetCircleFillColor (Color vColor) {defCircleFillColor = vColor;}
- Color GetCircleFillColor () {return defCircleFillColor;}
- void SetCircleOutlineColor (Color vColor) {defCircleOutlineColor = vColor;}
- Color GetCircleOutlineColor () {return defCircleOutlineColor;}
- void SetFontColor (Color vColor) {defFontColor = vColor;}
- Color GetFontColor () {return defFontColor;}
- void SetFontFace (CString vFontFace) {defFontFace = vFontFace;}
- CString GetFontFace () {return defFontFace;}
- void SetFontHeight (REAL vFontHeight) {defFontHeight = vFontHeight;}
- REAL GetFontHeight () {return defFontHeight;}
- void SetFontStyle (int vFontStyle) {defFontStyle = vFontStyle;}
- int GetFontStyle () {return defFontStyle;}
- int GetCount () {return (int) spots.size ();}
- public:
- int Append (XSpot& spot);
- int Move (float x, float y);
- int Recalculate ();
- int Draw (Graphics* g);
- int DrawLines (Graphics* g);
- int DrawSpots (Graphics* g, map<CString, PointF>* spotMap = NULL);
- };