Example #1
0
        // Copy constructor
        public Vertex(Vertex aVertex)
        {
            double latitude  = aVertex.getLocation().getAbsoluteLocation().getLatitude();
            double longitude = aVertex.getLocation().getAbsoluteLocation().getLongitude();
            double altitude  = aVertex.getLocation().getAbsoluteLocation().getAltitude();

            AggregateLocation aggLoc = new AggregateLocation(new AbsoluteLocation(latitude, longitude, altitude));

            this.location       = aggLoc;
            this.inEdges        = aVertex.getInEdges();
            this.outEdges       = aVertex.getOutEdges();
            this.id             = aVertex.getId();
            this.fingerprints   = aVertex.getFingerPrints();
            this.radiusVertices = aVertex.getRadiusVertices();
        }
Example #2
0
        /// <summary>
        ///We compare vertices by their location, cf. Location.equals()
        /// </summary>
        /// <param name="other"></param>
        /// <returns>True, if the two vertices reside at the same (unique) location</returns>
        public override bool Equals(Object other)
        {
            if (other == null)
            {
                return(false);
            }

            if (!(other is Vertex))
            {
                return(false);
            }

            AggregateLocation thisLocation  = this.getLocation();
            AggregateLocation otherLocation = ((Vertex)other).getLocation();

            if (thisLocation == null || otherLocation == null)
            {
                return(false);
            }
            return(thisLocation.Equals(otherLocation));
        }
Example #3
0
 public Vertex(int id, AggregateLocation aggregateLocation)
 {
     this.id       = id;
     this.location = aggregateLocation;
 }
Example #4
0
 public Vertex(int id, AbsoluteLocation absoluteLocation)
 {
     this.id       = id;
     this.location = new AggregateLocation(absoluteLocation);
 }