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