mapteksdk.labs.view module¶
Implement additional view controllers that are still a work-in progress and are being provided through labs for earlier feedback.
To use the labs version of the ViewController, you can:
>>> from mapteksdk.project import Project
>>> from mapteksdk.labs.view import enable_labs_on_view_controller
>>> import mapteksdk.pointstudio.operations as studio_operations
>>> project = Project()
>>> view = studio_operations.open_new_view()
>>> enable_labs_on_view_controller(view)
>>> camera = view.camera()
>>> print(camera.origin, camera.artificial_scale)
- class mapteksdk.labs.view.RigidTransform¶
Bases:
mapteksdk.internal.comms.InlineMessage
Represents a rigid body (6 degree of freedom) transformation in 3D space.
- rotation: (<class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>)¶
- translation: (<class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>)¶
- class mapteksdk.labs.view.Camera¶
Bases:
mapteksdk.internal.comms.Message
Response back for the Camera request.
- origin: (<class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>)¶
- artificial_scale: (<class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>, <class ‘ctypes.c_double’>)¶
- rigid_transform: mapteksdk.labs.view.RigidTransform¶
- angular_field_of_view: ctypes.c_double¶
- linear_field_of_view: ctypes.c_double¶
- perspective_factor: ctypes.c_double¶
- class mapteksdk.labs.view.LabsViewController(view_id: mapteksdk.data.objectid.ObjectID)¶
Bases:
mapteksdk.view.ViewController
Provides access onto a specified view, with additional work-in progress features.
- camera()¶
Return the current camera (i.e position/orientation) for the view.
- set_camera(new_camera, smoothly=True)¶
Change the current camera of the view.
- Parameters
new_camera (Camera) – The new camera to use for the view.
smoothly (bool) – Whether the camera should smoothly transition to the new state, or if it should change instantaneously.
- change_camera(change_function, smoothly=True)¶
Change a part of the camera.
The part that is changed is based on what the change_function does. It is called with the current state of the camera and should make the appropriate modifications to it
- Parameters
change_function (callable) – A function that will be passed the current state of the camera and should modify it and return the modified version back.
smoothly (bool) – Whether the camera should smoothly transition to the new state, or if it should change instantaneously.
- mapteksdk.labs.view.enable_labs_on_view_controller(view_controller) mapteksdk.labs.view.LabsViewController ¶
Enables the labs functionality on the given view controller.
- Returns
The provided view controller with labs functionality enabled.
- Return type
- Raises
TypeError – If the labs functionality has already been enabled.
TypeError – If the object is not a view controller.