예제 #1
0
 private double PointsToMap(ESRI.ArcGIS.Geometry.ITransformation displayTransform, double dPointSize)
 {
     double tempPointsToMap = 0;
     ESRI.ArcGIS.Display.IDisplayTransformation tempTransform = null;
     if (displayTransform == null)
         tempPointsToMap = dPointSize * m_dDeviceRatio;
     else
     {
         tempTransform = (IDisplayTransformation)displayTransform;
         tempPointsToMap = tempTransform.FromPoints(dPointSize);
     }
     return tempPointsToMap;
 }
예제 #2
0
        void ESRI.ArcGIS.Display.ISymbol.QueryBoundary(int hDC, ESRI.ArcGIS.Geometry.ITransformation displayTransform, ESRI.ArcGIS.Geometry.IGeometry Geometry, ESRI.ArcGIS.Geometry.IPolygon Boundary)
        {
            // Check input parameters. Boundary may be a preexisting Polygon, so
            // make sure it's geometry is cleared.
            if (Geometry == null | Boundary == null)
                return;
            if (!(Geometry is ESRI.ArcGIS.Geometry.IPoint))
                return;
            Boundary.SetEmpty();

            IPoint point = (IPoint)Geometry;
            IDisplayTransformation displayTransformation = (IDisplayTransformation)displayTransform;

            QueryBoundsFromGeom(hDC, ref displayTransformation, ref Boundary, ref point);
        }
예제 #3
0
        void ESRI.ArcGIS.Display.ISymbol.SetupDC(int hDC, ESRI.ArcGIS.Geometry.ITransformation Transformation)
        {
            //// Store the DisplayTransformation and display handle for use by Draw and ResetDC.
            //m_trans = Transformation as IDisplayTransformation;
            //m_lhDC = hDC;

            //// Set up the device ratio for use by Draw and the rest of SetupDC.
            //SetupDeviceRatio(m_lhDC, m_trans);

            ////Calculate the new Radius for the symbol from the Size (width) overall.
            ////Dim dRadius As Double
            ////m_dDeviceRadius = m_dSize / 2 '  This is the simplistic method, actually results in symbol slightly wrong size.
            ////m_dDeviceRadius = m_dSize / ((2 * Cos(45)) - Cos(45) + 1)
            //m_dDeviceRadius = (m_dSize / 2) * m_dDeviceRatio;
            //m_dDeviceXOffset = m_dXOffset * m_dDeviceRatio;
            //m_dDeviceYOffset = m_dYOffset * m_dDeviceRatio;

            ////  Check if we need to rotate the symbol based on the ISymbolRotation interface.
            //if (m_bRotWithTrans)
            //    m_dMapRotation = m_trans.Rotation;
            //else
            //    m_dMapRotation = 0;

            //// Setup the Pen which is used to outline the shapes.
            //// multiplying by m_dDeviceRatio allows the pen size to scale
            //m_lPen = Utility.CreatePen(0, Convert.ToInt32(1 * m_dDeviceRatio), System.Convert.ToInt32(m_colorBorder.RGB));

            //// Set the appropriate raster operation code for this draw, according to the
            //// ISymbol interface.
            //m_lROP2Old = (esriRasterOpCode)Utility.SetROP2(hDC, System.Convert.ToInt32(m_lROP2));

            //// Set up three solid brushes to fill in the shapes with the different color fills.
            //m_lBrushTop = Utility.CreateSolidBrush(System.Convert.ToInt32(m_colorTop.RGB));
            //m_lBrushLeft = Utility.CreateSolidBrush(System.Convert.ToInt32(m_colorLeft.RGB));
            //m_lBrushRight = Utility.CreateSolidBrush(System.Convert.ToInt32(m_colorRight.RGB));

            //// Select in the new pen and store the old pen - essential for use during cleanup.
            //m_lOldPen = Utility.SelectObject(hDC, m_lPen);
        }
예제 #4
0
        void ESRI.ArcGIS.Display.IMarkerMask.QueryMarkerMask(int hDC, ESRI.ArcGIS.Geometry.ITransformation Transform, ESRI.ArcGIS.Geometry.IGeometry Geometry, ESRI.ArcGIS.Geometry.IPolygon Boundary)
        {
            //  Code QueryBoundary using same steps as Draw. But add a step where
            //  Points are converted to Map units, and then build an appropriate Polygon.
            if (Geometry == null | Boundary == null)
                return;
            if (!(Transform is ESRI.ArcGIS.Display.IDisplayTransformation))
                return;
            if (!(Geometry is ESRI.ArcGIS.Geometry.IPoint))
                return;
            Boundary.SetEmpty();

            IPoint point = Geometry as IPoint;
            IDisplayTransformation displayTrans = (IDisplayTransformation)Transform;
            QueryBoundsFromGeom(hDC, ref displayTrans, ref Boundary, ref point);

            // Unlike ISymbol.QueryBoundary, QueryMarkerMask requires a Simple geometry.
            ITopologicalOperator topo = Boundary as ITopologicalOperator;
            if (!topo.IsKnownSimple)
            {
                if (!topo.IsSimple)
                    topo.Simplify();
            }
        }