![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
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()
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()
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)
enabled | If true, instance processing is enabled. |
Check if instance processing is enabled.
Boolean IsInstanceProcessingEnabled()
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)
axis | The alignment axis. |
Get the alignment axis.
Murl.IEnums.Axis GetAxis()
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)
order | The alignment order. |
Get the alignment order.
Murl.IEnums.SortOrder GetOrder()
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)
spacing | The spacing value. |
Get the alignment spacing.
Number GetSpacing()
Set the alignment padding. See SetPadding(const Vector&).
Boolean SetPadding(Number paddingX, Number paddingY, Number paddingZ)
paddingX | The X axis padding value. |
paddingY | The Y axis padding value. |
paddingZ | The Z axis padding value. |
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)
padding | A vector containing three individual padding values, one for each axis (X, Y and Z). |
Set the alignment padding in X direction. See SetPadding(const Vector&).
Boolean SetPaddingX(Number paddingX)
paddingX | The X axis padding value. |
Set the alignment padding in Y direction. See SetPadding(const Vector&).
Boolean SetPaddingY(Number paddingY)
paddingY | The Y axis padding value. |
Set the alignment padding in Z direction. See SetPadding(const Vector&).
Boolean SetPaddingZ(Number paddingZ)
paddingZ | The Z axis padding value. |
Get the alignment padding as a vector.
Murl.Math.Vector GetPadding()
Get the alignment padding in X direction.
Number GetPaddingX()
Get the alignment padding in Y direction.
Number GetPaddingY()
Get the alignment padding in Z direction.
Number GetPaddingZ()
Set the exact container size used for layouting. See SetContainerSize(const Vector&).
Boolean SetContainerSize(Number sizeX, Number sizeY, Number sizeZ)
sizeX | The container size in X direction. |
sizeY | The container size in Y direction. |
sizeZ | The container size in Z direction. |
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)
size | A vector containing the container size for X, Y and Z axes. |
Set the exact container size used for layouting, in X direction. See SetContainerSize(const Vector&).
Boolean SetContainerSizeX(Number sizeX)
sizeX | The container size in X direction. |
Set the exact container size used for layouting, in Y direction. See SetContainerSize(const Vector&).
Boolean SetContainerSizeY(Number sizeY)
sizeY | The container size in Y direction. |
Set the exact container size used for layouting, in Z direction. See SetContainerSize(const Vector&).
Boolean SetContainerSizeZ(Number sizeZ)
sizeZ | The container size in Z direction. |
Set the minimum container size used for layouting. See SetMinContainerSize(const Vector&).
Boolean SetMinContainerSize(Number sizeX, Number sizeY, Number sizeZ)
sizeX | The minimum container size in X direction. |
sizeY | The minimum container size in Y direction. |
sizeZ | The minimum container size in Z direction. |
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)
size | A vector containing the minimum container size for X, Y and Z. |
Set the minimum container size used for layouting, in X direction. See SetMinContainerSize(const Vector&).
Boolean SetMinContainerSizeX(Number sizeX)
sizeX | The minimum container size in X direction. |
Set the minimum container size used for layouting, in Y direction. See SetMinContainerSize(const Vector&).
Boolean SetMinContainerSizeY(Number sizeY)
sizeY | The minimum container size in Y direction. |
Set the minimum container size used for layouting, in Z direction. See SetMinContainerSize(const Vector&).
Boolean SetMinContainerSizeZ(Number sizeZ)
sizeZ | The minimum container size in Z direction. |
Get the minimum container size used for layouting.
Murl.Math.Vector GetMinContainerSize()
Get the minimum container size in X direction used for layouting.
Number GetMinContainerSizeX()
Get the minimum container size in Y direction used for layouting.
Number GetMinContainerSizeY()
Get the minimum container size in Z direction used for layouting.
Number GetMinContainerSizeZ()
Set the maximum container size used for layouting. See SetMaxContainerSize(const Vector&).
Boolean SetMaxContainerSize(Number sizeX, Number sizeY, Number sizeZ)
sizeX | The maximum container size in X direction. |
sizeY | The maximum container size in Y direction. |
sizeZ | The maximum container size in Z direction. |
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)
size | A vector containing the maximum container size for X, Y and Z. |
Set the maximum container size used for layouting, in X direction. See SetMaxContainerSize(const Vector&).
Boolean SetMaxContainerSizeX(Number sizeX)
sizeX | The maximum container size in X direction. |
Set the maximum container size used for layouting, in Y direction. See SetMaxContainerSize(const Vector&).
Boolean SetMaxContainerSizeY(Number sizeY)
sizeY | The maximum container size in Y direction. |
Set the maximum container size used for layouting, in Z direction. See SetMaxContainerSize(const Vector&).
Boolean SetMaxContainerSizeZ(Number sizeZ)
sizeZ | The maximum container size in Z direction. |
Get the maximum container size used for layouting.
Murl.Math.Vector GetMaxContainerSize()
Get the maximum container size in X direction used for layouting.
Number GetMaxContainerSizeX()
Get the maximum container size in Y direction used for layouting.
Number GetMaxContainerSizeY()
Get the maximum container size in Z direction used for layouting.
Number GetMaxContainerSizeZ()
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)
alignX | The container alignment in X direction. |
alignY | The container alignment in Y direction. |
alignZ | The container alignment in Z direction. |
Set the container alignment for the X axis.
Boolean SetContainerAlignmentX(Murl.IEnums.AlignmentX alignX)
alignX | The container alignment in X direction. |
Set the container alignment for the Y axis.
Boolean SetContainerAlignmentY(Murl.IEnums.AlignmentY alignY)
alignY | The container alignment in Y direction. |
Set the container alignment for the Z axis.
Boolean SetContainerAlignmentZ(Murl.IEnums.AlignmentZ alignZ)
alignZ | The container alignment in Z direction. |
Get the container alignment for the X axis.
Murl.IEnums.AlignmentX GetContainerAlignmentX()
Get the container alignment for the Y axis.
Murl.IEnums.AlignmentY GetContainerAlignmentY()
Get the container alignment for the Z axis.
Murl.IEnums.AlignmentZ GetContainerAlignmentZ()
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)
alignX | The object alignment in X direction. |
alignY | The object alignment in Y direction. |
alignZ | The object alignment in Z direction. |
Set the object alignment on the X axis.
Boolean SetObjectAlignmentX(Murl.IEnums.AlignmentX alignX)
alignX | The object alignment in X direction. |
Set the object alignment on the Y axis.
Boolean SetObjectAlignmentY(Murl.IEnums.AlignmentY alignY)
alignY | The object alignment in Y direction. |
Set the object alignment on the Z axis.
Boolean SetObjectAlignmentZ(Murl.IEnums.AlignmentZ alignZ)
alignZ | The object alignment in Z direction. |
Get the object alignment on the X axis.
Murl.IEnums.AlignmentX GetObjectAlignmentX()
Get the object alignment on the Y axis.
Murl.IEnums.AlignmentY GetObjectAlignmentY()
Get the object alignment on the Z axis.
Murl.IEnums.AlignmentZ GetObjectAlignmentZ()
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)
unitX | The alignment unit in X direction. |
unitY | The alignment unit in Y direction. |
unitZ | The alignment unit in Z direction. |
Set the object alignment unit along the X axis. See SetAlignmentUnit().
Boolean SetAlignmentUnitX(Number unitX)
unitX | The alignment unit in X direction. |
Set the object alignment unit along the Y axis. See SetAlignmentUnit().
Boolean SetAlignmentUnitY(Number unitY)
unitY | The alignment unit in Y direction. |
Set the object alignment unit along the Z axis. See SetAlignmentUnit().
Boolean SetAlignmentUnitZ(Number unitZ)
unitZ | The alignment unit in Z direction. |
Set the object alignment unit along the X axis.
Number GetAlignmentUnitX()
Set the object alignment unit along the Y axis.
Number GetAlignmentUnitY()
Set the object alignment unit along the Z axis.
Number GetAlignmentUnitZ()
Get the aligner's bounding volume.
Murl.Graph.IBoundingVolume GetBoundingVolume()