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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jan 20 00:55:48 EST 2012


Author: liuar
Date: 2012-01-19 21:55:48 -0800 (Thu, 19 Jan 2012)
New Revision: 6446

Modified:
   trunk/MgDev/Common/Stylization/SE_Renderer.cpp
Log:
Submit on behalf of Mars Wu
Integrate r6445
Fix ticket: http://trac.osgeo.org/mapguide/ticket/1920
If I use a raster symbol definition to stylize a point feature with enhanced stylization, then selecting the feature will not highlight the symbol on screen. It's not easy to realize if there is anything selected.

It's because the selection mode of raster symbol is not considered. Handling selection mode to fix it

Modified: trunk/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2012-01-20 05:47:10 UTC (rev 6445)
+++ trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2012-01-20 05:55:48 UTC (rev 6446)
@@ -474,21 +474,41 @@
         else if (primitive->type == SE_RenderPrimitive_Raster)
         {
             SE_RenderRaster* rp = (SE_RenderRaster*)primitive;
-            ImageData& imgData = rp->imageData;
 
-            if (imgData.data != NULL)
+            if (m_bSelectionMode)
             {
-                // update the extents with this primitive's bounds
-                for (int j=0; j<4; ++j)
-                    extents.add_point(primitive->bounds[j]);
+                // if the raster symbol is selected, then draw the mask selection polygon only
+                LineBuffer *lb = LineBufferPool::NewLineBuffer(m_pPool, 5);
+                std::auto_ptr<LineBuffer> spLB(lb);
 
-                // get position and angle to use
-                double x, y;
-                xform.transform(rp->position[0], rp->position[1], x, y);
-                double angleDeg = (rp->angleRad + angleRad) * M_180PI;
+                lb->MoveTo(rp->bounds[3].x, rp->bounds[3].y);
+                for (int i = 0; i < 4; ++i)
+                {
+                    lb->LineTo(rp->bounds[i].x, rp->bounds[i].y);
+                }
+                
+                DrawScreenPolygon(lb, &xform, m_selFillColor);
+                DrawScreenPolyline(lb, &xform, m_selLineStroke);
 
-                DrawScreenRaster(imgData.data, imgData.size, imgData.format, imgData.width, imgData.height, x, y, rp->extent[0], rp->extent[1], angleDeg, rp->opacity);
+                LineBufferPool::FreeLineBuffer(m_pPool, spLB.release());
             }
+            else 
+            {
+                ImageData& imgData = rp->imageData;
+                if (imgData.data != NULL)
+                {
+                    // update the extents with this primitive's bounds
+                    for (int j=0; j<4; ++j)
+                        extents.add_point(primitive->bounds[j]);
+
+                    // get position and angle to use
+                    double x, y;
+                    xform.transform(rp->position[0], rp->position[1], x, y);
+                    double angleDeg = (rp->angleRad + angleRad) * M_180PI;
+
+                    DrawScreenRaster(imgData.data, imgData.size, imgData.format, imgData.width, imgData.height, x, y, rp->extent[0], rp->extent[1], angleDeg, rp->opacity);
+                }
+            }
         }
     }
 


Property changes on: trunk/MgDev/Common/Stylization/SE_Renderer.cpp
___________________________________________________________________
Added: svn:mergeinfo
   + /sandbox/adsk/2.4j/Common/Stylization/SE_Renderer.cpp:6327-6445
/sandbox/rfc94/Common/Stylization/SE_Renderer.cpp:5099-5163
/trunk/MgDev/Common/Stylization/SE_Renderer.cpp:6250-6326



More information about the mapguide-commits mailing list