Files
Slnkdwf/SlnkDWFImpl/SLNKContourImpl.h
Jos Groot Lipman a51a02f07e FSN#18414 symbolen FILL reset
svn path=/Slnkdwf/trunk/; revision=12493
2010-08-12 21:52:18 +00:00

73 lines
2.6 KiB
C++

#pragma once
#include "Whiptk/whip_toolkit.h"
#define FONT_SIZER 1000
class CWhipFileState; // Forward declaration
class CSLNKContourImpl :
public WT_Polygon
{
public:
typedef enum {
LABEL_DEFAULT,
LABEL_CENTROID, // Not guaranteed inside
LABEL_TOPLEFT,
LABEL_OUTSIDERIGHT,
LABEL_OUTSIDEBOTTOM
} LABELPOS;
CSLNKContourImpl(void);
CSLNKContourImpl(
int count, /**< The number of points in the array. */
WT_Logical_Point const * points, /**< Pointer to the array of points. */
WT_Boolean copy, /**< Whether the points should be copied or if their addresses should be used directly from the array. */
CWhipFileState *parent
)
: WT_Polygon(count, points, copy), m_outlineAlpha(255), m_fromSymbol(false)
{
m_Color = WT_RGBA32(0,0,0,0); // alpha==0, 100% transparant
m_parentWhipFileState = parent;
}
~CSLNKContourImpl(void);
public:
WT_String m_contLabel; // As scanned from DWF-file
CString m_Key; // standaard m_contLabel voor contouren maar kan (en voor symbolen moet) een andere waarde krijgen
WT_Color m_Color;
int m_outlineAlpha; // Default 255, zet op 0 voor transparant
BOOL m_fromSymbol; // Dan zijn onze bounds maar matig betrouwbaar zo lang ze niet getransformeerd zijn.
CWhipFileState *m_parentWhipFileState;
WT_Fill_Pattern m_Pattern;
WT_Logical_Point m_ptLabel; // Coordinates of the label
CString m_ExtraLabel; // Can be defined
WT_URL_Item m_Url; // Can be defined
double m_DWGArea; // As determined, original source drawing units
WT_Result serialize(WT_File & file, BOOL solidOnly, BOOL forFind);
static BOOL PointInPolygon(const WT_Logical_Point pt, const WT_Point_Set &ps);
static BOOL PointInPolygon(const CPoint pt, const CPoint *ps, int size);
static void EdgeAngle(const WT_Logical_Point pt, const WT_Point_Set &ps, double &EdgeAngle, double &EdgeDistance);
static double DWFArea(const WT_Point_Set &pg);
static WT_Logical_Point Centroid(const WT_Point_Set &pg);
WT_Logical_Point LabelPosition(LABELPOS pos = LABEL_DEFAULT);
void SerializeLabel(WT_File &my_file, LABELPOS pos,
int fontheight,
double scale,
HDC myDC);
WT_Logical_Point DrawOneLabel(WT_File &my_file,
WT_Logical_Point ptTxt,
CString tok,
int fontheight,
double scale,
HDC myDC, int width=-2);
static WT_Integer32 m_next_node_num;
#ifndef DWFTK_READ_ONLY
void serializeXML( DWFToolkit::DWFXMLSerializer& rSerializer,
WT_Units units )
throw( DWFException );
#endif
};