Package com.luciad.view.vertical
Interface ILcdVVModel
- All Known Implementing Classes:
ALcdVVModel
,TLcdVVTerrainModel
,TLcdVVTerrainProfileModel
public interface ILcdVVModel
A vertical view model.
It describes one main profile (typically a cross-section line) and zero or more sub-profiles
(typically additional information such as the terrain height or altitude zones).
The line section drawn between two successive points of the main profile is called a segment.
A sub-profile can contain
multiple points
per main profile segment,
defining a number of steps in the segment. The number of steps of the sub-profile is equal to
the number of sub-profile-points in a segment minus one.
The sub-profile point coordinates on the X-axis are defined by the stepLenghtRatio(int, int, int)
.
For each of the sub-profile points, it is possible to specify two (possibly coinciding)
altitude values: the minimum
and maximum altitude
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(ChangeListener aListener) ThechangeEvent
will be thrown when the models internal state has changed and recalculation is required.double
getDistance
(int aPointIndexA, int aPointIndexB) Returns the distance between the given two points.getPoint
(int aIndex) int
int
boolean
double
maxZ
(int aSubProfilePointIndex, int aSegmentIndex, int aSubProfileIndex) double
minZ
(int aSubProfilePointIndex, int aSegmentIndex, int aSubProfileIndex) void
removeChangeListener
(ChangeListener aListener) void
setPointZ
(int aIndex, double aZ, boolean isLastInRow) This method will be called whenever a point of the main-profile is being dragged so that its Z-dimension needs to be changed.float
stepLenghtRatio
(int aSubProfilePointIndex, int aSegmentIndex, int aSubProfileIndex) Returns where the given sub-profile point is positioned on the X-axis.int
subProfilePointCount
(int aSegmentIndex, int aSubProfileIndex) Returns the number of points (steps) of a sub-profile for the given main profile segment.
-
Method Details
-
getPointCount
int getPointCount()- Returns:
- the number of points on the main-profile.
-
isEditable
boolean isEditable()- Returns:
- true if editing of the main-profile (dragging the points) is allowed.
-
getPoint
- Parameters:
aIndex
- the index of the point in the main profile- Returns:
- a point at a given index on the main-profile.
- Throws:
IndexOutOfBoundsException
- See Also:
-
getSubProfileCount
int getSubProfileCount()- Returns:
- the number of sub-profiles in this
ILcdVVModel
.
-
subProfilePointCount
Returns the number of points (steps) of a sub-profile for the given main profile segment.- Parameters:
aSegmentIndex
- the index of the segment in the main profileaSubProfileIndex
- the index of the sub-profile to use- Returns:
- For a given segment and for one specific sub-profile, how many points are contained.
- Throws:
IndexOutOfBoundsException
-
minZ
double minZ(int aSubProfilePointIndex, int aSegmentIndex, int aSubProfileIndex) throws IndexOutOfBoundsException - Parameters:
aSubProfilePointIndex
- the index of the sub-profile point whose altitude to retrieveaSegmentIndex
- the main-profile segment of the sub-profile point A segment is a line-piece drawn between two main-profile points.aSubProfileIndex
- the index of the sub-profile to use- Returns:
- Should return the minimum altitude for one specific sub-profile-point. This minZ value will be used when the rendering mode for this sub-profile is BOTTOM_LINE, FILLED or POLYGON.
- Throws:
IndexOutOfBoundsException
-
maxZ
double maxZ(int aSubProfilePointIndex, int aSegmentIndex, int aSubProfileIndex) throws IndexOutOfBoundsException - Parameters:
aSubProfilePointIndex
- the index of the sub-profile point whose altitude to retrieveaSegmentIndex
- the main-profile segment to retrieve the step length for. A segment is a line-piece drawn between two main-profile points.aSubProfileIndex
- the index of the sub-profile to use- Returns:
- Should return the maximum altitude for one specific sub-profile-point. This maxZ value will be used when rendering mode for this sub-profile is TOP_LINE, FILLED or POLYGON.
- Throws:
IndexOutOfBoundsException
-
stepLenghtRatio
float stepLenghtRatio(int aSubProfilePointIndex, int aSegmentIndex, int aSubProfileIndex) throws IndexOutOfBoundsException Returns where the given sub-profile point is positioned on the X-axis. More precisely, this method returns the percentage on the X-axis the given sub-profile point represents on the given main profile segment. The sum of all the ratios for one sub-profile on the segment should be 1.- Parameters:
aSubProfilePointIndex
- defines the step. It is the point to the right of the step, so it can never be less than 1,aSegmentIndex
- the main-profile segment to retrieve the step length for. A segment is a line-piece drawn between two main-profile points.aSubProfileIndex
- the sub-profile to retrieve the step length ratio for- Returns:
- the percentage on the X-axis the given sub-profile step represents
- Throws:
IndexOutOfBoundsException
-
setPointZ
This method will be called whenever a point of the main-profile is being dragged so that its Z-dimension needs to be changed. If isLastInRow is false, the user should consider caching the Z-value.- Parameters:
aIndex
- The index of the point being dragged.aZ
- The new altitude for the point.isLastInRow
- While the user is dragging the point, this parameter will be false, at the release of the mouse this parameter will be true.- Throws:
IndexOutOfBoundsException
-
getDistance
double getDistance(int aPointIndexA, int aPointIndexB) Returns the distance between the given two points. This distance typically determines the X-axis of a VV panel. The distance unit can be meters, degrees, seconds, ...- Returns:
- the distance between two points
-
addChangeListener
ThechangeEvent
will be thrown when the models internal state has changed and recalculation is required. -
removeChangeListener
- See Also:
-