Module fmeobjects :: Class FMEMultiArea
[hide private]
[frames] | no frames]

Class FMEMultiArea


init(MultipleInvocations)

Create an instance of a Multi-Area geometry object.

init()

Default FMEMultiArea constructor.

Returns: FMEMultiArea

init(multiArea)

Create a copy of the passed in Multi-Area geometry object.

Parameters

Returns: FMEMultiArea

Instance Methods [hide private]
 
__decIterRef__(args)
 
__incIterRef__(args)
 
__init__(MultipleInvocations)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__iter__(x)
iter(x)
None
appendPart(area)
This appends the area to the multi area.
None
appendParts(multiArea)
This appends the multi area passed in to the multi area.
FMEArea of a terminal type or None
getPartAt(index)
This method returns the area at the given index.
tuple
isInPlane(tolerance, normalVector, valD, recalculateD)
Works similarly to isPlanar(), but checks planarity with respect to given normal or given plane (if plane equation D is specified - see below).
bool
isPlanar(tolerance)
Returns True if this is planar within the given tolerance, and False otherwise.
int
numParts()
This returns the number of areas that make up this multi area.
None
offset(offsetPoint)
Offsets the geometry by the coords specified by offsetPoint.
FMEArea of a terminal type or None
removeLastPart()
This removes and returns the last area of the multi area.
None
rotate2D(center, angle)
The angle is CCW up from the horizontal and is measured in degrees.
None
scale(xscale, yscale, zscale)
Applies a scale factor to the multi area.

Inherited from FMEGeometry: __getObject__, __new__, boundingBox, boundingCube, bounds, clearMeasures, copyAttributesFromFeature, copyNameFromGeometry, copyTraitsFromGeometry, copyTraitsToFeature, deleteName, force2D, force3D, getArea, getMeasureNames, getName, getTrait, getTraitNames, getTraitNullMissingAndType, getTraitType, hasMeasures, hasName, is3D, isCollection, measureExists, removeMeasure, removeTraits, renameMeasure, setName, setTrait, setTraitNullWithType

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(MultipleInvocations)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

appendPart(area)

 

This appends the area to the multi area. If None is passed in, nothing will be appended. All areas in the multi area will be forced to have the same dimension. If any 3D areas exist, all 2D areas will be converted to 3D with a default Z value of 0.0.

Parameters:
  • area (FMEArea) - The area to be appended.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

appendParts(multiArea)

 

This appends the multi area passed in to the multi area. If None is passed in, nothing will be appended.

Parameters:
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

getPartAt(index)

 

This method returns the area at the given index. None is returned if the index is out of range.

Parameters:
  • index (int) - The index of the area part to return.
Returns: FMEArea of a terminal type or None
The area at the given index. Note: This method returns a terminal area type of the FMEArea; i.e. one of the leaf classes in the FMEArea inheritance graph. For example, a FMEPolygon is returned if the area truly is a polygon.
Raises:
  • FMEException - An exception is raised if an error occurred.

isInPlane(tolerance, normalVector, valD, recalculateD)

 

Works similarly to isPlanar(), but checks planarity with respect to given normal or given plane (if plane equation D is specified - see below). If given normal is the zero vector, the normal used to check the planarity is computed using Newell's method as in isPlanar(). valD is a reference to a value of D in the plane equation AX + BY + CZ = D. It can be used to make sure that multiple pieces lie in the same plane. If 'recalculateD' is set to False, the passed in value of D will be used in the calculation. If 'recalcualteD' is set to True, the passed in value is ignored and is instead automatically calculated (and returned in the second position of the returned tuple). A useful calling pattern for ensuring co-planarity is to get valD computed on the first call to the function setting recalculateD to True, and then use this value for future calls with recalculateD to False.

Parameters:
  • tolerance (float) - The tolerance to check against.
  • normalVector (tuple of 3 floats) - The normal used to check the planarity.
  • valD (float) - The value D from 'AX + BY + CZ = D'.
  • recalculateD (bool) - Whether to recalculate 'D' or not.
Returns: tuple
A tuple containing a boolean, tuple, and float representing: 1) Whether or not the multiarea is in plane; 2) The normal vector returned; and 3) The value 'D'.

Note: If recalculateD is False, the tuple returned will only contain the boolean and vector tuple (i.e. 'valD' is not returned).

isPlanar(tolerance)

 

Returns True if this is planar within the given tolerance, and False otherwise.

The planarity condition is computed by the following algorithm. The normal vector <A, B, C> is determined by the vertices of this area using Newell's method. For the first point (x', y', z') of this area, we compute D' = Ax' + By' + Cz'. Then, this area is planar if and only if every subsequent point (x, y, z) of this area gives a D = Ax + By + Cz, that is within the tolerance amount of D'. That is, | D - D' | <= tolerance.

If the specified tolerance is negative, then this method always returns True.

Parameters:
  • tolerance (float) - The tolerance to check against.
Returns: bool
Whether the multiarea is planar within the tolerance supplied.

numParts()

 

This returns the number of areas that make up this multi area.

Returns: int
The number of areas in multi area.

offset(offsetPoint)

 

Offsets the geometry by the coords specified by offsetPoint.

Parameters:
  • offsetPoint (FMEPoint) - The point to offset the coordinates of the geometry by.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

removeLastPart()

 

This removes and returns the last area of the multi area. If there are no areas in the multi area, it will return None.

Returns: FMEArea of a terminal type or None
The last area of the multi area. Note: This method returns a terminal area type of the FMEArea; i.e. one of the leaf classes in the FMEArea inheritance graph. For example, a FMEPolygon is returned if the area truly is a polygon.
Raises:
  • FMEException - An exception is raised if an error occurred.

rotate2D(center, angle)

 

The angle is CCW up from the horizontal and is measured in degrees.

Parameters:
  • center (FMEPoint) - The center of the rotation.
  • angle (float) - The angle in degrees.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

scale(xscale, yscale, zscale)

 

Applies a scale factor to the multi area. The zscale is ignored if geometry is 2D.

Parameters:
  • xscale (float) - The x scale factor.
  • yscale (float) - The y scale factor.
  • zscale (float) - The z scale factor.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.