maxon¶
Note
Core members documented here are defined directly in maxon; there is no maxon.frameworks.core module. See the Maxon API section of the API Overview for more information about the special conventions of this API.
Module for fundamental Maxon API types and operations.
Interfaces¶
Hardware and Software Information¶
|
This class is the entry point to access machine interfaces.
|
This class declares functions to access and manage machines.
|
|
Application wide functions.
|
|
|
Application wide system functions.
|
I/O¶
|
FileFormatHandlerInterface implements a handler for a specific FileFormat.
|
|
maxon.FileFormatInterface allows to implement and register file formats with its detection algorithm. |
|
The IoHandler class offers some I/O functionality for filenames.
|
|
The connection interface a given
maxon.Url. |
|
The
IoBrowseIterator interface for a given maxon.Url. |
|
Interface is the base interface for all stream interfaces.
|
|
Creates an
maxon.InOutputStreamInterface class to read/write bytes from/into streams. |
|
Interface for input streams. It allows to read data from streams.
|
|
Creates an |
|
Interface class for |
Network¶
Static interface to access network functionality. |
|
|
Represents an Internet Protocol (IP) address. |
|
Provides an Internet Protocol (IP) address + port.
|
Logger¶
|
Each object of
maxon.LoggerLine represents an entry in the logger with several meta information. |
|
The logger interface allows to create new custom loggers for specific tasks and to access existing loggers.
|
Misc¶
|
A timer class to retrieve the current time. |
|
Initializes the appropriate C++ Data object and store it within the _data member. |
This is the interface for the Gradient data type.
|
|
|
Reference class for |
|
Reference class for |
Core¶
Class to store and find any |
|
|
Class to store and find any data type under any type of key. |
|
|
|
Class to store unicode strings. String stores 16bit unicode characters.
|
|
Class to store ASCII strings. CString stores 8 bit characters.
|
|
Class that handles resources. |
Core Helper¶
|
A
maxon.ClassInterface object represents an object class at runtime. |
|
Object is the root of the interface hierarchy of the MAXON API.
|
|
AutoIterator implements a foreach iterator for a BaseArray |
|
|
References¶
Hardware and Software Information¶
|
Reference class of |
I/O¶
|
Reference class of |
|
Reference class of |
|
Reference class of |
|
Reference class of |
|
Reference class of |
|
Reference class of |
|
Reference class of |
|
Reference class of |
|
Reference class of |
Network¶
|
Reference class of |
|
Reference class of |
Logger¶
|
Reference class of |
|
Reference class of |
Core¶
|
Reference class of |
|
Registries are used to register specific implementations of a given interface.
|
|
Reference class of |
|
Reference class of |
|
Reference to a |
|
Reference class of |
|
Reference class of |
|
Reference class of |
Core Helper¶
|
Reference class of |
|
Creates and stores internally the reference of the C++ Data.
|
Data Types¶
Simple Data Type¶
|
Boolean type, possible values are only False/True, 8 bits. |
|
Signed 8 bits character. |
|
Unsigned 8 bits character. |
alias of |
|
|
Floating point value 32 bits (float). |
|
Floating point value 64 bits (double). |
alias of |
|
|
Signed integer 16 bits (either positive or negative number). |
|
Signed integer 32 bits (either positive or negative number). |
|
Signed integer 64 bits (either positive or negative number). |
alias of |
|
|
Unsigned integer 16 bits (always positive number). |
|
Unsigned integer 32 bits (always positive number). |
|
Unsigned integer 64 bits (always positive number). |
Vector / Matrix Data Type¶
|
A vector consisting of three components X, Y and Z. |
|
Initializes a new three component vector.
|
|
Initializes a new three component vector.
|
alias of |
|
|
Initializes a new three component vector.
|
|
Initializes a new three component vector.
|
alias of |
|
|
Initializes a new three component color. |
|
Initializes a new three component color. |
|
Initializes a new three component color. |
alias of |
|
|
Initializes a new four component vector.
|
|
Initializes a new four component vector.
|
|
Initializes a new four component vector.
|
alias of |
|
|
Initializes a new four component color. |
|
Initializes a new four component color. |
alias of |
|
|
Initializes a new three components square matrix.
|
|
Initializes a new three components square matrix.
|
|
A 3x3 matrix |
|
A 32 bits 3x3 matrix. |
|
A 64 bits 3x3 matrix. |
Alias for |
Collection Data Type¶
|
Initialize the Array in order to store a given type. At the moment only maxon Data Type are supported.
|
|
A generic array class template used to stored any kind of data. |
|
maxon.Pair provides in-place static storage for elements of arbitrary types. |
|
maxon.Tuple provides in-place static storage for elements of arbitrary types. |
|
A
maxon.Block stands for a number of elements with a regular memory layout. |
|
Similar to a |
Id Data Type¶
|
|
|
|
Time Data Type¶
|
At some point developers have to deal with times, dates and timezones.
|
|
Class that represents the Universal date-time (UTC+0000).
|
|
The |
|
Timer value in seconds. |
Core Data Type¶
|
Represents an config entry value. |
|
An object to represents the current file location. |
|
Delegate base class which can be used for |
Core Iterator Data Type¶
|
Base class for iterator |
RegistryEntryIteratorInterface is used internally by |
|
|
|
|
Iterator to iterate through all elements of a |
|
Represents a python iterator for an |
Base Core Data Type¶
|
An object of this class can store every type of data as long as that type has been registered (see |
|
|
|
Base reference for all objects which hold a data capsule |
|
Represents a C++ structure. |
|
Represents a built-in |
|
Class for all data objects, that have no proper wrapper class in Python. |
|
Maxon API rely on object that are declared. Such object are stored under a
maxon.Declaration object. |
|
The data type represents the |
|
A component implements the functions of a given interface.
|
|
maxon.ComponentRoot is the base class of all components (see maxon.MAXON_COMPONENT). |
|
Represent an Object |
Decorators¶
Interface Decorator¶
|
|
Decorator to defines an Interface that can be treated as Reference at the same time. |
|
|
|
|
|
|
|
|
At the moment MAXON_FUNCTION is just a dummy function to mark the function that it is trampolin code to another function. |
|
At the moment MAXON_STATICFUNCTION is just a dummy function to mark the function that it is trampolin code to another function. |
At the moment MAXON_OVERLOAD is just a dummy function to mark a function being overloaded |
|
|
At the moment MAXON_FUNCTION_EXTEND is just a dummy function to mark the function that it is trampolin code to another function. |
|
Enum Decorator¶
|
|
|
Registration Decorator¶
|
Decorator to mark an element as a Maxon API component (available from a registry) |
|
MAXON_COMPONENT_OBJECT_REGISTER registers a component, creates an object class which uses the component and
|
|
MAXON_COMPONENT_OBJECT_REGISTER registers a component, creates an object class which uses the component and
|
|
Functions¶
Methods Signature¶
|
Executes a function when the current scope is left. |
|
Creates a SourceLocation object for the current Python Frame. |
Alias for |
|
|
Retrieves the |
|
Convert all passed objects to a maxon or Python object, depending on the passed type. |
|
Makes a |
|
Cast the object o to the type T. |
|
Cast(T, o) Cast the object o to the type T. |
Methods Definition¶
-
maxon.finally_once(func, *args, **kwargs) Executes a function when the current scope is left.
Note
An optional parameter canRaise can be passed to notify that func may eventually raise.
- Parameters
func (
function(*args, **kwargs)) – Function to be called.args (Any) – Optional arguments to be passed to func.
kwargs (Any) – Optional settings like canRaise to control if func can raise an exception.
cleanup = finally_once(lambda x: MyFunction(x), canRaise=False)
-
maxon.MAXON_SOURCE_LOCATION(offset=0) Creates a SourceLocation object for the current Python Frame.
- Parameters
offset (Optional[int])) – Optional trace back offset to retrieve the current source location from.
- Returns
The source location corresponding to the Python frame calling this function.
- Return type
-
maxon.MAXON_ATTRIBUTE(id) Alias for
maxon.InternedId.
-
maxon.GetDataType(obj) Retrieves the
maxon.DataTypeof the passed object.- Parameters
type – The object to retrieves the
maxon.DataTypefrom.- Type
- Returns
The datatype.
- Return type
-
maxon.MaxonConvert(*args) Convert all passed objects to a maxon or Python object, depending on the passed type.
Note
Latest arguments determine how the conversion is done by passing a
maxon.CONVERSIONMODE.import maxon # Returns a maxon.Int32 of value 10 print maxon.MaxonConvert(10) # Returns a int of value 10 print maxon.MaxonConvert(maxon.Int(10)) # Forces a return value to Maxon API type, in this case a maxon.Int32 of value 10 print maxon.MaxonConvert(maxon.Int(10), maxon.CONVERSIONMODE.TOMAXON) # Forces a return value to Python Builtin, in this case a int of value 10 print maxon.MaxonConvert(10, maxon.CONVERSIONMODE.TOBUILTIN)
- Parameters
args (Any) – The object to converts.
- Returns
The object converted
- Return type
Any
-
maxon.ToBlock(data, size, stride=None, dt=None) Makes a
maxon.Blockor amaxon.StridedBlockfrom a pointer, a size and a stride.- Parameters
data (
maxon.Data) – The data to transform to a Block.size (int) – Number of elements.
stride (int) – Element stride.
dt (
maxon.DataType) – The Datatype of the data to be converted as block
- Returns
A block of elements for this data and datatype.
- Return type
Union[
maxon.StridedBlock,maxon.Block]
-
maxon.Cast(T, o) Cast the object o to the type T.
Warning
This function is only there to expose a C++ Object to Python.As a Python developer you normally don’t have to deal with this function.Usemaxon.MaxonConvert()instead.- Parameters
T (type) – The type to cast the object to.
o (
maxon.Data) – The Initial object
- Returns
The casted object
- Return type
T
-
maxon.reinterpret_cast(T, o) Cast(T, o) Cast the object o to the type T.
Warning
This function is only there to expose a C++ Object to Python.As a Python developer you normally don’t have to deal with this function.Usemaxon.MaxonConvert()instead.- Parameters
T (type) – The type to cast the object to.
o (
maxon.Data) – The Initial object
- Returns
The casted object
- Return type
T