|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef TSIMPLECOLORSTYLES_H
|
|
Toshihiro Shimizu |
890ddd |
#define TSIMPLECOLORSTYLES_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzCore includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tcolorstyles.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tlevel.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "traster.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tstrokeoutline.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Qt includes
|
|
Toshihiro Shimizu |
890ddd |
#include <qcoreapplication></qcoreapplication>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef DVAPI
|
|
Toshihiro Shimizu |
890ddd |
#undef DVVAR
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifdef TVRENDER_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 |
// Forward declarations
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TStrokeProp;
|
|
Toshihiro Shimizu |
890ddd |
class TRegionProp;
|
|
Toshihiro Shimizu |
890ddd |
class TRegionOutline;
|
|
Toshihiro Shimizu |
890ddd |
class TTessellator;
|
|
Toshihiro Shimizu |
890ddd |
class TColorFunction;
|
|
Toshihiro Shimizu |
890ddd |
class TFlash;
|
|
Toshihiro Shimizu |
890ddd |
class TVectorImage;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//=================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TSimpleStrokeStyle declaration
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*!
|
|
Toshihiro Shimizu |
890ddd |
Base classs for stroke color styles.
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TSimpleStrokeStyle : public TColorStyle
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
bool isRegionStyle() const { return false; }
|
|
Toshihiro Shimizu |
890ddd |
bool isStrokeStyle() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual TStrokeProp *makeStrokeProp(const TStroke *stroke);
|
|
Toshihiro Shimizu |
890ddd |
virtual TRegionProp *makeRegionProp(const TRegion *)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
assert(false);
|
|
Toshihiro Shimizu |
890ddd |
return 0;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void drawStroke(const TColorFunction *cf, const TStroke *stroke) const = 0;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TOutlineStyle declaration
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TOutlineStyle : public TColorStyle
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
class StrokeOutlineModifier
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
StrokeOutlineModifier() {}
|
|
Toshihiro Shimizu |
890ddd |
virtual ~StrokeOutlineModifier() {}
|
|
Toshihiro Shimizu |
890ddd |
virtual StrokeOutlineModifier *clone() const = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void modify(TStrokeOutline &outline) const = 0;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class RegionOutlineModifier
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
RegionOutlineModifier() {}
|
|
Toshihiro Shimizu |
890ddd |
virtual ~RegionOutlineModifier() {}
|
|
Toshihiro Shimizu |
890ddd |
virtual RegionOutlineModifier *clone() const = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void modify(TRegionOutline &outline) const = 0;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
// StrokeOutlineModifier *m_strokeOutlineModifier;
|
|
Toshihiro Shimizu |
890ddd |
RegionOutlineModifier *m_regionOutlineModifier;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TOutlineStyle();
|
|
Toshihiro Shimizu |
890ddd |
TOutlineStyle(const TOutlineStyle &);
|
|
Toshihiro Shimizu |
890ddd |
virtual ~TOutlineStyle();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//StrokeOutlineModifier* getStrokeOutlineModifier() const { return m_strokeOutlineModifier; }
|
|
Toshihiro Shimizu |
890ddd |
//void setStrokeOutlineModifier(StrokeOutlineModifier *modifier);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
RegionOutlineModifier *getRegionOutlineModifier() const { return m_regionOutlineModifier; }
|
|
Toshihiro Shimizu |
890ddd |
void setRegionOutlineModifier(RegionOutlineModifier *modifier);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool isRegionStyle() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
bool isStrokeStyle() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void computeOutline(const TStroke *stroke,
|
|
Toshihiro Shimizu |
890ddd |
TStrokeOutline &outline,
|
|
Toshihiro Shimizu |
890ddd |
TOutlineUtil::OutlineParameter param) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TStrokeProp *makeStrokeProp(const TStroke *stroke);
|
|
Toshihiro Shimizu |
890ddd |
TRegionProp *makeRegionProp(const TRegion *region);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//virtual void drawRegion( const TVectorRenderData &rd, TRegionOutline &outline ) const =0 ;
|
|
Toshihiro Shimizu |
890ddd |
virtual void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &outline) const = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void drawRegion(TFlash &, const TRegion *) const {};
|
|
Toshihiro Shimizu |
890ddd |
virtual void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void drawStroke(TFlash &flash, const TStroke *stroke) const { TColorStyle::drawStroke(flash, stroke); }
|
|
Toshihiro Shimizu |
890ddd |
virtual void setFill(TFlash &) const {};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
// Not assignable
|
|
Toshihiro Shimizu |
890ddd |
TOutlineStyle &operator=(const TOutlineStyle &);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
typedef TSmartPointerT<toutlinestyle> TOutlineStyleP;</toutlinestyle>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TSolidColorStyle declaration
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TSolidColorStyle : public TOutlineStyle
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
TPixel32 m_color;
|
|
Toshihiro Shimizu |
890ddd |
TTessellator *m_tessellator;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void makeIcon(const TDimension &d);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void loadData(TInputStreamInterface &);
|
|
Toshihiro Shimizu |
890ddd |
virtual void saveData(TOutputStreamInterface &) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TSolidColorStyle(const TPixel32 &color = TPixel32::Black);
|
|
Toshihiro Shimizu |
890ddd |
TSolidColorStyle(const TSolidColorStyle &);
|
|
Toshihiro Shimizu |
890ddd |
~TSolidColorStyle();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle *clone() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getDescription() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool hasMainColor() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
TPixel32 getMainColor() const { return m_color; }
|
|
Toshihiro Shimizu |
890ddd |
void setMainColor(const TPixel32 &color) { m_color = color; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &outline) const;
|
|
Toshihiro Shimizu |
890ddd |
virtual void drawRegion(TFlash &flash, const TRegion *r) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *s) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void setFill(TFlash &flash) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getTagId() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
// Not assignable
|
|
Toshihiro Shimizu |
890ddd |
TSolidColorStyle &operator=(const TSolidColorStyle &);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TCenterLineStrokeStyle declaration
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*!
|
|
Toshihiro Shimizu |
890ddd |
Constant thickness stroke style.
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TCenterLineStrokeStyle : public TSimpleStrokeStyle
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
TPixel32 m_color;
|
|
Toshihiro Shimizu |
890ddd |
USHORT m_stipple;
|
|
Toshihiro Shimizu |
890ddd |
double m_width;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TCenterLineStrokeStyle(const TPixel32 &color = TPixel32(0, 0, 0, 255),
|
|
Toshihiro Shimizu |
890ddd |
USHORT stipple = 0x0,
|
|
Toshihiro Shimizu |
890ddd |
double width = 1.0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle *clone() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getDescription() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TPixel32 getColor() const { return m_color; }
|
|
Toshihiro Shimizu |
890ddd |
USHORT getStipple() const { return m_stipple; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void drawStroke(const TColorFunction *cf, const TStroke *stroke) const;
|
|
Toshihiro Shimizu |
890ddd |
void drawStroke(TFlash &flash, const TStroke *s) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool hasMainColor() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
TPixel32 getMainColor() const { return m_color; }
|
|
Toshihiro Shimizu |
890ddd |
void setMainColor(const TPixel32 &color) { m_color = color; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getParamCount() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle::ParamType getParamType(int index) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getParamNames(int index) const;
|
|
Toshihiro Shimizu |
890ddd |
void getParamRange(int index, double &min, double &max) const;
|
|
Toshihiro Shimizu |
890ddd |
double getParamValue(TColorStyle::double_tag, int index) const;
|
|
Toshihiro Shimizu |
890ddd |
void setParamValue(int index, double value);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getTagId() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void loadData(TInputStreamInterface &);
|
|
Toshihiro Shimizu |
890ddd |
void saveData(TOutputStreamInterface &) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
// Not assignable
|
|
Toshihiro Shimizu |
890ddd |
TCenterLineStrokeStyle &operator=(const TCenterLineStrokeStyle &);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//------------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TRasterImagePatternStrokeStyle declaration
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TRasterImagePatternStrokeStyle : public TColorStyle
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
static TFilePath m_rootDir;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
TLevelP m_level;
|
|
Shinya Kitaoka |
3bfa54 |
std::string m_name;
|
|
Toshihiro Shimizu |
890ddd |
double m_space,
|
|
Toshihiro Shimizu |
890ddd |
m_rotation;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TRasterImagePatternStrokeStyle();
|
|
Shinya Kitaoka |
3bfa54 |
TRasterImagePatternStrokeStyle(const std::string &patternName);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool isRegionStyle() const { return false; }
|
|
Toshihiro Shimizu |
890ddd |
bool isStrokeStyle() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getLevelFrameCount() { return m_level->getFrameCount(); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void computeTransformations(std::vector<taffine> &positions, const TStroke *stroke) const;</taffine>
|
|
Toshihiro Shimizu |
890ddd |
void drawStroke(const TVectorRenderData &rd, const std::vector<taffine> &positions, const TStroke *stroke) const;</taffine>
|
|
Toshihiro Shimizu |
890ddd |
void drawStroke(TFlash &flash, const TStroke *stroke) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void invalidate(){};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle *clone() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getDescription() const { return "TRasterImagePatternStrokeStyle"; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool hasMainColor() const { return false; }
|
|
Toshihiro Shimizu |
890ddd |
TPixel32 getMainColor() const { return TPixel32::Black; }
|
|
Toshihiro Shimizu |
890ddd |
void setMainColor(const TPixel32 &) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TStrokeProp *makeStrokeProp(const TStroke *stroke);
|
|
Toshihiro Shimizu |
890ddd |
TRegionProp *makeRegionProp(const TRegion *)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
assert(false);
|
|
Toshihiro Shimizu |
890ddd |
return 0;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getTagId() const { return 2000; };
|
|
Shinya Kitaoka |
3bfa54 |
void getObsoleteTagIds(std::vector<int> &ids) const;</int>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
3bfa54 |
void loadLevel(const std::string &patternName);
|
|
Toshihiro Shimizu |
890ddd |
static TFilePath getRootDir();
|
|
Toshihiro Shimizu |
890ddd |
static void setRootDir(const TFilePath &path) { m_rootDir = path + "custom styles"; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getParamCount() const;
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle::ParamType getParamType(int index) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getParamNames(int index) const;
|
|
Toshihiro Shimizu |
890ddd |
void getParamRange(int index, double &min, double &max) const;
|
|
Toshihiro Shimizu |
890ddd |
double getParamValue(TColorStyle::double_tag, int index) const;
|
|
Toshihiro Shimizu |
890ddd |
void setParamValue(int index, double value);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void makeIcon(const TDimension &d);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void loadData(TInputStreamInterface &);
|
|
Toshihiro Shimizu |
890ddd |
void loadData(int oldId, TInputStreamInterface &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void saveData(TOutputStreamInterface &) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
// Not assignable
|
|
Toshihiro Shimizu |
890ddd |
TRasterImagePatternStrokeStyle &operator=(const TRasterImagePatternStrokeStyle &);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TVectorImagePatternStrokeStyle declaration
|
|
Toshihiro Shimizu |
890ddd |
//**********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TVectorImagePatternStrokeStyle : public TColorStyle
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
static TFilePath m_rootDir;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
TLevelP m_level;
|
|
Shinya Kitaoka |
3bfa54 |
std::string m_name;
|
|
Toshihiro Shimizu |
890ddd |
double m_space, m_rotation;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TVectorImagePatternStrokeStyle();
|
|
Shinya Kitaoka |
3bfa54 |
TVectorImagePatternStrokeStyle(const std::string &patternName);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool isRegionStyle() const { return false; }
|
|
Toshihiro Shimizu |
890ddd |
bool isStrokeStyle() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getLevelFrameCount() { return m_level->getFrameCount(); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void computeTransformations(std::vector<taffine> &positions, const TStroke *stroke) const;</taffine>
|
|
Toshihiro Shimizu |
890ddd |
void drawStroke(const TVectorRenderData &rd, const std::vector<taffine> &positions, const TStroke *stroke) const;</taffine>
|
|
Toshihiro Shimizu |
890ddd |
void drawStroke(TFlash &flash, const TStroke *stroke) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void invalidate(){};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle *clone() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getDescription() const { return "TVectorImagePatternStrokeStyle"; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool hasMainColor() const { return false; }
|
|
Toshihiro Shimizu |
890ddd |
TPixel32 getMainColor() const { return TPixel32::Black; }
|
|
Toshihiro Shimizu |
890ddd |
void setMainColor(const TPixel32 &) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TStrokeProp *makeStrokeProp(const TStroke *stroke);
|
|
Toshihiro Shimizu |
890ddd |
TRegionProp *makeRegionProp(const TRegion *)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
assert(false);
|
|
Toshihiro Shimizu |
890ddd |
return 0;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getTagId() const { return 2800; };
|
|
Shinya Kitaoka |
3bfa54 |
void getObsoleteTagIds(std::vector<int> &ids) const;</int>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
3bfa54 |
void loadLevel(const std::string &patternName);
|
|
Toshihiro Shimizu |
890ddd |
static TFilePath getRootDir();
|
|
Toshihiro Shimizu |
890ddd |
static void setRootDir(const TFilePath &path) { m_rootDir = path + "custom styles"; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getParamCount() const;
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle::ParamType getParamType(int index) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getParamNames(int index) const;
|
|
Toshihiro Shimizu |
890ddd |
void getParamRange(int index, double &min, double &max) const;
|
|
Toshihiro Shimizu |
890ddd |
double getParamValue(TColorStyle::double_tag, int index) const;
|
|
Toshihiro Shimizu |
890ddd |
void setParamValue(int index, double value);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
static void clearGlDisplayLists();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void makeIcon(const TDimension &d);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void loadData(TInputStreamInterface &);
|
|
Toshihiro Shimizu |
890ddd |
void loadData(int oldId, TInputStreamInterface &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void saveData(TOutputStreamInterface &) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
// Not assignable
|
|
Toshihiro Shimizu |
890ddd |
TVectorImagePatternStrokeStyle &operator=(const TVectorImagePatternStrokeStyle &);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif // TSIMPLECOLORSTYLES_H
|