Location Class

Class describing a location in a network. ,'s are not allowed in the ID.

Definition

Namespace: DHI.Mike1D.Generic
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class Location : ILocation, IComparable, 
	ICloneable, IEquatable<ILocation>, IExtensibleDataObject
Inheritance
Object    Location
Derived
Implements
ILocation, ICloneable, IComparable, IEquatableILocation, IExtensibleDataObject

Constructors

Location Constructor
Location(String, Double) Constructor

Properties

Chainage Chainage. Unit: [m]
ExtensionData Data from an extended DataContract not recognized here
ID Identification name

Methods

CalculateRatio Calculate the ratio of the inter Location position in between the start (sc) and end (ec) locations, such that v = (1-ratio)*v_sc + ratio*v_ec If inter is not in between sc and ec, ratio can be negative or larger than one.
Clone Returns a deep clone of this object
CompareTo Compares two ILocations. First id is compared, secondly chainage. This can be used to sort the ILocations, first alphabetically, secondly by chainage.
CreateSpanAroundLocation Create a LocationSpan around the given location, that goes startDist up and endDist down from the chainage of the location. Span will go from location.Chainage-startDist to location.Chainage+endDist.
Equals(ILocation) Indicates whether the current object is equal to another object of the same type. The Location chainage must be within LOCATION_EQUAL_TOLERANCE.
Equals(Object) Determines whether the specified Object is equal to the current Object.
(Overrides ObjectEquals(Object))
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
FromString(String) This method is made to get back from a Location.ToString(). It is therefor very important that any changes in ToString are reflected in this method.
FromString(String, Boolean) This method is made to get back from a Location.ToString(). It is therefor very important that any changes in ToString are reflected in this method. The flag specifies whether or not the hyphens around the ID is wished kept or not.
GetHashCode Serves as a hash function for a particular type.
(Overrides ObjectGetHashCode)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IDCompareTo Compare the ID with the others ID.
IDEquals(ILocation) Check if the ID equals the others ID
IDEquals(ILocationSpan) Check if the ID equals the others ID, case ignored (culture invariant)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToString This method os important when creating a node id from a location. It is important to act in _chainage == Constants.DELETEVALUE since this is how rivers are connected to pipes.
(Overrides ObjectToString)
ToStringInUserUnits Gives the textual representation of the string in user units.

Fields

_chainage Position along the reach.
_id Identification name

Extension Methods

ChainageAsDiagnosticsValue Get chainage as DiagnosticsValue (includes unit)
(Defined by GenericExtensions)
ChainageEquals Returns true if the chainage equals, withing LOCATION_EQUAL_TOLERANCE
(Defined by GenericExtensions)
ChainageEquals Returns true if the chainage equals, withing tolerance
(Defined by GenericExtensions)
ChainageIsAfter Returns true if the chainage is after, and more than LOCATION_EQUAL_TOLERANCE after

This is consistent with the ChainageEquals, so that any chainage will only return true for one of the ChainageIsBefore, ChainageEquals, ChainageIsAfter


(Defined by GenericExtensions)
ChainageIsAfter Returns true if the chainage is after, and more than tolerance after

This is consistent with the ChainageEquals, so that any chainage will only return true for one of the ChainageIsBefore, ChainageEquals, ChainageIsAfter


(Defined by GenericExtensions)
ChainageIsBefore Returns true if the chainage is before, and more than LOCATION_EQUAL_TOLERANCE before

This is consistent with the ChainageEquals, so that any chainage will only return true for one of the ChainageIsBefore, ChainageEquals, ChainageIsAfter


(Defined by GenericExtensions)
ChainageIsBefore Returns true if the chainage is before, and more than tolerance before

This is consistent with the ChainageEquals, so that any chainage will only return true for one of the ChainageIsBefore, ChainageEquals, ChainageIsAfter


(Defined by GenericExtensions)

See Also