001 002/* 003 * Copyright (C) 2010 Archie L. Cobbs. All rights reserved. 004 * 005 * $Id$ 006 */ 007 008package org.dellroad.jibxbindings.pidf.lo.gml; 009 010import java.net.URI; 011 012/** 013 * GML sphere. 014 */ 015public class Sphere extends Solid { 016 017 private double[] center; 018 private Measure radius; 019 020 public Sphere() { 021 } 022 023 public Sphere(String gid, URI srsName, int srsDimension, double[] center, Measure radius) { 024 super(gid, srsName, srsDimension); 025 this.setCenter(center); 026 this.setRadius(radius); 027 } 028 029 /** 030 * The center of the sphere. 031 */ 032 public double[] getCenter() { 033 return this.center; 034 } 035 public void setCenter(double[] center) { 036 this.center = center; 037 } 038 039 /** 040 * The sphere's {@code <gs:radius>}. 041 */ 042 public Measure getRadius() { 043 return this.radius; 044 } 045 public void setRadius(Measure radius) { 046 this.radius = radius; 047 } 048 049 @Override 050 public void visit(GMLObjectSwitch gmlObjectSwitch) { 051 gmlObjectSwitch.caseSphere(this); 052 } 053 054// Cloneable 055 056 @Override 057 public Sphere clone() { 058 final Sphere clone = (Sphere)super.clone(); 059 clone.center = this.center != null ? this.center.clone() : null; 060 clone.radius = this.radius != null ? this.radius.clone() : null; 061 return clone; 062 } 063} 064