FSN#28477 Versie 3.15: node_num teller iets netter opgelost

svn path=/Slnkdwf/trunk/; revision=20588
This commit is contained in:
Jos Groot Lipman
2014-02-09 14:23:17 +00:00
parent 8bcc4f50e5
commit fe4815fdf3
7 changed files with 13 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
// Zorg dat versies alfabetisch altijd op elkaar volgen! // Zorg dat versies alfabetisch altijd op elkaar volgen!
#define SLNK_MAJOR_VERSION 3 #define SLNK_MAJOR_VERSION 3
#define SLNK_MINOR_VERSION 14 #define SLNK_MINOR_VERSION 15
#define SLNK_BUILD_VERSION 0 #define SLNK_BUILD_VERSION 0
// Define resource strings // Define resource strings

View File

@@ -30,7 +30,7 @@ CSLNKSymbolImpl::CSLNKSymbolImpl(double dwgX, double dwgY, WT_Units units)
WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units, WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units,
CSLNKSymbolDefinition *symbdef, CSLNKSymbolDefinition *symbdef,
WT_Integer32 node_num, WT_Integer32 &node_num,
double hintScale, double hintScale,
BOOL forFind, double scale) BOOL forFind, double scale)
{ {
@@ -181,7 +181,7 @@ WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units,
file.heuristics().set_apply_transform(WD_False); // Hebben we al rechtstreeks op de contour gedaan file.heuristics().set_apply_transform(WD_False); // Hebben we al rechtstreeks op de contour gedaan
m_SLNKContour.serialize(file, node_num, true, forFind, scale); m_SLNKContour.serialize(file, node_num, true, forFind, scale);
// Nog een keer voor een mogelijke outline // Nog een keer voor een mogelijke outline
m_SLNKContour.serialize(file, node_num+1, false, forFind, scale); m_SLNKContour.serialize(file, node_num, false, forFind, scale);
// En transform weer terug // En transform weer terug
file.heuristics().set_transform(wasTransform); file.heuristics().set_transform(wasTransform);

View File

@@ -12,7 +12,7 @@ public:
WT_Result serialize (WT_File & file, WT_Units & units, WT_Result serialize (WT_File & file, WT_Units & units,
CSLNKSymbolDefinition *symbdef, CSLNKSymbolDefinition *symbdef,
WT_Integer32 node_num, WT_Integer32 &node_num,
double hintScale, BOOL forFind, double hintScale, BOOL forFind,
double scale); double scale);
WT_Result calculateBoundary (myWT_File *wtFile); WT_Result calculateBoundary (myWT_File *wtFile);

View File

@@ -765,7 +765,7 @@ bool CWhipFile::GenerateSymbols(myWT_File &my_file)
CSLNKSymbolImpl *symbol= m_SLNKSymbols[i]; CSLNKSymbolImpl *symbol= m_SLNKSymbols[i];
if (symbol->m_symbolName == "" || !m_SLNKSymbolDefinitions.Lookup(symbol->m_symbolName)) if (symbol->m_symbolName == "" || !m_SLNKSymbolDefinitions.Lookup(symbol->m_symbolName))
symbol->serialize(my_file, m_contunits, NULL, symbol->serialize(my_file, m_contunits, NULL,
m_SLNKContouren.GetCount() + 2*i, // node_num doortellen. *2 omdat we twee contouren doen m_next_node_num,
m_hintScale, m_forFind, scale); m_hintScale, m_forFind, scale);
else else
{ {
@@ -776,7 +776,7 @@ bool CWhipFile::GenerateSymbols(myWT_File &my_file)
cmt.serialize(my_file); cmt.serialize(my_file);
#endif #endif
symbol->serialize(my_file, m_contunits, m_SLNKSymbolDefinitions[symbol->m_symbolName], symbol->serialize(my_file, m_contunits, m_SLNKSymbolDefinitions[symbol->m_symbolName],
m_SLNKContouren.GetCount() + 2*i, // node_num doortellen *2 omdat we twee contouren doen m_next_node_num,
m_hintScale, m_forFind, scale); m_hintScale, m_forFind, scale);
} }
} }
@@ -871,7 +871,7 @@ bool CWhipFile::GenerateContouren(WT_File &my_planfile, myWT_File &my_file,
{ {
CSLNKContourImpl *contour= m_SLNKContouren[i]; CSLNKContourImpl *contour= m_SLNKContouren[i];
// i ook gebruiken als node_num, eigenlijk initialiseren op laatste van planfile // i ook gebruiken als node_num, eigenlijk initialiseren op laatste van planfile
contour->serialize(my_file, i, solidOnly, m_forFind, scale); contour->serialize(my_file, m_next_node_num, solidOnly, m_forFind, scale);
} }
my_file.desired_rendition().object_node() = current_node; my_file.desired_rendition().object_node() = current_node;
@@ -938,6 +938,8 @@ STDMETHODIMP CWhipFile::Generate(myWT_File &my_file)
double scale = m_contunits.application_to_dwf_transform()(0,0); double scale = m_contunits.application_to_dwf_transform()(0,0);
myDoTRACE("\nSchaal: %.2f", scale); myDoTRACE("\nSchaal: %.2f", scale);
m_next_node_num = 0;
WT_Result result; WT_Result result;
my_file.set_file_mode(WT_File::File_Write); my_file.set_file_mode(WT_File::File_Write);

View File

@@ -157,6 +157,7 @@ private:
CAtlRegExp<> m_reContouren; CAtlRegExp<> m_reContouren;
CAtlRegExp<> m_reLabels; CAtlRegExp<> m_reLabels;
CAtlRegExp<> m_reLayers; // Die met SaveAs moeten blijven CAtlRegExp<> m_reLayers; // Die met SaveAs moeten blijven
WT_Integer32 m_next_node_num;
const static WT_Logical_Point star[]; const static WT_Logical_Point star[];
const static WT_Logical_Point octa[]; const static WT_Logical_Point octa[];

View File

@@ -637,7 +637,7 @@ CSize CSLNKContourImpl::DrawOneLabel(WT_File &my_file,
Als solidOnly dan alleen als alpha==255 en een label (wel herkend) Als solidOnly dan alleen als alpha==255 en een label (wel herkend)
****************************************************************************/ ****************************************************************************/
WT_Result CSLNKContourImpl::serialize(WT_File & file, WT_Integer32 node_num, BOOL solidOnly, BOOL forFind, double scale) WT_Result CSLNKContourImpl::serialize(WT_File & file, WT_Integer32 &node_num, BOOL solidOnly, BOOL forFind, double scale)
{ {
if (!m_fromSymbol && m_contLabel == "" && !solidOnly) // Alleen bij tweede slag if (!m_fromSymbol && m_contLabel == "" && !solidOnly) // Alleen bij tweede slag
{ // May very well be a textobject itself, just emit it { // May very well be a textobject itself, just emit it
@@ -657,7 +657,7 @@ WT_Result CSLNKContourImpl::serialize(WT_File & file, WT_Integer32 node_num, BOO
(m_Color.rgba().m_rgb.a<255 && !solidOnly)) (m_Color.rgba().m_rgb.a<255 && !solidOnly))
{ {
// Start a node for 'everything'. Dit is wat we concreet teruggeven bij klikken in de tekening // Start a node for 'everything'. Dit is wat we concreet teruggeven bij klikken in de tekening
WT_Object_Node my_node(file, node_num, m_Key); WT_Object_Node my_node(file, node_num++, m_Key);
file.desired_rendition().object_node() = my_node; file.desired_rendition().object_node() = my_node;
//char s[256]; //char s[256];

View File

@@ -45,7 +45,7 @@ public:
double m_LabelRotation; // Label rotation, around Centroid! double m_LabelRotation; // Label rotation, around Centroid!
double m_Fontheight; // Font hoogte in mm double m_Fontheight; // Font hoogte in mm
WT_Result serialize(WT_File & file, WT_Integer32 node_num, BOOL solidOnly, BOOL forFind, double scale); WT_Result serialize(WT_File & file, WT_Integer32 &node_num, BOOL solidOnly, BOOL forFind, double scale);
static BOOL PointInPolygon(const WT_Logical_Point pt, const WT_Point_Set &ps); 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 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 void EdgeAngle(const WT_Logical_Point pt, const WT_Point_Set &ps, double &EdgeAngle, double &EdgeDistance);