org.jdelaunay.delaunay.geometries
Class Element

java.lang.Object
  extended by org.jdelaunay.delaunay.geometries.Element
Direct Known Subclasses:
ConstraintPolygon, DEdge, DPoint, DTriangle

public abstract class Element
extends Object

Abstract container for all the geometric elements that are used during the triangulation

Author:
Adelin Piau, Jean-Yves Martin, Erwan Bocher

Field Summary
static List<Integer> WEIGHTED_PROPERTIES
          The list that will contains the property values that will be used during the intersection.
 
Constructor Summary
Element()
          default constructor
Element(Element element)
          Constructor
Element(int property)
          Constructor
 
Method Summary
 void addProperty(int property)
          add property value.
abstract  boolean contains(com.vividsolutions.jts.geom.Coordinate c)
          Check if the coordinate is inside the element
abstract  boolean contains(DPoint aPoint)
          Check if the point is inside the element
abstract  BoundaryBox getBoundingBox()
          Computed bounding box
 int getExternalGID()
          get the external GID associated to the object (-1 if it has not been set)
 int getGID()
          get GID value
 double getHeight()
          Get the height of the element.
 int getMaxWeight(Map<Integer,Integer> map)
          Get the weight of this DEdge.
 int getProperty()
          get property value
 boolean hasProperty(int property)
          check for a specific type value
 void removeProperties()
          Remove all properties of the element
 void setExternalGID(int externalGID)
          Set an external GID, referencing this object for an external use, and eventually make correspondances with an external attributes table.
 void setGID(int gid)
          set GID value
 void setHeight(double height)
          Set the height of the element
 void setProperty(int property)
          set property value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEIGHTED_PROPERTIES

public static final List<Integer> WEIGHTED_PROPERTIES
The list that will contains the property values that will be used during the intersection. Note that it is up to you to fill the list with the property values you need. Property values must be managed as described in addProperty.

Constructor Detail

Element

public Element()
default constructor


Element

public Element(Element element)
Constructor


Element

public Element(int property)
Constructor

Method Detail

setGID

public final void setGID(int gid)
set GID value

Parameters:
gid -

getGID

public final int getGID()
get GID value


setProperty

public final void setProperty(int property)
set property value

Parameters:
property -

addProperty

public void addProperty(int property)
add property value. Properties are managed, with this method, by making a or operation on the bits of the underlying int. We are marking bits on an int, where each bit can be associated (externally) to a given property. To mark the bit number 5, for instance, you must add the property 16 (as the only bit set to 1 in 16 is the fifth one). If you add the property 25, you will set the bits 5, 3 and 2 to 1

Parameters:
property -

hasProperty

public final boolean hasProperty(int property)
check for a specific type value

Parameters:
property -

getProperty

public final int getProperty()
get property value

Returns:
property

removeProperties

public final void removeProperties()
Remove all properties of the element


getMaxWeight

public final int getMaxWeight(Map<Integer,Integer> map)
Get the weight of this DEdge. This property will be used, fo instance, by the forceConstraintIntegrity in ConstrainedMesh, to decide which Z value to use when computing a new intersection.

Parameters:
map -
Returns:
The maximal weight

setExternalGID

public final void setExternalGID(int externalGID)
Set an external GID, referencing this object for an external use, and eventually make correspondances with an external attributes table.

Parameters:
externalGID -

getExternalGID

public final int getExternalGID()
get the external GID associated to the object (-1 if it has not been set)

Returns:
The external gid for this element.

getHeight

public final double getHeight()
Get the height of the element.

Returns:
The height in double

setHeight

public final void setHeight(double height)
Set the height of the element

Parameters:
height -

getBoundingBox

public abstract BoundaryBox getBoundingBox()
Computed bounding box

Returns:
The boundary box of this element.

contains

public abstract boolean contains(DPoint aPoint)
Check if the point is inside the element

Parameters:
aPoint -
Returns:
bool

contains

public abstract boolean contains(com.vividsolutions.jts.geom.Coordinate c)
                          throws DelaunayError
Check if the coordinate is inside the element

Parameters:
c -
Returns:
bool
Throws:
DelaunayError


Copyright © 2014 IRSTV CNRS-FR-2488. All Rights Reserved.