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
/*=====================================================================
Toshihiro Shimizu 890ddd
  
Toshihiro Shimizu 890ddd
This include file defines classes needed for parsing of the PLI format 
Toshihiro Shimizu 890ddd
designed for use in the paperless consortium.
Toshihiro Shimizu 890ddd
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
/*=====================================================================
Toshihiro Shimizu 890ddd
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
/*=====================================================================
Toshihiro Shimizu 890ddd
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
/*!
Toshihiro Shimizu 890ddd
  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
Toshihiro Shimizu 890ddd
  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
 */
Toshihiro Shimizu 890ddd
class PliTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	enum Type {
Toshihiro Shimizu 890ddd
		NONE = -1,
Toshihiro Shimizu 890ddd
		END_CNTRL = 0,
Toshihiro Shimizu 890ddd
		SET_DATA_8_CNTRL,
Toshihiro Shimizu 890ddd
		SET_DATA_16_CNTRL,
Toshihiro Shimizu 890ddd
		SET_DATA_32_CNTRL,
Toshihiro Shimizu 890ddd
		TEXT,
Toshihiro Shimizu 890ddd
		PALETTE,
Toshihiro Shimizu 890ddd
		PALETTE_WITH_ALPHA,
Toshihiro Shimizu 890ddd
		DUMMY1,
Toshihiro Shimizu 890ddd
		DUMMY2,
Toshihiro Shimizu 890ddd
		DUMMY3,
Toshihiro Shimizu 890ddd
		THICK_QUADRATIC_CHAIN_GOBJ,
Toshihiro Shimizu 890ddd
		DUMMY4,
Toshihiro Shimizu 890ddd
		DUMMY5,
Toshihiro Shimizu 890ddd
		BITMAP_GOBJ,
Toshihiro Shimizu 890ddd
		GROUP_GOBJ,
Toshihiro Shimizu 890ddd
		TRANSFORMATION_GOBJ,
Toshihiro Shimizu 890ddd
		IMAGE_GOBJ,
Toshihiro Shimizu 890ddd
		COLOR_NGOBJ,
Toshihiro Shimizu 890ddd
		GEOMETRIC_TRANSFORMATION_GOBJ,
Toshihiro Shimizu 890ddd
		DOUBLEPAIR_OBJ,
Toshihiro Shimizu 890ddd
		STYLE_NGOBJ,
Toshihiro Shimizu 890ddd
		INTERSECTION_DATA_GOBJ,
Toshihiro Shimizu 890ddd
		IMAGE_BEGIN_GOBJ,
Toshihiro Shimizu 890ddd
		THICK_QUADRATIC_LOOP_GOBJ,
Toshihiro Shimizu 890ddd
		OUTLINE_OPTIONS_GOBJ,
Toshihiro Shimizu 890ddd
		PRECISION_SCALE_GOBJ,
Toshihiro Shimizu 890ddd
		// ...
Toshihiro Shimizu 890ddd
		HOW_MANY_TAG_TYPES
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	Type m_type;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	PliTag();
Toshihiro Shimizu 890ddd
	PliTag(const Type type);
Toshihiro Shimizu 890ddd
	virtual ~PliTag(){};
Toshihiro Shimizu 890ddd
	//PliTag(const PliTag &tag);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TStyleParam
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	enum Type {
Toshihiro Shimizu 890ddd
		SP_NONE = 0,
Toshihiro Shimizu 890ddd
		SP_BYTE,
Toshihiro Shimizu 890ddd
		SP_INT,
Toshihiro Shimizu 890ddd
		SP_DOUBLE,
Toshihiro Shimizu 890ddd
		SP_USHORT,
Toshihiro Shimizu 890ddd
		SP_RASTER,
Toshihiro Shimizu 890ddd
		SP_STRING,
Toshihiro Shimizu 890ddd
		SP_HOWMANY
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
	Type m_type;
Toshihiro Shimizu 890ddd
	double m_numericVal;
Toshihiro Shimizu 890ddd
	TRaster32P m_r;
Shinya Kitaoka 3bfa54
	std::string m_string;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStyleParam()
Toshihiro Shimizu 890ddd
		: m_type(SP_NONE), m_numericVal(0), m_r(), m_string()
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStyleParam(const TStyleParam &styleParam)
Toshihiro Shimizu 890ddd
		: m_type(styleParam.m_type), m_numericVal(styleParam.m_numericVal), m_r(styleParam.m_r), m_string(styleParam.m_string)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStyleParam(double x)
Toshihiro Shimizu 890ddd
		: m_type(SP_DOUBLE), m_numericVal(x), m_r(), m_string()
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
	TStyleParam(int x)
Toshihiro Shimizu 890ddd
		: m_type(SP_INT), m_numericVal(x), m_r(), m_string()
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
	TStyleParam(BYTE x)
Toshihiro Shimizu 890ddd
		: m_type(SP_BYTE), m_numericVal(x), m_r(), m_string()
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
	TStyleParam(USHORT x)
Toshihiro Shimizu 890ddd
		: m_type(SP_USHORT), m_numericVal(x), m_r(), m_string()
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStyleParam(const TRaster32P &x)
Toshihiro Shimizu 890ddd
		: m_type(SP_RASTER), m_numericVal(0), m_r(x), m_string()
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	TStyleParam(const std::string &x)
Toshihiro Shimizu 890ddd
		: m_type(SP_STRING), m_numericVal(0), m_r(), m_string(x)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	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
Toshihiro Shimizu 890ddd
class PliObjectTag : public PliTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	PliObjectTag();
Toshihiro Shimizu 890ddd
	PliObjectTag(const Type type);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class PliGeometricTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	PliGeometricTag();
Toshihiro Shimizu 890ddd
	PliGeometricTag(const Type type);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*=====================================================================
Toshihiro Shimizu 890ddd
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
Toshihiro Shimizu 890ddd
class TextTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 3bfa54
	std::string m_text;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TextTag();
Toshihiro Shimizu 890ddd
	TextTag(const TextTag &textTag);
Shinya Kitaoka 3bfa54
	TextTag(const std::string &text);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
 */
Toshihiro Shimizu 890ddd
class PaletteTag : public PliTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TUINT32 m_numColors;
Toshihiro Shimizu 890ddd
	TPixelRGBM32 *m_color;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	PaletteTag();
Toshihiro Shimizu 890ddd
	PaletteTag(TUINT32 numColors, TPixelRGBM32 *m_color);
Toshihiro Shimizu 890ddd
	PaletteTag(const PaletteTag &paletteTag);
Toshihiro Shimizu 890ddd
	~PaletteTag();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool setColor(const TUINT32 index, const TPixelRGBM32 &color);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
 */
Toshihiro Shimizu 890ddd
class PaletteWithAlphaTag : public PliTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TUINT32 m_numColors;
Toshihiro Shimizu 890ddd
	TPixelRGBM32 *m_color;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	PaletteWithAlphaTag();
Toshihiro Shimizu 890ddd
	PaletteWithAlphaTag(TUINT32 numColors);
Toshihiro Shimizu 890ddd
	PaletteWithAlphaTag(TUINT32 numColors, TPixelRGBM32 *m_color);
Toshihiro Shimizu 890ddd
	PaletteWithAlphaTag(PaletteWithAlphaTag &paletteTag);
Toshihiro Shimizu 890ddd
	~PaletteWithAlphaTag();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool setColor(const TUINT32 index, const TPixelRGBM32 &color);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
All the geometric tags that contains curve informations are 
Toshihiro Shimizu 890ddd
instantiations of this template class
Toshihiro Shimizu 890ddd
 */
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class ThickQuadraticChainTag : public PliGeometricTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TUINT32 m_numCurves;
Shinya Kitaoka 79e39b
	std::unique_ptr<tthickquadratic[]> m_curve;</tthickquadratic[]>
Toshihiro Shimizu 890ddd
	bool m_isLoop;
Toshihiro Shimizu 890ddd
	double m_maxThickness;
Toshihiro Shimizu 890ddd
	TStroke::OutlineOptions m_outlineOptions;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	ThickQuadraticChainTag()
Shinya Kitaoka 79e39b
		: PliGeometricTag(THICK_QUADRATIC_CHAIN_GOBJ)
Shinya Kitaoka 79e39b
		, m_numCurves(0)
Shinya Kitaoka 79e39b
		, m_maxThickness(1)
Shinya Kitaoka 79e39b
	{
Shinya Kitaoka 79e39b
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	ThickQuadraticChainTag(TUINT32 numCurves, const TThickQuadratic *curve, double maxThickness)
Shinya Kitaoka 79e39b
		: PliGeometricTag(THICK_QUADRATIC_CHAIN_GOBJ)
Shinya Kitaoka 79e39b
		, m_numCurves(numCurves)
Shinya Kitaoka 79e39b
		, m_maxThickness(maxThickness <= 0 ? 1 : maxThickness)
Toshihiro Shimizu 890ddd
	{
Shinya Kitaoka 79e39b
		if (m_numCurves > 0) {
Shinya Kitaoka 79e39b
			m_curve.reset(new TThickQuadratic[m_numCurves]);
Shinya Kitaoka 79e39b
			for (UINT i = 0; i < m_numCurves; i++) {
Toshihiro Shimizu 890ddd
				m_curve[i] = curve[i];
Shinya Kitaoka 79e39b
			}
Toshihiro Shimizu 890ddd
		}
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	ThickQuadraticChainTag(const ThickQuadraticChainTag &chainTag)
Shinya Kitaoka 79e39b
		: PliGeometricTag(THICK_QUADRATIC_CHAIN_GOBJ)
Shinya Kitaoka 79e39b
		, m_numCurves(chainTag.m_numCurves)
Shinya Kitaoka 79e39b
		, m_maxThickness(chainTag.m_maxThickness)
Toshihiro Shimizu 890ddd
	{
Shinya Kitaoka 79e39b
		if (m_numCurves > 0) {
Shinya Kitaoka 79e39b
			m_curve.reset(new TThickQuadratic[m_numCurves]);
Shinya Kitaoka 79e39b
			for (UINT i = 0; i < m_numCurves; i++) {
Toshihiro Shimizu 890ddd
				m_curve[i] = chainTag.m_curve[i];
Shinya Kitaoka 79e39b
			}
Toshihiro Shimizu 890ddd
		}
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	// not implemented
Shinya Kitaoka 79e39b
	const ThickQuadraticChainTag &operator=(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
*/
Toshihiro Shimizu 890ddd
class BitmapTag : public PliGeometricTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	enum compressionType {
Toshihiro Shimizu 890ddd
		NONE = 0,
Toshihiro Shimizu 890ddd
		RLE,
Toshihiro Shimizu 890ddd
		HOW_MANY_COMPRESSION
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TRaster32P m_r;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	BitmapTag();
Toshihiro Shimizu 890ddd
	BitmapTag(const TRaster32P &r);
Toshihiro Shimizu 890ddd
	BitmapTag(const BitmapTag &bitmap);
Toshihiro Shimizu 890ddd
	~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
Toshihiro Shimizu 890ddd
class ColorTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	enum styleType {
Toshihiro Shimizu 890ddd
		STYLE_NONE = 0,
Toshihiro Shimizu 890ddd
		SOLID,
Toshihiro Shimizu 890ddd
		LINEAR_GRADIENT,
Toshihiro Shimizu 890ddd
		RADIAL_GRADIENT,
Toshihiro Shimizu 890ddd
		STYLE_HOW_MANY
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
	enum attributeType {
Toshihiro Shimizu 890ddd
		ATTRIBUTE_NONE = 0,
Toshihiro Shimizu 890ddd
		EVENODD_LOOP_FILL,
Toshihiro Shimizu 890ddd
		DIRECTION_LOOP_FILL,
Toshihiro Shimizu 890ddd
		STROKE_COLOR,
Toshihiro Shimizu 890ddd
		LEFT_STROKE_COLOR,
Toshihiro Shimizu 890ddd
		RIGHT_STROKE_COLOR,
Toshihiro Shimizu 890ddd
		ATTRIBUTE_HOW_MANY
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	styleType m_style;
Toshihiro Shimizu 890ddd
	attributeType m_attribute;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TUINT32 m_numColors;
Shinya Kitaoka 79e39b
	std::unique_ptr<tuint32[]> m_color;</tuint32[]>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	ColorTag();
Shinya Kitaoka 79e39b
	ColorTag(styleType style, attributeType attribute, TUINT32 numColors, std::unique_ptr<tuint32[]> color);</tuint32[]>
Toshihiro Shimizu 890ddd
	ColorTag(const ColorTag &colorTag);
Toshihiro Shimizu 890ddd
	~ColorTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class StyleTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	USHORT m_id;
Toshihiro Shimizu 890ddd
	USHORT m_pageIndex;
Toshihiro Shimizu 890ddd
	int m_numParams;
Shinya Kitaoka 79e39b
	std::unique_ptr<tstyleparam[]> m_param;</tstyleparam[]>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	StyleTag();
Toshihiro Shimizu 890ddd
	StyleTag(int id, USHORT pagePaletteindex, int m_numParams, TStyleParam *m_params);
Toshihiro Shimizu 890ddd
	StyleTag(const StyleTag &trasformationTag);
Toshihiro Shimizu 890ddd
	~StyleTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class GeometricTransformationTag : public PliGeometricTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TAffine m_affine;
Toshihiro Shimizu 890ddd
	PliGeometricTag *m_object;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	GeometricTransformationTag();
Toshihiro Shimizu 890ddd
	GeometricTransformationTag(const TAffine &affine, PliGeometricTag *m_object);
Toshihiro Shimizu 890ddd
	GeometricTransformationTag(const GeometricTransformationTag &trasformationTag);
Toshihiro Shimizu 890ddd
	~GeometricTransformationTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class GroupTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	enum {
Toshihiro Shimizu 890ddd
		NONE = 0,
Toshihiro Shimizu 890ddd
		STROKE,
Toshihiro Shimizu 890ddd
		SKETCH_STROKE,
Toshihiro Shimizu 890ddd
		LOOP,
Toshihiro Shimizu 890ddd
		FILL_SEED, //(1 ColorTag + 1 pointTag)
Toshihiro Shimizu 890ddd
		PALETTE,
Toshihiro Shimizu 890ddd
		TYPE_HOW_MANY
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	UCHAR m_type;
Toshihiro Shimizu 890ddd
	TUINT32 m_numObjects;
Shinya Kitaoka 79e39b
	std::unique_ptr<pliobjecttag*[]> m_object;</pliobjecttag*[]>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	GroupTag();
Shinya Kitaoka 79e39b
	GroupTag(UCHAR type, TUINT32 numObjects, PliObjectTag** object);
Shinya Kitaoka 79e39b
	GroupTag(UCHAR type, TUINT32 numObjects, std::unique_ptr<pliobjecttag*[]> object);</pliobjecttag*[]>
Toshihiro Shimizu 890ddd
	GroupTag(const GroupTag &groupTag);
Toshihiro Shimizu 890ddd
	~GroupTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class ImageTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TFrameId m_numFrame;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TUINT32 m_numObjects;
Shinya Kitaoka 79e39b
	std::unique_ptr<pliobjecttag*[]> m_object;</pliobjecttag*[]>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//ImageTag();
Shinya Kitaoka 79e39b
	ImageTag(const TFrameId &numFrame, TUINT32 numObjects, PliObjectTag** object);
Shinya Kitaoka 79e39b
	ImageTag(const TFrameId &frameId, TUINT32 numObjects, std::unique_ptr<pliobjecttag*[]> object);</pliobjecttag*[]>
Toshihiro Shimizu 890ddd
	ImageTag(const ImageTag &imageTag);
Toshihiro Shimizu 890ddd
	~ImageTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DoublePairTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	double m_first, m_second;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	DoublePairTag();
Toshihiro Shimizu 890ddd
	DoublePairTag(double x, double y);
Toshihiro Shimizu 890ddd
	DoublePairTag(const DoublePairTag &pointTag);
Toshihiro Shimizu 890ddd
	~DoublePairTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class IntersectionDataTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	UINT m_branchCount;
Shinya Kitaoka 79e39b
	std::unique_ptr<tvectorimage::intersectionbranch[]> m_branchArray;</tvectorimage::intersectionbranch[]>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	IntersectionDataTag();
Shinya Kitaoka 79e39b
	IntersectionDataTag(UINT branchCount, std::unique_ptr<tvectorimage::intersectionbranch[]> branchArray);</tvectorimage::intersectionbranch[]>
Toshihiro Shimizu 890ddd
	IntersectionDataTag(const IntersectionDataTag &tag);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	~IntersectionDataTag();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class StrokeOutlineOptionsTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TStroke::OutlineOptions m_options;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	StrokeOutlineOptionsTag();
Toshihiro Shimizu 890ddd
	StrokeOutlineOptionsTag(const TStroke::OutlineOptions &options);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class PrecisionScaleTag : public PliObjectTag
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	int m_precisionScale;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	PrecisionScaleTag();
Toshihiro Shimizu 890ddd
	PrecisionScaleTag(int precisionScale);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=====================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
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).
Toshihiro Shimizu 890ddd
Notice that implementation is opaque at this level (by means class 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
Toshihiro Shimizu 890ddd
class ParsedPli
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	ParsedPliImp *imp;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	void setFrameCount(int);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	ParsedPli();
Toshihiro Shimizu 890ddd
	ParsedPli(const TFilePath &filename, bool readInfo = false);
Toshihiro Shimizu 890ddd
	ParsedPli(USHORT framesNumber, UCHAR precision, UCHAR maxThickness, double autocloseTolerance);
Toshihiro Shimizu 890ddd
	~ParsedPli();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QString getCreator() const;
Toshihiro Shimizu 890ddd
	void setCreator(const QString &creator);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void getVersion(UINT &majorVersionNumber, UINT &minorVersionNumber) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool addTag(PliTag *tag, bool addFront = false);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadInfo(bool readPalette, TPalette *&palette, TContentHistory *&history);
Toshihiro Shimizu 890ddd
	ImageTag *loadFrame(const TFrameId &frameId);
Toshihiro Shimizu 890ddd
	const TFrameId &getFrameNumber(int index);
Toshihiro Shimizu 890ddd
	int getFrameCount() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	double getThickRatio() const;
Toshihiro Shimizu 890ddd
	double getMaxThickness() const;
Toshihiro Shimizu 890ddd
	void setMaxThickness(double maxThickness);
Toshihiro Shimizu 890ddd
	double getAutocloseTolerance() const;
Toshihiro Shimizu 890ddd
	int &precisionScale();
Toshihiro Shimizu 890ddd
	//aggiuti questi 2 membri per salvare la paletta globale
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//vector<bool> m_idWrittenColorsArray;</bool>
Shinya Kitaoka 3bfa54
	std::vector<pliobjecttag *=""> m_palette_tags;</pliobjecttag>
Toshihiro Shimizu 890ddd
	// these two functions are used to browse the tag list,
Toshihiro Shimizu 890ddd
	// code example:   for (PliTag *tag = getFirstTag(); tag; tag = getNextTag()) {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	PliTag *getFirstTag();
Toshihiro Shimizu 890ddd
	PliTag *getNextTag();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool writePli(const TFilePath &filename);
Toshihiro Shimizu 890ddd
	void setCreator(std::string creator);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif