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