Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef STROKESTYLES_H
Toshihiro Shimizu 890ddd
#define STROKESTYLES_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzCore includes
Toshihiro Shimizu 890ddd
#include "tsimplecolorstyles.h"
Toshihiro Shimizu 890ddd
#include "tvectorimage.h"
Toshihiro Shimizu 890ddd
#include "tstrokeprop.h"
Toshihiro Shimizu 890ddd
#include "tgl.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TVectorRendeData;
Toshihiro Shimizu 890ddd
class TRandom;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef COLORFX_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct {
Toshihiro Shimizu 890ddd
	TPointD point;
Toshihiro Shimizu 890ddd
	double dbl1;
Toshihiro Shimizu 890ddd
	double dbl2;
Toshihiro Shimizu 890ddd
} PointAnd2Double;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
typedef std::vector<tpointd> Points;</tpointd>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct {
Toshihiro Shimizu 890ddd
	float blend;
Toshihiro Shimizu 890ddd
	Points points;
Toshihiro Shimizu 890ddd
} BlendAndPoint;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
typedef std::vector<std::pair<tpointd, tpixel32="">> PointsAndColors;</std::pair<tpointd,>
Shinya Kitaoka 3bfa54
typedef std::vector<points> PointMatrix;</points>
Shinya Kitaoka 3bfa54
typedef std::vector<std::pair<tpointd, double="">> PointsAndDoubles;</std::pair<tpointd,>
Shinya Kitaoka 3bfa54
typedef std::vector<std::pair<glenum, points="">> DrawmodePointsMatrix;</std::pair<glenum,>
Shinya Kitaoka 3bfa54
typedef std::vector<trectd> RectVector;</trectd>
Shinya Kitaoka 3bfa54
typedef std::vector<pointand2double> PointsAnd2Doubles;</pointand2double>
Shinya Kitaoka 3bfa54
typedef std::vector<double> Doubles;</double>
Shinya Kitaoka 3bfa54
typedef std::vector<blendandpoint> BlendAndPoints;</blendandpoint>
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
template <class t=""></class>
Toshihiro Shimizu 890ddd
class TOptimizedStrokeStyleT : public TColorStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TOptimizedStrokeStyleT() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStrokeProp *makeStrokeProp(const TStroke *stroke);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TRegionProp *makeRegionProp(const TRegion *region)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		assert(false);
Toshihiro Shimizu 890ddd
		return 0;
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	virtual void computeData(T &data, const TStroke *stroke, const TColorFunction *cf) const = 0;
Toshihiro Shimizu 890ddd
	virtual void drawStroke(const TColorFunction *cf, T &data, const TStroke *stroke) const = 0;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TFurStrokeStyle : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	double m_cs, m_sn, m_angle, m_length;
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TFurStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Points &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Points &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &rd, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TFurStrokeStyle", "Herringbone"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		os << m_color << m_angle << m_length;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		is >> m_color >> m_angle >> m_length;
Toshihiro Shimizu 890ddd
		m_cs = cos(m_angle);
Toshihiro Shimizu 890ddd
		m_sn = sin(m_angle);
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 103; };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TChainStrokeStyle : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TChainStrokeStyle(const TPixel32 &color);
Toshihiro Shimizu 890ddd
	TChainStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TChainStrokeStyle", "Chain"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Points &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Points &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color; }
Toshihiro Shimizu 890ddd
	int getTagId() const { return 104; };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TSprayStrokeStyle : public TSimpleStrokeStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_blend, m_intensity, m_radius;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TSprayStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TSprayStrokeStyle", "Circlets"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_blend >> m_intensity >> m_radius; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_blend << m_intensity << m_radius; }
Toshihiro Shimizu 890ddd
	int getTagId() const { return 106; };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TGraphicPenStrokeStyle : public TOptimizedStrokeStyleT<drawmodepointsmatrix></drawmodepointsmatrix>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_intensity;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TGraphicPenStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TGraphicPenStrokeStyle", "Dashes"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(DrawmodePointsMatrix &data, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, DrawmodePointsMatrix &data, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *s) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_intensity; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_intensity; }
Toshihiro Shimizu 890ddd
	int getTagId() const { return 107; };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TDottedLineStrokeStyle : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_in, m_line, m_out, m_blank;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TDottedLineStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Points &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Points &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TDottedLineStrokeStyle", "Vanishing"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_in >> m_line >> m_out >> m_blank; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_in << m_line << m_out << m_blank; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 111; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TRopeStrokeStyle : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_bend;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TRopeStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Points &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Points &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TRopeStrokeStyle", "Rope"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_bend; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_bend; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 108; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TCrystallizeStrokeStyle : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_period, m_opacity;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TCrystallizeStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Points &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Points &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TCrystallizeStrokeStyle", "Tulle"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_period >> m_opacity; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_period << m_opacity; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 109; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TBraidStrokeStyle : public TSimpleStrokeStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_colors[3];
Toshihiro Shimizu 890ddd
	double m_period;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TBraidStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TBraidStrokeStyle", "Plait"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_colors[0]; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_colors[0] = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getColorParamCount() const { return 3; }
Toshihiro Shimizu 890ddd
	TPixel32 getColorParamValue(int index) const;
Toshihiro Shimizu 890ddd
	void setColorParamValue(int index, const TPixel32 &color);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_colors[0] >> m_colors[1] >> m_colors[2] >> m_period; }
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_colors[0] << m_colors[1] << m_colors[2] << m_period; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 136; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const { ids.push_back(112); }</int>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TSketchStrokeStyle : public TSimpleStrokeStyle
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
	TSketchStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TSketchStrokeStyle", "Fuzz"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &fl, const TStroke *s) const;
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 113; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TBubbleStrokeStyle : public TSimpleStrokeStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color0, m_color1;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TBubbleStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TBubbleStrokeStyle", "Bubbles"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color0; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color0 = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getColorParamCount() const { return 2; }
Toshihiro Shimizu 890ddd
	TPixel32 getColorParamValue(int index) const { return index == 0 ? m_color0 : m_color1; }
Toshihiro Shimizu 890ddd
	void setColorParamValue(int index, const TPixel32 &color)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		if (index == 0)
Toshihiro Shimizu 890ddd
			m_color0 = color;
Toshihiro Shimizu 890ddd
		else
Toshihiro Shimizu 890ddd
			m_color1 = color;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color0 >> m_color1; }
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color0 << m_color1; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 114; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const { ids.push_back(137); }</int>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TTissueStrokeStyle : public TOptimizedStrokeStyleT<pointmatrix></pointmatrix>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_density, m_border;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TTissueStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(PointMatrix &data, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, PointMatrix &data, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TTissueStrokeStyle", "Gauze"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_density >> m_border; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_density << m_border; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 117; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TBiColorStrokeStyle : public TOutlineStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color0, m_color1;
Toshihiro Shimizu 890ddd
	double m_parameter;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TBiColorStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &boundary) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TBiColorStrokeStyle", "Shade"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color0; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color0 = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is);
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getColorParamCount() const { return 2; }
Toshihiro Shimizu 890ddd
	TPixel32 getColorParamValue(int index) const { return index == 0 ? m_color0 : m_color1; }
Toshihiro Shimizu 890ddd
	void setColorParamValue(int index, const TPixel32 &color)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		if (index == 0)
Toshihiro Shimizu 890ddd
			m_color0 = color;
Toshihiro Shimizu 890ddd
		else
Toshihiro Shimizu 890ddd
			m_color1 = color;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 135; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const</int>
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		ids.push_back(115);
Toshihiro Shimizu 890ddd
		ids.push_back(119);
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TNormal2StrokeStyle : public TOutlineStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_lightx, m_lighty, m_shininess, m_metal, m_bend;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TNormal2StrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &boundary) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TNormal2StrokeStyle", "Bump"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_lightx >> m_lighty >> m_shininess >> m_metal >> m_bend; }
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_lightx << m_lighty
Toshihiro Shimizu 890ddd
														 << m_shininess << m_metal << m_bend; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 120; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const { ids.push_back(121); }</int>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TChalkStrokeStyle2 : public TOptimizedStrokeStyleT<doubles></doubles>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_blend, m_intensity, m_in, m_out, m_noise;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TChalkStrokeStyle2();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TChalkStrokeStyle2", "Chalk"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Doubles &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Doubles &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_blend >> m_intensity >> m_in >> m_out >> m_noise; }
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_blend << m_intensity << m_in
Toshihiro Shimizu 890ddd
														 << m_out << m_noise; }
Toshihiro Shimizu 890ddd
	int getTagId() const { return 123; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const { ids.push_back(105); }</int>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TBlendStrokeStyle2 : public TOptimizedStrokeStyleT<pointsanddoubles></pointsanddoubles>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_blend, m_in, m_out;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TBlendStrokeStyle2();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(PointsAndDoubles &data, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, PointsAndDoubles &data, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TBlendStrokeStyle2", "Fade"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_blend >> m_in >> m_out; }
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_blend << m_in << m_out; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 125; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const { ids.push_back(110); }</int>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TTwirlStrokeStyle : public TOptimizedStrokeStyleT<doubles></doubles>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_period, m_blend;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TTwirlStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Doubles &data, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Doubles &data, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	//void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TTwirlStrokeStyle", "Ribbon"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_period >> m_blend; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_period << m_blend; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 126; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TSawToothStrokeStyle : public TOutlineStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_parameter;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TSawToothStrokeStyle(TPixel32 color = TPixel32::Blue,
Toshihiro Shimizu 890ddd
						 double parameter = 20.0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &boundary) const {}
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeOutline(const TStroke *stroke,
Toshihiro Shimizu 890ddd
						TStrokeOutline &outline,
Toshihiro Shimizu 890ddd
						TOutlineUtil::OutlineParameter param) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TSawToothStrokeStyle", "Jagged"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 127; };
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_parameter; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_parameter; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TMultiLineStrokeStyle2 : public TOptimizedStrokeStyleT<blendandpoints></blendandpoints>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color0, m_color1;
Toshihiro Shimizu 890ddd
	double m_intensity, m_length, m_thick, m_noise;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TMultiLineStrokeStyle2();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(BlendAndPoints &data, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, BlendAndPoints &data, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	//void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TMultiLineStrokeStyle2", "Gouache"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color0; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color0 = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getColorParamCount() const { return 2; }
Toshihiro Shimizu 890ddd
	TPixel32 getColorParamValue(int index) const { return index == 0 ? m_color0 : m_color1; }
Toshihiro Shimizu 890ddd
	void setColorParamValue(int index, const TPixel32 &color)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		if (index == 0)
Toshihiro Shimizu 890ddd
			m_color0 = color;
Toshihiro Shimizu 890ddd
		else
Toshihiro Shimizu 890ddd
			m_color1 = color;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color0 >> m_color1 >> m_intensity >> m_length >> m_thick >> m_noise; }
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color0 << m_color1 << m_intensity << m_length << m_thick << m_noise; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 138; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const</int>
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		ids.push_back(118);
Toshihiro Shimizu 890ddd
		ids.push_back(128);
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TZigzagStrokeStyle : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_minDist, m_maxDist;
Toshihiro Shimizu 890ddd
	double m_minAngle, m_maxAngle;
Toshihiro Shimizu 890ddd
	double m_thickness;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//void drawBLines(RectVector& rects) const;
Toshihiro Shimizu 890ddd
	void setRealMinMax() const;
Toshihiro Shimizu 890ddd
	bool getZigZagPosition(const TStroke *stroke, TRandom &rnd,
Toshihiro Shimizu 890ddd
						   const double s, const int first,
Toshihiro Shimizu 890ddd
						   const double minTranslLength,
Toshihiro Shimizu 890ddd
						   TThickPoint &pos, TThickPoint &pos1) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TZigzagStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Points &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Points &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	//void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TZigzagStrokeStyle", "Zigzag"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_minDist >> m_maxDist >> m_minAngle >> m_maxAngle >> m_thickness; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_minDist << m_maxDist << m_minAngle << m_maxAngle << m_thickness; }
Toshihiro Shimizu 890ddd
	bool isSaveSupported() { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 129; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TSinStrokeStyle : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_frequency, m_thick;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TSinStrokeStyle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeData(Points &positions, const TStroke *stroke, const TColorFunction *cf) const;
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, Points &positions, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	//void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TSinStrokeStyle", "Wave"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_frequency >> m_thick; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_frequency << m_thick; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 130; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TFriezeStrokeStyle2 : public TOptimizedStrokeStyleT<points></points>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color;
Toshihiro Shimizu 890ddd
	double m_parameter, m_thick;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TFriezeStrokeStyle2();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TFriezeStrokeStyle2", "Curl"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	void computeData(std::vector<tpointd> &positions, const TStroke *stroke, const TColorFunction *cf) const;</tpointd>
Shinya Kitaoka 3bfa54
	void drawStroke(const TColorFunction *cf, std::vector<tpointd> &positions, const TStroke *stroke) const;</tpointd>
Toshihiro Shimizu 890ddd
	//void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color >> m_parameter >> m_thick; }
Toshihiro Shimizu 890ddd
	void loadData(int oldId, TInputStreamInterface &);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color << m_parameter << m_thick; }
Toshihiro Shimizu 890ddd
	int getTagId() const { return 133; };
Shinya Kitaoka 3bfa54
	void getObsoleteTagIds(std::vector<int> &ids) const { ids.push_back(102); }</int>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TDualColorStrokeStyle2 : public TOutlineStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color0, m_color1;
Toshihiro Shimizu 890ddd
	double m_parameter;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TDualColorStrokeStyle2(
Toshihiro Shimizu 890ddd
		TPixel32 color0 = TPixel32::Blue,
Toshihiro Shimizu 890ddd
		TPixel32 color1 = TPixel32::Yellow,
Toshihiro Shimizu 890ddd
		double parameter = 20.0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &boundary) const {}
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeOutline(const TStroke *stroke,
Toshihiro Shimizu 890ddd
						TStrokeOutline &outline,
Toshihiro Shimizu 890ddd
						TOutlineUtil::OutlineParameter param) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TDualColorStrokeStyle2", "Striped"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color0; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color) { m_color0 = color; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getColorParamCount() const { return 2; }
Toshihiro Shimizu 890ddd
	TPixel32 getColorParamValue(int index) const { return (index == 0) ? m_color0 : m_color1; }
Toshihiro Shimizu 890ddd
	void setColorParamValue(int index, const TPixel32 &color)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		if (index == 0)
Toshihiro Shimizu 890ddd
			m_color0 = color;
Toshihiro Shimizu 890ddd
		else
Toshihiro Shimizu 890ddd
			m_color1 = color;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 132; };
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color0 >> m_color1 >> m_parameter; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color0 << m_color1 << m_parameter; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TLongBlendStrokeStyle2 : public TOutlineStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPixel32 m_color0, m_color1;
Toshihiro Shimizu 890ddd
	double m_parameter;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TLongBlendStrokeStyle2(TPixel32 color0 = TPixel32::Blue,
Toshihiro Shimizu 890ddd
						   TPixel32 color1 = TPixel32::Transparent,
Toshihiro Shimizu 890ddd
						   double parameter = 20.0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &boundary) const {}
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void drawStroke(TFlash &flash, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void invalidate() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeOutline(const TStroke *stroke,
Toshihiro Shimizu 890ddd
						TStrokeOutline &outline,
Toshihiro Shimizu 890ddd
						TOutlineUtil::OutlineParameter param) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TLongBlendStrokeStyle2", "Watercolor"); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool hasMainColor() const { return true; }
Toshihiro Shimizu 890ddd
	TPixel32 getMainColor() const { return m_color0; }
Toshihiro Shimizu 890ddd
	void setMainColor(const TPixel32 &color0) { m_color0 = color0; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getColorParamCount() const { return 2; }
Toshihiro Shimizu 890ddd
	TPixel32 getColorParamValue(int index) const { return index == 0 ? m_color0 : m_color1; }
Toshihiro Shimizu 890ddd
	void setColorParamValue(int index, const TPixel32 &color)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		if (index == 0)
Toshihiro Shimizu 890ddd
			m_color0 = color;
Toshihiro Shimizu 890ddd
		else
Toshihiro Shimizu 890ddd
			m_color1 = color;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getTagId() const { return 134; };
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is) { is >> m_color0 >> m_color1 >> m_parameter; }
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const { os << m_color0 << m_color1 << m_parameter; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef _DEBUG
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class OutlineViewerStyle : public TSolidColorStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	double m_parameter[4];
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool m_boolPar;
Toshihiro Shimizu 890ddd
	int m_intPar;
Toshihiro Shimizu 890ddd
	int m_enumPar;
Toshihiro Shimizu 890ddd
	TFilePath m_pathPar;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	OutlineViewerStyle(TPixel32 color = TPixel32::Black,
Toshihiro Shimizu 890ddd
					   double parameter0 = 0.0, double parameter1 = 0.0,
Toshihiro Shimizu 890ddd
					   double parameter2 = 2.0, double parameter3 = 3.0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool getParamValue(TColorStyle::bool_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, bool value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void getParamRange(int index, int &min, int &max) const;
Toshihiro Shimizu 890ddd
	int getParamValue(TColorStyle::int_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, int value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void getParamRange(int index, QStringList &enumItems) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TFilePath getParamValue(TColorStyle::TFilePath_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, const TFilePath &path);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void computeOutline(const TStroke *stroke,
Toshihiro Shimizu 890ddd
						TStrokeOutline &outline,
Toshihiro Shimizu 890ddd
						TOutlineUtil::OutlineParameter param) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("OutlineViewerStyle", "OutlineViewer(OnlyDebug)"); }
Toshihiro Shimizu 890ddd
	int getTagId() const { return 99; };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TMatrioskaStrokeStyle;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TMatrioskaStrokeProp : public TStrokeProp
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	double m_outlinePixelSize;
Toshihiro Shimizu 890ddd
	TMatrioskaStrokeStyle *m_colorStyle;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	std::vector<tstrokeoutline> m_outline;</tstrokeoutline>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	std::vector<tstroke *=""> m_appStrokes;</tstroke>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TMatrioskaStrokeProp(const TStroke *stroke, TMatrioskaStrokeStyle *style);
Toshihiro Shimizu 890ddd
	~TMatrioskaStrokeProp();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	const TColorStyle *getColorStyle() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStrokeProp *clone(const TStroke *stroke) const;
Toshihiro Shimizu 890ddd
	void draw(const TVectorRenderData &rd);
Toshihiro Shimizu 890ddd
	void draw(TFlash &flash);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TMatrioskaStrokeStyle : public TSolidColorStyle
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	double m_parameter;
Toshihiro Shimizu 890ddd
	TPixel32 m_color2;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	void loadData(TInputStreamInterface &is);
Toshihiro Shimizu 890ddd
	void saveData(TOutputStreamInterface &os) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TMatrioskaStrokeStyle(
Toshihiro Shimizu 890ddd
		TPixel32 color1 = TPixel32::Magenta,
Toshihiro Shimizu 890ddd
		TPixel32 color2 = TPixel32::Blue,
Toshihiro Shimizu 890ddd
		double parameter = 6.0,
Toshihiro Shimizu 890ddd
		bool alternate = true);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getColorParamCount() const { return 2; }
Toshihiro Shimizu 890ddd
	TPixel32 getColorParamValue(int index) const;
Toshihiro Shimizu 890ddd
	void setColorParamValue(int index, const TPixel32 &color);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getParamCount() const;
Toshihiro Shimizu 890ddd
	TColorStyle::ParamType getParamType(int index) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getParamNames(int index) const;
Toshihiro Shimizu 890ddd
	void getParamRange(int index, double &min, double &max) const;
Toshihiro Shimizu 890ddd
	double getParamValue(TColorStyle::double_tag, int index) const;
Toshihiro Shimizu 890ddd
	void setParamValue(int index, double value);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStrokeProp *makeStrokeProp(const TStroke *stroke);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isRegionStyle() const { return false; }
Toshihiro Shimizu 890ddd
	bool isStrokeStyle() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getDescription() const { return QCoreApplication::translate("TMatrioskaStrokeStyle", "Toothpaste"); }
Toshihiro Shimizu 890ddd
	int getTagId() const { return 141; };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif // STROKESTYLES_H