Esempio n. 1
0
        private static unsafe double DistanceRatioFromPointToCellCenter2(SQuantizedPoint3D *pBest, double cellCenterX, double cellCenterY, int cellSizeX, int cellSizeY)
        {
            var ratioBestToCellCenterX  = ((*pBest).X - cellCenterX) / cellSizeX;
            var ratioBestToCellCenterX2 = ratioBestToCellCenterX * ratioBestToCellCenterX;

            var ratioBestToCellCenterY  = ((*pBest).Y - cellCenterY) / cellSizeY;
            var ratioBestToCellCenterY2 = ratioBestToCellCenterY * ratioBestToCellCenterY;

            var distance2 = ratioBestToCellCenterX2 + ratioBestToCellCenterY2;

            return(distance2);
        }
Esempio n. 2
0
        public unsafe IPointDataChunk Process(IPointDataChunk chunk)
        {
            if (m_index + chunk.PointCount <= m_count)
            {
                byte *pb = chunk.PointDataPtr;

                if (m_quantized)
                {
                    int[][] values = m_values as int[][];
                    while (pb < chunk.PointDataEndPtr)
                    {
                        SQuantizedPoint3D *p = (SQuantizedPoint3D *)pb;
                        values[0][m_index] = (*p).X;
                        values[1][m_index] = (*p).Y;
                        values[2][m_index] = (*p).Z;
                        ++m_index;
                        pb += chunk.PointSizeBytes;
                    }
                }
                else
                {
                    double[][] values = m_values as double[][];
                    while (pb < chunk.PointDataEndPtr)
                    {
                        Point3D *p = (Point3D *)pb;
                        values[0][m_index] = (*p).X;
                        values[1][m_index] = (*p).Y;
                        values[2][m_index] = (*p).Z;
                        ++m_index;
                        pb += chunk.PointSizeBytes;
                    }
                }
            }

            return(chunk);
        }
Esempio n. 3
0
 public SQuantizedPoint3DPtr(SQuantizedPoint3D *value)
 {
     m_value = value;
 }