[mapguide-commits] r9564 - trunk/MgDev/Common/Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Jun 30 03:16:21 PDT 2019


Author: jng
Date: 2019-06-30 03:16:21 -0700 (Sun, 30 Jun 2019)
New Revision: 9564

Modified:
   trunk/MgDev/Common/Stylization/LabelRenderer.cpp
   trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
Log:
Add extra debugging code for labelling

Modified: trunk/MgDev/Common/Stylization/LabelRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2019-06-29 06:51:33 UTC (rev 9563)
+++ trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2019-06-30 10:16:21 UTC (rev 9564)
@@ -20,7 +20,12 @@
 #include "SE_Renderer.h"
 
 //#define DEBUG_LABELS
+//#define DEBUG_LABEL_CALLS
 
+#ifdef DEBUG_LABEL_CALLS
+#include <iostream>
+#endif
+
 extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
 
 
@@ -337,7 +342,15 @@
     lb.Close();
     SE_LineStroke lineStroke(0xffff0000, 3.0);
     m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+    std::wcout << L"LabelRenderer::AddExclusionRegion ["
+               << L"(" << pts[0].x << L"," << pts[0].y << L"),"
+               << L"(" << pts[1].x << L"," << pts[1].y << L"),"
+               << L"(" << pts[2].x << L"," << pts[2].y << L"),"
+               << L"(" << pts[3].x << L"," << pts[3].y << L")"
+               << L"]" << std::endl;
 #endif
+#endif
 
     RS_F_Point* tmp = (RS_F_Point*)alloca(npts * sizeof(RS_F_Point));
 
@@ -406,6 +419,14 @@
         lb.Close();
         SE_LineStroke lineStroke(info.m_tdef.textcolor().argb(), 0.0);
         m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+        std::wcout << L"LabelRenderer::DrawSimpleLabel ["
+                   << L"(" << pts[0].x << L"," << pts[0].y << L"),"
+                   << L"(" << pts[1].x << L"," << pts[1].y << L"),"
+                   << L"(" << pts[2].x << L"," << pts[2].y << L"),"
+                   << L"(" << pts[3].x << L"," << pts[3].y << L")"
+                   << L"] - (" << info.m_text << L")" << std::endl;
+#endif
     }
 #endif
 
@@ -490,7 +511,15 @@
         lb.Close();
         SE_LineStroke lineStroke(0xff000000, 0.0);
         m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+        std::wcout << L"LabelRenderer::DrawSELabel ["
+                   << L"(" << fpts[0].x << L"," << fpts[0].y << L"),"
+                   << L"(" << fpts[1].x << L"," << fpts[1].y << L"),"
+                   << L"(" << fpts[2].x << L"," << fpts[2].y << L"),"
+                   << L"(" << fpts[3].x << L"," << fpts[3].y << L")"
+                   << L"] - (" << info.m_text << L")" << std::endl;
 #endif
+#endif
     }
 
     return true;
@@ -576,7 +605,15 @@
             lb.Close();
             SE_LineStroke lineStroke(info.m_tdef.textcolor().argb(), 0.0);
             m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+            std::wcout << L"LabelRenderer::DrawPathLabel ["
+                       << L"(" << pts[0].x << L"," << pts[0].y << L"),"
+                       << L"(" << pts[1].x << L"," << pts[1].y << L"),"
+                       << L"(" << pts[2].x << L"," << pts[2].y << L"),"
+                       << L"(" << pts[3].x << L"," << pts[3].y << L")"
+                       << L"] - (" << info.m_text << L")" << std::endl;
 #endif
+#endif
         }
 
         //-------------------------------------------------------

Modified: trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp	2019-06-29 06:51:33 UTC (rev 9563)
+++ trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp	2019-06-30 10:16:21 UTC (rev 9564)
@@ -20,7 +20,12 @@
 #include "SE_Renderer.h"
 
 //#define DEBUG_LABELS
+//#define DEBUG_LABEL_CALLS
 
+#ifdef DEBUG_LABEL_CALLS
+#include <iostream>
+#endif
+
 extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
 
 
@@ -904,6 +909,14 @@
         SE_LineStroke lineStroke(color, 0.0);
 //      SE_LineStroke lineStroke(info.m_tdef.textcolor().argb(), 0.0);
         m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+        std::wcout << L"LabelRendererLocal::ComputeSimpleLabelBounds ["
+                   << L"(" << pts[0].x << L"," << pts[0].y << L"),"
+                   << L"(" << pts[1].x << L"," << pts[1].y << L"),"
+                   << L"(" << pts[2].x << L"," << pts[2].y << L"),"
+                   << L"(" << pts[3].x << L"," << pts[3].y << L")"
+                   << L"] - (" << info.m_text << L")" << std::endl;
+#endif
     }
 #endif
 
@@ -1006,7 +1019,15 @@
             SE_LineStroke lineStroke(color, 0.0);
 //          SE_LineStroke lineStroke(info.m_tdef.textcolor().argb(), 0.0);
             m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+            std::wcout << L"LabelRendererLocal::ComputePathLabelBounds ["
+                       << L"(" << pts[0].x << L"," << pts[0].y << L"),"
+                       << L"(" << pts[1].x << L"," << pts[1].y << L"),"
+                       << L"(" << pts[2].x << L"," << pts[2].y << L"),"
+                       << L"(" << pts[3].x << L"," << pts[3].y << L")"
+                       << L"] - (" << info.m_text << L")" << std::endl;
 #endif
+#endif
         }
 
         // add current periodic label to the return list
@@ -1073,7 +1094,15 @@
     SE_LineStroke lineStroke(color, 0.0);
 //  SE_LineStroke lineStroke(info.m_tdef.textcolor().argb(), 0.0);
     m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+    std::wcout << L"LabelRenderer::ComputeSELabelBounds ["
+               << L"(" << info.m_rotated_points[0].x << L"," << info.m_rotated_points[0].y << L"),"
+               << L"(" << info.m_rotated_points[1].x << L"," << info.m_rotated_points[1].y << L"),"
+               << L"(" << info.m_rotated_points[2].x << L"," << info.m_rotated_points[2].y << L"),"
+               << L"(" << info.m_rotated_points[3].x << L"," << info.m_rotated_points[3].y << L")"
+               << L"] - (" << info.m_text << L")" << std::endl;
 #endif
+#endif
 
     return true;
 }
@@ -1189,7 +1218,15 @@
     lb.Close();
     SE_LineStroke lineStroke(0xffff0000, 3.0);
     m_serenderer->DrawScreenPolyline(&lb, NULL, lineStroke);
+#ifdef DEBUG_LABEL_CALLS
+    std::wcout << L"LabelRendererLocal::AddExclusionRegion [" 
+               << L"(" << pts[0].x << L"," << pts[0].y << L"),"
+               << L"(" << pts[1].x << L"," << pts[1].y << L"),"
+               << L"(" << pts[2].x << L"," << pts[2].y << L"),"
+               << L"(" << pts[3].x << L"," << pts[3].y << L")"
+               << L"]" << std::endl;
 #endif
+#endif
 
     RS_F_Point* tmp = (RS_F_Point*)alloca(npts * sizeof(RS_F_Point));
 



More information about the mapguide-commits mailing list