Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IAligner

The IAligner graph node interface.

IAligner nodes allow to automatically arrange a number of child sub-graphs along one dedicated main axis (see SetAxis()), in either ascending or descending order (see SetOrder()). By design, each individual child represents a closed sub-graph for which the common bounding volume is calculated when the aligner performs its layout procedure. In other words, if for example five plane geometry nodes should be arranged, each of these planes must be in a separate child sub-graph. If two or more planes are within the same child sub-graph, their bounding volumes are combined, and this combined volume is used for arranging the respective child graph.

For the remaining two axes and the dedicated main axis set via SetAxis(), it is possible to specify an alignment mode so that the linearly aligned children are also aligned to either side or center of the aligner. By default, these object alignment modes (which can be set via SetObjectAlignment()) are set to UNDEFINED, which means that no alignment is done for any axis other than the main axis.

It is also possible to specify a minimum and maximum container size (see SetMinContainerSize() and SetMaxContainerSize(), respectively), together with a container alignment property (see SetContainerAlignment()) to control the actual size and pivot point of the resulting layout container.

Aligned objects can be arranged with an optional spacing parameter (see SetSpacing()), which represents the space left out between two consecutive child sub-graphs.

In addition, it is possible to specify padding values (see SetPadding()) to add an extra border to the resulting container after layouting.

See also Graph::IBoundingBox.


Table members

Methods


GetNodeInterface()

Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Murl.Graph.INode GetNodeInterface()

Returns
Murl.Graph.INode The constant Graph::INode interface, or null if not available

GetTransformInterface()

Get the constant Graph::ITransform interface. This method returns a constant pointer to the node's Graph::ITransform interface, to be able to query the node's transformation matrix and depth order.

Murl.Graph.ITransform GetTransformInterface()

Returns
Murl.Graph.ITransform The constant Graph::ITransform interface, or null if not available

SetInstanceProcessingEnabled(enabled)

Enable/disable instance processing. If enabled, child nodes that implement the IInstance interface are processed separately, so that all their individual replications are treated as if they were direct children of the aligner. Note that in this case, activating or deactivating the instance node itself has no effect; if all replications of an instance should be made invisible, one must iterate over all the instance's children manually. By default, instance processing is enabled.

Boolean SetInstanceProcessingEnabled(Boolean enabled)

Parameters
enabledIf true, instance processing is enabled.
Returns
Boolean true if successful.

IsInstanceProcessingEnabled()

Check if instance processing is enabled.

Boolean IsInstanceProcessingEnabled()

Returns
Boolean true if enabled.

SetAxis(axis)

Set the alignment axis. This method can be used to set the aligner's main axis. When performing its layout operation, the position of each child sub-graph is increased or decreased (depending on the order defined by SetOrder()), but only for the given axis. The other two coordinates of each sub-graph are left unchanged, unless explicitly set via SetObjectAlignment().

Boolean SetAxis(Murl.IEnums.Axis axis)

Parameters
axisThe alignment axis.
Returns
Boolean true if successful.

GetAxis()

Get the alignment axis.

Murl.IEnums.Axis GetAxis()

Returns
Murl.IEnums.Axis The alignment axis.

SetOrder(order)

Set the alignment order. This method sets the alignment order to either ascending or descending, along the main axis. See SetAxis().

Boolean SetOrder(Murl.IEnums.SortOrder order)

Parameters
orderThe alignment order.
Returns
Boolean true if successful.

GetOrder()

Get the alignment order.

Murl.IEnums.SortOrder GetOrder()

Returns
Murl.IEnums.SortOrder The alignment order.

SetSpacing(spacing)

Set the alignment spacing. This method defines the size of the empty space between two consecutive sub-graphs, along the main axis defined via SetAxis().

Boolean SetSpacing(Number spacing)

Parameters
spacingThe spacing value.
Returns
Boolean true if successful.

GetSpacing()

Get the alignment spacing.

Number GetSpacing()

Returns
Number The spacing value.

SetPadding(paddingX, paddingY, paddingZ)

Set the alignment padding. See SetPadding(const Vector&).

Boolean SetPadding(Number paddingX, Number paddingY, Number paddingZ)

Parameters
paddingXThe X axis padding value.
paddingYThe Y axis padding value.
paddingZThe Z axis padding value.
Returns
Boolean true if successful.

SetPadding(padding)

Set the alignment padding. This method defines the "border size", added to both sides of each axis to effectively enlarge the alignment container by twice the given values, individually for each of the three axes.

Boolean SetPadding(Murl.Math.Vector padding)

Parameters
paddingA vector containing three individual padding values, one for each axis (X, Y and Z).
Returns
Boolean true if successful.

SetPaddingX(paddingX)

Set the alignment padding in X direction. See SetPadding(const Vector&).

Boolean SetPaddingX(Number paddingX)

Parameters
paddingXThe X axis padding value.
Returns
Boolean true if successful.

SetPaddingY(paddingY)

Set the alignment padding in Y direction. See SetPadding(const Vector&).

Boolean SetPaddingY(Number paddingY)

Parameters
paddingYThe Y axis padding value.
Returns
Boolean true if successful.

SetPaddingZ(paddingZ)

Set the alignment padding in Z direction. See SetPadding(const Vector&).

Boolean SetPaddingZ(Number paddingZ)

Parameters
paddingZThe Z axis padding value.
Returns
Boolean true if successful.

GetPadding()

Get the alignment padding as a vector.

Murl.Math.Vector GetPadding()

Returns
Murl.Math.Vector A vector containing the 3 padding values, for X, Y and Z axis.

GetPaddingX()

Get the alignment padding in X direction.

Number GetPaddingX()

Returns
Number The X axis padding value.

GetPaddingY()

Get the alignment padding in Y direction.

Number GetPaddingY()

Returns
Number The Y axis padding value.

GetPaddingZ()

Get the alignment padding in Z direction.

Number GetPaddingZ()

Returns
Number The Z axis padding value.

SetContainerSize(sizeX, sizeY, sizeZ)

Set the exact container size used for layouting. See SetContainerSize(const Vector&).

Boolean SetContainerSize(Number sizeX, Number sizeY, Number sizeZ)

Parameters
sizeXThe container size in X direction.
sizeYThe container size in Y direction.
sizeZThe container size in Z direction.
Returns
Boolean true if successful.

SetContainerSize(size)

Set the exact container size used for layouting. This method sets both minimum and maximum size values for the layout container to the given ones, effectively restricting the container to always have constant dimensions. See SetMinContainerSize() and SetMaxContainerSize(). The exact container size cannot be queried directly, use both GetMinContainerSize() and GetMaxContainerSize(), which return the same values when an exact container size was specified.

Boolean SetContainerSize(Murl.Math.Vector size)

Parameters
sizeA vector containing the container size for X, Y and Z axes.
Returns
Boolean true if successful.

SetContainerSizeX(sizeX)

Set the exact container size used for layouting, in X direction. See SetContainerSize(const Vector&).

Boolean SetContainerSizeX(Number sizeX)

Parameters
sizeXThe container size in X direction.
Returns
Boolean true if successful.

SetContainerSizeY(sizeY)

Set the exact container size used for layouting, in Y direction. See SetContainerSize(const Vector&).

Boolean SetContainerSizeY(Number sizeY)

Parameters
sizeYThe container size in Y direction.
Returns
Boolean true if successful.

SetContainerSizeZ(sizeZ)

Set the exact container size used for layouting, in Z direction. See SetContainerSize(const Vector&).

Boolean SetContainerSizeZ(Number sizeZ)

Parameters
sizeZThe container size in Z direction.
Returns
Boolean true if successful.

SetMinContainerSize(sizeX, sizeY, sizeZ)

Set the minimum container size used for layouting. See SetMinContainerSize(const Vector&).

Boolean SetMinContainerSize(Number sizeX, Number sizeY, Number sizeZ)

Parameters
sizeXThe minimum container size in X direction.
sizeYThe minimum container size in Y direction.
sizeZThe minimum container size in Z direction.
Returns
Boolean true if successful.

SetMinContainerSize(size)

Set the minimum container size used for layouting. This method sets the minimum overall container size used for layouting. Using a minimum container size is usually useful when an aligner is itself embedded into another (parent) aligner. When the total size of the aligned contents is smaller than the size values given here, the container maintains that minimum size. If the contents are larger, then also the container is enlarged, unless a maximum size is defined via SetMaxContainerSize(). If any of the three axis values is negative, this axis is considered unrestricted. See also SetContainerSize() to set an exact container size.

Boolean SetMinContainerSize(Murl.Math.Vector size)

Parameters
sizeA vector containing the minimum container size for X, Y and Z.
Returns
Boolean true if successful.

SetMinContainerSizeX(sizeX)

Set the minimum container size used for layouting, in X direction. See SetMinContainerSize(const Vector&).

Boolean SetMinContainerSizeX(Number sizeX)

Parameters
sizeXThe minimum container size in X direction.
Returns
Boolean true if successful.

SetMinContainerSizeY(sizeY)

Set the minimum container size used for layouting, in Y direction. See SetMinContainerSize(const Vector&).

Boolean SetMinContainerSizeY(Number sizeY)

Parameters
sizeYThe minimum container size in Y direction.
Returns
Boolean true if successful.

SetMinContainerSizeZ(sizeZ)

Set the minimum container size used for layouting, in Z direction. See SetMinContainerSize(const Vector&).

Boolean SetMinContainerSizeZ(Number sizeZ)

Parameters
sizeZThe minimum container size in Z direction.
Returns
Boolean true if successful.

GetMinContainerSize()

Get the minimum container size used for layouting.

Murl.Math.Vector GetMinContainerSize()

Returns
Murl.Math.Vector A vector containing the minimum container size for X, Y and Z.

GetMinContainerSizeX()

Get the minimum container size in X direction used for layouting.

Number GetMinContainerSizeX()

Returns
Number The minimum container size in X direction.

GetMinContainerSizeY()

Get the minimum container size in Y direction used for layouting.

Number GetMinContainerSizeY()

Returns
Number The minimum container size in Y direction.

GetMinContainerSizeZ()

Get the minimum container size in Z direction used for layouting.

Number GetMinContainerSizeZ()

Returns
Number The minimum container size in Z direction.

SetMaxContainerSize(sizeX, sizeY, sizeZ)

Set the maximum container size used for layouting. See SetMaxContainerSize(const Vector&).

Boolean SetMaxContainerSize(Number sizeX, Number sizeY, Number sizeZ)

Parameters
sizeXThe maximum container size in X direction.
sizeYThe maximum container size in Y direction.
sizeZThe maximum container size in Z direction.
Returns
Boolean true if successful.

SetMaxContainerSize(size)

Set the maximum container size used for layouting. This method sets the maximum overall container size used for layouting. Using a minimum container size is usually useful when an aligner is itself embedded into another (parent) aligner. When the total size of the aligned contents is higher than the size values given here, the container is restricted to that maximum size. If the contents are smaller, this smaller size is accepted, unless a minimum size is defined via SetMinContainerSize(). If any of the three axis values is negative, this axis is considered unrestricted. See also SetContainerSize() to set an exact container size.

Boolean SetMaxContainerSize(Murl.Math.Vector size)

Parameters
sizeA vector containing the maximum container size for X, Y and Z.
Returns
Boolean true if successful.

SetMaxContainerSizeX(sizeX)

Set the maximum container size used for layouting, in X direction. See SetMaxContainerSize(const Vector&).

Boolean SetMaxContainerSizeX(Number sizeX)

Parameters
sizeXThe maximum container size in X direction.
Returns
Boolean true if successful.

SetMaxContainerSizeY(sizeY)

Set the maximum container size used for layouting, in Y direction. See SetMaxContainerSize(const Vector&).

Boolean SetMaxContainerSizeY(Number sizeY)

Parameters
sizeYThe maximum container size in Y direction.
Returns
Boolean true if successful.

SetMaxContainerSizeZ(sizeZ)

Set the maximum container size used for layouting, in Z direction. See SetMaxContainerSize(const Vector&).

Boolean SetMaxContainerSizeZ(Number sizeZ)

Parameters
sizeZThe maximum container size in Z direction.
Returns
Boolean true if successful.

GetMaxContainerSize()

Get the maximum container size used for layouting.

Murl.Math.Vector GetMaxContainerSize()

Returns
Murl.Math.Vector A vector containing the maximum container size for X, Y and Z.

GetMaxContainerSizeX()

Get the maximum container size in X direction used for layouting.

Number GetMaxContainerSizeX()

Returns
Number The maximum container size in X direction.

GetMaxContainerSizeY()

Get the maximum container size in Y direction used for layouting.

Number GetMaxContainerSizeY()

Returns
Number The maximum container size in Y direction.

GetMaxContainerSizeZ()

Get the maximum container size in Z direction used for layouting.

Number GetMaxContainerSizeZ()

Returns
Number The maximum container size in Z direction.

SetContainerAlignment(alignX, alignY, alignZ)

Set the container alignment for all three axes. The container alignment properties specify the actual pivot (or anchor) point for handling the aligner. For example, using IEnums::ALIGNMENT_X_LEFT for the X axis and IEnums::ALIGNMENT_Y_TOP will layout the aligner's contents to the right (positive X axis) and bottom (negative Y axis) from the aligner's origin. By default, the aligner's container alignment is set to CENTER for all three axes.

Boolean SetContainerAlignment(Murl.IEnums.AlignmentX alignX, Murl.IEnums.AlignmentY alignY, Murl.IEnums.AlignmentZ alignZ)

Parameters
alignXThe container alignment in X direction.
alignYThe container alignment in Y direction.
alignZThe container alignment in Z direction.
Returns
Boolean true if successful.

SetContainerAlignmentX(alignX)

Set the container alignment for the X axis.

Boolean SetContainerAlignmentX(Murl.IEnums.AlignmentX alignX)

Parameters
alignXThe container alignment in X direction.
Returns
Boolean true if successful.

SetContainerAlignmentY(alignY)

Set the container alignment for the Y axis.

Boolean SetContainerAlignmentY(Murl.IEnums.AlignmentY alignY)

Parameters
alignYThe container alignment in Y direction.
Returns
Boolean true if successful.

SetContainerAlignmentZ(alignZ)

Set the container alignment for the Z axis.

Boolean SetContainerAlignmentZ(Murl.IEnums.AlignmentZ alignZ)

Parameters
alignZThe container alignment in Z direction.
Returns
Boolean true if successful.

GetContainerAlignmentX()

Get the container alignment for the X axis.

Murl.IEnums.AlignmentX GetContainerAlignmentX()

Returns
Murl.IEnums.AlignmentX The container alignment in X direction.

GetContainerAlignmentY()

Get the container alignment for the Y axis.

Murl.IEnums.AlignmentY GetContainerAlignmentY()

Returns
Murl.IEnums.AlignmentY The container alignment in Y direction.

GetContainerAlignmentZ()

Get the container alignment for the Z axis.

Murl.IEnums.AlignmentZ GetContainerAlignmentZ()

Returns
Murl.IEnums.AlignmentZ The container alignment in Z direction.

SetObjectAlignment(alignX, alignY, alignZ)

Set the object alignment for all three axes. The object alignment properties specify how the contents of the aligner are arranged for each axis. If for example the main axis is set to X in ascending order, the X alignment is set to LEFT, and the Y object alignment value is set to BOTTOM, all sub-graphs are aligned in their given order from left to right, and their Y start coordinates are aligned at the bottom of the container. Note that for all axes with object alignment set to UNDEFINED, the respective sub-graphs' coordinate along that axis remains unchanged.

Boolean SetObjectAlignment(Murl.IEnums.AlignmentX alignX, Murl.IEnums.AlignmentY alignY, Murl.IEnums.AlignmentZ alignZ)

Parameters
alignXThe object alignment in X direction.
alignYThe object alignment in Y direction.
alignZThe object alignment in Z direction.
Returns
Boolean true if successful.

SetObjectAlignmentX(alignX)

Set the object alignment on the X axis.

Boolean SetObjectAlignmentX(Murl.IEnums.AlignmentX alignX)

Parameters
alignXThe object alignment in X direction.
Returns
Boolean true if successful.

SetObjectAlignmentY(alignY)

Set the object alignment on the Y axis.

Boolean SetObjectAlignmentY(Murl.IEnums.AlignmentY alignY)

Parameters
alignYThe object alignment in Y direction.
Returns
Boolean true if successful.

SetObjectAlignmentZ(alignZ)

Set the object alignment on the Z axis.

Boolean SetObjectAlignmentZ(Murl.IEnums.AlignmentZ alignZ)

Parameters
alignZThe object alignment in Z direction.
Returns
Boolean true if successful.

GetObjectAlignmentX()

Get the object alignment on the X axis.

Murl.IEnums.AlignmentX GetObjectAlignmentX()

Returns
Murl.IEnums.AlignmentX The object alignment in X direction.

GetObjectAlignmentY()

Get the object alignment on the Y axis.

Murl.IEnums.AlignmentY GetObjectAlignmentY()

Returns
Murl.IEnums.AlignmentY The object alignment in Y direction.

GetObjectAlignmentZ()

Get the object alignment on the Z axis.

Murl.IEnums.AlignmentZ GetObjectAlignmentZ()

Returns
Murl.IEnums.AlignmentZ The object alignment in Z direction.

SetAlignmentUnit(unitX, unitY, unitZ)

Set the object alignment unit. This method sets the alignment unit for all three axes, which can be used to round the aligner container's positions to some given values, in order to e.g. position the resulting container on integer pixel coordinates. By default, the alignment units for all axes are set to -1.0, which means "no rounding".

Boolean SetAlignmentUnit(Number unitX, Number unitY, Number unitZ)

Parameters
unitXThe alignment unit in X direction.
unitYThe alignment unit in Y direction.
unitZThe alignment unit in Z direction.
Returns
Boolean true if successful.

SetAlignmentUnitX(unitX)

Set the object alignment unit along the X axis. See SetAlignmentUnit().

Boolean SetAlignmentUnitX(Number unitX)

Parameters
unitXThe alignment unit in X direction.
Returns
Boolean true if successful.

SetAlignmentUnitY(unitY)

Set the object alignment unit along the Y axis. See SetAlignmentUnit().

Boolean SetAlignmentUnitY(Number unitY)

Parameters
unitYThe alignment unit in Y direction.
Returns
Boolean true if successful.

SetAlignmentUnitZ(unitZ)

Set the object alignment unit along the Z axis. See SetAlignmentUnit().

Boolean SetAlignmentUnitZ(Number unitZ)

Parameters
unitZThe alignment unit in Z direction.
Returns
Boolean true if successful.

GetAlignmentUnitX()

Set the object alignment unit along the X axis.

Number GetAlignmentUnitX()

Returns
Number The alignment unit in X direction.

GetAlignmentUnitY()

Set the object alignment unit along the Y axis.

Number GetAlignmentUnitY()

Returns
Number The alignment unit in Y direction.

GetAlignmentUnitZ()

Set the object alignment unit along the Z axis.

Number GetAlignmentUnitZ()

Returns
Number The alignment unit in Z direction.

GetBoundingVolume()

Get the aligner's bounding volume.

Murl.Graph.IBoundingVolume GetBoundingVolume()

Returns
Murl.Graph.IBoundingVolume The bounding volume.