#region Disclaimer / License
// Copyright (C) 2010, Jackie Ng
// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
using System.Drawing;
using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.ObjectModels.FeatureSource;
using OSGeo.MapGuide.ObjectModels.Common;
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.MaestroAPI;
using System.ComponentModel;
using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
using OSGeo.MapGuide.ObjectModels.WatermarkDefinition;
namespace OSGeo.MapGuide.ObjectModels.LayerDefinition
{
#region core enums
///
/// The type of length unit
///
[System.SerializableAttribute()]
public enum LengthUnitType
{
///
Millimeters,
///
Centimeters,
///
Meters,
///
Kilometers,
///
Inches,
///
Feet,
///
Yards,
///
Miles,
///
Points,
}
///
/// The type of size context
///
[System.SerializableAttribute()]
public enum SizeContextType
{
///
MappingUnits,
///
DeviceUnits,
}
///
/// The type of shape
///
[System.SerializableAttribute()]
public enum ShapeType
{
///
Square,
///
Circle,
///
Triangle,
///
Star,
///
Cross,
///
X,
}
///
/// The type of background style
///
[System.SerializableAttribute()]
public enum BackgroundStyleType
{
///
Transparent,
///
Opaque,
///
Ghosted,
}
///
/// The type of feature name
///
[System.SerializableAttribute()]
public enum FeatureNameType
{
///
FeatureClass,
///
NamedExtension,
}
///
/// The type of explicit color
///
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema = false)]
public enum ItemChoiceType
{
///
Band,
///
Bands,
///
ExplicitColor,
}
#endregion
#region core
///
/// The type of layer definition
///
public enum LayerType
{
///
/// DWF-based drawing layer
///
Drawing,
///
/// Vector layer
///
Vector,
///
/// Raster layer
///
Raster
}
///
/// Represents elements that can create clones of themselves
///
///
public interface ICloneableLayerElement
{
///
/// Clones this instance.
///
///
T Clone();
}
///
/// Helper class to clone certain elements
///
public static class LayerElementCloningUtil
{
///
/// Clones the strokes.
///
/// The strokes.
///
public static IList CloneStrokes(IEnumerable strokes)
{
Check.NotNull(strokes, "strokes");
var list = new List();
foreach (var st in strokes)
{
list.Add(st.Clone());
}
return list;
}
}
///
/// Factory interface to assist in creating common layer definition elements
///
public interface ILayerElementFactory
{
///
/// Creates a name-value pair
///
///
///
///
INameStringPair CreatePair(string name, string value);
///
/// Creates a default area rule (monochromatic)
///
///
IAreaRule CreateDefaultAreaRule();
///
/// Creates a default area style (monochromatic)
///
///
IAreaVectorStyle CreateDefaultAreaStyle();
///
/// Creates a default fill (monochromatic)
///
///
IFill CreateDefaultFill();
///
/// Creates a default line style (monochromatic)
///
///
ILineVectorStyle CreateDefaultLineStyle();
///
/// Creates a default mark symbol
///
///
IMarkSymbol CreateDefaultMarkSymbol();
///
/// Creates a default point style
///
///
IPointVectorStyle CreateDefaultPointStyle();
///
/// Creates a default 2D point symbolization
///
///
IPointSymbolization2D CreateDefaultPointSymbolization2D();
///
/// Creates a default stroke
///
///
IStroke CreateDefaultStroke();
///
/// Creates a default text symbol
///
///
ITextSymbol CreateDefaultTextSymbol();
///
/// Creates a fill
///
///
///
///
///
IFill CreateFill(string pattern, System.Drawing.Color background, System.Drawing.Color foreground);
///
/// Creates a default line rule
///
///
ILineRule CreateDefaultLineRule();
///
/// Creates a default point rule
///
///
IPointRule CreateDefaultPointRule();
///
/// Creates a stroke of the specified color
///
///
///
IStroke CreateStroke(System.Drawing.Color color);
///
/// Creates a vector scale range
///
///
IVectorScaleRange CreateVectorScaleRange();
///
/// Creates a font symbol
///
///
IFontSymbol CreateDefaultFontSymbol();
///
/// Creates a W2D symbol from a Symbol Library
///
///
///
///
IW2DSymbol CreateDefaultW2DSymbol(string symbolLibrary, string symbolName);
ICompositeRule CreateDefaultCompositeRule();
ICompositeTypeStyle CreateDefaultCompositeStyle();
}
///
/// Top-level interface of the layer definition
///
public interface ILayerDefinition : IResource, ILayerElementFactory
{
///
/// Gets the sub layer.
///
/// The sub layer.
ISubLayerDefinition SubLayer { get; }
}
///
/// Represents the base of all layer definitions
///
public interface ISubLayerDefinition : INotifyPropertyChanged
{
///
/// Gets the type of layer definition
///
LayerType LayerType { get; }
///
/// Gets or sets the resource id which is the data source for this layer
///
string ResourceId { get; set; }
}
///
/// Represents the base of all layer definitions. Based on Layer Definition schema
/// version 2.3.0
///
public interface ISubLayerDefinition2 : ISubLayerDefinition, IWatermarkCollection
{
}
///
/// Represents a layer definition based on a vector-based feature source
///
public interface IVectorLayerDefinition : ISubLayerDefinition
{
///
/// Gets or sets fully qualified name of the feature class which this layer applies
///
string FeatureName { get; set; }
///
/// Gets or sets the geometry field of the feature class which this layer applies
///
string Geometry { get; set; }
///
/// Gets or sets an FDO expression which represents the URL that is opened when
/// a feature is selected
///
string Url { get; set; }
///
/// Gets or sets an FDO expression which represents the HTML content that is displayed
/// when the mouse is over the current feature
///
string ToolTip { get; set; }
///
/// Gets or sets an FDO filter which is applied when rendering/styling features
///
string Filter { get; set; }
///
/// Gets the scale ranges for this layer
///
IEnumerable VectorScaleRange { get; }
///
/// Gets the collection index of this scale range
///
///
///
int IndexOfScaleRange(IVectorScaleRange range);
///
/// Removes all scale ranges from this layer
///
void RemoveAllScaleRanges();
///
/// Gets the scale range at this specified index
///
///
///
IVectorScaleRange GetScaleRangeAt(int index);
///
/// Adds the specified vector scale range
///
///
void AddVectorScaleRange(IVectorScaleRange range);
///
/// Removes the specified vector scale range
///
///
void RemoveVectorScaleRange(IVectorScaleRange range);
///
/// Gets the property mappings for this layer. This determines which properties
/// are displayed (and what labels to use) in the property pane and
///
IEnumerable PropertyMapping { get; }
///
/// Adds the specified property mapping
///
///
void AddPropertyMapping(INameStringPair pair);
///
/// Removes the specified property mapping
///
///
void RemovePropertyMapping(INameStringPair pair);
///
/// Gets the property mapping at the specified index
///
///
///
INameStringPair GetPropertyMappingAt(int index);
///
/// Gets the property mapping for the feature class property
///
///
///
INameStringPair GetPropertyMapping(string name);
///
/// Gets the position of the specified pair in the order of property mappings
///
///
///
int GetPosition(INameStringPair pair);
///
/// Moves the specified pair up the order of property mappings
///
///
///
int MoveUp(INameStringPair pair);
///
/// Moves the specified pair down the order of property mappings
///
///
///
int MoveDown(INameStringPair pair);
///
/// Gets the supported symbol definition version to use for composite symbolization.
/// If the Layer Definition does not support composite symbolization, null is returned
///
Version SymbolDefinitionVersion { get; }
}
///
/// Represents a layer definition based on a raster-based feature source
///
public interface IRasterLayerDefinition : ISubLayerDefinition
{
///
/// Gets or sets the name of the feature class.
///
/// The name of the feature class.
string FeatureName { get; set; }
///
/// Gets or sets the raster property.
///
/// The raster property.
string Geometry { get; set; }
///
/// Gets the grid scale ranges.
///
/// The grid scale ranges.
IEnumerable GridScaleRange { get; }
///
/// Adds the specified grid scale range
///
///
void AddGridScaleRange(IGridScaleRange range);
///
/// Removes the specified grid scale range
///
///
void RemoveGridScaleRange(IGridScaleRange range);
int IndexOfScaleRange(IGridScaleRange range);
IGridScaleRange GetScaleRangeAt(int index);
int GridScaleRangeCount { get; }
}
//If only all layers were as simple as this one...
///
/// Represents a layer definition based on a DWF-based drawing source
///
public interface IDrawingLayerDefinition : ISubLayerDefinition
{
///
/// Gets or sets the sheet of the DWF to user
///
string Sheet { get; set; }
///
/// Gets or sets the layers to show from the specified sheet. Shows all layers if this is not specified
///
string LayerFilter { get; set; }
///
/// Gets or sets the zoomed in part of the scale range. Defaults to 0 if not specified. Inclusive
///
double MinScale { get; set; }
///
/// Gets or sets the zoomed out part of the scale range. Defaults to the application's maximum value if not specified. Exclusive
///
double MaxScale { get; set; }
}
#endregion
#region vector layer
///
/// The stylization to be applied to the vector features for a given scale range
///
public interface IVectorScaleRange
{
///
/// The zoomed in part of the scale range. Defaults to 0 if not specified. Inclusive
///
double? MinScale { get; set; }
///
/// The zoomed out part of the scale range. Defaults to the application's maximum value if not specified. Exclusive
///
double? MaxScale { get; set; }
///
/// Gets or sets the area style for this scale range
///
IAreaVectorStyle AreaStyle { get; set; }
///
/// Gets or sets the point style for this scale range
///
IPointVectorStyle PointStyle { get; set; }
///
/// Gets or sets the line style for this scale range
///
ILineVectorStyle LineStyle { get; set; }
///
/// Creates a clone of this instance
///
///
IVectorScaleRange Clone();
}
///
/// The stylization to be applied to the vector features for a given scale range. Supports elevation
/// and extrusion settings.
///
/// Supported by Layer Definition 1.1.0 and higher
///
public interface IVectorScaleRange2 : IVectorScaleRange
{
///
/// Creates a new instance of . This instance is detached
/// and needs to be assigned to the property to take effect.
///
///
///
///
///
///
IElevationSettings Create(string zOffset, string zExtrusion, ElevationTypeType zOffsetType, LengthUnitType unit);
///
/// Gets or sets the elevation settings
///
IElevationSettings ElevationSettings { get; set; }
///
/// Gets or sets the composite styles for this scale range
///
IEnumerable CompositeStyle { get; set; }
}
///
/// Represents a name-value pair
///
public interface INameStringPair
{
///
/// Gets or set the name
///
string Name { get; set; }
///
/// Gets or sets the value
///
string Value { get; set; }
}
///
/// base interface for all style specifications
///
public interface IVectorStyle
{
///
/// Gets the type of this style specification
///
StyleType StyleType { get; }
int RuleCount { get; }
}
///
/// Indicates the type of geometry this style specification is for
///
public enum StyleType
{
///
///
///
Area,
///
///
///
Line,
///
///
///
Point,
///
///
///
Composite
}
///
/// Style specification for a area geometry layer
///
public interface IAreaVectorStyle : IVectorStyle, IRuleCollection
{
///
/// Enumerates the rules in this specification
///
IEnumerable Rules { get; }
///
/// Adds a rule to this specification
///
///
void AddRule(IAreaRule rule);
///
/// Removes a rule from this specification
///
///
void RemoveRule(IAreaRule rule);
///
/// Removes all rules.
///
void RemoveAllRules();
}
///
/// Style specification for a line geometry layer
///
public interface ILineVectorStyle : IVectorStyle, IRuleCollection
{
///
/// Enumerates the rules in this specification
///
IEnumerable Rules { get; }
///
/// Adds a rule to this specification
///
///
void AddRule(ILineRule rule);
///
/// Removes a rule from this specification
///
///
void RemoveRule(ILineRule rule);
///
/// Removes all current rules
///
void RemoveAllRules();
///
/// Gets the line rule at the specified index
///
///
///
ILineRule GetRuleAt(int index);
}
///
/// Defines a collection of style rules
///
/// The type of the rule.
public interface IRuleCollection
{
///
/// Gets the index of the specified rule
///
///
///
int IndexOfRule(TRule rule);
///
/// Gets the rule at the specified index
///
/// The index.
///
TRule GetRuleAt(int index);
///
/// Moves the specified rule up the list
///
/// The rule.
///
bool MoveUp(TRule rule);
///
/// Moves the specified rule down the list
///
/// The rule.
///
bool MoveDown(TRule rule);
}
///
/// Style specification for a point geometry layer
///
public interface IPointVectorStyle : IVectorStyle, IRuleCollection
{
///
/// Gets or sets whether to create a text layer
///
bool DisplayAsText { get; set; }
///
/// Gets or sets whether to allow labels from any map layer (including the current layer) to obscure features on the current layer
///
bool AllowOverpost { get; set; }
///
/// Enumerates the rules for this specification
///
IEnumerable Rules { get; }
///
/// Adds a rule to this specification
///
///
void AddRule(IPointRule rule);
///
/// Removes a rule from this specification
///
///
void RemoveRule(IPointRule rule);
///
/// Removes all current rules
///
void RemoveAllRules();
}
///
/// Base interface for style rules of all geometric types
///
public interface IVectorRule
{
///
/// Gets or sets the label for the rule to be displayed in the legend
///
string LegendLabel { get; set; }
///
/// Gets or sets the filter for this rule
///
string Filter { get; set; }
///
/// Gets or sets the the label
///
ITextSymbol Label { get; set; }
}
///
/// A style rule for the point geometry type
///
public interface IPointRule : IVectorRule
{
///
/// Gets or sets the symbolization settings for this point rule
///
IPointSymbolization2D PointSymbolization2D { get; set; }
}
///
/// A style rule for the line geometry type
///
public interface ILineRule : IVectorRule
{
///
/// Gets the symbolization settings for this line rule
///
IEnumerable Strokes { get; }
///
/// Removes any existing strokes and adds the specified list of strokes
///
///
void SetStrokes(IEnumerable strokes);
///
/// Adds a stroke to this rule
///
///
void AddStroke(IStroke stroke);
///
/// Removes a stroke from this rule
///
///
void RemoveStroke(IStroke stroke);
}
///
/// A style rule for the area/polygon geometry type
///
public interface IAreaRule : IVectorRule
{
///
/// Gets or sets the polygon stylization settings
///
IAreaSymbolizationFill AreaSymbolization2D { get; set; }
}
///
/// Encapsulates the stylization of a line
///
public interface IStroke : ICloneableLayerElement
{
///
/// Gets or sets the line style
///
string LineStyle { get; set; }
///
/// Gets or sets the thickness
///
string Thickness { get; set; }
///
/// Gets or sets the color
///
string Color { get; set; }
///
/// Gets or sets the thickness unit
///
LengthUnitType Unit { get; set; }
}
///
/// Encapsulates the stylization of a line. Supported in Layer Definition schema
/// 1.1.0 and newer
///
public interface IStroke2 : IStroke, ICloneableLayerElement
{
///
/// Gets or sets the size context of the thickness units
///
SizeContextType SizeContext { get; set; }
}
///
/// Symbolization characteristics for areas.
///
public interface IAreaSymbolizationFill : ICloneableLayerElement
{
///
/// Gets or sets the style of the polygon fill.
///
IFill Fill { get; set; }
///
/// Gets or sets the style of the polygon edge
///
IStroke Stroke { get; set; }
}
///
/// The type of point symbol
///
public enum PointSymbolType
{
///
/// A textual symbol
///
Text,
///
/// A predefined shape such as a square or circle.
///
Mark,
///
/// A raster or image symbol. Note that these do not scale well, but sometimes this is all that you have. Supported formats are application specific.
///
Image,
///
/// A symbol specified using a font character
///
Font,
///
/// A vector symbol defined using a W2D stream
///
W2D,
///
/// A vector symbol specifed from a block
///
Block
}
///
/// Defines common properties for all symbols
///
public interface ISymbol
{
///
/// Gets the type of symbol
///
PointSymbolType Type { get; }
///
/// Gets or sets the units that the sizes are specified in
///
LengthUnitType Unit { get; set; }
///
/// Gets or sets whether the sizes are with respect to the earth or the user's display device
///
SizeContextType SizeContext { get; set; }
///
/// Gets or sets the width of the symbol. This is a double FDO expression. Does not apply to font symbols
///
string SizeX { get; set; }
///
/// Gets or sets the height of the symbol. This is a double FDO expression.
///
string SizeY { get; set; }
///
/// Gets or sets the amount to rotate the symbol in degrees. This is a double FDO expression. Does not apply to line labels
///
string Rotation { get; set; }
///
/// Hint for the UI only. When the user enters a constant size for the width or height, the other dimension should be adjusted accordingly. Does not apply to font symbols or labels.
///
bool MaintainAspect { get; set; }
///
/// Gets or sets the X offset for the symbol specified in symbol space. This is a double FDO expression. Does not apply to labels.
///
string InsertionPointX { get; set; }
///
/// Gets or sets the Y offset for the symbol specified in symbol space. This is a double FDO expression. Does not apply to labels.
///
string InsertionPointY { get; set; }
}
///
/// Advanced placement settings
///
public interface IAdvancedPlacement
{
///
/// Gets or sets the scale limit.
///
/// The scale limit.
double ScaleLimit { get; set; }
}
///
/// Represents a text symbol
///
public interface ITextSymbol : ISymbol, ICloneableLayerElement
{
///
/// Gets or sets the textual content
///
string Text { get; set; }
///
/// Gets or sets the name of the font
///
string FontName { get; set; }
///
/// Gets or sets the foreground color
///
string ForegroundColor { get; set; }
///
/// Gets or sets the background color
///
string BackgroundColor { get; set; }
///
/// Gets or sets the background style
///
BackgroundStyleType BackgroundStyle { get; set; }
///
/// Gets or sets the horizontal alignment
///
string HorizontalAlignment { get; set; }
///
/// Gets or sets the vertical alignment
///
string VerticalAlignment { get; set; }
///
/// Gets or sets whether to bold the text
///
string Bold { get; set; }
///
/// Gets or sets whether to italicize the text
///
string Italic { get; set; }
///
/// Gets or sets whether to underline the text
///
string Underlined { get; set; }
///
/// Gets or sets the advanced placement settings
///
IAdvancedPlacement AdvancedPlacement { get; set; }
}
///
/// Stylization of a predefined shape (ShapeType)
///
public interface IMarkSymbol : ISymbol, ICloneableLayerElement
{
///
/// Gets or sets the type of shape
///
ShapeType Shape { get; set; }
///
/// Gets or sets the fill settings
///
IFill Fill { get; set; }
///
/// Gets or sets the outline settings
///
IStroke Edge { get; set; }
}
///
/// Symbols that are specified by a font and character.
///
public interface IFontSymbol : ISymbol, ICloneableLayerElement
{
///
/// Gets or sets the name of the font. If the font is not installed, the actual font used is application dependent.
///
string FontName { get; set; }
///
/// Gets or sets the character
///
string Character { get; set; }
///
/// Gets or sets whether to bold the text
///
bool? Bold { get; set; }
///
/// Gets or sets whether to italicize the text
///
bool? Italic { get; set; }
///
/// Gets or sets whether to underline the text
///
bool? Underlined { get; set; }
///
/// Gets or sets the foreground color
///
string ForegroundColor { get; set; }
}
///
/// Represents a DWF-based W2D symbol
///
public interface IW2DSymbol : ISymbol, ICloneableLayerElement
{
///
/// Gets or sets the reference to the symbol
///
ISymbolReference W2DSymbol { get; set; }
///
/// Gets or sets the fill color
///
string FillColor { get; set; }
///
/// Gets or sets the line color
///
string LineColor { get; set; }
///
/// Gets or sets the text color
///
string TextColor { get; set; }
}
///
/// Symbols that are comprised of a raster.
///
public interface IImageSymbol : ISymbol, ICloneableLayerElement
{
///
/// Gets or sets the image.
///
/// The image.
IBaseImageSymbol Image { get; set; }
}
///
/// The types of image symbol references
///
public enum ImageSymbolReferenceType
{
///
///
///
SymbolReference,
///
///
///
Inline
}
///
///
///
public interface IBaseImageSymbol
{
///
/// Gets the type.
///
/// The type.
ImageSymbolReferenceType Type { get; }
}
///
/// Represents a reference to a symbol library item image
///
public interface ISymbolReference : IBaseImageSymbol, ICloneableLayerElement
{
///
/// Gets or sets the resource id.
///
/// The resource id.
string ResourceId { get; set; }
///
/// Gets or sets the name of the library item.
///
/// The name of the library item.
string LibraryItemName { get; set; }
}
///
/// Represents an inline symbol image
///
public interface IInlineImageSymbol : IBaseImageSymbol, ICloneableLayerElement
{
///
/// Gets or sets the BinHex data for image
///
byte[] Content { get; set; }
}
///
/// Represents a block symbol
///
public interface IBlockSymbol : ISymbol, ICloneableLayerElement
{
///
/// Gets or sets the name of the drawing
///
string DrawingName { get; set; }
///
/// Gets or sets the name of the block
///
string BlockName { get; set; }
///
/// Gets or sets the color of the block
///
string BlockColor { get; set; }
///
/// Gets or sets the color of the layer
///
string LayerColor { get; set; }
}
///
/// Symbolization characteristics for points.
///
public interface IPointSymbolization2D : ICloneableLayerElement
{
///
/// Gets or sets the symbol.
///
/// The symbol.
ISymbol Symbol { get; set; }
}
///
/// Represents a fill
///
public interface IFill : ICloneableLayerElement
{
///
/// Gets or sets the fill pattern
///
string FillPattern { get; set; }
///
/// Gets or sets the background color
///
string BackgroundColor { get; set; }
///
/// Gets or sets the foreground color
///
string ForegroundColor { get; set; }
}
#endregion
#region raster layer
///
/// Defines how to scale numbers into a color channel
///
public interface IChannelBand
{
///
/// Gets or sets the name of the band
///
string Band { get; set; }
///
/// Gets or sets the low band value. Default is low value found in band. Band values less than this are snapped to this number
///
double? LowBand { get; set; }
///
/// Gets or sets the high band value. Default is high value found in band. Band values greater than this are snapped to this number
///
double? HighBand { get; set; }
///
/// Gets or sets the low channel value. Default is 0. Range is 0:255. LowBand is mapped to this number. LowChannel can be greater than HighChannel
///
byte LowChannel { get; set; }
///
/// Gets or sets the high channel value. Default is 255. Range is 0:255
///
byte HighChannel { get; set; }
}
///
/// Specifies a color using distinct RGB values
///
public interface IGridColorBands
{
///
/// Gets or sets the red channel band
///
IChannelBand RedBand { get; set; }
///
/// Gets or sets the green channel band
///
IChannelBand GreenBand { get; set; }
///
/// Gets or sets the blue channel band
///
IChannelBand BlueBand { get; set; }
}
///
/// An explicit color
///
public interface IExplicitColor
{
///
/// Gets the type.
///
/// The type.
ItemChoiceType Type { get; }
}
///
/// An explicit color value
///
public interface IExplictColorValue : IExplicitColor
{
///
/// Gets the value.
///
/// The value.
string Value { get; }
}
///
/// An explicit color band
///
public interface IExplicitColorBand : IExplicitColor
{
///
/// Gets the band.
///
/// The band.
string Band { get; }
}
///
/// An explicit color band
///
public interface IExplicitColorBands : IExplicitColor
{
///
/// Gets the bands.
///
/// The bands.
IGridColorBands Bands { get; }
}
///
/// A grid color
///
public interface IGridColor
{
///
/// Gets or sets the color of the explicit.
///
/// The color of the explicit.
IExplicitColor ExplicitColor { get; set; }
///
/// Set the color
///
///
void SetValue(string htmlColor);
///
/// Gets the html color value
///
///
string GetValue();
}
///
/// A grid color rule
///
public interface IGridColorRule
{
///
/// Gets or sets the label for the rule to be displayed in the legend
///
string LegendLabel { get; set; }
///
/// Gets or sets a filter for the rule. This is a boolean FDO expression. Any features that pass this filter are styled using this rule's stylization
///
string Filter { get; set; }
///
/// Gets or sets a label for the rule. Does not apply to GridColorRule
///
ITextSymbol Label { get; set; }
///
/// Gets or sets the color.
///
/// The color.
IGridColor Color { get; set; }
}
///
/// Specifies how to shade given a band and a light source
///
public interface IHillShade
{
///
/// Gets or sets the name of the band used for the computation
///
string Band { get; set; }
///
/// Gets or sets the azimuth of the sun in degrees
///
double Azimuth { get; set; }
///
/// Gets or sets the altitude of the sun in degrees
///
double Altitude { get; set; }
///
/// Gets or sets the scale factor applied to the band prior to computing hillshade. Defaults to 1 if not specified
///
double ScaleFactor { get; set; }
}
///
/// A grid color style
///
public interface IGridColorStyle
{
///
/// Gets or sets the hill shade.
///
/// The hill shade.
IHillShade HillShade { get; set; }
///
/// Gets or sets the transparency color. If a pixel color prior to factoring in HillShade is this value then the pixel is transparent
///
string TransparencyColor { get; set; }
///
/// Gets or sets the brightness factor
///
double? BrightnessFactor { get; set; }
///
/// Gets or sets the contrast factor
///
double? ContrastFactor { get; set; }
///
/// Gets the color rules for this style
///
IEnumerable ColorRule { get; }
///
/// Gets the number of color rules
///
int ColorRuleCount { get; }
///
/// Gets the color rule at the specified index
///
///
///
IGridColorRule GetColorRuleAt(int index);
///
/// Adds a color rule to this style
///
///
void AddColorRule(IGridColorRule rule);
///
/// Removes the specified color rule from this style
///
///
void RemoveColorRule(IGridColorRule rule);
///
/// Creates a default hillshade
///
///
IHillShade CreateHillShade();
}
///
/// A grid surface style
///
public interface IGridSurfaceStyle
{
///
/// Gets or sets the band to use for 3D data
///
string Band { get; set; }
///
/// Gets or sets the value that determines which input value is mapped to zero elevation. Defaults to 0 if not specified
///
double ZeroValue { get; set; }
///
/// Gets or sets the value that determines how to scale the inputs into a consistent elevation. Defaults to 1 if not specified
///
double ScaleFactor { get; set; }
///
/// Gets or sets the default color to use if no ColorStyle is defined at a pixel
///
string DefaultColor { get; set; }
}
///
/// A grid scale range
///
public interface IGridScaleRange
{
///
/// Gets or sets the zoomed in part of the scale range. Defaults to 0 if not specified. Inclusive
///
double? MinScale { get; set; }
///
/// Gets or sets the zoomed out part of the scale range. Defaults to the application's maximum value if not specified. Exclusive
///
double? MaxScale { get; set; }
///
/// Defines the height field of the grid
///
IGridSurfaceStyle SurfaceStyle { get; set; }
///
/// Gets or sets the color style.
///
/// The color style.
IGridColorStyle ColorStyle { get; set; }
///
/// When the user has zoomed in by this amount, a request for more detailed raster data is made
///
double RebuildFactor { get; set; }
///
/// Creates a default grid color style
///
///
IGridColorStyle CreateColorStyle();
///
/// Creates a default grid surface style
///
///
IGridSurfaceStyle CreateSurfaceStyle();
}
#endregion
#region Layer Definition 1.1.0 interfaces
///
/// Type of elevation
///
[System.SerializableAttribute()]
public enum ElevationTypeType
{
///
RelativeToGround,
///
Absolute,
}
///
/// Represents a composite style definition
///
public interface ICompositeTypeStyle : IVectorStyle, IRuleCollection
{
///
/// Gets the composite rules.
///
/// The composite rules.
IEnumerable CompositeRule { get; }
///
/// Adds the composite rule.
///
/// The comp rule.
void AddCompositeRule(ICompositeRule compRule);
///
/// Removes the composite rule.
///
/// The comp rule.
void RemoveCompositeRule(ICompositeRule compRule);
}
///
/// Represents a composite rule
///
public interface ICompositeRule
{
///
/// Gets or sets the legend label.
///
/// The legend label.
string LegendLabel { get; set; }
///
/// Gets or sets the filter.
///
/// The filter.
string Filter { get; set; }
///
/// Gets or sets the composite symbolization.
///
/// The composite symbolization.
ICompositeSymbolization CompositeSymbolization { get; set; }
}
///
/// Represents a composite symbolization
///
public interface ICompositeSymbolization
{
///
/// Gets the symbol instances.
///
/// The symbol instances.
IEnumerable SymbolInstance { get; }
///
/// Adds the symbol instance.
///
/// The inst.
void AddSymbolInstance(ISymbolInstance inst);
///
/// Removes the symbol instance.
///
/// The inst.
void RemoveSymbolInstance(ISymbolInstance inst);
///
/// Creates a symbol reference.
///
///
///
ISymbolInstance CreateSymbolReference(string resourceId);
///
/// Creates an inline simple symbol instance
///
///
///
ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef);
///
/// Creates an inline compound symbol instance
///
///
///
ISymbolInstance CreateInlineCompoundSymbol(ICompoundSymbolDefinition compDef);
}
///
/// Represents a parameter override
///
public interface IParameterOverride
{
///
/// Gets or sets the name of the symbol definition containing that parameter being overridden
///
string SymbolName { get; set; }
///
/// Gets or sets the identifier of the parameter being overridden
///
string ParameterIdentifier { get; set; }
///
/// Gets or sets the override value for the parameter
///
string ParameterValue { get; set; }
}
///
/// A collection of parameter overrides
///
public interface IParameterOverrideCollection
{
///
/// Gets the parameter overrides.
///
/// The parameter overrides.
IEnumerable Override { get; }
///
/// Adds the parameter override.
///
/// The parameter override
void AddOverride(IParameterOverride ov);
///
/// Removes the parameter override.
///
/// The parameter override
void RemoveOverride(IParameterOverride ov);
///
/// Creates a parameter override
///
/// The symbol name
/// The name of the parameter to override
///
IParameterOverride CreateParameterOverride(string symbol, string name);
}
///
/// Represents elevation settings
///
public interface IElevationSettings
{
///
/// Gets or sets the Z offset.
///
/// The Z offset.
string ZOffset { get; set; }
///
/// Gets or sets the Z extrusion.
///
/// The Z extrusion.
string ZExtrusion { get; set; }
///
/// Gets or sets the type of the Z offset.
///
/// The type of the Z offset.
ElevationTypeType ZOffsetType { get; set; }
///
/// Gets or sets the unit.
///
/// The unit.
LengthUnitType Unit { get; set; }
}
#endregion
#region Layer Definition 1.2.0 interfaces
///
/// The types of usage context
///
[System.SerializableAttribute()]
public enum UsageContextType
{
///
Unspecified,
///
Point,
///
Line,
///
Area,
}
///
/// The types of geometry context
///
[System.SerializableAttribute()]
public enum GeometryContextType
{
///
Unspecified,
///
Point,
///
LineString,
///
Polygon,
}
///
/// Provides legend labeling information for a theme
///
public interface IThemeLabel
{
///
/// Gets or sets the legend description for the theme
///
string Description { get; set; }
///
/// Gets or sets the default legend format to use for each category
///
string CategoryFormat { get; set; }
}
///
/// Version 2 of parameter overrides that supports theme labels. Applies to v1.2.0 of the Layer Definition schema
///
public interface IParameterOverride2 : IParameterOverride
{
///
/// Gets or sets the theme label.
///
/// The theme label.
IThemeLabel ThemeLabel { get; set; }
}
///
/// Version 2 of symbol instance that supports rendering passes and specific contexts. Applies to v1.2.0 of the Layer Definition schema
///
public interface ISymbolInstance2 : ISymbolInstance
{
///
/// Gets or sets the rendering pass.
///
/// The rendering pass.
string RenderingPass { get; set; }
///
/// Gets or sets the usage context.
///
/// The usage context.
UsageContextType UsageContext { get; set; }
///
/// Gets or sets the geometry context.
///
/// The geometry context.
GeometryContextType GeometryContext { get; set; }
}
#endregion
#region Layer Definition 1.3.0 interfaces
///
/// A point vector style introduced in the v1.3.0 layer definition schema
///
public interface IPointVectorStyle2 : IPointVectorStyle
{
///
/// Gets or sets a value indicating whether [show in legend].
///
/// true if [show in legend]; otherwise, false.
bool ShowInLegend { get; set; }
}
///
/// A line vector style introduced in the v1.3.0 layer definition schema
///
public interface ILineVectorStyle2 : ILineVectorStyle
{
///
/// Gets or sets a value indicating whether [show in legend].
///
/// true if [show in legend]; otherwise, false.
bool ShowInLegend { get; set; }
}
///
/// An area vector style introduced in the v1.3.0 layer definition schema
///
public interface IAreaVectorStyle2 : IAreaVectorStyle
{
///
/// Gets or sets a value indicating whether [show in legend].
///
/// true if [show in legend]; otherwise, false.
bool ShowInLegend { get; set; }
}
///
/// A composite style introduced in the v1.3.0 layer definition schema
///
public interface ICompositeTypeStyle2 : ICompositeTypeStyle
{
///
/// Gets or sets a value indicating whether [show in legend].
///
/// true if [show in legend]; otherwise, false.
bool ShowInLegend { get; set; }
}
#endregion
#region Layer Definition 2.3.0 interfaces
#endregion
}