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

de.micromata.opengis.kml.v_2_2_0.Model 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 }
 * 

* A 3D object described in a COLLADA file (referenced in the {@code } tag). COLLADA * files have a .dae file extension. Models are created in their own coordinate space * and then located, positioned, and scaled in Google Earth. See the "Topics in KML" * page on Regions for more detail. *

*

* Google Earth supports only triangles and lines as primitive types. The maximum number * of triangles allowed is 21845. Google Earth does not support animation or skinning. * Google Earth does not support external geometry references. *

*

* Google Earth supports the COLLADA common profile, with the following exceptions: *

* * Syntax: *
<Model id="ID">
 *   <!-- specific to Model -->
 *   <altitudeMode>clampToGround</altitudeMode> 
 *       <!-- kml:altitudeModeEnum: clampToGround,relativeToGround,or absolute -->
 *       <!-- or, substitute gx:altitudeMode: clampToSeaFloor, relativeToSeaFloor -->
 *   <Location> 
 *     <longitude></longitude> <!-- kml:angle180 -->
 *     <latitude></latitude>   <!-- kml:angle90 -->  
 *     <altitude>0</altitude>  <!-- double --> 
 *   </Location> 
 *   <Orientation>               
 *     <heading>0</heading>    <!-- kml:angle360 -->
 *     <tilt>0</tilt>          <!-- kml:angle360 -->
 *     <roll>0</roll>          <!-- kml:angle360 -->
 *   </Orientation> 
 *   <Scale> 
 *     <x>1</x>                <!-- double -->
 *     <y>1</y>                <!-- double -->
 *     <z>1</z>                <!-- double -->
 *   </Scale> 
 *   <Link>...</Link>
 *   <ResourceMap>
 *     <Alias>
 *       <targetHref>...</targetHref>   <!-- anyURI -->
 *       <sourceHref>...</sourceHref>   <!-- anyURI -->
 *     </Alias>
 *   </ResourceMap>
 * </Model>
* * Extends: * * * Contained By: * * * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ModelType", propOrder = { "altitudeMode", "location", "orientation", "scale", "link", "resourceMap", "modelSimpleExtension", "modelObjectExtension" }) @XmlRootElement(name = "Model", namespace = "http://www.opengis.net/kml/2.2") public class Model extends Geometry implements Cloneable { /** * AltitudeMode *

* clampToGround, relativeToGround, absolute *

* * See Also: * See LookAt and {@code } * * * */ @XmlElement(defaultValue = "clampToGround") protected AltitudeMode altitudeMode; /** * {@code } *

* Specifies the exact coordinates of the Model's origin in latitude, longitude, and * altitude. Latitude and longitude measurements are standard lat-lon projection with * WGS84 datum. Altitude is distance above the earth's surface, in meters, and is interpreted * according to altitudeMode or gx:altitudeMode. {@code 39.55375305703105 * -118.9813220168456 1223 } *

* * * */ @XmlElement(name = "Location") protected Location location; /** * {@code } *

* Describes rotation of a 3D model's coordinate system to position the object in Google * Earth. See diagram below. {@code 45.0 10.0 * 0.0 } *

* * * */ @XmlElement(name = "Orientation") protected Orientation orientation; /** * {@code } *

* Note: The {@code } tag has been deprecated. Use {@code } instead. *

*

* Resizes the icon. *

*

* Scales a model along the x, y, and z axes in the model's coordinate space. {@code * 2.5 2.5 3.5 } *

* * * */ @XmlElement(name = "Scale") protected Scale scale; /** * {@code } (required). see {@code }. *

* {@code } specifies the location of any of the following: *

*

* If the file specified in {@code }is a local file, the {@code } and {@code } * elements are not used. *

*

* KML files fetched by network links Image files used in any Overlay (the {@code }element * specifies the image in an Overlay; {@code }has the same fields as {@code }) Model files * used in the {@code } element *

*

* Specifies the URL of the website containing this KML or KMZ file. Be sure to include * the namespace for this element in any KML file that uses it: xmlns:atom="http://www.w3.org/2005/Atom" * (see the sample that follows). *

*

* Specifies the file to load and optional refresh parameters. See {@code }. *

*

* The {@code } element replaces the {@code } element of NetworkLink contained in earlier * KML releases and adds functionality for the {@code } element (introduced in KML * 2.1). In Google Earth releases 3.0 and earlier, the {@code } element is ignored. *

*

* The file is conditionally loaded and refreshed, depending on the refresh parameters * supplied here. Two different sets of refresh parameters can be specified: one set * is based on time ({@code } and {@code }) and one is based on the current * "camera" view ({@code } and {@code }). In addition, Link specifies * whether to scale the bounding box parameters that are sent to the server ({@code } * and provides a set of optional viewing parameters that can be sent to the server * ({@code }) as well as a set of optional parameters containing version and language * information. *

*

* Tip: To display the top-level Folder or Document within a Network Link in the List * View, assign an ID to the Folder or Document. Without this ID, only the child object * names are displayed in the List View. *

*

* When a file is fetched, the URL that is sent to the server is composed of three * pieces of information: *

*

* the href (Hypertext Reference) that specifies the file to load. an arbitrary format * string that is created from (a) parameters that you specify in the {@code } * element or (b) bounding box parameters (this is the default and is used if no {@code } * element is included in the file). a second format string that is specified in the * {@code } element. *

* * Syntax: *
<Link id="ID">
     *   <!-- specific to Link -->
     *   <href>...</href>                      <!-- string -->
     *   <refreshMode>onChange</refreshMode>   
     *     <!-- refreshModeEnum: onChange, onInterval, or onExpire -->   
     *   <refreshInterval>4</refreshInterval>  <!-- float -->
     *   <viewRefreshMode>never</viewRefreshMode> 
     *     <!-- viewRefreshModeEnum: never, onStop, onRequest, onRegion -->
     *   <viewRefreshTime>4</viewRefreshTime>  <!-- float -->
     *   <viewBoundScale>1</viewBoundScale>    <!-- float -->
     *   <viewFormat>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]</viewFormat>
     *                                         <!-- string -->
     *   <httpQuery>...</httpQuery>            <!-- string -->
     * </Link>
* * Extends: * * * Contained By: * * * * See Also: * {@code } * {@code } * * * */ @XmlElement(name = "Link") protected Link link; /** * {@code } * * */ @XmlElement(name = "ResourceMap") protected ResourceMap resourceMap; @XmlElement(name = "ModelSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List modelSimpleExtension; /** * {@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 = "ModelObjectExtensionGroup") protected List modelObjectExtension; public Model() { super(); } /** * * * @return * possible object is * {@code <}{@link Object}{@code >} * {@code <}{@link de.micromata.opengis.kml.v_2_2_0.AltitudeMode}{@code >} * * */ public AltitudeMode getAltitudeMode() { return altitudeMode; } /** * * * @param value * allowed object is * {@code <}{@link Object}{@code >} * {@code <}{@link de.micromata.opengis.kml.v_2_2_0.AltitudeMode}{@code >} * * */ public void setAltitudeMode(AltitudeMode value) { this.altitudeMode = value; } /** * * * @return * possible object is * {@link Location} * */ public Location getLocation() { return location; } /** * * * @param value * allowed object is * {@link Location} * */ public void setLocation(Location value) { this.location = value; } /** * * * @return * possible object is * {@link Orientation} * */ public Orientation getOrientation() { return orientation; } /** * * * @param value * allowed object is * {@link Orientation} * */ public void setOrientation(Orientation value) { this.orientation = value; } /** * * * @return * possible object is * {@link Scale} * */ public Scale getScale() { return scale; } /** * * * @param value * allowed object is * {@link Scale} * */ public void setScale(Scale value) { this.scale = value; } /** * * * @return * possible object is * {@link Link} * */ public Link getLink() { return link; } /** * * * @param value * allowed object is * {@link Link} * */ public void setLink(Link value) { this.link = value; } /** * * * @return * possible object is * {@link ResourceMap} * */ public ResourceMap getResourceMap() { return resourceMap; } /** * * * @param value * allowed object is * {@link ResourceMap} * */ public void setResourceMap(ResourceMap value) { this.resourceMap = value; } /** * * */ public List getModelSimpleExtension() { if (modelSimpleExtension == null) { modelSimpleExtension = new ArrayList(); } return this.modelSimpleExtension; } /** * * */ public List getModelObjectExtension() { if (modelObjectExtension == null) { modelObjectExtension = new ArrayList(); } return this.modelObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((altitudeMode == null)? 0 :altitudeMode.hashCode())); result = ((prime*result)+((location == null)? 0 :location.hashCode())); result = ((prime*result)+((orientation == null)? 0 :orientation.hashCode())); result = ((prime*result)+((scale == null)? 0 :scale.hashCode())); result = ((prime*result)+((link == null)? 0 :link.hashCode())); result = ((prime*result)+((resourceMap == null)? 0 :resourceMap.hashCode())); result = ((prime*result)+((modelSimpleExtension == null)? 0 :modelSimpleExtension.hashCode())); result = ((prime*result)+((modelObjectExtension == null)? 0 :modelObjectExtension.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 Model) == false) { return false; } Model other = ((Model) obj); if (altitudeMode == null) { if (other.altitudeMode!= null) { return false; } } else { if (altitudeMode.equals(other.altitudeMode) == false) { return false; } } if (location == null) { if (other.location!= null) { return false; } } else { if (location.equals(other.location) == false) { return false; } } if (orientation == null) { if (other.orientation!= null) { return false; } } else { if (orientation.equals(other.orientation) == false) { return false; } } if (scale == null) { if (other.scale!= null) { return false; } } else { if (scale.equals(other.scale) == false) { return false; } } if (link == null) { if (other.link!= null) { return false; } } else { if (link.equals(other.link) == false) { return false; } } if (resourceMap == null) { if (other.resourceMap!= null) { return false; } } else { if (resourceMap.equals(other.resourceMap) == false) { return false; } } if (modelSimpleExtension == null) { if (other.modelSimpleExtension!= null) { return false; } } else { if (modelSimpleExtension.equals(other.modelSimpleExtension) == false) { return false; } } if (modelObjectExtension == null) { if (other.modelObjectExtension!= null) { return false; } } else { if (modelObjectExtension.equals(other.modelObjectExtension) == false) { return false; } } return true; } /** * Creates a new instance of {@link Location} and set it to location. * * This method is a short version for: * {@code * Location location = new Location(); * this.setLocation(location); } * * */ public Location createAndSetLocation() { Location newValue = new Location(); this.setLocation(newValue); return newValue; } /** * Creates a new instance of {@link Orientation} and set it to orientation. * * This method is a short version for: * {@code * Orientation orientation = new Orientation(); * this.setOrientation(orientation); } * * */ public Orientation createAndSetOrientation() { Orientation newValue = new Orientation(); this.setOrientation(newValue); return newValue; } /** * Creates a new instance of {@link Scale} and set it to scale. * * This method is a short version for: * {@code * Scale scale = new Scale(); * this.setScale(scale); } * * */ public Scale createAndSetScale() { Scale newValue = new Scale(); this.setScale(newValue); return newValue; } /** * Creates a new instance of {@link Link} and set it to link. * * This method is a short version for: * {@code * Link link = new Link(); * this.setLink(link); } * * */ public Link createAndSetLink() { Link newValue = new Link(); this.setLink(newValue); return newValue; } /** * Creates a new instance of {@link ResourceMap} and set it to resourceMap. * * This method is a short version for: * {@code * ResourceMap resourceMap = new ResourceMap(); * this.setResourceMap(resourceMap); } * * */ public ResourceMap createAndSetResourceMap() { ResourceMap newValue = new ResourceMap(); this.setResourceMap(newValue); return newValue; } /** * * * @param modelSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setModelSimpleExtension(final List modelSimpleExtension) { this.modelSimpleExtension = modelSimpleExtension; } /** * add a value to the modelSimpleExtension property collection * * @param modelSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public Model addToModelSimpleExtension(final Object modelSimpleExtension) { this.getModelSimpleExtension().add(modelSimpleExtension); return this; } /** * * * @param modelObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setModelObjectExtension(final List modelObjectExtension) { this.modelObjectExtension = modelObjectExtension; } /** * add a value to the modelObjectExtension property collection * * @param modelObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public Model addToModelObjectExtension(final AbstractObject modelObjectExtension) { this.getModelObjectExtension().add(modelObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public Model addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setGeometrySimpleExtension(final List geometrySimpleExtension) { super.setGeometrySimpleExtension(geometrySimpleExtension); } @Obvious @Override public Model addToGeometrySimpleExtension(final Object geometrySimpleExtension) { super.getGeometrySimpleExtension().add(geometrySimpleExtension); return this; } /** * * */ @Obvious @Override public void setGeometryObjectExtension(final List geometryObjectExtension) { super.setGeometryObjectExtension(geometryObjectExtension); } @Obvious @Override public Model addToGeometryObjectExtension(final AbstractObject geometryObjectExtension) { super.getGeometryObjectExtension().add(geometryObjectExtension); return this; } /** * fluent setter * * * @param altitudeMode * required parameter */ public Model withAltitudeMode(final AltitudeMode altitudeMode) { this.setAltitudeMode(altitudeMode); return this; } /** * fluent setter * * * @param location * required parameter */ public Model withLocation(final Location location) { this.setLocation(location); return this; } /** * fluent setter * * * @param orientation * required parameter */ public Model withOrientation(final Orientation orientation) { this.setOrientation(orientation); return this; } /** * fluent setter * * * @param scale * required parameter */ public Model withScale(final Scale scale) { this.setScale(scale); return this; } /** * fluent setter * * * @param link * required parameter */ public Model withLink(final Link link) { this.setLink(link); return this; } /** * fluent setter * * * @param resourceMap * required parameter */ public Model withResourceMap(final ResourceMap resourceMap) { this.setResourceMap(resourceMap); return this; } /** * fluent setter * * * @param modelSimpleExtension * required parameter */ public Model withModelSimpleExtension(final List modelSimpleExtension) { this.setModelSimpleExtension(modelSimpleExtension); return this; } /** * fluent setter * * * @param modelObjectExtension * required parameter */ public Model withModelObjectExtension(final List modelObjectExtension) { this.setModelObjectExtension(modelObjectExtension); return this; } @Obvious @Override public Model withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public Model withId(final String id) { super.withId(id); return this; } @Obvious @Override public Model withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public Model withGeometrySimpleExtension(final List geometrySimpleExtension) { super.withGeometrySimpleExtension(geometrySimpleExtension); return this; } @Obvious @Override public Model withGeometryObjectExtension(final List geometryObjectExtension) { super.withGeometryObjectExtension(geometryObjectExtension); return this; } @Override public Model clone() { Model copy; copy = ((Model) super.clone()); copy.location = ((location == null)?null:((Location) location.clone())); copy.orientation = ((orientation == null)?null:((Orientation) orientation.clone())); copy.scale = ((scale == null)?null:((Scale) scale.clone())); copy.link = ((link == null)?null:((Link) link.clone())); copy.resourceMap = ((resourceMap == null)?null:((ResourceMap) resourceMap.clone())); copy.modelSimpleExtension = new ArrayList((getModelSimpleExtension().size())); for (Object iter: modelSimpleExtension) { copy.modelSimpleExtension.add(iter); } copy.modelObjectExtension = new ArrayList((getModelObjectExtension().size())); for (AbstractObject iter: modelObjectExtension) { copy.modelObjectExtension.add(iter.clone()); } return copy; } }