Inheritance: IMapDisplay
 public ExportRouteGadget(SymbolDB symbolDB, EventDB eventDB, MapDisplay mapDisplay)
 {
     this.symbolDB = symbolDB;
     this.eventDB = eventDB;
     this.mapDisplay = mapDisplay.CloneToFullIntensity();
     this.mapDisplay.SetCourse(null);
     this.mapDisplay.SetPrintArea(null);
 }
Example #2
0
 // Create an instance for displaying the given mapDisplay. This should be
 // a clone, since it will be changed.
 public ExportBitmap(MapDisplay mapDisplay)
 {
     this.mapDisplay = mapDisplay;
     this.mapDisplay.AntiAlias = true;
     this.mapDisplay.MapIntensity = 1.0F;
     this.mapDisplay.Printing = false;
     this.mapDisplay.ColorModel = ColorModel.CMYK;
 }
Example #3
0
        // Clones this map display, and set the clone to full intensity
        public MapDisplay CloneToFullIntensity()
        {
            MapDisplay newMapDisplay = (MapDisplay)MemberwiseClone();

            newMapDisplay.dimmedBitmap = null;         // clones should not share dimmed bitmaps.
            newMapDisplay.mapIntensity = 1;

            return(newMapDisplay);
        }
Example #4
0
        RectangleF?printArea;                       // print area to display, or null for none.

        // Clones this map display.
        public MapDisplay Clone()
        {
            MapDisplay newMapDisplay = (MapDisplay)MemberwiseClone();

            newMapDisplay.dimmedBitmap = null;         // clones should not share dimmed bitmaps.
            newMapDisplay.UpdateDimmedBitmap();

            return(newMapDisplay);
        }
Example #5
0
 public ExportRouteGadget(SymbolDB symbolDB, EventDB eventDB, Controller controller, MapDisplay mapDisplay)
 {
     this.symbolDB   = symbolDB;
     this.eventDB    = eventDB;
     this.controller = controller;
     this.mapDisplay = mapDisplay.CloneToFullIntensity();
     this.mapDisplay.SetCourse(null);
     this.mapDisplay.SetPrintArea(null);
     this.mapDisplay.ColorModel = ColorModel.CMYK;
 }
Example #6
0
        // mapDisplay is a MapDisplay that contains the correct map. All other features of the map display need to be customized.
        public BitmapCreation(EventDB eventDB, SymbolDB symbolDB, Controller controller, MapDisplay mapDisplay,
                              BitmapCreationSettings bitmapCreationSettings, CourseAppearance appearance)
        {
            this.eventDB                = eventDB;
            this.symbolDB               = symbolDB;
            this.controller             = controller;
            this.mapDisplay             = mapDisplay.CloneToFullIntensity();
            this.bitmapCreationSettings = bitmapCreationSettings;
            this.appearance             = appearance;

            // Set default features for creating bitmaps.
            this.mapDisplay.MapIntensity = 1.0F;
            this.mapDisplay.AntiAlias    = true;
            this.mapDisplay.ColorModel   = bitmapCreationSettings.ColorModel;
        }
Example #7
0
        // mapDisplay is a MapDisplay that contains the correct map. All other features of the map display need to be customized.
        public CoursePrinting(EventDB eventDB, SymbolDB symbolDB, Controller controller, MapDisplay mapDisplay, CoursePrintSettings coursePrintSettings, CourseAppearance appearance)
            : base(QueryEvent.GetEventTitle(eventDB, " "), controller, coursePrintSettings.PageSettings, coursePrintSettings.PrintingColorModel)
        {
            this.eventDB             = eventDB;
            this.symbolDB            = symbolDB;
            this.controller          = controller;
            this.mapDisplay          = mapDisplay;
            this.coursePrintSettings = coursePrintSettings;
            this.appearance          = appearance;

            // Set default features for printing.
            mapDisplay.MapIntensity = 1.0F;
            mapDisplay.AntiAlias    = false;
            mapDisplay.Printing     = true;
            mapDisplay.ColorModel   = base.colorModel;
        }
Example #8
0
        // mapDisplay is a MapDisplay that contains the correct map. All other features of the map display need to be customized.
        public CoursePrinting(EventDB eventDB, SymbolDB symbolDB, Controller controller, MapDisplay mapDisplay, CoursePrintSettings coursePrintSettings, CourseAppearance appearance)
            : base(QueryEvent.GetEventTitle(eventDB, " "), controller, coursePrintSettings.PageSettings, coursePrintSettings.PrintingColorModel)
        {
            this.eventDB = eventDB;
            this.symbolDB = symbolDB;
            this.controller = controller;
            this.mapDisplay = mapDisplay;
            this.coursePrintSettings = coursePrintSettings;
            this.appearance = appearance;

            // Set default features for printing.
            mapDisplay.MapIntensity = 1.0F;
            mapDisplay.AntiAlias = false;
            mapDisplay.Printing = true;
            mapDisplay.ColorModel = base.colorModel;
        }
Example #9
0
        // mapDisplay is a MapDisplay that contains the correct map. All other features of the map display need to be customized.
        public CoursePdf(EventDB eventDB, SymbolDB symbolDB, Controller controller, MapDisplay mapDisplay, 
            CoursePdfSettings coursePdfSettings, CourseAppearance appearance)
        {
            this.eventDB = eventDB;
            this.symbolDB = symbolDB;
            this.controller = controller;
            this.mapDisplay = mapDisplay;
            this.coursePdfSettings = coursePdfSettings;
            this.appearance = appearance;

            // Set default features for printing.
            mapDisplay.MapIntensity = 1.0F;
            mapDisplay.AntiAlias = false;
            mapDisplay.Printing = true;
            mapDisplay.ColorModel = coursePdfSettings.ColorModel;

            mapBounds = mapDisplay.MapBounds;

            if (mapDisplay.MapType == MapType.PDF) {
                // For PDF maps, we remove the PDF map from the MapDisplay and add it in separately.
                sourcePdfMapFileName = mapDisplay.FileName;
            }
        }
Example #10
0
        // mapDisplay is a MapDisplay that contains the correct map. All other features of the map display need to be customized.
        public CoursePdf(EventDB eventDB, SymbolDB symbolDB, Controller controller, MapDisplay mapDisplay,
                         CoursePdfSettings coursePdfSettings, CourseAppearance appearance)
        {
            this.eventDB           = eventDB;
            this.symbolDB          = symbolDB;
            this.controller        = controller;
            this.mapDisplay        = mapDisplay;
            this.coursePdfSettings = coursePdfSettings;
            this.appearance        = appearance;

            // Set default features for printing.
            mapDisplay.MapIntensity = 1.0F;
            mapDisplay.AntiAlias    = false;
            mapDisplay.Printing     = true;
            mapDisplay.ColorModel   = coursePdfSettings.ColorModel;

            mapBounds = mapDisplay.MapBounds;

            if (mapDisplay.MapType == MapType.PDF)
            {
                // For PDF maps, we remove the PDF map from the MapDisplay and add it in separately.
                sourcePdfMapFileName = mapDisplay.FileName;
            }
        }
Example #11
0
        // Get the purple color to use for display, taking into account the user preferences in courseAppearance, the map loaded into the mapDisplay,
        // and the default purple if none of those provide a color. MapDisplay and courseAppearance can be null, in which case they won't be used.
        public static void GetPurpleColor(MapDisplay mapDisplay, CourseAppearance courseAppearance, out short ocadId, out float cyan, out float magenta, out float yellow, out float black, out bool overprint)
        {
            overprint = (courseAppearance == null) ? true : courseAppearance.purpleColorBlend;

            if (courseAppearance != null && !courseAppearance.useDefaultPurple) {
                // Use the purple from the course display.
                cyan = courseAppearance.purpleC;
                magenta = courseAppearance.purpleM;
                yellow = courseAppearance.purpleY;
                black = courseAppearance.purpleK;
                ocadId = NormalCourseAppearance.courseOcadId;
                return;
            }
            else if (mapDisplay != null && FindPurpleColor(mapDisplay.GetMapColors(), out ocadId, out cyan, out magenta, out yellow, out black)) {
                // FindPurpleColor found a purple to use.
                return;
            }
            else {
                // Use the program default.
                ocadId = NormalCourseAppearance.courseOcadId;
                cyan = NormalCourseAppearance.courseColorC;
                magenta = NormalCourseAppearance.courseColorM;
                yellow = NormalCourseAppearance.courseColorY;
                black = NormalCourseAppearance.courseColorK;
                return;
            }
        }
Example #12
0
        // Update the topology pane display.
        void UpdateTopology()
        {
            if (topologyMapDisplay == null) {
                topologyMapDisplay = new MapDisplay();
                topologyMapDisplay.SetMapFile(MapType.None, null);
                topologyMapDisplay.AntiAlias = false;
                topologyMapDisplay.Printing = true;
                mapViewerTopology.SetMap(topologyMapDisplay);
            }

            CourseLayout topologyCourseLayout = controller.GetTopologyLayout();
            topologyMapDisplay.SetCourse(topologyCourseLayout);

            if (topologyCourseLayout == null)
                radioButtonDescriptions.Checked = true;
            radioButtonTopology.Enabled = (topologyCourseLayout != null);

            // Get zoom factor for the width, but constrained by min/max on the mapViewerTopology
            float desiredZoomFactor = mapViewerTopology.ZoomFactorForWorldWidth(panelTopology.Width - vScrollbarWidth, topologyMapDisplay.Bounds.Width);
            mapViewerTopology.ZoomFactor = desiredZoomFactor;
            mapViewerTopology.Recenter();

            UpdateTopologyScrollBars();
        }
Example #13
0
        // Update the map file on display.
        void UpdateMapFile()
        {
            if (mapDisplay != controller.MapDisplay) {
                // The mapDisplay object is new. This currently only happens on startup.
                mapDisplay = controller.MapDisplay;
                mapDisplay.MapIntensity = Settings.Default.MapIntensity;
                mapDisplay.AntiAlias = Settings.Default.MapHighQuality;
                controller.ShowAllControls = Settings.Default.ViewAllControls;
                mapViewer.SetMap(mapDisplay);
                ShowRectangle(mapDisplay.MapBounds);
            }

            if (mapDisplay.MapType != controller.MapType || mapDisplay.FileName != controller.MapFileName || (controller.MapType == MapType.Bitmap && mapDisplay.Dpi != controller.MapDpi)) {
                // A new map file has been loaded, or the DPI has changed.

                mapViewer.ZoomFactor = 1.0F;   // used if the map bounds are empty, then this zoom factor is preserved.
                ShowRectangle(mapDisplay.MapBounds);

                // Reset the OCAD file creating settings dialog to default settings.
                ocadCreationSettingsPrevious = null;
            }

            if (mapDisplay.OcadOverprintEffect != controller.OcadOverprintEffect) {
                mapDisplay.OcadOverprintEffect = controller.OcadOverprintEffect;
            }
        }