Files
Slnkdwf/SlnkDWFImpl/SLNKContourImpl.h
Jos Groot Lipman 185babff53 Versie 2.80
svn path=/Slnkdwf/trunk/; revision=12530
2012-01-11 19:23:50 +00:00

76 lines
2.8 KiB
C++

#pragma once
#include "Whiptk/whip_toolkit.h"
#define FONT_SIZER 1000
class CWhipFile; // 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. */
CWhipFile *parent
)
: WT_Polygon(count, points, copy), m_outlineColor(128,128,128,255), m_fromSymbol(false), m_onTop(false)
{
m_Color = WT_RGBA32(0,0,0,0); // alpha==0, 100% transparant
m_Lineweight = 10.0; // 10 mm default
m_parentWhipFile = 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; // Vul-kleur
WT_Color m_outlineColor; // Contour kleur
BOOL m_onTop; // Deze wordt later (bovenop) getekend dan degene die niet onTop hebben
BOOL m_fromSymbol; // Dan zijn onze bounds maar matig betrouwbaar zo lang ze niet getransformeerd zijn.
CWhipFile *m_parentWhipFile;
WT_Fill_Pattern m_Pattern;
WT_Logical_Point m_ptLabel; // Coordinates of the label
CString m_ShowLabel; // As will be shown
WT_URL_Item m_Url; // Can be defined
double m_DWGArea; // As determined, original source drawing units
double m_Lineweight; // DWG coordinaten
WT_Result serialize(WT_File & file, BOOL solidOnly, BOOL forFind, double scale);
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
};