Class Proxy
from raimad.proxy
class Proxy
Proxy: transforming and layermapping wrapper around a Compo.
TODO description here.
def __init__(self, compo: 'rai.typing.CompoLike', lmap: 'rai.typing.LMapShorthand' = None, transform: 'rai.typing.Transform | None' = None, _cif_link: bool = False, _autogenned: bool = False, _deepcopied: bool = False):
"""
Initialize self. See help(type(self)) for accurate signature.
"""
def steamroll(self) -> 'rai.typing.Geoms':
"""
Get all geometries of this proxy.
This function returns all geometries
(i.e. all raw geometries as well as subcompos)
of the CompoLike pointed to by this proxy,
as seen through this proxy.
"""
def get_flat_transform(self, maxdepth: int = -1) -> 'rai.typing.Transform':
"""
Get flattened transform from tower of proxies.
"""
def get_flat_lmap(self, maxdepth: int = -1) -> raimad.proxy.LMap:
"""
Get flattened lmap from tower of proxies.
"""
def final(self) -> 'rai.typing.Compo':
"""
Return the compo at the bottom of a tower of proxies.
"""
def final_p(self) -> 'rai.typing.Proxy':
"""
Return the proxy at the bottom of a tower of proxies.
"""
def depth(self) -> int:
"""
Measure depth of a tower of proxies.
The depth of a compo is 0,
a proxy pointing to a compo is 1,
a proxy pointing to a proxy pointing to a compo is 2,
and so forth.
"""
def descend(self) -> 'Iterator[rai.typing.CompoLike]':
"""
Descend a tower of proxies to the compo at the bottom.
"""
def descend_p(self) -> 'Iterator[rai.typing.Proxy]':
"""
Descend a tower of proxies to the lowest proxy.
"""
def proxy(self) -> 'rai.typing.Proxy':
"""
Return a new proxy pointing to this proxy.
"""
def walk_hier(self) -> 'Iterator[rai.typing.Proxy]':
"""
Traverse the subcomponent hierarchy of the CompoLike of this proxy.
This method will recursively walk through the entire
subcompo hierarchy of the CompoLike pointed to by
this proxy.
Each node is wrapped in a copy of this proxy.
"""
def shallow_copy(self, _autogenned: bool = False, _deepcopied: bool = False) -> 'rai.typing.Proxy':
"""
"""
def shallow_copy_reassign(self, new_compo: 'rai.typing.CompoLike', _autogenned: bool = False, _deepcopied: bool = False) -> 'rai.typing.Proxy':
"""
"""
def deep_copy(self, _autogenned: bool = False) -> 'rai.typing.Proxy':
"""
"""
def deep_copy_reassign(self, new_compo: 'rai.typing.CompoLike', _autogenned: bool = False, _deepcopied: bool = False) -> 'rai.typing.Proxy':
"""
"""
def transform_point(self, point: 'rai.typing.PointLike') -> 'rai.typing.PointLike':
"""
Apply this proxies transform to a point, return the transformed point.
A Point (tuple of two floats) is always returned,
even if a BoundPoint is passed in.
Parameters
----------
point : rai.typing.PointLike
The point to transform.
Returns
-------
rai.typing.Point
The transformed point.
"""
def __str__(self) -> str:
"""
Return str(self).
"""
def __repr__(self) -> str:
"""
Return string representation of this proxy.
"""
def scale(self, x: float, y: float | None = None) -> Self:
"""
Scale this proxy.
Parameters
----------
x : float
Factor to scale by along the x axis
y : float
Factor to scale by along the y axis.
If unspecified or None,
use the x scale factor.
Returns
-------
Self
self is returned to allow chaining methods.
"""
def movex(self, factor: float) -> Self:
"""
Move this proxy horizontally.
Parameters
----------
x : float
Move this many units along x axis.
Returns
-------
Self
self is returned to allow chaining methods.
"""
def movey(self, factor: float) -> Self:
"""
Move this proxy vertically.
Parameters
----------
y : float
Move this many units along y axis.
Returns
-------
Self
self is returned to allow chaining methods.
"""
def move(self, x: float, y: float) -> Self:
"""
Move this proxy.
Parameters
----------
x : float
Move this many units along x axis.
y : float
Move this many units along y axis.
Returns
-------
Self
self is returned to allow chaining methods.
"""
def hflip(self, x: float = 0) -> Self:
"""
Flip (mirror) along horizontal axis.
Parameters
----------
x : float
Flip around this horizontal line (x coordinate)
Returns
-------
Self
self is returned to allow chaining methods.
"""
def vflip(self, y: float = 0) -> Self:
"""
Flip (mirror) along vertical axis.
Parameters
----------
y : float
Flip around this vertical line (y coordinate)
Returns
-------
Self
self is returned to allow chaining methods.
"""
def flip(self, x: float = 0, y: float = 0) -> Self:
"""
Flip (mirror) along both horizontal and vertical axis.
Parameters
----------
x : float
Flip around this point (x coordinate). Default: origin
y : float
Flip around this point (y coordinate). Default: origin
Returns
-------
Self
self is returned to allow chaining methods.
"""
def rotate(self, angle: float, x: float = 0, y: float = 0) -> Self:
"""
Rotate this proxy, possibly around a point.
Arguments
---------
angle : float
Rotate by this many radians in the positive orientation
x : float
Rotate around this point (x coord). Default: origin
y : float
Rotate around this point (y coord). Default: origin
Returns
-------
Self
self is returned to allow method chaining.
"""
def map(self, lmap_shorthand: 'rai.typing.LMapShorthand') -> Self:
"""
Apply layermap to proxy.
"""
def snap_left(self, other: Self) -> Self:
"""
Move this proxy so its bbox is to the left of the target proxy.
________
| |
| |________
| | |
| self | target |
| |________|
| |
|________|
Parameters
----------
The target proxy
Returns
-------
Self
This proxy is returned to allow method chaining.
"""
def snap_right(self, other: Self) -> Self:
"""
Move this proxy so its bbox is to the right of the target proxy.
________
| |
________| |
| | |
| target | self |
|________| |
| |
|________|
Parameters
----------
The target proxy
Returns
-------
Self
This proxy is returned to allow method chaining.
"""
def snap_above(self, other: Self) -> Self:
"""
Move this proxy so its bbox is directly above the target proxy.
________________
| |
| self |
|________________|
| |
| target |
|________|
Parameters
----------
The target proxy
Returns
-------
Self
This proxy is returned to allow method chaining.
"""
def snap_below(self, other: Self) -> Self:
"""
Move this proxy so its bbox is directly below the target proxy.
________
| |
| target |
___|________|___
| |
| self |
|________________|
Parameters
----------
The target proxy
Returns
-------
Self
This proxy is returned to allow method chaining.
"""