mapteksdk.data.primitives.cell_properties module¶
Module containing the CellProperties Mixin class which provides support for Cell primitives.
-
class
mapteksdk.data.primitives.cell_properties.
CellProperties
¶ Bases:
object
A mixin class used by spatial objects to provide support for Cell Primitives.
Cell primitives are quadrilaterals defined by four points. Inheriting classes may impose restrictions on what quadrilaterals can be included in the object. See the documentation for inheriting classes for an explanation on how points are used to define cells for that object.
-
property
major_dimension_count
¶ The major dimension count of the Cell Network.
If the inheriting object is stored in row major order, then this will correspond to the row count. If stored in column major order then this will correspond to the column count.
-
property
minor_dimension_count
¶ The major dimension count of the Cell Network.
If the inheriting object is stored in row major order, then this will correspond to the column count. If stored in column major order then this will correspond to the row count.
-
property
cell_count
¶ The number of cells in the cell network.
By default this is equal to the (major_dimension_count - 1) x (minor_dimension_count - 1), however subclasses may override this function to return different values.
-
property
cell_visibility
¶ The visibility of the cells as a flat array.
This array will contain cell_count booleans - one for each cell. True indicates the cell is visible and False indicates the cell is invisible.
Notes
If set to an array which is too large, the excess values will be ignored. If set to an array which is too small, this will be padded with True.
-
property
cell_selection
¶ The selection of the cells as a flat array.
This array will contain cell_count booleans - one for each cell. True indicates the cell is selected and False indicates the cell is not selected.
Notes
If set to an array which is too large, the excess values will be ignored. If set to an array which is too small, this will be padded with False.
-
property
cell_point_count
¶ The number of points in the cell network, including invalid points for which point properties are not stored. This is equal to: major_dimension_count * minor_dimension_count.
If the object contains invalid points, then cell_point_count > point_count.
See also
mapteksdk.data.primitives.PointProperties.point_count
The count of valid points in the object.
-
property
cell_attributes
¶ Access custom cell attributes. These are arrays of values of the same type with one value for each cell.
Use Object.cell_attributes[attribute_name] to access a cell attribute called attribute_name. See PrimitiveAttributes for valid operations on cell attributes.
- Returns
Access to the cell attributes.
- Return type
- Raises
ValueError – If the type of the attribute is not supported.
-
save_cell_attribute
(attribute_name, data)¶ Create and/or edit the values of the call attribute attribute_name.
This is equivalent to Object.cell_attributes[attribute_name] = data.
- Parameters
attribute_name (str) – The name of attribute
data (array_like) – An array_like of length cell_count containing the values for attribute_name.
- Raises
Exception – If the object is opened in read-only mode.
ValueError – If the type of the attribute is not supported.
-
delete_cell_attribute
(attribute_name)¶ Delete a cell attribute by name.
This is equivalent to: cell_attributes.delete_attribute(attribute_name)
- Parameters
attribute_name (str) – The name of attribute
- Raises
Exception – If the object is opened in read-only mode.
ValueError – If the primitive type is not supported.
-
save
()¶ Saves cell primitives within inheriting object. This should be called during the save of an inheriting object. This function should not be called directly.
- Raises
Exception – If in read-only mode.
-
property