|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef COLORFXUTILS_H
|
|
Toshihiro Shimizu |
890ddd |
#define COLORFXUTILS_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "tgeometry.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tpixel.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "trandom.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tregionoutline.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tcurves.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TRegion;
|
|
Toshihiro Shimizu |
890ddd |
class TFlash;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class RubberDeform {
|
|
Shinya Kitaoka |
120a6e |
std::vector<t3dpointd> *m_pPolyOri;</t3dpointd>
|
|
Shinya Kitaoka |
120a6e |
std::vector<t3dpointd> m_polyLoc;</t3dpointd>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void deformStep();
|
|
Shinya Kitaoka |
120a6e |
double avgLength();
|
|
Shinya Kitaoka |
120a6e |
void refinePoly(const double rf = -1.0);
|
|
Shinya Kitaoka |
120a6e |
void getBBox(TRectD &bbox);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
RubberDeform();
|
|
Shinya Kitaoka |
120a6e |
RubberDeform(std::vector<t3dpointd> *pPolyOri, const double rf = -1.0);</t3dpointd>
|
|
Shinya Kitaoka |
120a6e |
void copyLoc2Ori() { *m_pPolyOri = m_polyLoc; };
|
|
Shinya Kitaoka |
120a6e |
void copyOri2Loc() { m_polyLoc = *m_pPolyOri; };
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual ~RubberDeform();
|
|
Shinya Kitaoka |
120a6e |
void deform(const double n);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class SFlashUtils {
|
|
Shinya Kitaoka |
120a6e |
void computeOutline(const TRegion *region,
|
|
Shinya Kitaoka |
120a6e |
TRegionOutline::PointVector &polyline) const;
|
|
Shinya Kitaoka |
120a6e |
void PointVector2QuadsArray(const std::vector<t3dpointd> &pv,</t3dpointd>
|
|
Shinya Kitaoka |
120a6e |
std::vector<tquadratic *=""> &quadArray,</tquadratic>
|
|
Shinya Kitaoka |
120a6e |
std::vector<tquadratic *=""> &toBeDeleted,</tquadratic>
|
|
Shinya Kitaoka |
120a6e |
const bool isRounded) const;
|
|
Shinya Kitaoka |
120a6e |
int nbDiffVerts(const std::vector<tpointd> &pv) const;</tpointd>
|
|
Shinya Kitaoka |
120a6e |
void Triangle2Quad(std::vector<tpointd> &p) const;</tpointd>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
const TRegion *m_r;
|
|
Shinya Kitaoka |
120a6e |
TRegionOutline m_ro;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
SFlashUtils(){};
|
|
Shinya Kitaoka |
120a6e |
SFlashUtils(const TRegion *r) : m_r(r){};
|
|
Shinya Kitaoka |
120a6e |
virtual ~SFlashUtils(){};
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void computeRegionOutline();
|
|
Shinya Kitaoka |
120a6e |
void drawRegionOutline(TFlash &flash, const bool isRounded = true) const;
|
|
Shinya Kitaoka |
120a6e |
void drawGradedPolyline(TFlash &flash, std::vector<tpointd> &pv,</tpointd>
|
|
Shinya Kitaoka |
120a6e |
const TPixel32 &c1, const TPixel32 &c2) const;
|
|
Shinya Kitaoka |
120a6e |
void drawGradedRegion(TFlash &flash, std::vector<tpointd> &pv,</tpointd>
|
|
Shinya Kitaoka |
120a6e |
const TPixel32 &c1, const TPixel32 &c2,
|
|
Shinya Kitaoka |
120a6e |
const TRegion &r) const;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif
|