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 TypeMethodDescriptionvoidvoidconnectAlignment(double tolerance) Iterates through the stream alignment connecting the stream elements together.booleanconnectNode(StreamElement elem, StreamNode node, double tol) voidconnectReach(StreamElement elem, double tol) createReach(StreamPolyLine line, double tol) booleanDeletes all elements, nodes, and reaches.booleandeleteReach(int index) booleandeleteReach(String name) voiddeleteStreamNode(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) longGets the MapIdentifier attribute of the MapObjectInterface objectintgetNode(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.voidinit()voidload()Method to tell the Map Object to load its data into memorynewStreamNode(StreamElement reach) booleanreadFile(Identifier id) voidbooleanremoveReachFromJunction(String name, boolean upStream) voidvoidSets the Extent attribute of the MapObjectInterface objectbooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.booleansetLocked(int lockType) voidSets the MapIdentifier attribute of the MapObjectInterface objectvoidunload()Method to tell the Map Object to unload, because the map is donevoidbooleanwriteFile(Identifier id) booleanMethods 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, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.map.MapObjectInterface
getNameMethods 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:
getElementVectorin interfaceStreamAlignmentIfc
-
getNodeVector
- Specified by:
getNodeVectorin interfaceStreamAlignmentIfc
-
getDrawProp
- Specified by:
getDrawPropin interfaceStreamAlignmentIfc
-
getJunctionVector
- Specified by:
getJunctionVectorin interfaceStreamAlignmentIfc
-
newStreamElement
- Specified by:
newStreamElementin interfaceStreamAlignmentIfc
-
newStreamNode
- Specified by:
newStreamNodein interfaceStreamAlignmentIfc
-
deleteStreamNode
- Specified by:
deleteStreamNodein interfaceStreamAlignmentIfc
-
newStreamJunction
- Specified by:
newStreamJunctionin 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:
findNearestReachin 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:
findNearestReachin interfaceStreamAlignmentIfc
-
findReach
Finds a Reach that Contains the given World Point- Specified by:
findReachin 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:
findReachin interfaceStreamAlignmentIfc
-
findReach
- Specified by:
findReachin interfaceStreamAlignmentIfc
-
findReach
- Specified by:
findReachin interfaceStreamAlignmentIfc
-
deleteReach
public boolean deleteReach(int index) -
deleteReach
- Specified by:
deleteReachin interfaceStreamAlignmentIfc
-
deleteAll
public boolean deleteAll()Deletes all elements, nodes, and reaches.- Specified by:
deleteAllin interfaceStreamAlignmentIfc
-
getReach
- Specified by:
getReachin interfaceStreamAlignmentIfc
-
getJunction
- Specified by:
getJunctionin interfaceStreamAlignmentIfc
-
getNode
- Specified by:
getNodein interfaceStreamAlignmentNodeIfc
-
createReach
- Specified by:
createReachin interfaceStreamAlignmentIfc
-
connectAlignment
public void connectAlignment(double tolerance) Iterates through the stream alignment connecting the stream elements together.- Specified by:
connectAlignmentin interfaceStreamAlignmentIfc
-
connectReach
- Specified by:
connectReachin interfaceStreamAlignmentIfc
-
connectNode
- Specified by:
connectNodein interfaceStreamAlignmentIfc
-
unload
public void unload()Description copied from interface:MapObjectInterfaceMethod to tell the Map Object to unload, because the map is done- Specified by:
unloadin interfaceMapObjectInterface
-
readFile
-
writeFileGml
-
writeFile
-
setMapIdentifier
Description copied from interface:MapObjectInterfaceSets the MapIdentifier attribute of the MapObjectInterface object- Specified by:
setMapIdentifierin interfaceMapObjectInterface- Parameters:
id- The new MapIdentifier value
-
getMapIdentifier
Description copied from interface:MapObjectInterfaceGets the MapIdentifier attribute of the MapObjectInterface object- Specified by:
getMapIdentifierin interfaceMapObjectInterface- Returns:
- The MapIdentifier value
-
setExtent
Description copied from interface:MapObjectInterfaceSets the Extent attribute of the MapObjectInterface object- Specified by:
setExtentin interfaceMapObjectInterface- Parameters:
rc- The new Extent value
-
getExtent
Description copied from interface:MapObjectInterfaceGets the Extent attribute of the MapObjectInterface object- Specified by:
getExtentin interfaceMapObjectInterface- Returns:
- The Extent value
-
updateJunctionLocations
public void updateJunctionLocations()- Specified by:
updateJunctionLocationsin interfaceStreamAlignmentIfc
-
findStreamJunction
look for the closest stream junction on the given stream near the given point- Specified by:
findStreamJunctionin interfaceStreamAlignmentIfc
-
findStreamNode
look for a stream node on the given stream near the given point- Specified by:
findStreamNodein interfaceStreamAlignmentIfc
-
findNearestStreamNode
- Specified by:
findNearestStreamNodein interfaceStreamAlignmentIfc
-
findDownstreamNode
- Specified by:
findDownstreamNodein interfaceStreamAlignmentIfc
-
findUpstreamNode
- Specified by:
findUpstreamNodein interfaceStreamAlignmentIfc
-
removeReachFromJunction
- Specified by:
removeReachFromJunctionin 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:
getStreamSegmentsByNodesin interfaceStreamAlignmentIfc
-
getNextLineIndex
public int getNextLineIndex()- Specified by:
getNextLineIndexin interfaceStreamAlignmentIfc
-
getNextDefaultElementName
- Specified by:
getNextDefaultElementNamein interfaceStreamAlignmentIfc
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classNamedType- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin 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:
setLockedin interfaceStreamAlignmentIfc
-
load
Description copied from interface:MapObjectInterfaceMethod to tell the Map Object to load its data into memory- Specified by:
loadin interfaceMapObjectInterface- Throws:
IOException- Description of Exception
-
getLastModifiedTime
public long getLastModifiedTime() -
addPropertyChangeListener
- Specified by:
addPropertyChangeListenerin interfaceStreamAlignmentIfc
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfaceStreamAlignmentIfc
-
setCoordinateReferenceSystem
- Specified by:
setCoordinateReferenceSystemin interfaceStreamAlignmentIfc
-
getCoordinateReferenceSystem
Description copied from interface:MapObjectInterfaceReturns the coordinate reference system that describes the location of this map. Users can return NULL if they don't have CoordinateReferenceSystem.- Specified by:
getCoordinateReferenceSystemin interfaceMapObjectInterface- Returns:
-