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

Class FMEAggregate

 object --+    
          |    
FMEGeometry --+
              |
             FMEAggregate

init(MultipleInvocations)

Create an instance of an Aggregate geometry object.

init()

Default FMEAggregate constructor.

Returns: FMEAggregate

init(aggregate)

Create a copy of the passed in Aggregate geometry object.

Parameters

Returns: FMEAggregate

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(geometry)
This appends the geometry to the aggregate.
None
appendPartInLocalCoordinates(geometry)
This appends the geometry to the aggregate.
None
appendParts(aggregate)
This appends the aggregate of geometries passed in to the aggregate.
int
getAppearanceReference(front)
This method returns the appearance reference within the Library associated with this aggregate.
int or None
getGeometryDefinitionReference()
This method will get the geometry definition reference associated with this aggregate, if this aggregate is a geometry instance.
tuple of floats or None
getGeometryInstanceLocalOrigin()
This method retrieves the local origin associated with the geometry instance, if this aggregate is a geometry instance.
list of lists of floats or None
getGeometryInstanceMatrix()
This method retrieves the geometry instance transformation matrix associated with the geometry instance, if this aggregate is a geometry instance.
bool
getMultipleGeometryFlag()
This method determines if the aggregate contains a MultipleGeometry, that is, whether the aggregate is structured in a way such that each part is its own geometry separate from the other parts in the aggregate.
FMEGeometry of a terminal type or None
getPartAt(index)
This method returns the geometry at the given index.
FMEGeometry of a terminal type or None
getPartAtInLocalCoordinates(index)
This method returns the geometry at the given index.
list of lists of floats
getTransformationMatrix()
Gets this aggregate's transformation matrix.
bool
hasGeometryInstance(recursive)
This method returns True if this aggregate contains an instance of a geometry definition.
bool
hasTransformationMatrix()
This method determines if the aggregate has a transformation matrix or not.
bool
isAMulti()
This method determines if the aggregate's parts conform to a FMEMultiCurve, FMEMultiArea, or FMEMultiText, representation.
bool
isSimpleAggregate()
This method determines if the aggregate is a 'simple' aggregate.
int
numParts()
This returns the number of geometries that make up this aggregate.
None
offset(point)
Offsets the geometry by the coords specified by point.
FMEGeometry of a terminal type or None
removeLastPart()
This removes and returns the last geometry of the aggregate.
None
removeTransformationMatrix()
Removes this aggregate's transformation matrix.
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 aggregate.
None
setAppearanceReference(appearanceRef, front)
This method associates an appearance within the Library with this aggregate.
None
setGeometryDefinitionReference(gdReference)
This method sets the geometry definition reference of this aggregate, if this aggregate is not currently a geometry instance, this call will cause the aggregate to destroy all owned parts and turn the aggregate into a geometry instance.
None
setGeometryInstanceLocalOrigin(x, y, z)
This method sets the geometry instance local origin of this aggregate.
None
setGeometryInstanceMatrix(matrix)
This method sets the geometry instance transformation matrix of this aggregate.
None
setMultipleGeometryFlag(isMultiple)
This method sets whether the aggregate contains a MultipleGeometry, that is, whether the aggregate is structured in a way such that each part is its own geometry separate from the other parts in the aggregate.
None
setTransformationMatrix(matrix)
Sets this aggregate's transformation matrix, replacing the existing matrix if it exists.

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(geometry)

 

This appends the geometry to the aggregate. If None is passed in, nothing will be appended. Note that the geometries stored in an aggregate may have different dimensions. Calling this method will implicitly apply and clear any matrix associated with this aggregate.

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

appendPartInLocalCoordinates(geometry)

 

This appends the geometry to the aggregate. If None is passed in, nothing will be appended. Note that the geometries stored in an aggregate may have different dimensions. Calling this method will leave any matrix associated with the aggregate intact, meaning the new part will have any matrix applied.

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

appendParts(aggregate)

 

This appends the aggregate of geometries passed in to the aggregate. If None is passed in, nothing will be appended. Calling this method will implicitly apply and clear any matrix associated with this aggregate.

Parameters:
  • aggregate (FMEAggregate) - The aggregate of geometries to be appended.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

getAppearanceReference(front)

 

This method returns the appearance reference within the Library associated with this aggregate. The front parameter controls whether this query should return the front or the back appearance reference. Both can be fetched independently. If this aggregate is a regular aggregate with no geometry instance, a FMEException will be thrown.

Parameters:
  • front (bool) - Boolean indicting whether the appearance reference should be retrieved for the front or back of the aggregate.
Returns: int
The unique appearance reference for this appearance.

getGeometryDefinitionReference()

 

This method will get the geometry definition reference associated with this aggregate, if this aggregate is a geometry instance. If this aggregate is a regular aggregate with no geometry instance, None will be returned.

Returns: int or None
The geometry definition reference, or None.

getGeometryInstanceLocalOrigin()

 

This method retrieves the local origin associated with the geometry instance, if this aggregate is a geometry instance. This method will return None if the aggregate is a regular aggregate.

Returns: tuple of floats or None
The local origin, formatted (ddd) or None.

getGeometryInstanceMatrix()

 

This method retrieves the geometry instance transformation matrix associated with the geometry instance, if this aggregate is a geometry instance. This method will return None if the aggregate either contains no such matrix or is a regular aggregate.

Returns: list of lists of floats or None
The geometry instance transformation matrix, formatted [[dddd][dddd][dddd]] or None.

getMultipleGeometryFlag()

 

This method determines if the aggregate contains a MultipleGeometry, that is, whether the aggregate is structured in a way such that each part is its own geometry separate from the other parts in the aggregate. As a result, it is possible for an aggregate of 1 part to return true since it is about the structure of the aggregate, and not the content.

Returns: bool
Returns True if the aggregate contains a multiple geometry and False otherwise.

getPartAt(index)

 

This method returns the geometry at the given index. None is returned if the index is out of range. For an aggregate with a transformation matrix, the transformed geometry is returned.

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

getPartAtInLocalCoordinates(index)

 

This method returns the geometry at the given index. None is returned if the index is out of range. For an aggregate with a transformation matrix, it will NOT be applied to the part.

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

getTransformationMatrix()

 

Gets this aggregate's transformation matrix. If the aggregate does not have such a matrix, an identity matrix is returned. Only the top three rows of the matrix will be returned, as the bottom row is always [ 0 0 0 1 ].

Returns: list of lists of floats
The aggregate's tranformation matrix, formatted [[dddd][dddd][dddd]].

hasGeometryInstance(recursive)

 

This method returns True if this aggregate contains an instance of a geometry definition. If the parameter recursive is set to False, it will only test this aggregate itself. If recursive is equal to True, then this method will return True if any part contained in this aggregate at any level is a geometry instance.

Parameters:
  • recursive (bool) - To recurse or not.
Returns: bool
Whether there is geometry instance.

hasTransformationMatrix()

 

This method determines if the aggregate has a transformation matrix or not.

Returns: bool
Returns True if this aggregate has a transformation matrix, and False otherwise.

isAMulti()

 

This method determines if the aggregate's parts conform to a FMEMultiCurve, FMEMultiArea, or FMEMultiText, representation.

Returns: bool
This means that it will only return true if the aggregate contains:
  • Arcs, Lines, Paths, and nothing else.
  • Polygons, Ellipses, Donuts, and nothing else.
  • Text objects and nothing else.
  • Points and nothing else. This returns false for empty aggregates.

isSimpleAggregate()

 

This method determines if the aggregate is a 'simple' aggregate. i.e. that none of its geometries are an Aggregate or Multi.

Returns: bool
Returns True if this aggregate is simple, and False otherwise.

numParts()

 

This returns the number of geometries that make up this aggregate.

Returns: int
The number of geometries in aggregate.

offset(point)

 

Offsets the geometry by the coords specified by point. The offset will be applied to the transformation matrix associated with this aggregate. If the aggregate has no matrix, a new matrix will be created.

Parameters:
  • point (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 geometry of the aggregate. If there are no geometries in the aggregate, it will return None. Calling this method will implicitly apply and clear any matrix associated with this aggregate.

Returns: FMEGeometry of a terminal type or None
The last geometry of the aggregate. Note: This method returns a terminal geometry type of the FMEGeometry; i.e. one of the leaf classes in the FMEGeometry inheritance graph. For example, a FMEPoint is returned if the geometry truly is a point.
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. The rotation will be applied to the transformation matrix associated with this aggregate. If the aggregate has no matrix, a new matrix will be created.

Parameters:
  • center (FMEPoint) - The center of the aggregate's matrix.
  • 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 aggregate. The scale factor will be applied to the transformation matrix associated with this aggregate. The zscale is ignored if geometry is 2D. If the aggregate has no matrix, a new matrix will be created.

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.

setAppearanceReference(appearanceRef, front)

 

This method associates an appearance within the Library with this aggregate. This is done by passing in the unique appearance reference for this appearance. Subsequent calls to this method on the same side, will override the previous appearance used with the new appearance passed in. An appearance reference of '0' represents the default appearance. Interpretation of the default appearance is left to the consumer of this geometry. When set at this FMEAggregate level, the appearance represents the default appearance to apply when the contained surfaces use the default appearance instead of a specific appearance. Contained surfaces may be found within nested aggregates, geometry instances that reference geometries containing surfaces, or as surfaces or multi-surfaces. The second parameter controls whether this action should take place on the front of the contained surfaces or the back. Both can be set independently. The appearanceRef should be a valid reference to a definition stored in the FMELibrary. If the reference was not found in the library, it will still attach the reference to the instance, but will throw a FMEException. This is an unhealthy situation as it represents a 'dangling reference'.

Parameters:
  • appearanceRef (int) - The unique appearance reference for this appearance.
  • front (bool) - Boolean indicting whether the appearance reference should be set for the front or back of the aggregate.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred or the reference was not found in the library and a dangling reference was attached.

setGeometryDefinitionReference(gdReference)

 

This method sets the geometry definition reference of this aggregate, if this aggregate is not currently a geometry instance, this call will cause the aggregate to destroy all owned parts and turn the aggregate into a geometry instance. If gdReference reference was not found in the library, it will still attach the reference to the instance, but will this is an unhealthy situation as it represents a 'dangling reference' and the user should decide to remedy this by either adding a Geometry Definition with that exact reference to the library, or else remove the reference from this geometry instance.

Parameters:
  • gdReference (int) - A valid geometry definition reference to a geometry definition stored in the FMELibrary.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred or the reference was not found in the library and a dangling reference was attached.

setGeometryInstanceLocalOrigin(x, y, z)

 

This method sets the geometry instance local origin of this aggregate. If this aggregate is not currently a geometry instance, this call will cause the aggregate to destroy all owned parts and turn the aggregate into a geometry instance. The local origin is the origin from which the geometry instance transformation matrix is applied. The default local origin is (0,0,0).

Parameters:
  • x (float) - The x point of the local origin.
  • y (float) - The y point of the local origin.
  • z (float) - The z point of the local origin.
Returns: None

setGeometryInstanceMatrix(matrix)

 

This method sets the geometry instance transformation matrix of this aggregate. If this aggregate is not currently a geometry instance, this call will cause the aggregate to destroy all owned parts and turn the aggregate into a geometry instance. The transformation matrix is applied to the geometry definition from the local origin to obtain the instantiated geometry.

Parameters:
  • matrix (list of lists of floats) - The geometry instance transformation matrix, formatted [[dddd][dddd][dddd]].
Returns: None

setMultipleGeometryFlag(isMultiple)

 

This method sets whether the aggregate contains a MultipleGeometry, that is, whether the aggregate is structured in a way such that each part is its own geometry separate from the other parts in the aggregate.

Parameters:
  • isMultiple (bool) - True if the aggregate contains a MutlipleGeometry, False otherwise
Returns: None

setTransformationMatrix(matrix)

 

Sets this aggregate's transformation matrix, replacing the existing matrix if it exists. Only three rows are expected in the input array, as a bottom row of [ 0 0 0 1 ] is assumed.

Parameters:
  • matrix (list of lists of floats) - The transformation matrix, formatted [[dddd][dddd][dddd]].
Returns: None