From 03e397e316b97b6e7b2e079e202ff8d324880a15 Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Tue, 14 Jan 2014 11:36:58 +0000 Subject: [PATCH] FSN#28477 Versie 3.12: node_num niet meer een globale static maar altijd bij 0 beginnen te tellen. Bij dezelfde input krijg je nu een 100% identieke dwf svn path=/Slnkdwf/trunk/; revision=20324 --- RemoveAbout/RemoveAbout.vcproj | 2 +- SlnkDWFCom/SLNKDWFVersion.h | 2 +- SlnkDWFCom/SLNKSymbolImpl.cpp | 8 +++++--- SlnkDWFCom/SLNKSymbolImpl.h | 1 + SlnkDWFCom/WhipFile.cpp | 9 ++++++--- SlnkDWFImpl/SLNKContourImpl.cpp | 6 ++---- SlnkDWFImpl/SLNKContourImpl.h | 3 +-- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/RemoveAbout/RemoveAbout.vcproj b/RemoveAbout/RemoveAbout.vcproj index 4a86632..de094af 100644 --- a/RemoveAbout/RemoveAbout.vcproj +++ b/RemoveAbout/RemoveAbout.vcproj @@ -100,7 +100,7 @@ diff --git a/SlnkDWFCom/SLNKDWFVersion.h b/SlnkDWFCom/SLNKDWFVersion.h index 733e365..ee75a35 100644 --- a/SlnkDWFCom/SLNKDWFVersion.h +++ b/SlnkDWFCom/SLNKDWFVersion.h @@ -1,6 +1,6 @@ // Zorg dat versies alfabetisch altijd op elkaar volgen! #define SLNK_MAJOR_VERSION 3 -#define SLNK_MINOR_VERSION 11 +#define SLNK_MINOR_VERSION 12 #define SLNK_BUILD_VERSION 0 // Define resource strings diff --git a/SlnkDWFCom/SLNKSymbolImpl.cpp b/SlnkDWFCom/SLNKSymbolImpl.cpp index fd8402f..b13cf85 100644 --- a/SlnkDWFCom/SLNKSymbolImpl.cpp +++ b/SlnkDWFCom/SLNKSymbolImpl.cpp @@ -29,7 +29,9 @@ CSLNKSymbolImpl::CSLNKSymbolImpl(double dwgX, double dwgY, WT_Units units) } WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units, - CSLNKSymbolDefinition *symbdef, double hintScale, + CSLNKSymbolDefinition *symbdef, + WT_Integer32 node_num, + double hintScale, BOOL forFind, double scale) { ATLASSERT(symbdef != NULL); @@ -164,9 +166,9 @@ WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units, file.desired_rendition().font() = file.rendition().font() = WT_Font(); file.heuristics().set_apply_transform(WD_False); // Hebben we al rechtstreeks op de contour gedaan - m_SLNKContour.serialize(file, true, forFind, scale); + m_SLNKContour.serialize(file, node_num, true, forFind, scale); // Nog een keer voor een mogelijke outline - m_SLNKContour.serialize(file, false, forFind, scale); + m_SLNKContour.serialize(file, node_num+1, false, forFind, scale); // En transform weer terug file.heuristics().set_transform(wasTransform); diff --git a/SlnkDWFCom/SLNKSymbolImpl.h b/SlnkDWFCom/SLNKSymbolImpl.h index e8f962f..6263a16 100644 --- a/SlnkDWFCom/SLNKSymbolImpl.h +++ b/SlnkDWFCom/SLNKSymbolImpl.h @@ -12,6 +12,7 @@ public: WT_Result serialize (WT_File & file, WT_Units & units, CSLNKSymbolDefinition *symbdef, + WT_Integer32 node_num, double hintScale, BOOL forFind, double scale); WT_Result calculateBoundary (myWT_File *wtFile); diff --git a/SlnkDWFCom/WhipFile.cpp b/SlnkDWFCom/WhipFile.cpp index 06bf5d7..a002a75 100644 --- a/SlnkDWFCom/WhipFile.cpp +++ b/SlnkDWFCom/WhipFile.cpp @@ -765,7 +765,8 @@ bool CWhipFile::GenerateSymbols(myWT_File &my_file) CSLNKSymbolImpl *symbol= m_SLNKSymbols[i]; if (symbol->m_symbolName == "" || !m_SLNKSymbolDefinitions.Lookup(symbol->m_symbolName)) symbol->serialize(my_file, m_contunits, NULL, - m_hintScale, m_forFind, scale); + m_SLNKContouren.GetCount() + 2*i, // node_num doortellen. *2 omdat we twee contouren doen + m_hintScale, m_forFind, scale); else { #ifdef _DEBUG @@ -775,7 +776,8 @@ bool CWhipFile::GenerateSymbols(myWT_File &my_file) cmt.serialize(my_file); #endif symbol->serialize(my_file, m_contunits, m_SLNKSymbolDefinitions[symbol->m_symbolName], - m_hintScale, m_forFind, scale); + m_SLNKContouren.GetCount() + 2*i, // node_num doortellen *2 omdat we twee contouren doen + m_hintScale, m_forFind, scale); } } return true; @@ -868,7 +870,8 @@ bool CWhipFile::GenerateContouren(WT_File &my_planfile, myWT_File &my_file, for (size_t i=0; iserialize(my_file, solidOnly, m_forFind, scale); + // i ook gebruiken als node_num, eigenlijk initialiseren op laatste van planfile + contour->serialize(my_file, i, solidOnly, m_forFind, scale); } my_file.desired_rendition().object_node() = current_node; diff --git a/SlnkDWFImpl/SLNKContourImpl.cpp b/SlnkDWFImpl/SLNKContourImpl.cpp index b44df7b..c84a3a8 100644 --- a/SlnkDWFImpl/SLNKContourImpl.cpp +++ b/SlnkDWFImpl/SLNKContourImpl.cpp @@ -8,8 +8,6 @@ #define PALETTE_RED 1 // Color in the default colormap is red. -/*static*/ WT_Integer32 CSLNKContourImpl::m_next_node_num = 0; // Eigenlijk initialiseren op laatste van planfile - // Constructor voor symboldef's en symbolen // Hier weten we vaak de contour polygon nog niet (of kunnen die pas later bepalen/ // invullen met transformatie) @@ -639,7 +637,7 @@ CSize CSLNKContourImpl::DrawOneLabel(WT_File &my_file, Als solidOnly dan alleen als alpha==255 en een label (wel herkend) ****************************************************************************/ -WT_Result CSLNKContourImpl::serialize(WT_File & file, 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 { // May very well be a textobject itself, just emit it @@ -659,7 +657,7 @@ WT_Result CSLNKContourImpl::serialize(WT_File & file, BOOL solidOnly, BOOL forFi (m_Color.rgba().m_rgb.a<255 && !solidOnly)) { // Start a node for 'everything'. Dit is wat we concreet teruggeven bij klikken in de tekening - WT_Object_Node my_node(file,m_next_node_num++,m_Key); + WT_Object_Node my_node(file, node_num, m_Key); file.desired_rendition().object_node() = my_node; //char s[256]; diff --git a/SlnkDWFImpl/SLNKContourImpl.h b/SlnkDWFImpl/SLNKContourImpl.h index adfcbb5..4e9fd91 100644 --- a/SlnkDWFImpl/SLNKContourImpl.h +++ b/SlnkDWFImpl/SLNKContourImpl.h @@ -45,7 +45,7 @@ public: 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); + 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 CPoint pt, const CPoint *ps, int size); static void EdgeAngle(const WT_Logical_Point pt, const WT_Point_Set &ps, double &EdgeAngle, double &EdgeDistance); @@ -61,5 +61,4 @@ public: HDC myDC, int width=-2); void AddPoint(double pValX, double pValY); void AddPoint(WT_Logical_Point pt); - static WT_Integer32 m_next_node_num; };