All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.micromata.opengis.kml.v_2_2_0.Lod Maven / Gradle / Ivy

Go to download

This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.

There is a newer version: 3.0.4
Show newest version

package de.micromata.opengis.kml.v_2_2_0;

import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;
import jakarta.xml.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * {@code }
 * 

* {@code } (required) Measurement in screen pixels that represents the minimum * limit of the visibility range for a given Region. Google Earth calculates the size * of the Region when projected onto screen space. Then it computes the square root * of the Region's area (if, for example, the Region is square and the viewpoint is * directly above the Region, and the Region is not tilted, this measurement is equal * to the width of the projected Region). If this measurement falls within the limits * defined by {@code } and {@code } (and if the {@code } is in view), * the Region is active. If this limit is not reached, the associated geometry is considered * to be too far from the user's viewpoint to be drawn. {@code } Measurement * in screen pixels that represents the maximum limit of the visibility range for a * given Region. A value of −1, the default, indicates "active to infinite size." {@code } * Distance over which the geometry fades, from fully opaque to fully transparent. * This ramp value, expressed in screen pixels, is applied at the minimum end of the * LOD (visibility) limits. {@code } Distance over which the geometry fades, * from fully transparent to fully opaque. This ramp value, expressed in screen pixels, * is applied at the maximum end of the LOD (visibility) limits. *

* * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LodType", propOrder = { "minLodPixels", "maxLodPixels", "minFadeExtent", "maxFadeExtent", "lodSimpleExtension", "lodObjectExtension" }) @XmlRootElement(name = "Lod", namespace = "http://www.opengis.net/kml/2.2") public class Lod extends AbstractObject implements Cloneable { /** * {@code } (required) *

* Measurement in screen pixels that represents the minimum limit of the visibility * range for a given Region. Google Earth calculates the size of the Region when projected * onto screen space. Then it computes the square root of the Region's area (if, for * example, the Region is square and the viewpoint is directly above the Region, and * the Region is not tilted, this measurement is equal to the width of the projected * Region). If this measurement falls within the limits defined by {@code } and * {@code } (and if the {@code } is in view), the Region is active. If * this limit is not reached, the associated geometry is considered to be too far from * the user's viewpoint to be drawn. *

* * * */ @XmlElement(defaultValue = "0.0") protected double minLodPixels; /** * {@code } *

* Measurement in screen pixels that represents the maximum limit of the visibility * range for a given Region. A value of −1, the default, indicates "active to infinite * size." *

* * * */ @XmlElement(defaultValue = "-1.0") protected double maxLodPixels; /** * {@code } *

* Distance over which the geometry fades, from fully opaque to fully transparent. * This ramp value, expressed in screen pixels, is applied at the minimum end of the * LOD (visibility) limits. *

* * * */ @XmlElement(defaultValue = "0.0") protected double minFadeExtent; /** * {@code } *

* Distance over which the geometry fades, from fully transparent to fully opaque. * This ramp value, expressed in screen pixels, is applied at the maximum end of the * LOD (visibility) limits. *

*

* In the following diagram, if P=the calculated projected pixel size, the circled * numbers indicate the following: if (P lt minLodPixels) opacity=0 //#1 in diagram * else if(P lt minLodPixels + minFadeExtent) opacity=(P - minLodPixels)/minFadeExtent * //#2 in diagram else if (P lt maxLodPixels - maxFadeExtent) opacity=1 //#3 in diagram * else if (P lt maxLodPixels) opacity=(maxLodPixels-P)/maxFadeExtent //#4 in diagram * else opacity=0 //#5 in diagram *

* * * */ @XmlElement(defaultValue = "0.0") protected double maxFadeExtent; @XmlElement(name = "LodSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List lodSimpleExtension; /** * {@code } *

* This is an abstract base class and cannot be used directly in a KML file. It provides * the id attribute, which allows unique identification of a KML element, and the targetId * attribute, which is used to reference objects that have already been loaded into * Google Earth. The id attribute must be assigned if the Update mechanism is to * be used. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Object id="ID" targetId="NCName" -->
     * <!-- /Object> -->
* * * */ @XmlElement(name = "LodObjectExtensionGroup") protected List lodObjectExtension; public Lod() { super(); } /** * * * @return * possible object is * {@link Double} * */ public double getMinLodPixels() { return minLodPixels; } /** * * * @param value * allowed object is * {@link Double} * */ public void setMinLodPixels(double value) { this.minLodPixels = value; } /** * * * @return * possible object is * {@link Double} * */ public double getMaxLodPixels() { return maxLodPixels; } /** * * * @param value * allowed object is * {@link Double} * */ public void setMaxLodPixels(double value) { this.maxLodPixels = value; } /** * * * @return * possible object is * {@link Double} * */ public double getMinFadeExtent() { return minFadeExtent; } /** * * * @param value * allowed object is * {@link Double} * */ public void setMinFadeExtent(double value) { this.minFadeExtent = value; } /** * * * @return * possible object is * {@link Double} * */ public double getMaxFadeExtent() { return maxFadeExtent; } /** * * * @param value * allowed object is * {@link Double} * */ public void setMaxFadeExtent(double value) { this.maxFadeExtent = value; } /** * * */ public List getLodSimpleExtension() { if (lodSimpleExtension == null) { lodSimpleExtension = new ArrayList(); } return this.lodSimpleExtension; } /** * * */ public List getLodObjectExtension() { if (lodObjectExtension == null) { lodObjectExtension = new ArrayList(); } return this.lodObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); long temp; temp = Double.doubleToLongBits(minLodPixels); result = ((prime*result)+((int)(temp^(temp >>>(32))))); temp = Double.doubleToLongBits(maxLodPixels); result = ((prime*result)+((int)(temp^(temp >>>(32))))); temp = Double.doubleToLongBits(minFadeExtent); result = ((prime*result)+((int)(temp^(temp >>>(32))))); temp = Double.doubleToLongBits(maxFadeExtent); result = ((prime*result)+((int)(temp^(temp >>>(32))))); result = ((prime*result)+((lodSimpleExtension == null)? 0 :lodSimpleExtension.hashCode())); result = ((prime*result)+((lodObjectExtension == null)? 0 :lodObjectExtension.hashCode())); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (super.equals(obj) == false) { return false; } if ((obj instanceof Lod) == false) { return false; } Lod other = ((Lod) obj); if (minLodPixels!= other.minLodPixels) { return false; } if (maxLodPixels!= other.maxLodPixels) { return false; } if (minFadeExtent!= other.minFadeExtent) { return false; } if (maxFadeExtent!= other.maxFadeExtent) { return false; } if (lodSimpleExtension == null) { if (other.lodSimpleExtension!= null) { return false; } } else { if (lodSimpleExtension.equals(other.lodSimpleExtension) == false) { return false; } } if (lodObjectExtension == null) { if (other.lodObjectExtension!= null) { return false; } } else { if (lodObjectExtension.equals(other.lodObjectExtension) == false) { return false; } } return true; } /** * * * @param lodSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setLodSimpleExtension(final List lodSimpleExtension) { this.lodSimpleExtension = lodSimpleExtension; } /** * add a value to the lodSimpleExtension property collection * * @param lodSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public Lod addToLodSimpleExtension(final Object lodSimpleExtension) { this.getLodSimpleExtension().add(lodSimpleExtension); return this; } /** * * * @param lodObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setLodObjectExtension(final List lodObjectExtension) { this.lodObjectExtension = lodObjectExtension; } /** * add a value to the lodObjectExtension property collection * * @param lodObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public Lod addToLodObjectExtension(final AbstractObject lodObjectExtension) { this.getLodObjectExtension().add(lodObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public Lod addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * fluent setter * * * @param minLodPixels * required parameter */ public Lod withMinLodPixels(final double minLodPixels) { this.setMinLodPixels(minLodPixels); return this; } /** * fluent setter * * * @param maxLodPixels * required parameter */ public Lod withMaxLodPixels(final double maxLodPixels) { this.setMaxLodPixels(maxLodPixels); return this; } /** * fluent setter * * * @param minFadeExtent * required parameter */ public Lod withMinFadeExtent(final double minFadeExtent) { this.setMinFadeExtent(minFadeExtent); return this; } /** * fluent setter * * * @param maxFadeExtent * required parameter */ public Lod withMaxFadeExtent(final double maxFadeExtent) { this.setMaxFadeExtent(maxFadeExtent); return this; } /** * fluent setter * * * @param lodSimpleExtension * required parameter */ public Lod withLodSimpleExtension(final List lodSimpleExtension) { this.setLodSimpleExtension(lodSimpleExtension); return this; } /** * fluent setter * * * @param lodObjectExtension * required parameter */ public Lod withLodObjectExtension(final List lodObjectExtension) { this.setLodObjectExtension(lodObjectExtension); return this; } @Obvious @Override public Lod withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public Lod withId(final String id) { super.withId(id); return this; } @Obvious @Override public Lod withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Override public Lod clone() { Lod copy; copy = ((Lod) super.clone()); copy.lodSimpleExtension = new ArrayList((getLodSimpleExtension().size())); for (Object iter: lodSimpleExtension) { copy.lodSimpleExtension.add(iter); } copy.lodObjectExtension = new ArrayList((getLodObjectExtension().size())); for (AbstractObject iter: lodObjectExtension) { copy.lodObjectExtension.add(iter.clone()); } return copy; } }