Files
Slnkdwf/SlnkDWFImpl/SLNKContourImpl.h
Jos Groot Lipman 7f586d9727 1e aanzet labelrotation. Alleen parameter overdracht, heeft nog geen effect
svn path=/Slnkdwf/trunk/; revision=18472
2013-07-15 19:21:45 +00:00

66 lines
2.7 KiB
C++

#pragma once
#include "Whiptk/whip_toolkit.h"
#define FONT_SIZER 1000
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. */
WT_Units units
);
~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.
BOOL m_isDynamic; // Dan zal het eerste punt toevoegen niet meer alles resetten
WT_Units m_Units; // In welke eenheid zijn de LP coordinaten van deze contour?
// Zal voor symbooldefinities afwijken van de whipfile en symbool inserts
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
LABELPOS m_Labelpos; // Label position
double m_LabelRotation; // Label rotation, around Centroid!
double m_Fontheight; // Font hoogte in mm
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, double scale, HDC myDC);
WT_Logical_Point DrawOneLabel(WT_File &my_file,
WT_Logical_Point ptTxt,
CString tok,
int l_fontheight,
double scale,
HDC myDC, int width=-2);
void AddPoint(double pValX, double pValY);
void AddPoint(WT_Logical_Point pt);
static WT_Integer32 m_next_node_num;
};