Package hec.map.streamAlignment
Class BaseStreamAlignment
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.map.streamAlignment.BaseStreamAlignment
- All Implemented Interfaces:
AsciiSerializable
,FieldAccessor
,MapObjectInterface
,StreamAlignmentIfc
,StreamAlignmentNodeIfc
,Serializable
,Cloneable
,Comparable
,Observer
,Modifiable
Stream coordinate system for model discretizations.
- See Also:
-
Field Summary
FieldsFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
connectAlignment
(double tolerance) Iterates through the stream alignment connecting the stream elements together.boolean
connectNode
(StreamElement elem, StreamNode node, double tol) void
connectReach
(StreamElement elem, double tol) createReach
(StreamPolyLine line, double tol) boolean
Deletes all elements, nodes, and reaches.boolean
deleteReach
(int index) boolean
deleteReach
(String name) void
deleteStreamNode
(StreamNode node) findDownstreamNode
(StreamElement stream, double coord) findNearestReach
(WorldPt wpt, WorldPt wptbest) finds the stream element nearest the given point.findNearestReach
(WorldPt wpt, WorldPt wptbest, double[] mindist) finds the stream element nearest the given point.findNearestStreamNode
(StreamElement stream, WorldPt wpt) findReach
(int idx) Finds a Reach that Contains the given World PointfindReach
(WorldPt wpt, double tol, StreamElement rch0) Finds a Reach that Contains the given World Point for creating reachesfindReach
(StreamNode node, WorldPt wpt, double tol) Finds a reach that contains the given world point but does not have the given node.findStreamJunction
(StreamElement stream, WorldPt wpt, double tol) look for the closest stream junction on the given stream near the given pointfindStreamNode
(StreamElement stream, WorldPt wpt, double tol) look for a stream node on the given stream near the given pointfindUpstreamNode
(StreamElement stream, double coord) Returns the coordinate reference system that describes the location of this map.Gets the Extent attribute of the MapObjectInterface objectgetFieldObject
(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.getJunction
(int id) long
Gets the MapIdentifier attribute of the MapObjectInterface objectint
getNode
(int id) getReach
(int id) getStreamSegmentsByNodes
(Vector nodeVec, Vector ndirVec, Vector segVec) develops a set of stream segments bounded by the given nodes, also determines whether the nodes are inflow points or outflow points relative to the bounded segments.void
init()
void
load()
Method to tell the Map Object to load its data into memorynewStreamNode
(StreamElement reach) boolean
readFile
(Identifier id) void
boolean
removeReachFromJunction
(String name, boolean upStream) void
void
Sets the Extent attribute of the MapObjectInterface objectboolean
setFieldObject
(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.boolean
setLocked
(int lockType) void
Sets the MapIdentifier attribute of the MapObjectInterface objectvoid
unload()
Method to tell the Map Object to unload, because the map is donevoid
boolean
writeFile
(Identifier id) boolean
Methods inherited from class hec.lang.NamedType
addModifiableListener, clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, toString, update, useRecursiveModifiedTest
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hec.map.MapObjectInterface
getName
Methods inherited from interface hec.map.streamAlignment.StreamAlignmentIfc
addModifiableListener, removeModifiableListener, setModified
-
Field Details
-
FILE_NAME
- See Also:
-
-
Constructor Details
-
BaseStreamAlignment
public BaseStreamAlignment()
-
-
Method Details
-
init
public void init() -
getElementVector
- Specified by:
getElementVector
in interfaceStreamAlignmentIfc
-
getNodeVector
- Specified by:
getNodeVector
in interfaceStreamAlignmentIfc
-
getDrawProp
- Specified by:
getDrawProp
in interfaceStreamAlignmentIfc
-
getJunctionVector
- Specified by:
getJunctionVector
in interfaceStreamAlignmentIfc
-
newStreamElement
- Specified by:
newStreamElement
in interfaceStreamAlignmentIfc
-
newStreamNode
- Specified by:
newStreamNode
in interfaceStreamAlignmentIfc
-
deleteStreamNode
- Specified by:
deleteStreamNode
in interfaceStreamAlignmentIfc
-
newStreamJunction
- Specified by:
newStreamJunction
in interfaceStreamAlignmentIfc
-
findNearestReach
finds the stream element nearest the given point. returns the nearest stream element or null ptnbest to the nearest point on the stream- Specified by:
findNearestReach
in interfaceStreamAlignmentIfc
-
findNearestReach
finds the stream element nearest the given point. returns the nearest stream element or null ptnbest to the nearest point on the stream, mindist must have a size of at least 1- Specified by:
findNearestReach
in interfaceStreamAlignmentIfc
-
findReach
Finds a Reach that Contains the given World Point- Specified by:
findReach
in interfaceStreamAlignmentIfc
-
findReach
Finds a reach that contains the given world point but does not have the given node. -
findReach
Finds a Reach that Contains the given World Point for creating reaches- Specified by:
findReach
in interfaceStreamAlignmentIfc
-
findReach
- Specified by:
findReach
in interfaceStreamAlignmentIfc
-
findReach
- Specified by:
findReach
in interfaceStreamAlignmentIfc
-
deleteReach
public boolean deleteReach(int index) -
deleteReach
- Specified by:
deleteReach
in interfaceStreamAlignmentIfc
-
deleteAll
public boolean deleteAll()Deletes all elements, nodes, and reaches.- Specified by:
deleteAll
in interfaceStreamAlignmentIfc
-
getReach
- Specified by:
getReach
in interfaceStreamAlignmentIfc
-
getJunction
- Specified by:
getJunction
in interfaceStreamAlignmentIfc
-
getNode
- Specified by:
getNode
in interfaceStreamAlignmentNodeIfc
-
createReach
- Specified by:
createReach
in interfaceStreamAlignmentIfc
-
connectAlignment
public void connectAlignment(double tolerance) Iterates through the stream alignment connecting the stream elements together.- Specified by:
connectAlignment
in interfaceStreamAlignmentIfc
-
connectReach
- Specified by:
connectReach
in interfaceStreamAlignmentIfc
-
connectNode
- Specified by:
connectNode
in interfaceStreamAlignmentIfc
-
unload
public void unload()Description copied from interface:MapObjectInterface
Method to tell the Map Object to unload, because the map is done- Specified by:
unload
in interfaceMapObjectInterface
-
readFile
-
writeFileGml
-
writeFile
-
setMapIdentifier
Description copied from interface:MapObjectInterface
Sets the MapIdentifier attribute of the MapObjectInterface object- Specified by:
setMapIdentifier
in interfaceMapObjectInterface
- Parameters:
id
- The new MapIdentifier value
-
getMapIdentifier
Description copied from interface:MapObjectInterface
Gets the MapIdentifier attribute of the MapObjectInterface object- Specified by:
getMapIdentifier
in interfaceMapObjectInterface
- Returns:
- The MapIdentifier value
-
setExtent
Description copied from interface:MapObjectInterface
Sets the Extent attribute of the MapObjectInterface object- Specified by:
setExtent
in interfaceMapObjectInterface
- Parameters:
rc
- The new Extent value
-
getExtent
Description copied from interface:MapObjectInterface
Gets the Extent attribute of the MapObjectInterface object- Specified by:
getExtent
in interfaceMapObjectInterface
- Returns:
- The Extent value
-
updateJunctionLocations
public void updateJunctionLocations()- Specified by:
updateJunctionLocations
in interfaceStreamAlignmentIfc
-
findStreamJunction
look for the closest stream junction on the given stream near the given point- Specified by:
findStreamJunction
in interfaceStreamAlignmentIfc
-
findStreamNode
look for a stream node on the given stream near the given point- Specified by:
findStreamNode
in interfaceStreamAlignmentIfc
-
findNearestStreamNode
- Specified by:
findNearestStreamNode
in interfaceStreamAlignmentIfc
-
findDownstreamNode
- Specified by:
findDownstreamNode
in interfaceStreamAlignmentIfc
-
findUpstreamNode
- Specified by:
findUpstreamNode
in interfaceStreamAlignmentIfc
-
removeReachFromJunction
- Specified by:
removeReachFromJunction
in interfaceStreamAlignmentIfc
-
getStreamSegmentsByNodes
develops a set of stream segments bounded by the given nodes, also determines whether the nodes are inflow points or outflow points relative to the bounded segments. An error message is returned if the set of nodes do not form a closed pool.- Specified by:
getStreamSegmentsByNodes
in interfaceStreamAlignmentIfc
-
getNextLineIndex
public int getNextLineIndex()- Specified by:
getNextLineIndex
in interfaceStreamAlignmentIfc
-
getNextDefaultElementName
- Specified by:
getNextDefaultElementName
in interfaceStreamAlignmentIfc
-
getFieldObject
Description copied from interface:FieldAccessor
This method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObject
in interfaceFieldAccessor
- Overrides:
getFieldObject
in classNamedType
- Parameters:
fld
- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessor
This allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObject
in interfaceFieldAccessor
- Overrides:
setFieldObject
in classNamedType
- Parameters:
fld
- The java field object representing the member field to be setfobj
- The data to set in that field- Returns:
- returns true if successful
-
setLocked
public boolean setLocked(int lockType) - Specified by:
setLocked
in interfaceStreamAlignmentIfc
-
load
Description copied from interface:MapObjectInterface
Method to tell the Map Object to load its data into memory- Specified by:
load
in interfaceMapObjectInterface
- Throws:
IOException
- Description of Exception
-
getLastModifiedTime
public long getLastModifiedTime() -
addPropertyChangeListener
- Specified by:
addPropertyChangeListener
in interfaceStreamAlignmentIfc
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListener
in interfaceStreamAlignmentIfc
-
setCoordinateReferenceSystem
- Specified by:
setCoordinateReferenceSystem
in interfaceStreamAlignmentIfc
-
getCoordinateReferenceSystem
Description copied from interface:MapObjectInterface
Returns the coordinate reference system that describes the location of this map. Users can return NULL if they don't have CoordinateReferenceSystem.- Specified by:
getCoordinateReferenceSystem
in interfaceMapObjectInterface
- Returns:
-