コード例 #1
0
        void IExportControl.Init(UIDocument uidoc, View3D view, AppConfig config, Dictionary <int, bool> elementIds)
        {
            _UIDocument  = uidoc;
            _View        = view;
            _Config      = config;
            _LocalConfig = _Config.Cesium3DTiles;
            _ElementIds  = elementIds;

            _Features = new List <FeatureInfo>
            {
                new FeatureInfo(FeatureType.ExcludeTexture, Strings.FeatureNameExcludeTexture, Strings.FeatureDescriptionExcludeTexture, true, false),
                new FeatureInfo(FeatureType.ExcludeLines, Strings.FeatureNameExcludeLines, Strings.FeatureDescriptionExcludeLines),
                new FeatureInfo(FeatureType.ExcludePoints, Strings.FeatureNameExcludePoints, Strings.FeatureDescriptionExcludePoints, true, false),
                new FeatureInfo(FeatureType.OnlySelected, Strings.FeatureNameOnlySelected, Strings.FeatureDescriptionOnlySelected),
                new FeatureInfo(FeatureType.ExportGrids, Strings.FeatureNameExportGrids, Strings.FeatureDescriptionExportGrids),
                new FeatureInfo(FeatureType.Wireframe, Strings.FeatureNameWireframe, Strings.FeatureDescriptionWireframe, true, false),
                new FeatureInfo(FeatureType.Gray, Strings.FeatureNameGray, Strings.FeatureDescriptionGray, true, false),
                new FeatureInfo(FeatureType.GenerateModelsDb, Strings.FeatureNameGenerateModelsDb, Strings.FeatureDescriptionGenerateModelsDb),
                new FeatureInfo(FeatureType.GenerateThumbnail, Strings.FeatureNameGenerateThumbnail, Strings.FeatureDescriptionGenerateThumbnail),
                new FeatureInfo(FeatureType.UseViewOverrideGraphic, Strings.FeatureNameUseViewOverrideGraphic, Strings.FeatureDescriptionUseViewOverrideGraphic, true, false),
                new FeatureInfo(FeatureType.UseBasicRenderColor, string.Empty, string.Empty, true, false),
                new FeatureInfo(FeatureType.UseGoogleDraco, Strings.FeatureNameUseGoogleDraco, Strings.FeatureDescriptionUseGoogleDraco, true, false),
                new FeatureInfo(FeatureType.ExtractShell, Strings.FeatureNameExtractShell, Strings.FeatureDescriptionExtractShell, true, false),
                new FeatureInfo(FeatureType.ExportSvfzip, Strings.FeatureNameExportSvfzip, Strings.FeatureDescriptionExportSvfzip, true, false),
                new FeatureInfo(FeatureType.EnableQuantizedAttributes, Strings.FeatureNameEnableQuantizedAttributes, Strings.FeatureDescriptionEnableQuantizedAttributes, true, false),
                new FeatureInfo(FeatureType.EnableTextureWebP, Strings.FeatureNameEnableTextureWebP, Strings.FeatureDescriptionEnableTextureWebP, true, false),
                new FeatureInfo(FeatureType.EnableEmbedGeoreferencing, Strings.FeatureNameEnableEmbedGeoreferencing, Strings.FeatureDescriptionEnableEmbedGeoreferencing, true, false),
                new FeatureInfo(FeatureType.EnableUnlitMaterials, Strings.FeatureNameEnableUnlitMaterials, Strings.FeatureDescriptionEnableUnlitMaterials, true, false),
            };

            _VisualStyles = new List <VisualStyleInfo>();
            _VisualStyles.Add(new VisualStyleInfo(@"Wireframe", Strings.VisualStyleWireframe, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, true },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Gray", Strings.VisualStyleGray, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, true }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Colored", Strings.VisualStyleColored, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, true },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Textured", Strings.VisualStyleTextured + $@"({Strings.TextDefault})", new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, false },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, true },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Realistic", Strings.VisualStyleRealistic, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, false },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyleDefault = _VisualStyles.First(x => x.Key == @"Colored");

            const int DEFAULT_LEVEL_OF_DETAILS = 6;

            _LevelOfDetails = new List <ComboItemInfo>();
            _LevelOfDetails.Add(new ComboItemInfo(-1, Strings.TextAuto));
            for (var i = 0; i <= 15; i++)
            {
                string text;
                switch (i)
                {
                case 0:
                    text = $@"{i} ({Strings.TextLowest})";
                    break;

                case DEFAULT_LEVEL_OF_DETAILS:
                    text = $@"{i} ({Strings.TextNormal})";
                    break;

                case 15:
                    text = $@"{i} ({Strings.TextHighest})";
                    break;

                default:
                    text = i.ToString();
                    break;
                }

                _LevelOfDetails.Add(new ComboItemInfo(i, text));
            }
            _LevelOfDetailDefault = _LevelOfDetails.Find(x => x.Value == DEFAULT_LEVEL_OF_DETAILS);

            cbVisualStyle.Items.Clear();
            cbVisualStyle.Items.AddRange(_VisualStyles.Select(x => (object)x).ToArray());

            cbLevelOfDetail.Items.Clear();
            cbLevelOfDetail.Items.AddRange(_LevelOfDetails.Select(x => (object)x).ToArray());
        }
コード例 #2
0
        void IExportControl.Init(UIDocument uidoc, View3D view, AppConfig config, Dictionary <int, bool> elementIds)
        {
            _UIDocument  = uidoc;
            _View        = view;
            _Config      = config;
            _LocalConfig = _Config.Svf;
            _ElementIds  = elementIds;
            _ViewIds     = null;

            _Features = new List <FeatureInfo>
            {
                new FeatureInfo(FeatureType.ExcludeProperties, Strings.FeatureNameExcludeProperties, Strings.FeatureDescriptionExcludeProperties),
                new FeatureInfo(FeatureType.ExcludeTexture, Strings.FeatureNameExcludeTexture, Strings.FeatureDescriptionExcludeTexture, true, false),
                new FeatureInfo(FeatureType.ExcludeLines, Strings.FeatureNameExcludeLines, Strings.FeatureDescriptionExcludeLines),
                new FeatureInfo(FeatureType.ExcludePoints, Strings.FeatureNameExcludePoints, Strings.FeatureDescriptionExcludePoints, true, false),
                new FeatureInfo(FeatureType.UseLevelCategory, Strings.FeatureNameUseLevelCategory, Strings.FeatureDescriptionUseLevelCategory),
                new FeatureInfo(FeatureType.UseNwLevelCategory, Strings.FeatureNameUseNwLevelCategory, Strings.FeatureDescriptionUseNwLevelCategory),
                new FeatureInfo(FeatureType.UseBoundLevelCategory, Strings.FeatureNameUseBoundLevelCategory, Strings.FeatureDescriptionUseBoundLevelCategory),
                new FeatureInfo(FeatureType.OnlySelected, Strings.FeatureNameOnlySelected, Strings.FeatureDescriptionOnlySelected),
                new FeatureInfo(FeatureType.GenerateElementData, Strings.FeatureNameGenerateElementData, Strings.FeatureDescriptionGenerateElementData),
                new FeatureInfo(FeatureType.ExportGrids, Strings.FeatureNameExportGrids, Strings.FeatureDescriptionExportGrids),
                new FeatureInfo(FeatureType.ExportRooms, Strings.FeatureNameExportRooms, Strings.FeatureDescriptionExportRooms),
                new FeatureInfo(FeatureType.ConsolidateGroup, Strings.FeatureNameConsolidateGroup, Strings.FeatureDescriptionConsolidateGroup),
                new FeatureInfo(FeatureType.ConsolidateAssembly, Strings.FeatureNameConsolidateAssembly, Strings.FeatureDescriptionConsolidateAssembly),
                new FeatureInfo(FeatureType.Wireframe, Strings.FeatureNameWireframe, Strings.FeatureDescriptionWireframe, true, false),
                new FeatureInfo(FeatureType.Gray, Strings.FeatureNameGray, Strings.FeatureDescriptionGray, true, false),
                new FeatureInfo(FeatureType.GenerateModelsDb, Strings.FeatureNameGenerateModelsDb, Strings.FeatureDescriptionGenerateModelsDb),
                new FeatureInfo(FeatureType.GenerateThumbnail, Strings.FeatureNameGenerateThumbnail, Strings.FeatureDescriptionGenerateThumbnail),
                new FeatureInfo(FeatureType.UseCurrentViewport, Strings.FeatureNameUseCurrentViewport, Strings.FeatureDescriptionUseCurrentViewport),
                new FeatureInfo(FeatureType.UseViewOverrideGraphic, Strings.FeatureNameUseViewOverrideGraphic, Strings.FeatureDescriptionUseViewOverrideGraphic, true, false),
                new FeatureInfo(FeatureType.UseBasicRenderColor, string.Empty, string.Empty, true, false),
                new FeatureInfo(FeatureType.Export2DViewOnlySheet, Strings.FeatureNameExport2DViewOnlySheet, Strings.FeatureDescriptionExport2DViewOnlySheet),
                new FeatureInfo(FeatureType.Export2DViewAll, Strings.FeatureNameExport2DViewAll, Strings.FeatureDescriptionExport2DViewAll),
                new FeatureInfo(FeatureType.GenerateLeaflet, Strings.FeatureNameGenerateLeaflet, Strings.FeatureDescriptionGenerateLeaflet),
                new FeatureInfo(FeatureType.GenerateDwgDrawing, Strings.FeatureNameGenerateDwgDrawing, Strings.FeatureDescriptionGenerateDwgDrawing),
            };

            _VisualStyles = new List <VisualStyleInfo>();
            _VisualStyles.Add(new VisualStyleInfo(@"Wireframe", Strings.VisualStyleWireframe, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, true },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Gray", Strings.VisualStyleGray, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, true }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Colored", Strings.VisualStyleColored, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, true },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Textured", Strings.VisualStyleTextured + $@"({Strings.TextDefault})", new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, false },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, true },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Realistic", Strings.VisualStyleRealistic, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, false },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyleDefault = _VisualStyles.First(x => x.Key == @"Textured");

            _LevelOfDetails = new List <ComboItemInfo>();
            _LevelOfDetails.Add(new ComboItemInfo(-1, Strings.TextAuto));
            for (var i = 0; i <= 15; i++)
            {
                string text;
                switch (i)
                {
                case 0:
                    text = $@"{i} ({Strings.TextLowest})";
                    break;

                case 8:
                    text = $@"{i} ({Strings.TextNormal})";
                    break;

                case 15:
                    text = $@"{i} ({Strings.TextHighest})";
                    break;

                default:
                    text = i.ToString();
                    break;
                }

                _LevelOfDetails.Add(new ComboItemInfo(i, text));
            }
            _LevelOfDetailDefault = _LevelOfDetails.Find(x => x.Value == -1);

            cbVisualStyle.Items.Clear();
            cbVisualStyle.Items.AddRange(_VisualStyles.Select(x => (object)x).ToArray());

            cbLevelOfDetail.Items.Clear();
            cbLevelOfDetail.Items.AddRange(_LevelOfDetails.Select(x => (object)x).ToArray());
        }
コード例 #3
0
        void IExportControl.Init(Viewport view, AppConfig config, bool hasSelectElements)
        {
            _View              = view;
            _Config            = config;
            _LocalConfig       = _Config.Svf;
            _HasSelectElements = hasSelectElements;

            _Features = new List <FeatureInfo>
            {
                new FeatureInfo(FeatureType.ExcludeProperties, Strings.FeatureNameExcludeProperties, Strings.FeatureDescriptionExcludeProperties),
                new FeatureInfo(FeatureType.ExcludeTexture, Strings.FeatureNameExcludeTexture, Strings.FeatureDescriptionExcludeTexture, true, false),
                new FeatureInfo(FeatureType.ExcludeLines, Strings.FeatureNameExcludeLines, Strings.FeatureDescriptionExcludeLines),
                new FeatureInfo(FeatureType.ExcludePoints, Strings.FeatureNameExcludePoints, Strings.FeatureDescriptionExcludePoints, true, false),
                new FeatureInfo(FeatureType.OnlySelected, Strings.FeatureNameOnlySelected, Strings.FeatureDescriptionOnlySelected),
                new FeatureInfo(FeatureType.GenerateElementData, Strings.FeatureNameGenerateElementData, Strings.FeatureDescriptionGenerateElementData),
                new FeatureInfo(FeatureType.Wireframe, Strings.FeatureNameWireframe, Strings.FeatureDescriptionWireframe, true, false),
                new FeatureInfo(FeatureType.Gray, Strings.FeatureNameGray, Strings.FeatureDescriptionGray, true, false),
                new FeatureInfo(FeatureType.GenerateModelsDb, Strings.FeatureNameGenerateModelsDb, Strings.FeatureDescriptionGenerateModelsDb),
                new FeatureInfo(FeatureType.GenerateThumbnail, Strings.FeatureNameGenerateThumbnail, Strings.FeatureDescriptionGenerateThumbnail),
                new FeatureInfo(FeatureType.UseCurrentViewport, Strings.FeatureNameUseCurrentViewport, Strings.FeatureDescriptionUseCurrentViewport),
                new FeatureInfo(FeatureType.UseViewOverrideGraphic, Strings.FeatureNameUseViewOverrideGraphic, Strings.FeatureDescriptionUseViewOverrideGraphic, true, false),
                new FeatureInfo(FeatureType.UseBasicRenderColor, string.Empty, string.Empty, true, false),
                new FeatureInfo(FeatureType.RegroupForLink, Strings.FeatureNameRegroupForLink, Strings.FeatureDescriptionRegroupForLink),
            };

            _VisualStyles = new List <VisualStyleInfo>();
            _VisualStyles.Add(new VisualStyleInfo(@"Wireframe", Strings.VisualStyleWireframe, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, true },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Gray", Strings.VisualStyleGray, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, true }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Colored", Strings.VisualStyleColored, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, true },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, true },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Textured", Strings.VisualStyleTextured + $@"({Strings.TextDefault})", new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, false },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, true },
                { FeatureType.Gray, false }
            }));
            _VisualStyles.Add(new VisualStyleInfo(@"Realistic", Strings.VisualStyleRealistic, new Dictionary <FeatureType, bool>
            {
                { FeatureType.ExcludeTexture, false },
                { FeatureType.Wireframe, false },
                { FeatureType.UseViewOverrideGraphic, false },
                { FeatureType.UseBasicRenderColor, false },
                { FeatureType.Gray, false }
            }));
            _VisualStyleDefault = _VisualStyles.First(x => x.Key == @"Textured");

            _LevelOfDetails = new List <ComboItemInfo>();
            _LevelOfDetails.Add(new ComboItemInfo(-1, Strings.TextAuto));
            for (var i = 0; i <= 15; i++)
            {
                string text;
                switch (i)
                {
                case 0:
                    text = $@"{i} ({Strings.TextLowest})";
                    break;

                case 8:
                    text = $@"{i} ({Strings.TextNormal})";
                    break;

                case 15:
                    text = $@"{i} ({Strings.TextHighest})";
                    break;

                default:
                    text = i.ToString();
                    break;
                }

                _LevelOfDetails.Add(new ComboItemInfo(i, text));
            }
            _LevelOfDetailDefault = _LevelOfDetails.Find(x => x.Value == -1);

            cbVisualStyle.Items.Clear();
            cbVisualStyle.Items.AddRange(_VisualStyles.Select(x => (object)x).ToArray());

            cbLevelOfDetail.Items.Clear();
            cbLevelOfDetail.Items.AddRange(_LevelOfDetails.Select(x => (object)x).ToArray());
        }