Пример #1
0
        public static ScreenPoint[] CreateCustomMarker(EarType earType, bool isNoResponse, bool addShift)
        {
            const double lBottomX = 0.5;
            const double lTopY    = 0.75;

            List <ScreenPoint> marker      = new List <ScreenPoint>();
            ScreenPoint        topLeft     = new ScreenPoint(-lBottomX, -lTopY);
            ScreenPoint        bottomLeft  = new ScreenPoint(-lBottomX, lTopY);
            ScreenPoint        bottomRight = new ScreenPoint(lBottomX, lTopY);

            marker.Add(bottomRight);
            marker.Add(bottomLeft);
            marker.Add(topLeft);
            marker.Add(bottomLeft);
            marker.Add(bottomRight);

            if (isNoResponse)
            {
                ArrowMarker.AddArrowToMarker(marker, earType, bottomRight.X, bottomRight.Y);
            }

            if (addShift)
            {
                ShiftMarker.AddShift(marker, earType);
            }

            return(marker.ToArray());
        }
Пример #2
0
        public static ScreenPoint[] CreateCustomMarker(EarType earType, bool isNoResponse)
        {
            const double topRightX    = 0.75;
            const double topRightY    = -1;
            const double topLeftX     = -0.25;
            const double topLeftY     = topRightY;
            const double bottomLeftX  = topLeftX;
            const double bottomLeftY  = -topLeftY;
            const double bottomRightX = topRightX;
            const double bottomRightY = bottomLeftY;

            List <ScreenPoint> marker = new List <ScreenPoint>();

            if (earType == EarType.RightEar)
            {
                ScreenPoint topRight    = new ScreenPoint(topRightX, topRightY);
                ScreenPoint topLeft     = new ScreenPoint(topLeftX, topLeftY);
                ScreenPoint bottomLeft  = new ScreenPoint(bottomLeftX, bottomLeftY);
                ScreenPoint bottomRight = new ScreenPoint(bottomRightX, bottomRightY);
                marker.Add(bottomLeft);
                marker.Add(topLeft);
                marker.Add(topRight);
                marker.Add(topLeft);
                marker.Add(bottomLeft);
                marker.Add(bottomRight);
                marker.Add(bottomLeft);

                if (isNoResponse)
                {
                    ArrowMarker.AddArrowToMarker(marker, earType, bottomLeft.X, bottomLeft.Y);
                }
            }
            else if (earType == EarType.LeftEar)
            {
                ScreenPoint topLeft     = new ScreenPoint(-topRightX, topRightY);
                ScreenPoint topRight    = new ScreenPoint(-topLeftX, topLeftY);
                ScreenPoint bottomRight = new ScreenPoint(-bottomLeftX, bottomLeftY);
                ScreenPoint bottomLeft  = new ScreenPoint(-bottomRightX, bottomRightY);
                marker.Add(bottomRight);
                marker.Add(topRight);
                marker.Add(topLeft);
                marker.Add(topRight);
                marker.Add(bottomRight);
                marker.Add(bottomLeft);
                marker.Add(bottomRight);

                if (isNoResponse)
                {
                    ArrowMarker.AddArrowToMarker(marker, earType, bottomRight.X, bottomRight.Y);
                }
            }
            else
            {
                throw new InvalidEnumArgumentException();
            }

            return(marker.ToArray());
        }
Пример #3
0
        public static ScreenPoint[] CreateCustomMarker(EarType earType, bool isNoResponse, bool addShift)
        {
            const double lowerLeftX  = -0.75;
            const double lowerLeftY  = 0.75;
            const double upperX      = 0;
            const double upperY      = -0.75;
            const double lowerRightX = 0.75;
            const double lowerRightY = 0.75;
            const double midRightX   = 0.375;
            const double midRightY   = 0;
            const double midLeftX    = -0.375;
            const double midLeftY    = 0;

            ScreenPoint lowerLeft  = new ScreenPoint(lowerLeftX, lowerLeftY);
            ScreenPoint upper      = new ScreenPoint(upperX, upperY);
            ScreenPoint lowerRight = new ScreenPoint(lowerRightX, lowerRightY);
            ScreenPoint midRight   = new ScreenPoint(midRightX, midRightY);
            ScreenPoint midLeft    = new ScreenPoint(midLeftX, midLeftY);

            List <ScreenPoint> marker = new List <ScreenPoint>();

            if (earType == EarType.RightEar)
            {
                marker.Add(lowerLeft);
                marker.Add(upper);
                marker.Add(lowerRight);
                marker.Add(midRight);
                marker.Add(midLeft);
                marker.Add(lowerLeft);
            }
            else if (earType == EarType.LeftEar)
            {
                marker.Add(lowerRight);
                marker.Add(upper);
                marker.Add(lowerLeft);
                marker.Add(midLeft);
                marker.Add(midRight);
                marker.Add(lowerRight);
            }
            else
            {
                throw new InvalidEnumArgumentException();
            }

            if (isNoResponse)
            {
                ArrowMarker.AddArrowToMarker(marker, earType, marker.Last().X, marker.Last().Y);
            }

            if (addShift)
            {
                ShiftMarker.AddShift(marker, earType);
            }

            return(marker.ToArray());
        }
Пример #4
0
        public static ScreenPoint[] CreateCustomMarker(EarType earType, bool addArrow)
        {
            double radius       = Math.Sqrt(2);
            double angleRad     = 7 * Math.PI / 4;
            double shift        = radius / 2;
            double topRightX    = radius * Math.Cos(angleRad) - shift;
            double topRightY    = radius * Math.Sin(angleRad);
            double midX         = -shift;
            double midY         = 0;
            double bottomRightX = topRightX;
            double bottomRightY = -topRightY;

            List <ScreenPoint> marker = new List <ScreenPoint>();

            if (earType == EarType.RightEar)
            {
                ScreenPoint bottomRight = new ScreenPoint(bottomRightX, bottomRightY);
                ScreenPoint mid         = new ScreenPoint(midX, midY);
                ScreenPoint topRight    = new ScreenPoint(topRightX, topRightY);
                marker.Add(bottomRight);
                marker.Add(mid);
                marker.Add(topRight);
                marker.Add(mid);
                marker.Add(bottomRight);

                if (addArrow)
                {
                    ArrowMarker.AddArrowToMarker(marker, earType, bottomRightX, bottomRightY);
                }
            }
            else if (earType == EarType.LeftEar)
            {
                ScreenPoint bottomLeft = new ScreenPoint(-bottomRightX, bottomRightY);
                ScreenPoint mid        = new ScreenPoint(-midX, midY);
                ScreenPoint topLeft    = new ScreenPoint(-topRightX, topRightY);
                marker.Add(bottomLeft);
                marker.Add(mid);
                marker.Add(topLeft);
                marker.Add(mid);
                marker.Add(bottomLeft);

                if (addArrow)
                {
                    ArrowMarker.AddArrowToMarker(marker, earType, -bottomRightX, bottomRightY);
                }
            }
            else
            {
                throw new InvalidEnumArgumentException();
            }

            return(marker.ToArray());
        }
Пример #5
0
        public static ScreenPoint[] CreateCustomMarkerWithArrow(EarType earType)
        {
            List <ScreenPoint> marker = new List <ScreenPoint>();

            if (earType == EarType.RightEar)
            {
                double radius            = 1;
                double arrowTailAngleRad = Math.PI / 2;
                double arrowTailX        = radius * Math.Cos(arrowTailAngleRad);
                double arrowTailY        = radius * Math.Sin(arrowTailAngleRad);
                double numOfPoints       = 50;
                double angleInc          = 2 * Math.PI / numOfPoints;

                for (int i = 0; i <= numOfPoints; i++)
                {
                    double angleRad = arrowTailAngleRad + (angleInc * i);
                    marker.Add(new ScreenPoint(radius * Math.Cos(angleRad), radius * Math.Sin(angleRad)));
                }

                ArrowMarker.AddArrowToMarker(marker, earType, arrowTailX, arrowTailY);
            }
            else if (earType == EarType.LeftEar)
            {
                double      arrowTailX  = 1;
                double      arrowTailY  = 1;
                ScreenPoint bottomRight = new ScreenPoint(arrowTailX, arrowTailY);
                ScreenPoint center      = new ScreenPoint(0, 0);
                ScreenPoint topRight    = new ScreenPoint(arrowTailX, -arrowTailY);
                ScreenPoint bottomLeft  = new ScreenPoint(-arrowTailX, arrowTailY);
                ScreenPoint topLeft     = new ScreenPoint(-arrowTailX, -arrowTailY);
                marker.Add(bottomRight);
                marker.Add(center);
                marker.Add(topRight);
                marker.Add(bottomLeft);
                marker.Add(center);
                marker.Add(topLeft);
                marker.Add(bottomRight);

                ArrowMarker.AddArrowToMarker(marker, earType, arrowTailX, arrowTailY);
            }
            else
            {
                throw new InvalidEnumArgumentException();
            }

            return(marker.ToArray());
        }
Пример #6
0
        public static ScreenPoint[] CreateCustomMarkerWithArrow(EarType earType)
        {
            List <ScreenPoint> marker = new List <ScreenPoint>();

            if (earType == EarType.RightEar)
            {
                double      arrowTailX = -1;
                double      arrowTailY = 0.5;
                ScreenPoint left       = new ScreenPoint(-1, 0.5);
                ScreenPoint right      = new ScreenPoint(1, 0.5);
                ScreenPoint top        = new ScreenPoint(0, -1);
                marker.Add(left);
                marker.Add(top);
                marker.Add(right);
                marker.Add(left);
                ArrowMarker.AddArrowToMarker(marker, earType, arrowTailX, arrowTailY);
            }
            else if (earType == EarType.LeftEar)
            {
                double      arrowTailX  = 1;
                double      arrowTailY  = 1;
                ScreenPoint rightBottom = new ScreenPoint(arrowTailX, arrowTailY);
                ScreenPoint rightTop    = new ScreenPoint(arrowTailX, -arrowTailY);
                ScreenPoint leftTop     = new ScreenPoint(-arrowTailX, -arrowTailY);
                ScreenPoint leftBottom  = new ScreenPoint(-arrowTailX, arrowTailY);
                marker.Add(rightBottom);
                marker.Add(rightTop);
                marker.Add(leftTop);
                marker.Add(leftBottom);
                marker.Add(rightBottom);
                ArrowMarker.AddArrowToMarker(marker, earType, arrowTailX, arrowTailY);
            }
            else
            {
                throw new InvalidEnumArgumentException();
            }

            return(marker.ToArray());
        }
Пример #7
0
        public static ScreenPoint[] CreateCustomMarker(EarType earType, bool isNoResponse, bool addShift)
        {
            const double a = 0.5;
            const double b = 0.375;

            List <AGPoint> sUpperUpperHalf = new List <AGPoint>();

            sUpperUpperHalf.Add(new AGPoint(0.5, 0));
            sUpperUpperHalf.Add(new AGPoint(0.3, 0));
            sUpperUpperHalf.Add(new AGPoint(0.1, 0));
            sUpperUpperHalf.Add(new AGPoint(-0.1, 0));
            sUpperUpperHalf.Add(new AGPoint(-0.3, 0));
            sUpperUpperHalf.Add(new AGPoint(-0.5, 0));

            int i = 0;

            for (; i < sUpperUpperHalf.Count; i++)
            {
                sUpperUpperHalf[i].Y = -b - Math.Sqrt(Math.Pow(b, 2) - Math.Pow((b * sUpperUpperHalf[i].X / a), 2));
            }

            List <AGPoint> sUpperLowerHalf = new List <AGPoint>();

            sUpperLowerHalf.Add(new AGPoint(-0.5, 0));
            sUpperLowerHalf.Add(new AGPoint(-0.3, 0));
            sUpperLowerHalf.Add(new AGPoint(-0.1, 0));
            sUpperLowerHalf.Add(new AGPoint(0, 0));

            for (i = 0; i < sUpperLowerHalf.Count; i++)
            {
                sUpperLowerHalf[i].Y = -b + Math.Sqrt(Math.Pow(b, 2) - Math.Pow((b * sUpperLowerHalf[i].X / a), 2));
            }

            List <AGPoint> sLowerUpperHalf = new List <AGPoint>();

            sLowerUpperHalf.Add(new AGPoint(0.1, 0));
            sLowerUpperHalf.Add(new AGPoint(0.3, 0));
            sLowerUpperHalf.Add(new AGPoint(0.5, 0));

            for (i = 0; i < sLowerUpperHalf.Count; i++)
            {
                sLowerUpperHalf[i].Y = b - Math.Sqrt(Math.Pow(b, 2) - Math.Pow((b * sLowerUpperHalf[i].X / a), 2));
            }

            List <AGPoint> sLowerLowerHalf = new List <AGPoint>();

            sLowerLowerHalf.Add(new AGPoint(0.5, 0));
            sLowerLowerHalf.Add(new AGPoint(0.3, 0));
            sLowerLowerHalf.Add(new AGPoint(0.1, 0));
            sLowerLowerHalf.Add(new AGPoint(-0.1, 0));
            sLowerLowerHalf.Add(new AGPoint(-0.3, 0));
            sLowerLowerHalf.Add(new AGPoint(-0.5, 0));

            for (i = 0; i < sLowerLowerHalf.Count; i++)
            {
                sLowerLowerHalf[i].Y = b + Math.Sqrt(Math.Pow(b, 2) - Math.Pow((b * sLowerLowerHalf[i].X / a), 2));
            }

            List <ScreenPoint> marker = new List <ScreenPoint>();

            for (i = sLowerLowerHalf.Count - 2; i >= 0; i--)
            {
                marker.Add(new ScreenPoint(sLowerLowerHalf[i].X, sLowerLowerHalf[i].Y));
            }

            for (i = sLowerUpperHalf.Count - 1; i >= 0; i--)
            {
                marker.Add(new ScreenPoint(sLowerUpperHalf[i].X, sLowerUpperHalf[i].Y));
            }

            for (i = sUpperLowerHalf.Count - 1; i >= 0; i--)
            {
                marker.Add(new ScreenPoint(sUpperLowerHalf[i].X, sUpperLowerHalf[i].Y));
            }

            for (i = sUpperUpperHalf.Count - 1; i >= 0; i--)
            {
                marker.Add(new ScreenPoint(sUpperUpperHalf[i].X, sUpperUpperHalf[i].Y));
            }

            for (i = 0; i < sUpperUpperHalf.Count; i++)
            {
                marker.Add(new ScreenPoint(sUpperUpperHalf[i].X, sUpperUpperHalf[i].Y));
            }

            for (i = 0; i < sUpperLowerHalf.Count; i++)
            {
                marker.Add(new ScreenPoint(sUpperLowerHalf[i].X, sUpperLowerHalf[i].Y));
            }

            for (i = 0; i < sLowerUpperHalf.Count; i++)
            {
                marker.Add(new ScreenPoint(sLowerUpperHalf[i].X, sLowerUpperHalf[i].Y));
            }

            for (i = 0; i < sLowerLowerHalf.Count; i++)
            {
                marker.Add(new ScreenPoint(sLowerLowerHalf[i].X, sLowerLowerHalf[i].Y));
            }

            if (isNoResponse)
            {
                ScreenPoint lastPoint = marker.Last();
                ArrowMarker.AddArrowToMarker(marker, earType, lastPoint.X, lastPoint.Y);
            }

            if (addShift)
            {
                ShiftMarker.AddShift(marker, earType);
            }

            return(marker.ToArray());
        }