001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2004-2012 Open Geospatial Consortium, Inc.
006     *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007     *
008     *    Permission to use, copy, and modify this software and its documentation, with
009     *    or without modification, for any purpose and without fee or royalty is hereby
010     *    granted, provided that you include the following on ALL copies of the software
011     *    and documentation or portions thereof, including modifications, that you make:
012     *
013     *    1. The full text of this NOTICE in a location viewable to users of the
014     *       redistributed or derivative work.
015     *    2. Notice of any changes or modifications to the OGC files, including the
016     *       date changes were made.
017     *
018     *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019     *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020     *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021     *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022     *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023     *
024     *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025     *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026     *
027     *    The name and trademarks of copyright holders may NOT be used in advertising or
028     *    publicity pertaining to the software without specific, written prior permission.
029     *    Title to copyright in this software and any associated documentation will at all
030     *    times remain with copyright holders.
031     */
032    package org.opengis.style;
033    
034    import javax.measure.quantity.Length;
035    import javax.measure.unit.Unit;
036    
037    import org.opengis.annotation.Extension;
038    import org.opengis.annotation.UML;
039    import org.opengis.annotation.XmlElement;
040    
041    import static org.opengis.annotation.Specification.*;
042    
043    /**
044     * Abstract superclass of the symbolizers defined by the Symbology Encoding specification.
045     * <p>
046     * Please note you are not free to create your own subtype o Symbolizer - we are limited to LineSymbolizer, PointSymbolizer, PolygonSymbolizer, RasterSymbolizer and TextSymbolizer.
047     * <p>
048     * <b>using a static geometry<b/>
049     * you can use static geometry if needed, see {@link #getGeometryAttribute}
050     * </p>
051     *
052     * <b>Particular cases if the geometry is not the defined type of the symbolizer</b>
053     * <p>
054     * Geometry types other than inherently linear types can also be used. If a point geometry is
055     * used, it should be interpreted as a line of "epsilon" (arbitrarily small) length with a
056     * horizontal orientation centered on the point, and should be rendered with two end caps.
057     * If a polygon is used (or other "area" type), then its closed outline is used as the line string
058     * (with no end caps). If a raster geometry is used, its coverage-area outline is used for the
059     * line, rendered with no end caps.
060     * </p>
061     *
062     * @version <A HREF="http://www.opengeospatial.org/standards/symbol">Symbology Encoding Implementation Specification 1.1.0</A>
063     * @author Open Geospatial Consortium
064     * @author Johann Sorel (Geomatys)
065     * @author Chris Dillard (SYS Technologies)
066     * @since GeoAPI 2.2
067     */
068    @UML(identifier="PF_PortrayalSpecification", specification=ISO_19117)
069    public interface Symbolizer {
070        
071        /**
072         * Returns a  measure unit.
073         * This parameter is inherited from GML.
074         * Renderers shall use the unit to correctly render symbols.
075         *
076         * Recommended uom definitions are :
077         * <p>
078         * <ul>
079         *     <li>{@code metre}</li>
080         *     <li>{@code foot}</li>
081         *     <li>{@code pixel}</li>
082         * </ul>
083         * <p>
084         * 
085         * @return can be null. If the unit is null than we shall use a the pixel unit
086         */
087        @XmlElement("uom")
088        Unit<Length> getUnitOfMeasure();
089    
090        /**
091         * Returns the name of the geometry feature attribute to use for drawing.
092         * May return null (or Expression.NIL) if this symbol is to use the default geometry attribute,
093         * whatever it may be. Using null in this fashion is similar to a PropertyName using 
094         * the XPath expression ".".
095         * <p>                           
096         * The content of the element gives the property name in XPath syntax. In principle, a fixed geometry
097         * could be defined using GML or operators could be defined for computing the geometry
098         * from references or literals. However, using a feature property directly is by far the most
099         * commonly useful method.
100         * </p>
101         * @return Geometry attribute name, or <code>null</code> to indicate default geometry
102         */
103        @XmlElement("Geometry")
104        String getGeometryPropertyName();
105    
106        /**
107         * Exrepssion used to define a geometry for drawing. May return null if the default
108         * geometry attribute should be used. This expression is often a PropertyName.
109         * 
110         * @return Expression used to define a geometry for drawing, or Expression.NIL if the default geometry should be used.
111         */
112        /* Expression getGeometry(); */
113        
114        /**
115         * Returns a name for this symbolizer.
116         * This can be any string that uniquely identifies this style within a given
117         * canvas.  It is not meant to be human-friendly.  (The "title" property is
118         * meant to be human friendly.)
119         * @return a name for this style.
120         */
121        @XmlElement("Name")
122        String getName();
123    
124        /**
125         * Returns the description of this symbolizer.
126         *
127         * @return Description with usual informations used
128         * for user interfaces.
129         */
130        @XmlElement("Description")
131        Description getDescription();
132        
133        /**
134         * Calls the visit method of a StyleVisitor
135         *  
136         * @param visitor the style visitor
137         * @return value produced 
138         */
139        @Extension
140        Object accept(StyleVisitor visitor, Object extraData);
141    }