本文整理汇总了Java中com.vividsolutions.jts.geomgraph.Position.RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java Position.RIGHT属性的具体用法?Java Position.RIGHT怎么用?Java Position.RIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.vividsolutions.jts.geomgraph.Position
的用法示例。
在下文中一共展示了Position.RIGHT属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRightmostSideOfSegment
private int getRightmostSideOfSegment(DirectedEdge de, int i) {
Edge e = de.getEdge();
Coordinate coord[] = e.getCoordinates();
if (i < 0 || i + 1 >= coord.length) {
return -1;
}
if (coord[i].y == coord[i + 1].y) {
return -1; // indicates edge is parallel to x-axis
}
int pos = Position.LEFT;
if (coord[i].y < coord[i + 1].y) {
pos = Position.RIGHT;
}
return pos;
}
示例2: computeRingBufferCurve
private void computeRingBufferCurve(Coordinate[] inputPts, int side, OffsetSegmentGenerator segGen) {
// simplify input line to improve performance
double distTol = simplifyTolerance(this.distance);
// ensure that correct side is simplified
if (side == Position.RIGHT) {
distTol = -distTol;
}
Coordinate[] simp = BufferInputLineSimplifier.simplify(inputPts, distTol);
// Coordinate[] simp = inputPts;
int n = simp.length - 1;
segGen.initSideSegments(simp[n - 1], simp[0], side);
for (int i = 1; i <= n; i++) {
boolean addStartPoint = i != 1;
segGen.addNextSegment(simp[i], addStartPoint);
}
segGen.closeRing();
}
示例3: computeRingBufferCurve
private void computeRingBufferCurve(Coordinate[] inputPts, int side, OffsetSegmentGenerator segGen) {
// simplify input line to improve performance
double distTol = simplifyTolerance(distance);
// ensure that correct side is simplified
if (side == Position.RIGHT)
distTol = -distTol;
Coordinate[] simp = BufferInputLineSimplifier.simplify(inputPts, distTol);
// Coordinate[] simp = inputPts;
int n = simp.length - 1;
segGen.initSideSegments(simp[n - 1], simp[0], side);
for (int i = 1; i <= n; i++) {
boolean addStartPoint = i != 1;
segGen.addNextSegment(simp[i], addStartPoint);
}
segGen.closeRing();
}
示例4: addNextSegment
public void addNextSegment(Coordinate p, boolean addStartPoint) {
// s0-s1-s2 are the coordinates of the previous segment and the current one
s0 = s1;
s1 = s2;
s2 = p;
seg0.setCoordinates(s0, s1);
computeOffsetSegment(seg0, side, distance, offset0);
seg1.setCoordinates(s1, s2);
computeOffsetSegment(seg1, side, distance, offset1);
// do nothing if points are equal
if (s1.equals(s2)) return;
int orientation = CGAlgorithms.computeOrientation(s0, s1, s2);
boolean outsideTurn =
(orientation == CGAlgorithms.CLOCKWISE && side == Position.LEFT)
|| (orientation == CGAlgorithms.COUNTERCLOCKWISE && side == Position.RIGHT);
if (orientation == 0) { // lines are collinear
addCollinear(addStartPoint);
} else if (outsideTurn) {
addOutsideTurn(orientation, addStartPoint);
} else { // inside turn
addInsideTurn(orientation, addStartPoint);
}
}
示例5: computeRingBufferCurve
private void computeRingBufferCurve(Coordinate[] inputPts, int side, OffsetSegmentGenerator segGen)
{
// simplify input line to improve performance
double distTol = simplifyTolerance(distance);
// ensure that correct side is simplified
if (side == Position.RIGHT)
distTol = -distTol;
Coordinate[] simp = BufferInputLineSimplifier.simplify(inputPts, distTol);
// Coordinate[] simp = inputPts;
int n = simp.length - 1;
segGen.initSideSegments(simp[n - 1], simp[0], side);
for (int i = 1; i <= n; i++) {
boolean addStartPoint = i != 1;
segGen.addNextSegment(simp[i], addStartPoint);
}
segGen.closeRing();
}
示例6: merge
/**
* merge updates only the NULL attributes of this object
* with the attributes of another.
*/
public void merge(TopologyLocation gl)
{
// if the src is an Area label & and the dest is not, increase the dest to be an Area
if (gl.location.length > location.length) {
int [] newLoc = new int[3];
newLoc[Position.ON] = location[Position.ON];
newLoc[Position.LEFT] = Location.NONE;
newLoc[Position.RIGHT] = Location.NONE;
location = newLoc;
}
for (int i = 0; i < location.length; i++) {
if (location[i] == Location.NONE && i < gl.location.length)
location[i] = gl.location[i];
}
}
示例7: addNextSegment
public void addNextSegment(Coordinate p, boolean addStartPoint) {
// s0-s1-s2 are the coordinates of the previous segment and the current one
this.s0 = this.s1;
this.s1 = this.s2;
this.s2 = p;
this.seg0.setCoordinates(this.s0, this.s1);
this.computeOffsetSegment(this.seg0, this.side, this.distance, this.offset0);
this.seg1.setCoordinates(this.s1, this.s2);
this.computeOffsetSegment(this.seg1, this.side, this.distance, this.offset1);
// do nothing if points are equal
if (this.s1.equals(this.s2)) {
return;
}
int orientation = CGAlgorithms.computeOrientation(this.s0, this.s1, this.s2);
boolean outsideTurn =
(orientation == CGAlgorithms.CLOCKWISE && this.side == Position.LEFT)
|| (orientation == CGAlgorithms.COUNTERCLOCKWISE && this.side == Position.RIGHT);
if (orientation == 0) { // lines are collinear
this.addCollinear(addStartPoint);
} else if (outsideTurn) {
this.addOutsideTurn(orientation, addStartPoint);
} else { // inside turn
this.addInsideTurn(orientation, addStartPoint);
}
}
示例8: addNextSegment
public void addNextSegment(Coordinate p, boolean addStartPoint)
{
// s0-s1-s2 are the coordinates of the previous segment and the current one
s0 = s1;
s1 = s2;
s2 = p;
seg0.setCoordinates(s0, s1);
computeOffsetSegment(seg0, side, distance, offset0);
seg1.setCoordinates(s1, s2);
computeOffsetSegment(seg1, side, distance, offset1);
// do nothing if points are equal
if (s1.equals(s2)) return;
int orientation = CGAlgorithms.computeOrientation(s0, s1, s2);
boolean outsideTurn =
(orientation == CGAlgorithms.CLOCKWISE && side == Position.LEFT)
|| (orientation == CGAlgorithms.COUNTERCLOCKWISE && side == Position.RIGHT);
if (orientation == 0) { // lines are collinear
addCollinear(addStartPoint);
}
else if (outsideTurn)
{
addOutsideTurn(orientation, addStartPoint);
}
else { // inside turn
addInsideTurn(orientation, addStartPoint);
}
}
示例9: flip
public void flip()
{
if (location.length <= 1) return;
int temp = location[Position.LEFT];
location[Position.LEFT] = location[Position.RIGHT];
location[Position.RIGHT] = temp;
}
示例10: addPolygon
private void addPolygon(Polygon p) {
double offsetDistance = this.distance;
int offsetSide = Position.LEFT;
if (this.distance < 0.0) {
offsetDistance = -this.distance;
offsetSide = Position.RIGHT;
}
LinearRing shell = (LinearRing) p.getExteriorRing();
Coordinate[] shellCoord = CoordinateArrays.removeRepeatedPoints(shell.getCoordinates());
// optimization - don't bother computing buffer
// if the polygon would be completely eroded
if (this.distance < 0.0 && this.isErodedCompletely(shell, this.distance)) {
return;
}
// don't attemtp to buffer a polygon with too few distinct vertices
if (this.distance <= 0.0 && shellCoord.length < 3) {
return;
}
this.addPolygonRing(
shellCoord,
offsetDistance,
offsetSide,
Location.EXTERIOR,
Location.INTERIOR);
for (int i = 0; i < p.getNumInteriorRing(); i++) {
LinearRing hole = (LinearRing) p.getInteriorRingN(i);
Coordinate[] holeCoord = CoordinateArrays.removeRepeatedPoints(hole.getCoordinates());
// optimization - don't bother computing buffer for this hole
// if the hole would be completely covered
if (this.distance > 0.0 && this.isErodedCompletely(hole, -this.distance)) {
continue;
}
// Holes are topologically labelled opposite to the shell, since
// the interior of the polygon lies on their opposite side
// (on the left, if the hole is oriented CCW)
this.addPolygonRing(
holeCoord,
offsetDistance,
Position.opposite(offsetSide),
Location.INTERIOR,
Location.EXTERIOR);
}
}
示例11: addPolygon
private void addPolygon(Polygon p) {
double offsetDistance = distance;
int offsetSide = Position.LEFT;
if (distance < 0.0) {
offsetDistance = -distance;
offsetSide = Position.RIGHT;
}
LinearRing shell = (LinearRing) p.getExteriorRing();
Coordinate[] shellCoord = CoordinateArrays.removeRepeatedPoints(shell.getCoordinates());
// optimization - don't bother computing buffer
// if the polygon would be completely eroded
if (distance < 0.0 && isErodedCompletely(shell, distance))
return;
// don't attemtp to buffer a polygon with too few distinct vertices
if (distance <= 0.0 && shellCoord.length < 3)
return;
addPolygonRing(
shellCoord,
offsetDistance,
offsetSide,
Location.EXTERIOR,
Location.INTERIOR);
for (int i = 0; i < p.getNumInteriorRing(); i++) {
LinearRing hole = (LinearRing) p.getInteriorRingN(i);
Coordinate[] holeCoord = CoordinateArrays.removeRepeatedPoints(hole.getCoordinates());
// optimization - don't bother computing buffer for this hole
// if the hole would be completely covered
if (distance > 0.0 && isErodedCompletely(hole, -distance))
continue;
// Holes are topologically labelled opposite to the shell, since
// the interior of the polygon lies on their opposite side
// (on the left, if the hole is oriented CCW)
addPolygonRing(
holeCoord,
offsetDistance,
Position.opposite(offsetSide),
Location.INTERIOR,
Location.EXTERIOR);
}
}
示例12: getDelta
public int getDelta(int geomIndex)
{
return depth[geomIndex][Position.RIGHT] - depth[geomIndex][Position.LEFT];
}
示例13: setLocations
public void setLocations(int on, int left, int right) {
location[Position.ON] = on;
location[Position.LEFT] = left;
location[Position.RIGHT] = right;
}
示例14: TopologyLocation
/**
* Constructs a TopologyLocation specifying how points on, to the left of, and to the
* right of some GraphComponent relate to some Geometry. Possible values for the
* parameters are Location.NULL, Location.EXTERIOR, Location.BOUNDARY,
* and Location.INTERIOR.
* @see Location
*/
public TopologyLocation(int on, int left, int right) {
init(3);
location[Position.ON] = on;
location[Position.LEFT] = left;
location[Position.RIGHT] = right;
}