CrossSectionData Class

A class representing a collection of cross sections, spanning multiple reaches.

The collection orders the cross sections in two ways: If a reach only has one global cross-section, it is indexed by reachID and topoID. Other cross sections which have a location including a chainage, are ordered by locationID (reachID), topoID and chainage.

If a cross section gets its location updated after insertion into the collection, it needs to be removed and reinserted into the collection in order to be indexed correctly.

Events are not supported for COM interop, even though they appear in the type lib.

All physical quantities are in SI units.

Definition

Namespace: DHI.Mike1D.CrossSectionModule
Assembly: DHI.Mike1D.CrossSectionModule (in DHI.Mike1D.CrossSectionModule.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class CrossSectionData : AbstractDataAccess, 
	IEnumerable<ICrossSection>, IEnumerable
Inheritance
Object    AbstractDataAccess    CrossSectionData
Implements
IEnumerableICrossSection, IEnumerable

Constructors

CrossSectionDataInitializes a new instance of the CrossSectionData class

Properties

Connection Holder of read/write information
(Inherited from AbstractDataAccess)
Count returns the number of cross sections
CustomTypes List of custom types stored in the data object and that must be serialized.

A custom type is e.g. a user implemented structure or catchment model. In order to store information on the custom type in the .m1dx file, the system needs to know which custom types are being used, and they must be added to this list.


(Inherited from AbstractDataAccess)
ExtensionData Holds data from an extended DataContract
(Inherited from AbstractDataAccess)
RuntimeDiagnostics Diagnostics instance for the engine net. Used during runtime.
XSInterpolationType Defines how to interpolate a cross section.

Default value is ProcessedTopDown

Methods

Add Add the crossSection based on its location id and chainage and topoID.

If a cross section gets its location updated after insertion into the collection, it needs to be removed and reinserted into the collection.

AddGlobal Add the crossSection as a global crossSection for the entire reach.
Clear Removes all cross sections from this collection.
CreateRuntimeDiagnostics Create a runtime Diagnostics instance. This is called from the initializer which contains the cross section data since there is no initializer here (CrossSectionData is created during load, not initialization).
ElevateReachGlobal For all reach/topo-id's with only one cross section on chainage 0, elevate those cross sections to reach global
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
FindClosestCrossSection Find the closest cross section based on the location and topoID. If no cross section is found, null is returned.

If the reach defined in the location has a global cross section, the global cross section is returned. TODO: Consider returning null instead

This is meant for editing the cross sections, use Get to always get a cross section at a location.

FindCrossSection Find a cross section based on the location and topoID. If no cross section is found (chainage within Constants.LOCATION_EQUAL_TOLERANCE), null is returned.

If the reach defined in the location has a global cross section, the global cross section is returned. TODO: Consider returning null instead

This is meant for editing the cross sections, use Get to always get a cross section at a location.

FindCrossSectionsForLocationSpan Gets the cross-sections on locations inside span.

If excludeEnds is true, then cross sections must be strictly inside span (cross sections must be LOCATION_EQUAL_TOLERANCE inside span).

If excludeEnds is false, then cross sections on the end of the span will be included (within tolerance of LOCATION_EQUAL_TOLERANCE).

Uses StrictContains in the locationSpan to match. If there is a global cross section for this reachID, then an array of length 0 is returned.

FindGlobalCrossSection Find a cross section based on the reachID and topoID. The reach must have a global cross section defined, otherwise null is returned.
FindNeighborCrossSections Find the cross section's neighbors on the same reach and with the same topoID. If there is another cross section at that location already, return its neighbors. TODO: What to return if the branch only has one global cross section? Currently null.
GetCrossSection(ILocation, String) Get a cross section for a location, interpolated if none exists at the location. Returns null if a required interpolation is not possible. Returns a child if the location is found with in a location span of a cross section Processed data are found for the geometric interpolation
GetCrossSection(ILocation, String, Boolean) Get a cross section for a route location, interpolated if none exists all the location. Returns null if a required interpolation is not possible. Processed data can be found in 2 different ways (see below)
GetEnumerator Returns an enumerator that iterates through the collection.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetReachTopoIdEnumerable Return an enumerable that can iterate over all reach-id and topo-id combinations
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetVeryLargeCrossSection Get a standard very large cross section.
GetZExtremes returns the global extrema for z coordinates
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
MergeWith Merge other collection into this. If duplicates, this overrides other (not updated).
RemoveCrossSection Find and remove a cross section based on the location and topoID. If no cross section is found (chainage within Constants.LOCATION_EQUAL_TOLERANCE), false is returned. If the reach defined in the location has a global cross section, the global cross section is removed. TODO: Consider doing nothing
RemoveGlobalCrossSection Find and removes a cross section based on the reachID and topoID. The reach must have a global cross section defined, otherwise nothing happens.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Fields

_connection Protected holder of read/write info
(Inherited from AbstractDataAccess)

Extension Methods

AutoProcess Set the AutoProcess flag for all cross sections.
(Defined by CrossSectionExtensions)
Clone Clone all cross sections in CrossSectionData.
(Defined by CrossSectionExtensions)
GetCrossSections Find upstream and downstream cross section from crossSectionData at location. If none exists, create an return a GetVeryLargeCrossSection
(Defined by CrossSectionExtensions)
GetFloodMapCrossSectionsForReach Get all cross sections in crossSectionData within the reach specified by reachSpan. If no cross section exist at reach start/end chainage, and if a cross section exist upstream of start-chainage / downstream of end chainage, and if it is within digiPointSpan (if defined), those cross sections are included as well. Those cross sections are required in order to do proper cross line interpolation at start/end of reach span.
(Defined by FloodMapExtensions)
GetRiverBankLevels Get bank levels of cross sections inside span.
(Defined by CrossSectionExtensions)

See Also