Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
#ifndef _PLI_IO_H
Toshihiro Shimizu 890ddd
#define _PLI_IO_H
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
#pragma warning(disable : 4661)
Toshihiro Shimizu 890ddd
#pragma warning(disable : 4018)
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 79e39b
#include <memory></memory>
Shinya Kitaoka 79e39b
#include <vector></vector>
Shinya Kitaoka 79e39b
Toshihiro Shimizu 890ddd
#include "tfilepath.h"
Toshihiro Shimizu 890ddd
#include "tvectorimage.h"
Toshihiro Shimizu 890ddd
#include "tstroke.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qstring></qstring>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
This include file defines classes needed for parsing of the PLI format
Toshihiro Shimizu 890ddd
designed for use in the paperless consortium.
Shinya Kitaoka 120a6e
The classes are designed in reference of the file format as described
Toshihiro Shimizu 890ddd
in the related paperless document.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
====================================================================*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================
Shinya Kitaoka 120a6e
these headers contains definition for the pixel types,
Toshihiro Shimizu 890ddd
and for the different curves used (segments, quadratics, cubics)
Toshihiro Shimizu 890ddd
=====================================================================*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "traster.h"
Toshihiro Shimizu 890ddd
#include "tcurves.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================
Shinya Kitaoka 120a6e
utility macro used to export classes from the dll
Toshihiro Shimizu 890ddd
(DVAPI: Digital Video Application Progam Interface)
Toshihiro Shimizu 890ddd
=====================================================================*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================
Toshihiro Shimizu 890ddd
Base class for the generic PLI tag
Toshihiro Shimizu 890ddd
=====================================================================*/
Toshihiro Shimizu 890ddd
/*!
Shinya Kitaoka 120a6e
  This is the base class for the different tags that form the PLI format.
Toshihiro Shimizu 890ddd
  For an explanation of each one of them, refer to the documentation
Shinya Kitaoka 120a6e
  The different tags can be extracted fronm the class ParsedPli,
Toshihiro Shimizu 890ddd
  using methods getFirstTag and getNextTag.
Toshihiro Shimizu 890ddd
  The tag type is stored in m_type member.
Toshihiro Shimizu 890ddd
 */
Shinya Kitaoka 120a6e
class PliTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  enum Type {
Shinya Kitaoka 120a6e
    NONE      = -1,
Shinya Kitaoka 120a6e
    END_CNTRL = 0,
Shinya Kitaoka 120a6e
    SET_DATA_8_CNTRL,
Shinya Kitaoka 120a6e
    SET_DATA_16_CNTRL,
Shinya Kitaoka 120a6e
    SET_DATA_32_CNTRL,
Shinya Kitaoka 120a6e
    TEXT,
Shinya Kitaoka 120a6e
    PALETTE,
Shinya Kitaoka 120a6e
    PALETTE_WITH_ALPHA,
Shinya Kitaoka 120a6e
    DUMMY1,
Shinya Kitaoka 120a6e
    DUMMY2,
Shinya Kitaoka 120a6e
    DUMMY3,
Shinya Kitaoka 120a6e
    THICK_QUADRATIC_CHAIN_GOBJ,
Shinya Kitaoka 120a6e
    DUMMY4,
Shinya Kitaoka 120a6e
    DUMMY5,
Shinya Kitaoka 120a6e
    BITMAP_GOBJ,
Shinya Kitaoka 120a6e
    GROUP_GOBJ,
Shinya Kitaoka 120a6e
    TRANSFORMATION_GOBJ,
Shinya Kitaoka 120a6e
    IMAGE_GOBJ,
Shinya Kitaoka 120a6e
    COLOR_NGOBJ,
Shinya Kitaoka 120a6e
    GEOMETRIC_TRANSFORMATION_GOBJ,
Shinya Kitaoka 120a6e
    DOUBLEPAIR_OBJ,
Shinya Kitaoka 120a6e
    STYLE_NGOBJ,
Shinya Kitaoka 120a6e
    INTERSECTION_DATA_GOBJ,
Shinya Kitaoka 120a6e
    IMAGE_BEGIN_GOBJ,
Shinya Kitaoka 120a6e
    THICK_QUADRATIC_LOOP_GOBJ,
Shinya Kitaoka 120a6e
    OUTLINE_OPTIONS_GOBJ,
Shinya Kitaoka 120a6e
    PRECISION_SCALE_GOBJ,
Shinya Kitaoka 120a6e
    // ...
Shinya Kitaoka 120a6e
    HOW_MANY_TAG_TYPES
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  Type m_type;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  PliTag();
Shinya Kitaoka 120a6e
  PliTag(const Type type);
Shinya Kitaoka 120a6e
  virtual ~PliTag(){};
Shinya Kitaoka 120a6e
  // PliTag(const PliTag &tag);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class TStyleParam {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  enum Type {
Shinya Kitaoka 120a6e
    SP_NONE = 0,
Shinya Kitaoka 120a6e
    SP_BYTE,
Shinya Kitaoka 120a6e
    SP_INT,
Shinya Kitaoka 120a6e
    SP_DOUBLE,
Shinya Kitaoka 120a6e
    SP_USHORT,
Shinya Kitaoka 120a6e
    SP_RASTER,
Shinya Kitaoka 120a6e
    SP_STRING,
Shinya Kitaoka 120a6e
    SP_HOWMANY
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
  Type m_type;
Shinya Kitaoka 120a6e
  double m_numericVal;
Shinya Kitaoka 120a6e
  TRaster32P m_r;
Shinya Kitaoka 120a6e
  std::string m_string;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TStyleParam() : m_type(SP_NONE), m_numericVal(0), m_r(), m_string() {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TStyleParam(const TStyleParam &styleParam)
Shinya Kitaoka 120a6e
      : m_type(styleParam.m_type)
Shinya Kitaoka 120a6e
      , m_numericVal(styleParam.m_numericVal)
Shinya Kitaoka 120a6e
      , m_r(styleParam.m_r)
Shinya Kitaoka 120a6e
      , m_string(styleParam.m_string) {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TStyleParam(double x)
Shinya Kitaoka 120a6e
      : m_type(SP_DOUBLE), m_numericVal(x), m_r(), m_string() {}
Shinya Kitaoka 120a6e
  TStyleParam(int x) : m_type(SP_INT), m_numericVal(x), m_r(), m_string() {}
Shinya Kitaoka 120a6e
  TStyleParam(BYTE x) : m_type(SP_BYTE), m_numericVal(x), m_r(), m_string() {}
Shinya Kitaoka 120a6e
  TStyleParam(USHORT x)
Shinya Kitaoka 120a6e
      : m_type(SP_USHORT), m_numericVal(x), m_r(), m_string() {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TStyleParam(const TRaster32P &x)
Shinya Kitaoka 120a6e
      : m_type(SP_RASTER), m_numericVal(0), m_r(x), m_string() {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TStyleParam(const std::string &x)
Shinya Kitaoka 120a6e
      : m_type(SP_STRING), m_numericVal(0), m_r(), m_string(x) {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  UINT getSize();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Subclasses useful to a ierarchical structure of the tags
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
=====================================================================*/
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class PliObjectTag : public PliTag {
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  PliObjectTag();
Shinya Kitaoka 120a6e
  PliObjectTag(const Type type);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================*/
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class PliGeometricTag : public PliObjectTag {
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  PliGeometricTag();
Shinya Kitaoka 120a6e
  PliGeometricTag(const Type type);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================
Shinya Kitaoka 120a6e
real tags; their structures resembles the structure in the PLI file and
Toshihiro Shimizu 890ddd
the description in the PLI specific document
Toshihiro Shimizu 890ddd
=====================================================================*/
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class TextTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  std::string m_text;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TextTag();
Shinya Kitaoka 120a6e
  TextTag(const TextTag &textTag);
Shinya Kitaoka 120a6e
  TextTag(const std::string &text);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
 */
Shinya Kitaoka d1f6c4
class PaletteTag final : public PliTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TUINT32 m_numColors;
Shinya Kitaoka 120a6e
  TPixelRGBM32 *m_color;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  PaletteTag();
Shinya Kitaoka 120a6e
  PaletteTag(TUINT32 numColors, TPixelRGBM32 *m_color);
Shinya Kitaoka 120a6e
  PaletteTag(const PaletteTag &paletteTag);
Shinya Kitaoka 120a6e
  ~PaletteTag();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool setColor(const TUINT32 index, const TPixelRGBM32 &color);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
 */
Shinya Kitaoka d1f6c4
class PaletteWithAlphaTag final : public PliTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TUINT32 m_numColors;
Shinya Kitaoka 120a6e
  TPixelRGBM32 *m_color;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  PaletteWithAlphaTag();
Shinya Kitaoka 120a6e
  PaletteWithAlphaTag(TUINT32 numColors);
Shinya Kitaoka 120a6e
  PaletteWithAlphaTag(TUINT32 numColors, TPixelRGBM32 *m_color);
Shinya Kitaoka 120a6e
  PaletteWithAlphaTag(PaletteWithAlphaTag &paletteTag);
Shinya Kitaoka 120a6e
  ~PaletteWithAlphaTag();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool setColor(const TUINT32 index, const TPixelRGBM32 &color);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Shinya Kitaoka 120a6e
All the geometric tags that contains curve informations are
Toshihiro Shimizu 890ddd
instantiations of this template class
Toshihiro Shimizu 890ddd
 */
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class ThickQuadraticChainTag final : public PliGeometricTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TUINT32 m_numCurves;
Shinya Kitaoka 120a6e
  std::unique_ptr<tthickquadratic[]> m_curve;</tthickquadratic[]>
Shinya Kitaoka 120a6e
  bool m_isLoop;
Shinya Kitaoka 120a6e
  double m_maxThickness;
Shinya Kitaoka 120a6e
  TStroke::OutlineOptions m_outlineOptions;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  ThickQuadraticChainTag()
Shinya Kitaoka 120a6e
      : PliGeometricTag(THICK_QUADRATIC_CHAIN_GOBJ)
Shinya Kitaoka 120a6e
      , m_numCurves(0)
Shinya Kitaoka 120a6e
      , m_maxThickness(1) {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  ThickQuadraticChainTag(TUINT32 numCurves, const TThickQuadratic *curve,
Shinya Kitaoka 120a6e
                         double maxThickness)
Shinya Kitaoka 120a6e
      : PliGeometricTag(THICK_QUADRATIC_CHAIN_GOBJ)
Shinya Kitaoka 120a6e
      , m_numCurves(numCurves)
Shinya Kitaoka 120a6e
      , m_maxThickness(maxThickness <= 0 ? 1 : maxThickness) {
Shinya Kitaoka 120a6e
    if (m_numCurves > 0) {
Shinya Kitaoka 120a6e
      m_curve.reset(new TThickQuadratic[m_numCurves]);
Shinya Kitaoka 120a6e
      for (UINT i = 0; i < m_numCurves; i++) {
Shinya Kitaoka 120a6e
        m_curve[i] = curve[i];
Shinya Kitaoka 120a6e
      }
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  ThickQuadraticChainTag(const ThickQuadraticChainTag &chainTag)
Shinya Kitaoka 120a6e
      : PliGeometricTag(THICK_QUADRATIC_CHAIN_GOBJ)
Shinya Kitaoka 120a6e
      , m_numCurves(chainTag.m_numCurves)
Shinya Kitaoka 120a6e
      , m_maxThickness(chainTag.m_maxThickness) {
Shinya Kitaoka 120a6e
    if (m_numCurves > 0) {
Shinya Kitaoka 120a6e
      m_curve.reset(new TThickQuadratic[m_numCurves]);
Shinya Kitaoka 120a6e
      for (UINT i = 0; i < m_numCurves; i++) {
Shinya Kitaoka 120a6e
        m_curve[i] = chainTag.m_curve[i];
Shinya Kitaoka 120a6e
      }
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  // not implemented
Shinya Kitaoka 120a6e
  const ThickQuadraticChainTag &operator      =(
Shinya Kitaoka 120a6e
      const ThickQuadraticChainTag &chainTag) = delete;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
Not yet implemented
Toshihiro Shimizu 890ddd
*/
Shinya Kitaoka d1f6c4
class BitmapTag final : public PliGeometricTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  enum compressionType { NONE = 0, RLE, HOW_MANY_COMPRESSION };
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TRaster32P m_r;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  BitmapTag();
Shinya Kitaoka 120a6e
  BitmapTag(const TRaster32P &r);
Shinya Kitaoka 120a6e
  BitmapTag(const BitmapTag &bitmap);
Shinya Kitaoka 120a6e
  ~BitmapTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
Not yet implemented
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class ColorTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  enum styleType {
Shinya Kitaoka 120a6e
    STYLE_NONE = 0,
Shinya Kitaoka 120a6e
    SOLID,
Shinya Kitaoka 120a6e
    LINEAR_GRADIENT,
Shinya Kitaoka 120a6e
    RADIAL_GRADIENT,
Shinya Kitaoka 120a6e
    STYLE_HOW_MANY
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
  enum attributeType {
Shinya Kitaoka 120a6e
    ATTRIBUTE_NONE = 0,
Shinya Kitaoka 120a6e
    EVENODD_LOOP_FILL,
Shinya Kitaoka 120a6e
    DIRECTION_LOOP_FILL,
Shinya Kitaoka 120a6e
    STROKE_COLOR,
Shinya Kitaoka 120a6e
    LEFT_STROKE_COLOR,
Shinya Kitaoka 120a6e
    RIGHT_STROKE_COLOR,
Shinya Kitaoka 120a6e
    ATTRIBUTE_HOW_MANY
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  styleType m_style;
Shinya Kitaoka 120a6e
  attributeType m_attribute;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TUINT32 m_numColors;
Shinya Kitaoka 120a6e
  std::unique_ptr<tuint32[]> m_color;</tuint32[]>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  ColorTag();
Shinya Kitaoka 120a6e
  ColorTag(styleType style, attributeType attribute, TUINT32 numColors,
Shinya Kitaoka 120a6e
           std::unique_ptr<tuint32[]> color);</tuint32[]>
Shinya Kitaoka 120a6e
  ColorTag(const ColorTag &colorTag);
Shinya Kitaoka 120a6e
  ~ColorTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class StyleTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  USHORT m_id;
Shinya Kitaoka 120a6e
  USHORT m_pageIndex;
Shinya Kitaoka 120a6e
  int m_numParams;
Shinya Kitaoka 120a6e
  std::unique_ptr<tstyleparam[]> m_param;</tstyleparam[]>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  StyleTag();
Shinya Kitaoka 120a6e
  StyleTag(int id, USHORT pagePaletteindex, int m_numParams,
Shinya Kitaoka 120a6e
           TStyleParam *m_params);
Shinya Kitaoka 120a6e
  StyleTag(const StyleTag &trasformationTag);
Shinya Kitaoka 120a6e
  ~StyleTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class GeometricTransformationTag final : public PliGeometricTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TAffine m_affine;
Shinya Kitaoka 120a6e
  PliGeometricTag *m_object;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  GeometricTransformationTag();
Shinya Kitaoka 120a6e
  GeometricTransformationTag(const TAffine &affine, PliGeometricTag *m_object);
Shinya Kitaoka 120a6e
  GeometricTransformationTag(
Shinya Kitaoka 120a6e
      const GeometricTransformationTag &trasformationTag);
Shinya Kitaoka 120a6e
  ~GeometricTransformationTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class GroupTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  enum {
Shinya Kitaoka 120a6e
    NONE = 0,
Shinya Kitaoka 120a6e
    STROKE,
Shinya Kitaoka 120a6e
    SKETCH_STROKE,
Shinya Kitaoka 120a6e
    LOOP,
Shinya Kitaoka 120a6e
    FILL_SEED,  //(1 ColorTag + 1 pointTag)
Shinya Kitaoka 120a6e
    PALETTE,
Shinya Kitaoka 120a6e
    TYPE_HOW_MANY
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  UCHAR m_type;
Shinya Kitaoka 120a6e
  TUINT32 m_numObjects;
Shinya Kitaoka 120a6e
  std::unique_ptr<pliobjecttag *[]=""> m_object;</pliobjecttag>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  GroupTag();
Shinya Kitaoka 120a6e
  GroupTag(UCHAR type, TUINT32 numObjects, PliObjectTag **object);
Shinya Kitaoka 120a6e
  GroupTag(UCHAR type, TUINT32 numObjects,
Shinya Kitaoka 120a6e
           std::unique_ptr<pliobjecttag *[]=""> object);</pliobjecttag>
Shinya Kitaoka 120a6e
  GroupTag(const GroupTag &groupTag);
Shinya Kitaoka 120a6e
  ~GroupTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class ImageTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TFrameId m_numFrame;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TUINT32 m_numObjects;
Shinya Kitaoka 120a6e
  std::unique_ptr<pliobjecttag *[]=""> m_object;</pliobjecttag>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // ImageTag();
Shinya Kitaoka 120a6e
  ImageTag(const TFrameId &numFrame, TUINT32 numObjects, PliObjectTag **object);
Shinya Kitaoka 120a6e
  ImageTag(const TFrameId &frameId, TUINT32 numObjects,
Shinya Kitaoka 120a6e
           std::unique_ptr<pliobjecttag *[]=""> object);</pliobjecttag>
Shinya Kitaoka 120a6e
  ImageTag(const ImageTag &imageTag);
Shinya Kitaoka 120a6e
  ~ImageTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DoublePairTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  double m_first, m_second;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  DoublePairTag();
Shinya Kitaoka 120a6e
  DoublePairTag(double x, double y);
Shinya Kitaoka 120a6e
  DoublePairTag(const DoublePairTag &pointTag);
Shinya Kitaoka 120a6e
  ~DoublePairTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class IntersectionDataTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  UINT m_branchCount;
Shinya Kitaoka 120a6e
  std::unique_ptr<tvectorimage::intersectionbranch[]> m_branchArray;</tvectorimage::intersectionbranch[]>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  IntersectionDataTag();
Shinya Kitaoka 120a6e
  IntersectionDataTag(
Shinya Kitaoka 120a6e
      UINT branchCount,
Shinya Kitaoka 120a6e
      std::unique_ptr<tvectorimage::intersectionbranch[]> branchArray);</tvectorimage::intersectionbranch[]>
Shinya Kitaoka 120a6e
  IntersectionDataTag(const IntersectionDataTag &tag);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  ~IntersectionDataTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class StrokeOutlineOptionsTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TStroke::OutlineOptions m_options;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  StrokeOutlineOptionsTag();
Shinya Kitaoka 120a6e
  StrokeOutlineOptionsTag(const TStroke::OutlineOptions &options);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class PrecisionScaleTag final : public PliObjectTag {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  int m_precisionScale;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  PrecisionScaleTag();
Shinya Kitaoka 120a6e
  PrecisionScaleTag(int precisionScale);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Shinya Kitaoka 120a6e
The class which will store the parsed info in reading.
Toshihiro Shimizu 890ddd
(reading is realized by means of the constructor)
Toshihiro Shimizu 890ddd
and that must be filled up in writing(using writePli).
Shinya Kitaoka 120a6e
Notice that implementation is opaque at this level (by means class
Shinya Kitaoka 120a6e
ParsedPliImp).
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class ParsedPliImp;
Toshihiro Shimizu 890ddd
class TFilePath;
Toshihiro Shimizu 890ddd
class TContentHistory;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class ParsedPli {
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  ParsedPliImp *imp;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  void setFrameCount(int);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  ParsedPli();
Shinya Kitaoka 120a6e
  ParsedPli(const TFilePath &filename, bool readInfo = false);
Shinya Kitaoka 120a6e
  ParsedPli(USHORT framesNumber, UCHAR precision, UCHAR maxThickness,
Shinya Kitaoka 120a6e
            double autocloseTolerance);
Shinya Kitaoka 120a6e
  ~ParsedPli();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QString getCreator() const;
Shinya Kitaoka 120a6e
  void setCreator(const QString &creator);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void getVersion(UINT &majorVersionNumber, UINT &minorVersionNumber) const;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool addTag(PliTag *tag, bool addFront = false);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void loadInfo(bool readPalette, TPalette *&palette,
Shinya Kitaoka 120a6e
                TContentHistory *&history);
Shinya Kitaoka 120a6e
  ImageTag *loadFrame(const TFrameId &frameId);
Shinya Kitaoka 120a6e
  const TFrameId &getFrameNumber(int index);
Shinya Kitaoka 120a6e
  int getFrameCount() const;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  double getThickRatio() const;
Shinya Kitaoka 120a6e
  double getMaxThickness() const;
Shinya Kitaoka 120a6e
  void setMaxThickness(double maxThickness);
Shinya Kitaoka 120a6e
  double getAutocloseTolerance() const;
Shinya Kitaoka 120a6e
  int &precisionScale();
Shinya Kitaoka 120a6e
  // aggiuti questi 2 membri per salvare la paletta globale
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // vector<bool> m_idWrittenColorsArray;</bool>
Shinya Kitaoka 120a6e
  std::vector<pliobjecttag *=""> m_palette_tags;</pliobjecttag>
Shinya Kitaoka 120a6e
  // these two functions are used to browse the tag list,
Shinya Kitaoka 120a6e
  // code example:   for (PliTag *tag = getFirstTag(); tag; tag = getNextTag())
Shinya Kitaoka 120a6e
  // {}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  PliTag *getFirstTag();
Shinya Kitaoka 120a6e
  PliTag *getNextTag();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool writePli(const TFilePath &filename);
Shinya Kitaoka 120a6e
  void setCreator(std::string creator);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif