Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef ZIGZAG_STROKE_STYLE_H
Toshihiro Shimizu 890ddd
#define ZIGZAG_STROKE_STYLE_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tpixel.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef POICIPENSO
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TZigzagStrokeStyle : public TStrokeStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_density;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TZigzagStrokeStyle(const TPixel32 &color);
Toshihiro Shimizu 890ddd
	TZigzagStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void changeParameter(double delta);
Toshihiro Shimizu 890ddd
	TStrokeStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void draw(double pixelSize, const TColorFunction * = 0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_density; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_density; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 115; };
Toshihiro Shimizu 890ddd
	bool operator==(const TStrokeStyle &style) const
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		if (getTagId() != style.getTagId())
Toshihiro Shimizu 890ddd
			return false;
Toshihiro Shimizu 890ddd
		return m_color == ((TZigzagStrokeStyle &)style).m_color &&
Toshihiro Shimizu 890ddd
			   m_density == ((TZigzagStrokeStyle &)style).m_density;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TImageBasedZigzagStrokeStyle : public TStrokeStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_textScale;
Toshihiro Shimizu 890ddd
	TRaster32P m_texture;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TImageBasedZigzagStrokeStyle(const TPixel32 &color);
Toshihiro Shimizu 890ddd
	TImageBasedZigzagStrokeStyle();
Toshihiro Shimizu 890ddd
	TImageBasedZigzagStrokeStyle(const TRaster32P texture);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
	inline int realTextCoord(const int a, const int l) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void changeParameter(double delta);
Toshihiro Shimizu 890ddd
	TStrokeStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void draw(double pixelSize, const TColorFunction * = 0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_textScale; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_textScale; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 116; };
Toshihiro Shimizu 890ddd
	bool operator==(const TStrokeStyle &style) const
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		if (getTagId() != style.getTagId())
Toshihiro Shimizu 890ddd
			return false;
Toshihiro Shimizu 890ddd
		return m_color == ((TImageBasedZigzagStrokeStyle &)style).m_color &&
Toshihiro Shimizu 890ddd
			   m_textScale == ((TImageBasedZigzagStrokeStyle &)style).m_textScale;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif