Commit 708d3dee authored by BlackAngle233's avatar BlackAngle233
Browse files

update final design

parent 1444629e
fileFormatVersion: 2
guid: 387d7ab2aa8f0d048b343876905d4cce
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#ifndef __EASYAR_MOTIONTRACKER_HXX__
#define __EASYAR_MOTIONTRACKER_HXX__
#include "easyar/types.hxx"
namespace easyar {
/// <summary>
/// MotionTrackerCameraDevice implements a camera device with metric-scale six degree-of-freedom motion tracking, which outputs `InputFrame`_ (including image, camera parameters, timestamp, 6DOF pose and tracking status).
/// After creation, start/stop can be invoked to start or stop data flow.
/// When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
/// MotionTrackerCameraDevice outputs `InputFrame`_ from inputFrameSource. inputFrameSource shall be connected to `InputFrameSink`_ for further use. Refer to `Overview &lt;Overview.html&gt;`__ .
/// </summary>
class MotionTrackerCameraDevice
{
protected:
easyar_MotionTrackerCameraDevice * cdata_ ;
void init_cdata(easyar_MotionTrackerCameraDevice * cdata);
virtual MotionTrackerCameraDevice & operator=(const MotionTrackerCameraDevice & data) { return *this; } //deleted
public:
MotionTrackerCameraDevice(easyar_MotionTrackerCameraDevice * cdata);
virtual ~MotionTrackerCameraDevice();
MotionTrackerCameraDevice(const MotionTrackerCameraDevice & data);
const easyar_MotionTrackerCameraDevice * get_cdata() const;
easyar_MotionTrackerCameraDevice * get_cdata();
/// <summary>
/// Create MotionTrackerCameraDevice object.
/// </summary>
MotionTrackerCameraDevice();
/// <summary>
/// Check if the devices supports motion tracking. Returns True if the device supports Motion Tracking, otherwise returns False.
/// </summary>
static bool isAvailable();
/// <summary>
/// Sets current index of frame rate. Call before start. If this function is not called, the default is 30 fps.
/// </summary>
bool setFrameRateType(MotionTrackerCameraDeviceFPS fps);
/// <summary>
/// Sets focus mode to focusMode. Call before start. If this function is not called, the default is Continousauto.
/// </summary>
bool setFocusMode(MotionTrackerCameraDeviceFocusMode focusMode);
/// <summary>
/// Sets current index of frame resolution. Call before start. If this function is not called, the default is 1280 x 960 or 1280 x 720.
/// </summary>
bool setFrameResolutionType(MotionTrackerCameraDeviceResolution resolution);
/// <summary>
/// Set `InputFrame`_ buffer capacity.
/// bufferCapacity is the capacity of `InputFrame`_ buffer. If the count of `InputFrame`_ which has been output from the device and have not been released is higher than this number, the device will not output new `InputFrame`_ until previous `InputFrame`_ has been released. This may cause screen stuck. Refer to `Overview &lt;Overview.html&gt;`__ .
/// </summary>
void setBufferCapacity(int capacity);
/// <summary>
/// Get `InputFrame`_ buffer capacity. The default is 8.
/// </summary>
int bufferCapacity();
/// <summary>
/// `InputFrame`_ output port.
/// </summary>
void inputFrameSource(/* OUT */ InputFrameSource * * Return);
/// <summary>
/// Start motion tracking or resume motion tracking after pause.
/// Notice: Calling start after pausing will trigger device relocalization. Tracking will resume when the relocalization process succeeds.
/// </summary>
bool start();
/// <summary>
/// Pause motion tracking. Call `start` to trigger relocation, resume motion tracking if the relocation succeeds.
/// </summary>
void stop();
/// <summary>
/// Close motion tracking. The component shall not be used after calling close.
/// </summary>
void close();
/// <summary>
/// Perform hit test against the point cloud and return the nearest 3D point. The 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.
/// For the camera image coordinate system ([0, 1]^2), x-right, y-down, and origin is at left-top corner. `CameraParameters.imageCoordinatesFromScreenCoordinates`_ can be used to convert points from screen coordinate system to camera image coordinate system.
/// </summary>
void hitTestAgainstPointCloud(Vec2F cameraImagePoint, /* OUT */ ListOfVec3F * * Return);
/// <summary>
/// Performs ray cast from the user&#39;s device in the direction of given screen point.
/// Intersections with horizontal plane is detected in real time in the current field of view,and return the 3D point nearest to ray on horizontal plane.
/// For the camera image coordinate system ([0, 1]^2), x-right, y-down, and origin is at left-top corner. `CameraParameters.imageCoordinatesFromScreenCoordinates`_ can be used to convert points from screen coordinate system to camera image coordinate system.
/// The output point cloud coordinate on Horizontal plane is in the world coordinate system. The 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.
/// </summary>
void hitTestAgainstHorizontalPlane(Vec2F cameraImagePoint, /* OUT */ ListOfVec3F * * Return);
/// <summary>
/// Returns the vector of point cloud coordinate. Each 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.
/// </summary>
void getLocalPointsCloud(/* OUT */ ListOfVec3F * * Return);
};
#ifndef __EASYAR_LISTOFVEC_F__
#define __EASYAR_LISTOFVEC_F__
class ListOfVec3F
{
private:
easyar_ListOfVec3F * cdata_;
virtual ListOfVec3F & operator=(const ListOfVec3F & data) { return *this; } //deleted
public:
ListOfVec3F(easyar_ListOfVec3F * cdata);
virtual ~ListOfVec3F();
ListOfVec3F(const ListOfVec3F & data);
const easyar_ListOfVec3F * get_cdata() const;
easyar_ListOfVec3F * get_cdata();
ListOfVec3F(easyar_Vec3F * begin, easyar_Vec3F * end);
int size() const;
Vec3F at(int index) const;
};
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_MOTIONTRACKER_HXX__
#define __IMPLEMENTATION_EASYAR_MOTIONTRACKER_HXX__
#include "easyar/motiontracker.h"
#include "easyar/dataflow.hxx"
#include "easyar/frame.hxx"
#include "easyar/image.hxx"
#include "easyar/buffer.hxx"
#include "easyar/cameraparameters.hxx"
#include "easyar/vector.hxx"
#include "easyar/matrix.hxx"
namespace easyar {
inline MotionTrackerCameraDevice::MotionTrackerCameraDevice(easyar_MotionTrackerCameraDevice * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline MotionTrackerCameraDevice::~MotionTrackerCameraDevice()
{
if (cdata_) {
easyar_MotionTrackerCameraDevice__dtor(cdata_);
cdata_ = NULL;
}
}
inline MotionTrackerCameraDevice::MotionTrackerCameraDevice(const MotionTrackerCameraDevice & data)
:
cdata_(NULL)
{
easyar_MotionTrackerCameraDevice * cdata = NULL;
easyar_MotionTrackerCameraDevice__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_MotionTrackerCameraDevice * MotionTrackerCameraDevice::get_cdata() const
{
return cdata_;
}
inline easyar_MotionTrackerCameraDevice * MotionTrackerCameraDevice::get_cdata()
{
return cdata_;
}
inline void MotionTrackerCameraDevice::init_cdata(easyar_MotionTrackerCameraDevice * cdata)
{
cdata_ = cdata;
}
inline MotionTrackerCameraDevice::MotionTrackerCameraDevice()
:
cdata_(NULL)
{
easyar_MotionTrackerCameraDevice * _return_value_ = NULL;
easyar_MotionTrackerCameraDevice__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline bool MotionTrackerCameraDevice::isAvailable()
{
bool _return_value_ = easyar_MotionTrackerCameraDevice_isAvailable();
return _return_value_;
}
inline bool MotionTrackerCameraDevice::setFrameRateType(MotionTrackerCameraDeviceFPS arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_MotionTrackerCameraDevice_setFrameRateType(cdata_, static_cast<easyar_MotionTrackerCameraDeviceFPS>(arg0));
return _return_value_;
}
inline bool MotionTrackerCameraDevice::setFocusMode(MotionTrackerCameraDeviceFocusMode arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_MotionTrackerCameraDevice_setFocusMode(cdata_, static_cast<easyar_MotionTrackerCameraDeviceFocusMode>(arg0));
return _return_value_;
}
inline bool MotionTrackerCameraDevice::setFrameResolutionType(MotionTrackerCameraDeviceResolution arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_MotionTrackerCameraDevice_setFrameResolutionType(cdata_, static_cast<easyar_MotionTrackerCameraDeviceResolution>(arg0));
return _return_value_;
}
inline void MotionTrackerCameraDevice::setBufferCapacity(int arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_MotionTrackerCameraDevice_setBufferCapacity(cdata_, arg0);
}
inline int MotionTrackerCameraDevice::bufferCapacity()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_MotionTrackerCameraDevice_bufferCapacity(cdata_);
return _return_value_;
}
inline void MotionTrackerCameraDevice::inputFrameSource(/* OUT */ InputFrameSource * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_InputFrameSource * _return_value_ = NULL;
easyar_MotionTrackerCameraDevice_inputFrameSource(cdata_, &_return_value_);
*Return = new InputFrameSource(_return_value_);
}
inline bool MotionTrackerCameraDevice::start()
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_MotionTrackerCameraDevice_start(cdata_);
return _return_value_;
}
inline void MotionTrackerCameraDevice::stop()
{
if (cdata_ == NULL) {
return;
}
easyar_MotionTrackerCameraDevice_stop(cdata_);
}
inline void MotionTrackerCameraDevice::close()
{
if (cdata_ == NULL) {
return;
}
easyar_MotionTrackerCameraDevice_close(cdata_);
}
inline void MotionTrackerCameraDevice::hitTestAgainstPointCloud(Vec2F arg0, /* OUT */ ListOfVec3F * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfVec3F * _return_value_ = NULL;
easyar_MotionTrackerCameraDevice_hitTestAgainstPointCloud(cdata_, arg0.get_cdata(), &_return_value_);
*Return = new ListOfVec3F(_return_value_);
}
inline void MotionTrackerCameraDevice::hitTestAgainstHorizontalPlane(Vec2F arg0, /* OUT */ ListOfVec3F * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfVec3F * _return_value_ = NULL;
easyar_MotionTrackerCameraDevice_hitTestAgainstHorizontalPlane(cdata_, arg0.get_cdata(), &_return_value_);
*Return = new ListOfVec3F(_return_value_);
}
inline void MotionTrackerCameraDevice::getLocalPointsCloud(/* OUT */ ListOfVec3F * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfVec3F * _return_value_ = NULL;
easyar_MotionTrackerCameraDevice_getLocalPointsCloud(cdata_, &_return_value_);
*Return = new ListOfVec3F(_return_value_);
}
#ifndef __IMPLEMENTATION_EASYAR_LISTOFVEC_F__
#define __IMPLEMENTATION_EASYAR_LISTOFVEC_F__
inline ListOfVec3F::ListOfVec3F(easyar_ListOfVec3F * cdata)
: cdata_(cdata)
{
}
inline ListOfVec3F::~ListOfVec3F()
{
if (cdata_) {
easyar_ListOfVec3F__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfVec3F::ListOfVec3F(const ListOfVec3F & data)
: cdata_(static_cast<easyar_ListOfVec3F *>(NULL))
{
easyar_ListOfVec3F_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfVec3F * ListOfVec3F::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfVec3F * ListOfVec3F::get_cdata()
{
return cdata_;
}
inline ListOfVec3F::ListOfVec3F(easyar_Vec3F * begin, easyar_Vec3F * end)
: cdata_(static_cast<easyar_ListOfVec3F *>(NULL))
{
easyar_ListOfVec3F__ctor(begin, end, &cdata_);
}
inline int ListOfVec3F::size() const
{
return easyar_ListOfVec3F_size(cdata_);
}
inline Vec3F ListOfVec3F::at(int index) const
{
easyar_Vec3F _return_value_ = easyar_ListOfVec3F_at(cdata_, index);
return Vec3F(_return_value_.data[0], _return_value_.data[1], _return_value_.data[2]);
}
#endif
}
#endif
fileFormatVersion: 2
guid: d7f24f2019297df44a44ae1e68adce12
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#import "easyar/types.oc.h"
/// <summary>
/// MotionTrackerCameraDevice implements a camera device with metric-scale six degree-of-freedom motion tracking, which outputs `InputFrame`_ (including image, camera parameters, timestamp, 6DOF pose and tracking status).
/// After creation, start/stop can be invoked to start or stop data flow.
/// When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
/// MotionTrackerCameraDevice outputs `InputFrame`_ from inputFrameSource. inputFrameSource shall be connected to `InputFrameSink`_ for further use. Refer to `Overview &lt;Overview.html&gt;`__ .
/// </summary>
@interface easyar_MotionTrackerCameraDevice : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Create MotionTrackerCameraDevice object.
/// </summary>
+ (easyar_MotionTrackerCameraDevice *) create;
/// <summary>
/// Check if the devices supports motion tracking. Returns True if the device supports Motion Tracking, otherwise returns False.
/// </summary>
+ (bool)isAvailable;
/// <summary>
/// Sets current index of frame rate. Call before start. If this function is not called, the default is 30 fps.
/// </summary>
- (bool)setFrameRateType:(easyar_MotionTrackerCameraDeviceFPS)fps;
/// <summary>
/// Sets focus mode to focusMode. Call before start. If this function is not called, the default is Continousauto.
/// </summary>
- (bool)setFocusMode:(easyar_MotionTrackerCameraDeviceFocusMode)focusMode;
/// <summary>
/// Sets current index of frame resolution. Call before start. If this function is not called, the default is 1280 x 960 or 1280 x 720.
/// </summary>
- (bool)setFrameResolutionType:(easyar_MotionTrackerCameraDeviceResolution)resolution;
/// <summary>
/// Set `InputFrame`_ buffer capacity.
/// bufferCapacity is the capacity of `InputFrame`_ buffer. If the count of `InputFrame`_ which has been output from the device and have not been released is higher than this number, the device will not output new `InputFrame`_ until previous `InputFrame`_ has been released. This may cause screen stuck. Refer to `Overview &lt;Overview.html&gt;`__ .
/// </summary>
- (void)setBufferCapacity:(int)capacity;
/// <summary>
/// Get `InputFrame`_ buffer capacity. The default is 8.
/// </summary>
- (int)bufferCapacity;
/// <summary>
/// `InputFrame`_ output port.
/// </summary>
- (easyar_InputFrameSource *)inputFrameSource;
/// <summary>
/// Start motion tracking or resume motion tracking after pause.
/// Notice: Calling start after pausing will trigger device relocalization. Tracking will resume when the relocalization process succeeds.
/// </summary>
- (bool)start;
/// <summary>
/// Pause motion tracking. Call `start` to trigger relocation, resume motion tracking if the relocation succeeds.
/// </summary>
- (void)stop;
/// <summary>
/// Close motion tracking. The component shall not be used after calling close.
/// </summary>
- (void)close;
/// <summary>
/// Perform hit test against the point cloud and return the nearest 3D point. The 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.
/// For the camera image coordinate system ([0, 1]^2), x-right, y-down, and origin is at left-top corner. `CameraParameters.imageCoordinatesFromScreenCoordinates`_ can be used to convert points from screen coordinate system to camera image coordinate system.
/// </summary>
- (NSArray<easyar_Vec3F *> *)hitTestAgainstPointCloud:(easyar_Vec2F *)cameraImagePoint;
/// <summary>
/// Performs ray cast from the user&#39;s device in the direction of given screen point.
/// Intersections with horizontal plane is detected in real time in the current field of view,and return the 3D point nearest to ray on horizontal plane.
/// For the camera image coordinate system ([0, 1]^2), x-right, y-down, and origin is at left-top corner. `CameraParameters.imageCoordinatesFromScreenCoordinates`_ can be used to convert points from screen coordinate system to camera image coordinate system.
/// The output point cloud coordinate on Horizontal plane is in the world coordinate system. The 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.
/// </summary>
- (NSArray<easyar_Vec3F *> *)hitTestAgainstHorizontalPlane:(easyar_Vec2F *)cameraImagePoint;
/// <summary>
/// Returns the vector of point cloud coordinate. Each 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.
/// </summary>
- (NSArray<easyar_Vec3F *> *)getLocalPointsCloud;
@end
fileFormatVersion: 2
guid: 964a1670819e9b14b898ca5b689ebffc
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#ifndef __EASYAR_OBJECTTARGET_H__
#define __EASYAR_OBJECTTARGET_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void easyar_ObjectTargetParameters__ctor(/* OUT */ easyar_ObjectTargetParameters * * Return);
/// <summary>
/// Gets `Buffer`_ dictionary.
/// </summary>
void easyar_ObjectTargetParameters_bufferDictionary(easyar_ObjectTargetParameters * This, /* OUT */ easyar_BufferDictionary * * Return);
/// <summary>
/// Sets `Buffer`_ dictionary. obj, mtl and jpg/png files shall be loaded into the dictionay, and be able to be located by relative or absolute paths.
/// </summary>
void easyar_ObjectTargetParameters_setBufferDictionary(easyar_ObjectTargetParameters * This, easyar_BufferDictionary * bufferDictionary);
/// <summary>
/// Gets obj file path.
/// </summary>
void easyar_ObjectTargetParameters_objPath(easyar_ObjectTargetParameters * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Sets obj file path.
/// </summary>
void easyar_ObjectTargetParameters_setObjPath(easyar_ObjectTargetParameters * This, easyar_String * objPath);
/// <summary>
/// Gets target name. It can be used to distinguish targets.
/// </summary>
void easyar_ObjectTargetParameters_name(easyar_ObjectTargetParameters * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Sets target name.
/// </summary>
void easyar_ObjectTargetParameters_setName(easyar_ObjectTargetParameters * This, easyar_String * name);
/// <summary>
/// Gets the target uid. You can set this uid in the json config as a method to distinguish from targets.
/// </summary>
void easyar_ObjectTargetParameters_uid(easyar_ObjectTargetParameters * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Sets target uid.
/// </summary>
void easyar_ObjectTargetParameters_setUid(easyar_ObjectTargetParameters * This, easyar_String * uid);
/// <summary>
/// Gets meta data.
/// </summary>
void easyar_ObjectTargetParameters_meta(easyar_ObjectTargetParameters * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Sets meta data。
/// </summary>
void easyar_ObjectTargetParameters_setMeta(easyar_ObjectTargetParameters * This, easyar_String * meta);
/// <summary>
/// Gets the scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// </summary>
float easyar_ObjectTargetParameters_scale(easyar_ObjectTargetParameters * This);
/// <summary>
/// Sets the scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// It is needed to set the model scale in rendering engine separately.
/// </summary>
void easyar_ObjectTargetParameters_setScale(easyar_ObjectTargetParameters * This, float size);
void easyar_ObjectTargetParameters__dtor(easyar_ObjectTargetParameters * This);
void easyar_ObjectTargetParameters__retain(const easyar_ObjectTargetParameters * This, /* OUT */ easyar_ObjectTargetParameters * * Return);
const char * easyar_ObjectTargetParameters__typeName(const easyar_ObjectTargetParameters * This);
void easyar_ObjectTarget__ctor(/* OUT */ easyar_ObjectTarget * * Return);
/// <summary>
/// Creates a target from parameters.
/// </summary>
void easyar_ObjectTarget_createFromParameters(easyar_ObjectTargetParameters * parameters, /* OUT */ easyar_OptionalOfObjectTarget * Return);
/// <summary>
/// Creats a target from obj, mtl and jpg/png files.
/// </summary>
void easyar_ObjectTarget_createFromObjectFile(easyar_String * path, easyar_StorageType storageType, easyar_String * name, easyar_String * uid, easyar_String * meta, float scale, /* OUT */ easyar_OptionalOfObjectTarget * Return);
/// <summary>
/// The scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// </summary>
float easyar_ObjectTarget_scale(const easyar_ObjectTarget * This);
/// <summary>
/// The bounding box of object, it contains the 8 points of the box.
/// Vertices&#39;s indices are defined and stored following the rule:
/// ::
///
/// 4-----7
/// /| /|
/// 5-----6 | z
/// | | | | |
/// | 0---|-3 o---y
/// |/ |/ /
/// 1-----2 x
/// </summary>
void easyar_ObjectTarget_boundingBox(easyar_ObjectTarget * This, /* OUT */ easyar_ListOfVec3F * * Return);
/// <summary>
/// Sets model target scale, this will overwrite the value set in the json file or the default value. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// It is needed to set the model scale in rendering engine separately.
/// It also should been done before loading ObjectTarget into `ObjectTracker`_ using `ObjectTracker.loadTarget`_.
/// </summary>
bool easyar_ObjectTarget_setScale(easyar_ObjectTarget * This, float scale);
/// <summary>
/// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
/// </summary>
int easyar_ObjectTarget_runtimeID(const easyar_ObjectTarget * This);
/// <summary>
/// Returns the target uid. A target uid is useful in cloud based algorithms. If no cloud is used, you can set this uid in the json config as a alternative method to distinguish from targets.
/// </summary>
void easyar_ObjectTarget_uid(const easyar_ObjectTarget * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Returns the target name. Name is used to distinguish targets in a json file.
/// </summary>
void easyar_ObjectTarget_name(const easyar_ObjectTarget * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Set name. It will erase previously set data or data from cloud.
/// </summary>
void easyar_ObjectTarget_setName(easyar_ObjectTarget * This, easyar_String * name);
/// <summary>
/// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
/// </summary>
void easyar_ObjectTarget_meta(const easyar_ObjectTarget * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Set meta data. It will erase previously set data or data from cloud.
/// </summary>
void easyar_ObjectTarget_setMeta(easyar_ObjectTarget * This, easyar_String * data);
void easyar_ObjectTarget__dtor(easyar_ObjectTarget * This);
void easyar_ObjectTarget__retain(const easyar_ObjectTarget * This, /* OUT */ easyar_ObjectTarget * * Return);
const char * easyar_ObjectTarget__typeName(const easyar_ObjectTarget * This);
void easyar_castObjectTargetToTarget(const easyar_ObjectTarget * This, /* OUT */ easyar_Target * * Return);
void easyar_tryCastTargetToObjectTarget(const easyar_Target * This, /* OUT */ easyar_ObjectTarget * * Return);
void easyar_ListOfVec3F__ctor(easyar_Vec3F const * begin, easyar_Vec3F const * end, /* OUT */ easyar_ListOfVec3F * * Return);
void easyar_ListOfVec3F__dtor(easyar_ListOfVec3F * This);
void easyar_ListOfVec3F_copy(const easyar_ListOfVec3F * This, /* OUT */ easyar_ListOfVec3F * * Return);
int easyar_ListOfVec3F_size(const easyar_ListOfVec3F * This);
easyar_Vec3F easyar_ListOfVec3F_at(const easyar_ListOfVec3F * This, int index);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: f7e9cea3531cc644387fc10ca20210e6
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#ifndef __EASYAR_OBJECTTARGET_HXX__
#define __EASYAR_OBJECTTARGET_HXX__
#include "easyar/types.hxx"
#include "easyar/target.hxx"
namespace easyar {
/// <summary>
/// ObjectTargetParameters represents the parameters to create a `ObjectTarget`_ .
/// </summary>
class ObjectTargetParameters
{
protected:
easyar_ObjectTargetParameters * cdata_ ;
void init_cdata(easyar_ObjectTargetParameters * cdata);
virtual ObjectTargetParameters & operator=(const ObjectTargetParameters & data) { return *this; } //deleted
public:
ObjectTargetParameters(easyar_ObjectTargetParameters * cdata);
virtual ~ObjectTargetParameters();
ObjectTargetParameters(const ObjectTargetParameters & data);
const easyar_ObjectTargetParameters * get_cdata() const;
easyar_ObjectTargetParameters * get_cdata();
ObjectTargetParameters();
/// <summary>
/// Gets `Buffer`_ dictionary.
/// </summary>
void bufferDictionary(/* OUT */ BufferDictionary * * Return);
/// <summary>
/// Sets `Buffer`_ dictionary. obj, mtl and jpg/png files shall be loaded into the dictionay, and be able to be located by relative or absolute paths.
/// </summary>
void setBufferDictionary(BufferDictionary * bufferDictionary);
/// <summary>
/// Gets obj file path.
/// </summary>
void objPath(/* OUT */ String * * Return);
/// <summary>
/// Sets obj file path.
/// </summary>
void setObjPath(String * objPath);
/// <summary>
/// Gets target name. It can be used to distinguish targets.
/// </summary>
void name(/* OUT */ String * * Return);
/// <summary>
/// Sets target name.
/// </summary>
void setName(String * name);
/// <summary>
/// Gets the target uid. You can set this uid in the json config as a method to distinguish from targets.
/// </summary>
void uid(/* OUT */ String * * Return);
/// <summary>
/// Sets target uid.
/// </summary>
void setUid(String * uid);
/// <summary>
/// Gets meta data.
/// </summary>
void meta(/* OUT */ String * * Return);
/// <summary>
/// Sets meta data。
/// </summary>
void setMeta(String * meta);
/// <summary>
/// Gets the scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// </summary>
float scale();
/// <summary>
/// Sets the scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// It is needed to set the model scale in rendering engine separately.
/// </summary>
void setScale(float size);
};
/// <summary>
/// ObjectTarget represents 3d object targets that can be tracked by `ObjectTracker`_ .
/// The size of ObjectTarget is determined by the `obj` file. You can change it by changing the object `scale`, which is default to 1.
/// A ObjectTarget can be tracked by `ObjectTracker`_ after a successful load into the `ObjectTracker`_ using `ObjectTracker.loadTarget`_ .
/// </summary>
class ObjectTarget : public Target
{
protected:
easyar_ObjectTarget * cdata_ ;
void init_cdata(easyar_ObjectTarget * cdata);
virtual ObjectTarget & operator=(const ObjectTarget & data) { return *this; } //deleted
public:
ObjectTarget(easyar_ObjectTarget * cdata);
virtual ~ObjectTarget();
ObjectTarget(const ObjectTarget & data);
const easyar_ObjectTarget * get_cdata() const;
easyar_ObjectTarget * get_cdata();
ObjectTarget();
/// <summary>
/// Creates a target from parameters.
/// </summary>
static void createFromParameters(ObjectTargetParameters * parameters, /* OUT */ ObjectTarget * * Return);
/// <summary>
/// Creats a target from obj, mtl and jpg/png files.
/// </summary>
static void createFromObjectFile(String * path, StorageType storageType, String * name, String * uid, String * meta, float scale, /* OUT */ ObjectTarget * * Return);
/// <summary>
/// The scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// </summary>
float scale();
/// <summary>
/// The bounding box of object, it contains the 8 points of the box.
/// Vertices&#39;s indices are defined and stored following the rule:
/// ::
///
/// 4-----7
/// /| /|
/// 5-----6 | z
/// | | | | |
/// | 0---|-3 o---y
/// |/ |/ /
/// 1-----2 x
/// </summary>
void boundingBox(/* OUT */ ListOfVec3F * * Return);
/// <summary>
/// Sets model target scale, this will overwrite the value set in the json file or the default value. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// It is needed to set the model scale in rendering engine separately.
/// It also should been done before loading ObjectTarget into `ObjectTracker`_ using `ObjectTracker.loadTarget`_.
/// </summary>
bool setScale(float scale);
/// <summary>
/// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
/// </summary>
int runtimeID();
/// <summary>
/// Returns the target uid. A target uid is useful in cloud based algorithms. If no cloud is used, you can set this uid in the json config as a alternative method to distinguish from targets.
/// </summary>
void uid(/* OUT */ String * * Return);
/// <summary>
/// Returns the target name. Name is used to distinguish targets in a json file.
/// </summary>
void name(/* OUT */ String * * Return);
/// <summary>
/// Set name. It will erase previously set data or data from cloud.
/// </summary>
void setName(String * name);
/// <summary>
/// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
/// </summary>
void meta(/* OUT */ String * * Return);
/// <summary>
/// Set meta data. It will erase previously set data or data from cloud.
/// </summary>
void setMeta(String * data);
static void tryCastFromTarget(Target * v, /* OUT */ ObjectTarget * * Return);
};
#ifndef __EASYAR_OPTIONALOFOBJECTTARGET__
#define __EASYAR_OPTIONALOFOBJECTTARGET__
struct OptionalOfObjectTarget
{
bool has_value;
ObjectTarget * value;
};
static inline easyar_OptionalOfObjectTarget OptionalOfObjectTarget_to_c(ObjectTarget * o);
#endif
#ifndef __EASYAR_LISTOFVEC_F__
#define __EASYAR_LISTOFVEC_F__
class ListOfVec3F
{
private:
easyar_ListOfVec3F * cdata_;
virtual ListOfVec3F & operator=(const ListOfVec3F & data) { return *this; } //deleted
public:
ListOfVec3F(easyar_ListOfVec3F * cdata);
virtual ~ListOfVec3F();
ListOfVec3F(const ListOfVec3F & data);
const easyar_ListOfVec3F * get_cdata() const;
easyar_ListOfVec3F * get_cdata();
ListOfVec3F(easyar_Vec3F * begin, easyar_Vec3F * end);
int size() const;
Vec3F at(int index) const;
};
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_OBJECTTARGET_HXX__
#define __IMPLEMENTATION_EASYAR_OBJECTTARGET_HXX__
#include "easyar/objecttarget.h"
#include "easyar/buffer.hxx"
#include "easyar/target.hxx"
#include "easyar/vector.hxx"
namespace easyar {
inline ObjectTargetParameters::ObjectTargetParameters(easyar_ObjectTargetParameters * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline ObjectTargetParameters::~ObjectTargetParameters()
{
if (cdata_) {
easyar_ObjectTargetParameters__dtor(cdata_);
cdata_ = NULL;
}
}
inline ObjectTargetParameters::ObjectTargetParameters(const ObjectTargetParameters & data)
:
cdata_(NULL)
{
easyar_ObjectTargetParameters * cdata = NULL;
easyar_ObjectTargetParameters__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ObjectTargetParameters * ObjectTargetParameters::get_cdata() const
{
return cdata_;
}
inline easyar_ObjectTargetParameters * ObjectTargetParameters::get_cdata()
{
return cdata_;
}
inline void ObjectTargetParameters::init_cdata(easyar_ObjectTargetParameters * cdata)
{
cdata_ = cdata;
}
inline ObjectTargetParameters::ObjectTargetParameters()
:
cdata_(NULL)
{
easyar_ObjectTargetParameters * _return_value_ = NULL;
easyar_ObjectTargetParameters__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline void ObjectTargetParameters::bufferDictionary(/* OUT */ BufferDictionary * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_BufferDictionary * _return_value_ = NULL;
easyar_ObjectTargetParameters_bufferDictionary(cdata_, &_return_value_);
*Return = new BufferDictionary(_return_value_);
}
inline void ObjectTargetParameters::setBufferDictionary(BufferDictionary * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTargetParameters_setBufferDictionary(cdata_, arg0->get_cdata());
}
inline void ObjectTargetParameters::objPath(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ObjectTargetParameters_objPath(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ObjectTargetParameters::setObjPath(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTargetParameters_setObjPath(cdata_, arg0->get_cdata());
}
inline void ObjectTargetParameters::name(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ObjectTargetParameters_name(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ObjectTargetParameters::setName(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTargetParameters_setName(cdata_, arg0->get_cdata());
}
inline void ObjectTargetParameters::uid(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ObjectTargetParameters_uid(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ObjectTargetParameters::setUid(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTargetParameters_setUid(cdata_, arg0->get_cdata());
}
inline void ObjectTargetParameters::meta(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ObjectTargetParameters_meta(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ObjectTargetParameters::setMeta(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTargetParameters_setMeta(cdata_, arg0->get_cdata());
}
inline float ObjectTargetParameters::scale()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_ObjectTargetParameters_scale(cdata_);
return _return_value_;
}
inline void ObjectTargetParameters::setScale(float arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTargetParameters_setScale(cdata_, arg0);
}
inline ObjectTarget::ObjectTarget(easyar_ObjectTarget * cdata)
:
Target(static_cast<easyar_Target *>(NULL)),
cdata_(NULL)
{
init_cdata(cdata);
}
inline ObjectTarget::~ObjectTarget()
{
if (cdata_) {
easyar_ObjectTarget__dtor(cdata_);
cdata_ = NULL;
}
}
inline ObjectTarget::ObjectTarget(const ObjectTarget & data)
:
Target(static_cast<easyar_Target *>(NULL)),
cdata_(NULL)
{
easyar_ObjectTarget * cdata = NULL;
easyar_ObjectTarget__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ObjectTarget * ObjectTarget::get_cdata() const
{
return cdata_;
}
inline easyar_ObjectTarget * ObjectTarget::get_cdata()
{
return cdata_;
}
inline void ObjectTarget::init_cdata(easyar_ObjectTarget * cdata)
{
cdata_ = cdata;
{
easyar_Target * cdata_inner = NULL;
easyar_castObjectTargetToTarget(cdata, &cdata_inner);
Target::init_cdata(cdata_inner);
}
}
inline ObjectTarget::ObjectTarget()
:
Target(static_cast<easyar_Target *>(NULL)),
cdata_(NULL)
{
easyar_ObjectTarget * _return_value_ = NULL;
easyar_ObjectTarget__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline void ObjectTarget::createFromParameters(ObjectTargetParameters * arg0, /* OUT */ ObjectTarget * * Return)
{
easyar_OptionalOfObjectTarget _return_value_ = {false, NULL};
easyar_ObjectTarget_createFromParameters(arg0->get_cdata(), &_return_value_);
*Return = (_return_value_.has_value ? new ObjectTarget(_return_value_.value) : NULL);
}
inline void ObjectTarget::createFromObjectFile(String * arg0, StorageType arg1, String * arg2, String * arg3, String * arg4, float arg5, /* OUT */ ObjectTarget * * Return)
{
easyar_OptionalOfObjectTarget _return_value_ = {false, NULL};
easyar_ObjectTarget_createFromObjectFile(arg0->get_cdata(), static_cast<easyar_StorageType>(arg1), arg2->get_cdata(), arg3->get_cdata(), arg4->get_cdata(), arg5, &_return_value_);
*Return = (_return_value_.has_value ? new ObjectTarget(_return_value_.value) : NULL);
}
inline float ObjectTarget::scale()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_ObjectTarget_scale(cdata_);
return _return_value_;
}
inline void ObjectTarget::boundingBox(/* OUT */ ListOfVec3F * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfVec3F * _return_value_ = NULL;
easyar_ObjectTarget_boundingBox(cdata_, &_return_value_);
*Return = new ListOfVec3F(_return_value_);
}
inline bool ObjectTarget::setScale(float arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_ObjectTarget_setScale(cdata_, arg0);
return _return_value_;
}
inline int ObjectTarget::runtimeID()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_ObjectTarget_runtimeID(cdata_);
return _return_value_;
}
inline void ObjectTarget::uid(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ObjectTarget_uid(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ObjectTarget::name(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ObjectTarget_name(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ObjectTarget::setName(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTarget_setName(cdata_, arg0->get_cdata());
}
inline void ObjectTarget::meta(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ObjectTarget_meta(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ObjectTarget::setMeta(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTarget_setMeta(cdata_, arg0->get_cdata());
}
inline void ObjectTarget::tryCastFromTarget(Target * v, /* OUT */ ObjectTarget * * Return)
{
if (v == NULL) {
*Return = NULL;
return;
}
easyar_ObjectTarget * cdata = NULL;
easyar_tryCastTargetToObjectTarget(v->get_cdata(), &cdata);
if (cdata == NULL) {
*Return = NULL;
return;
}
*Return = new ObjectTarget(cdata);
}
#ifndef __IMPLEMENTATION_EASYAR_OPTIONALOFOBJECTTARGET__
#define __IMPLEMENTATION_EASYAR_OPTIONALOFOBJECTTARGET__
static inline easyar_OptionalOfObjectTarget OptionalOfObjectTarget_to_c(ObjectTarget * o)
{
if (o != NULL) {
easyar_OptionalOfObjectTarget _return_value_ = {true, o->get_cdata()};
return _return_value_;
} else {
easyar_OptionalOfObjectTarget _return_value_ = {false, NULL};
return _return_value_;
}
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_LISTOFVEC_F__
#define __IMPLEMENTATION_EASYAR_LISTOFVEC_F__
inline ListOfVec3F::ListOfVec3F(easyar_ListOfVec3F * cdata)
: cdata_(cdata)
{
}
inline ListOfVec3F::~ListOfVec3F()
{
if (cdata_) {
easyar_ListOfVec3F__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfVec3F::ListOfVec3F(const ListOfVec3F & data)
: cdata_(static_cast<easyar_ListOfVec3F *>(NULL))
{
easyar_ListOfVec3F_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfVec3F * ListOfVec3F::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfVec3F * ListOfVec3F::get_cdata()
{
return cdata_;
}
inline ListOfVec3F::ListOfVec3F(easyar_Vec3F * begin, easyar_Vec3F * end)
: cdata_(static_cast<easyar_ListOfVec3F *>(NULL))
{
easyar_ListOfVec3F__ctor(begin, end, &cdata_);
}
inline int ListOfVec3F::size() const
{
return easyar_ListOfVec3F_size(cdata_);
}
inline Vec3F ListOfVec3F::at(int index) const
{
easyar_Vec3F _return_value_ = easyar_ListOfVec3F_at(cdata_, index);
return Vec3F(_return_value_.data[0], _return_value_.data[1], _return_value_.data[2]);
}
#endif
}
#endif
fileFormatVersion: 2
guid: 935ee9726f162c842b8468c4b83736df
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#import "easyar/types.oc.h"
#import "easyar/target.oc.h"
/// <summary>
/// ObjectTargetParameters represents the parameters to create a `ObjectTarget`_ .
/// </summary>
@interface easyar_ObjectTargetParameters : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (easyar_ObjectTargetParameters *) create;
/// <summary>
/// Gets `Buffer`_ dictionary.
/// </summary>
- (easyar_BufferDictionary *)bufferDictionary;
/// <summary>
/// Sets `Buffer`_ dictionary. obj, mtl and jpg/png files shall be loaded into the dictionay, and be able to be located by relative or absolute paths.
/// </summary>
- (void)setBufferDictionary:(easyar_BufferDictionary *)bufferDictionary;
/// <summary>
/// Gets obj file path.
/// </summary>
- (NSString *)objPath;
/// <summary>
/// Sets obj file path.
/// </summary>
- (void)setObjPath:(NSString *)objPath;
/// <summary>
/// Gets target name. It can be used to distinguish targets.
/// </summary>
- (NSString *)name;
/// <summary>
/// Sets target name.
/// </summary>
- (void)setName:(NSString *)name;
/// <summary>
/// Gets the target uid. You can set this uid in the json config as a method to distinguish from targets.
/// </summary>
- (NSString *)uid;
/// <summary>
/// Sets target uid.
/// </summary>
- (void)setUid:(NSString *)uid;
/// <summary>
/// Gets meta data.
/// </summary>
- (NSString *)meta;
/// <summary>
/// Sets meta data。
/// </summary>
- (void)setMeta:(NSString *)meta;
/// <summary>
/// Gets the scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// </summary>
- (float)scale;
/// <summary>
/// Sets the scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// It is needed to set the model scale in rendering engine separately.
/// </summary>
- (void)setScale:(float)size;
@end
/// <summary>
/// ObjectTarget represents 3d object targets that can be tracked by `ObjectTracker`_ .
/// The size of ObjectTarget is determined by the `obj` file. You can change it by changing the object `scale`, which is default to 1.
/// A ObjectTarget can be tracked by `ObjectTracker`_ after a successful load into the `ObjectTracker`_ using `ObjectTracker.loadTarget`_ .
/// </summary>
@interface easyar_ObjectTarget : easyar_Target
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (easyar_ObjectTarget *) create;
/// <summary>
/// Creates a target from parameters.
/// </summary>
+ (easyar_ObjectTarget *)createFromParameters:(easyar_ObjectTargetParameters *)parameters;
/// <summary>
/// Creats a target from obj, mtl and jpg/png files.
/// </summary>
+ (easyar_ObjectTarget *)createFromObjectFile:(NSString *)path storageType:(easyar_StorageType)storageType name:(NSString *)name uid:(NSString *)uid meta:(NSString *)meta scale:(float)scale;
/// <summary>
/// The scale of model. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// </summary>
- (float)scale;
/// <summary>
/// The bounding box of object, it contains the 8 points of the box.
/// Vertices&#39;s indices are defined and stored following the rule:
/// ::
///
/// 4-----7
/// /| /|
/// 5-----6 | z
/// | | | | |
/// | 0---|-3 o---y
/// |/ |/ /
/// 1-----2 x
/// </summary>
- (NSArray<easyar_Vec3F *> *)boundingBox;
/// <summary>
/// Sets model target scale, this will overwrite the value set in the json file or the default value. The value is the physical scale divided by model coordinate system scale. The default value is 1. (Supposing the unit of model coordinate system is 1 meter.)
/// It is needed to set the model scale in rendering engine separately.
/// It also should been done before loading ObjectTarget into `ObjectTracker`_ using `ObjectTracker.loadTarget`_.
/// </summary>
- (bool)setScale:(float)scale;
/// <summary>
/// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
/// </summary>
- (int)runtimeID;
/// <summary>
/// Returns the target uid. A target uid is useful in cloud based algorithms. If no cloud is used, you can set this uid in the json config as a alternative method to distinguish from targets.
/// </summary>
- (NSString *)uid;
/// <summary>
/// Returns the target name. Name is used to distinguish targets in a json file.
/// </summary>
- (NSString *)name;
/// <summary>
/// Set name. It will erase previously set data or data from cloud.
/// </summary>
- (void)setName:(NSString *)name;
/// <summary>
/// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
/// </summary>
- (NSString *)meta;
/// <summary>
/// Set meta data. It will erase previously set data or data from cloud.
/// </summary>
- (void)setMeta:(NSString *)data;
@end
fileFormatVersion: 2
guid: 3c11a8352d5e214459eb7bf02eafbbf3
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#ifndef __EASYAR_OBJECTTRACKER_H__
#define __EASYAR_OBJECTTRACKER_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Returns the list of `TargetInstance`_ contained in the result.
/// </summary>
void easyar_ObjectTrackerResult_targetInstances(const easyar_ObjectTrackerResult * This, /* OUT */ easyar_ListOfTargetInstance * * Return);
/// <summary>
/// Sets the list of `TargetInstance`_ contained in the result.
/// </summary>
void easyar_ObjectTrackerResult_setTargetInstances(easyar_ObjectTrackerResult * This, easyar_ListOfTargetInstance * instances);
void easyar_ObjectTrackerResult__dtor(easyar_ObjectTrackerResult * This);
void easyar_ObjectTrackerResult__retain(const easyar_ObjectTrackerResult * This, /* OUT */ easyar_ObjectTrackerResult * * Return);
const char * easyar_ObjectTrackerResult__typeName(const easyar_ObjectTrackerResult * This);
void easyar_castObjectTrackerResultToFrameFilterResult(const easyar_ObjectTrackerResult * This, /* OUT */ easyar_FrameFilterResult * * Return);
void easyar_tryCastFrameFilterResultToObjectTrackerResult(const easyar_FrameFilterResult * This, /* OUT */ easyar_ObjectTrackerResult * * Return);
void easyar_castObjectTrackerResultToTargetTrackerResult(const easyar_ObjectTrackerResult * This, /* OUT */ easyar_TargetTrackerResult * * Return);
void easyar_tryCastTargetTrackerResultToObjectTrackerResult(const easyar_TargetTrackerResult * This, /* OUT */ easyar_ObjectTrackerResult * * Return);
/// <summary>
/// Returns true.
/// </summary>
bool easyar_ObjectTracker_isAvailable(void);
/// <summary>
/// `FeedbackFrame`_ input port. The InputFrame member of FeedbackFrame must have raw image, timestamp, and camera parameters.
/// </summary>
void easyar_ObjectTracker_feedbackFrameSink(easyar_ObjectTracker * This, /* OUT */ easyar_FeedbackFrameSink * * Return);
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
int easyar_ObjectTracker_bufferRequirement(easyar_ObjectTracker * This);
/// <summary>
/// `OutputFrame`_ output port.
/// </summary>
void easyar_ObjectTracker_outputFrameSource(easyar_ObjectTracker * This, /* OUT */ easyar_OutputFrameSource * * Return);
/// <summary>
/// Creates an instance.
/// </summary>
void easyar_ObjectTracker_create(/* OUT */ easyar_ObjectTracker * * Return);
/// <summary>
/// Starts the track algorithm.
/// </summary>
bool easyar_ObjectTracker_start(easyar_ObjectTracker * This);
/// <summary>
/// Stops the track algorithm. Call start to start the track again.
/// </summary>
void easyar_ObjectTracker_stop(easyar_ObjectTracker * This);
/// <summary>
/// Close. The component shall not be used after calling close.
/// </summary>
void easyar_ObjectTracker_close(easyar_ObjectTracker * This);
/// <summary>
/// Load a `Target`_ into the tracker. A Target can only be tracked by tracker after a successful load.
/// This method is an asynchronous method. A load operation may take some time to finish and detection of a new/lost target may take more time during the load. The track time after detection will not be affected. If you want to know the load result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void easyar_ObjectTracker_loadTarget(easyar_ObjectTracker * This, easyar_Target * target, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Unload a `Target`_ from the tracker.
/// This method is an asynchronous method. An unload operation may take some time to finish and detection of a new/lost target may take more time during the unload. If you want to know the unload result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void easyar_ObjectTracker_unloadTarget(easyar_ObjectTracker * This, easyar_Target * target, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Returns current loaded targets in the tracker. If an asynchronous load/unload is in progress, the returned value will not reflect the result until all load/unload finish.
/// </summary>
void easyar_ObjectTracker_targets(const easyar_ObjectTracker * This, /* OUT */ easyar_ListOfTarget * * Return);
/// <summary>
/// Sets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
bool easyar_ObjectTracker_setSimultaneousNum(easyar_ObjectTracker * This, int num);
/// <summary>
/// Gets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
int easyar_ObjectTracker_simultaneousNum(const easyar_ObjectTracker * This);
void easyar_ObjectTracker__dtor(easyar_ObjectTracker * This);
void easyar_ObjectTracker__retain(const easyar_ObjectTracker * This, /* OUT */ easyar_ObjectTracker * * Return);
const char * easyar_ObjectTracker__typeName(const easyar_ObjectTracker * This);
void easyar_ListOfTargetInstance__ctor(easyar_TargetInstance * const * begin, easyar_TargetInstance * const * end, /* OUT */ easyar_ListOfTargetInstance * * Return);
void easyar_ListOfTargetInstance__dtor(easyar_ListOfTargetInstance * This);
void easyar_ListOfTargetInstance_copy(const easyar_ListOfTargetInstance * This, /* OUT */ easyar_ListOfTargetInstance * * Return);
int easyar_ListOfTargetInstance_size(const easyar_ListOfTargetInstance * This);
easyar_TargetInstance * easyar_ListOfTargetInstance_at(const easyar_ListOfTargetInstance * This, int index);
void easyar_ListOfTarget__ctor(easyar_Target * const * begin, easyar_Target * const * end, /* OUT */ easyar_ListOfTarget * * Return);
void easyar_ListOfTarget__dtor(easyar_ListOfTarget * This);
void easyar_ListOfTarget_copy(const easyar_ListOfTarget * This, /* OUT */ easyar_ListOfTarget * * Return);
int easyar_ListOfTarget_size(const easyar_ListOfTarget * This);
easyar_Target * easyar_ListOfTarget_at(const easyar_ListOfTarget * This, int index);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: 2cf9ff87337134147843fe69b160a0f5
timeCreated: 1611716671
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#ifndef __EASYAR_OBJECTTRACKER_HXX__
#define __EASYAR_OBJECTTRACKER_HXX__
#include "easyar/types.hxx"
#include "easyar/target.hxx"
namespace easyar {
/// <summary>
/// Result of `ObjectTracker`_ .
/// </summary>
class ObjectTrackerResult : public TargetTrackerResult
{
protected:
easyar_ObjectTrackerResult * cdata_ ;
void init_cdata(easyar_ObjectTrackerResult * cdata);
virtual ObjectTrackerResult & operator=(const ObjectTrackerResult & data) { return *this; } //deleted
public:
ObjectTrackerResult(easyar_ObjectTrackerResult * cdata);
virtual ~ObjectTrackerResult();
ObjectTrackerResult(const ObjectTrackerResult & data);
const easyar_ObjectTrackerResult * get_cdata() const;
easyar_ObjectTrackerResult * get_cdata();
/// <summary>
/// Returns the list of `TargetInstance`_ contained in the result.
/// </summary>
void targetInstances(/* OUT */ ListOfTargetInstance * * Return);
/// <summary>
/// Sets the list of `TargetInstance`_ contained in the result.
/// </summary>
void setTargetInstances(ListOfTargetInstance * instances);
static void tryCastFromFrameFilterResult(FrameFilterResult * v, /* OUT */ ObjectTrackerResult * * Return);
static void tryCastFromTargetTrackerResult(TargetTrackerResult * v, /* OUT */ ObjectTrackerResult * * Return);
};
/// <summary>
/// ObjectTracker implements 3D object target detection and tracking.
/// ObjectTracker occupies (1 + SimultaneousNum) buffers of camera. Use setBufferCapacity of camera to set an amount of buffers that is not less than the sum of amount of buffers occupied by all components. Refer to `Overview &lt;Overview.html&gt;`__ .
/// After creation, you can call start/stop to enable/disable the track process. start and stop are very lightweight calls.
/// When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
/// ObjectTracker inputs `FeedbackFrame`_ from feedbackFrameSink. `FeedbackFrameSource`_ shall be connected to feedbackFrameSink for use. Refer to `Overview &lt;Overview.html&gt;`__ .
/// Before a `Target`_ can be tracked by ObjectTracker, you have to load it using loadTarget/unloadTarget. You can get load/unload results from callbacks passed into the interfaces.
/// </summary>
class ObjectTracker
{
protected:
easyar_ObjectTracker * cdata_ ;
void init_cdata(easyar_ObjectTracker * cdata);
virtual ObjectTracker & operator=(const ObjectTracker & data) { return *this; } //deleted
public:
ObjectTracker(easyar_ObjectTracker * cdata);
virtual ~ObjectTracker();
ObjectTracker(const ObjectTracker & data);
const easyar_ObjectTracker * get_cdata() const;
easyar_ObjectTracker * get_cdata();
/// <summary>
/// Returns true.
/// </summary>
static bool isAvailable();
/// <summary>
/// `FeedbackFrame`_ input port. The InputFrame member of FeedbackFrame must have raw image, timestamp, and camera parameters.
/// </summary>
void feedbackFrameSink(/* OUT */ FeedbackFrameSink * * Return);
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
int bufferRequirement();
/// <summary>
/// `OutputFrame`_ output port.
/// </summary>
void outputFrameSource(/* OUT */ OutputFrameSource * * Return);
/// <summary>
/// Creates an instance.
/// </summary>
static void create(/* OUT */ ObjectTracker * * Return);
/// <summary>
/// Starts the track algorithm.
/// </summary>
bool start();
/// <summary>
/// Stops the track algorithm. Call start to start the track again.
/// </summary>
void stop();
/// <summary>
/// Close. The component shall not be used after calling close.
/// </summary>
void close();
/// <summary>
/// Load a `Target`_ into the tracker. A Target can only be tracked by tracker after a successful load.
/// This method is an asynchronous method. A load operation may take some time to finish and detection of a new/lost target may take more time during the load. The track time after detection will not be affected. If you want to know the load result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void loadTarget(Target * target, CallbackScheduler * callbackScheduler, FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Unload a `Target`_ from the tracker.
/// This method is an asynchronous method. An unload operation may take some time to finish and detection of a new/lost target may take more time during the unload. If you want to know the unload result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void unloadTarget(Target * target, CallbackScheduler * callbackScheduler, FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Returns current loaded targets in the tracker. If an asynchronous load/unload is in progress, the returned value will not reflect the result until all load/unload finish.
/// </summary>
void targets(/* OUT */ ListOfTarget * * Return);
/// <summary>
/// Sets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
bool setSimultaneousNum(int num);
/// <summary>
/// Gets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
int simultaneousNum();
};
#ifndef __EASYAR_LISTOFTARGETINSTANCE__
#define __EASYAR_LISTOFTARGETINSTANCE__
class ListOfTargetInstance
{
private:
easyar_ListOfTargetInstance * cdata_;
virtual ListOfTargetInstance & operator=(const ListOfTargetInstance & data) { return *this; } //deleted
public:
ListOfTargetInstance(easyar_ListOfTargetInstance * cdata);
virtual ~ListOfTargetInstance();
ListOfTargetInstance(const ListOfTargetInstance & data);
const easyar_ListOfTargetInstance * get_cdata() const;
easyar_ListOfTargetInstance * get_cdata();
ListOfTargetInstance(easyar_TargetInstance * * begin, easyar_TargetInstance * * end);
int size() const;
TargetInstance * at(int index) const;
};
#endif
#ifndef __EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
#define __EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
struct FunctorOfVoidFromTargetAndBool
{
void * _state;
void (* func)(void * _state, Target *, bool);
void (* destroy)(void * _state);
FunctorOfVoidFromTargetAndBool(void * _state, void (* func)(void * _state, Target *, bool), void (* destroy)(void * _state));
};
static void FunctorOfVoidFromTargetAndBool_func(void * _state, easyar_Target *, bool, /* OUT */ easyar_String * * _exception);
static void FunctorOfVoidFromTargetAndBool_destroy(void * _state);
static inline easyar_FunctorOfVoidFromTargetAndBool FunctorOfVoidFromTargetAndBool_to_c(FunctorOfVoidFromTargetAndBool f);
#endif
#ifndef __EASYAR_LISTOFTARGET__
#define __EASYAR_LISTOFTARGET__
class ListOfTarget
{
private:
easyar_ListOfTarget * cdata_;
virtual ListOfTarget & operator=(const ListOfTarget & data) { return *this; } //deleted
public:
ListOfTarget(easyar_ListOfTarget * cdata);
virtual ~ListOfTarget();
ListOfTarget(const ListOfTarget & data);
const easyar_ListOfTarget * get_cdata() const;
easyar_ListOfTarget * get_cdata();
ListOfTarget(easyar_Target * * begin, easyar_Target * * end);
int size() const;
Target * at(int index) const;
};
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_OBJECTTRACKER_HXX__
#define __IMPLEMENTATION_EASYAR_OBJECTTRACKER_HXX__
#include "easyar/objecttracker.h"
#include "easyar/target.hxx"
#include "easyar/frame.hxx"
#include "easyar/matrix.hxx"
#include "easyar/dataflow.hxx"
#include "easyar/image.hxx"
#include "easyar/buffer.hxx"
#include "easyar/cameraparameters.hxx"
#include "easyar/vector.hxx"
#include "easyar/callbackscheduler.hxx"
namespace easyar {
inline ObjectTrackerResult::ObjectTrackerResult(easyar_ObjectTrackerResult * cdata)
:
TargetTrackerResult(static_cast<easyar_TargetTrackerResult *>(NULL)),
cdata_(NULL)
{
init_cdata(cdata);
}
inline ObjectTrackerResult::~ObjectTrackerResult()
{
if (cdata_) {
easyar_ObjectTrackerResult__dtor(cdata_);
cdata_ = NULL;
}
}
inline ObjectTrackerResult::ObjectTrackerResult(const ObjectTrackerResult & data)
:
TargetTrackerResult(static_cast<easyar_TargetTrackerResult *>(NULL)),
cdata_(NULL)
{
easyar_ObjectTrackerResult * cdata = NULL;
easyar_ObjectTrackerResult__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ObjectTrackerResult * ObjectTrackerResult::get_cdata() const
{
return cdata_;
}
inline easyar_ObjectTrackerResult * ObjectTrackerResult::get_cdata()
{
return cdata_;
}
inline void ObjectTrackerResult::init_cdata(easyar_ObjectTrackerResult * cdata)
{
cdata_ = cdata;
{
easyar_TargetTrackerResult * cdata_inner = NULL;
easyar_castObjectTrackerResultToTargetTrackerResult(cdata, &cdata_inner);
TargetTrackerResult::init_cdata(cdata_inner);
}
}
inline void ObjectTrackerResult::targetInstances(/* OUT */ ListOfTargetInstance * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfTargetInstance * _return_value_ = NULL;
easyar_ObjectTrackerResult_targetInstances(cdata_, &_return_value_);
*Return = new ListOfTargetInstance(_return_value_);
}
inline void ObjectTrackerResult::setTargetInstances(ListOfTargetInstance * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTrackerResult_setTargetInstances(cdata_, arg0->get_cdata());
}
inline void ObjectTrackerResult::tryCastFromFrameFilterResult(FrameFilterResult * v, /* OUT */ ObjectTrackerResult * * Return)
{
if (v == NULL) {
*Return = NULL;
return;
}
easyar_ObjectTrackerResult * cdata = NULL;
easyar_tryCastFrameFilterResultToObjectTrackerResult(v->get_cdata(), &cdata);
if (cdata == NULL) {
*Return = NULL;
return;
}
*Return = new ObjectTrackerResult(cdata);
}
inline void ObjectTrackerResult::tryCastFromTargetTrackerResult(TargetTrackerResult * v, /* OUT */ ObjectTrackerResult * * Return)
{
if (v == NULL) {
*Return = NULL;
return;
}
easyar_ObjectTrackerResult * cdata = NULL;
easyar_tryCastTargetTrackerResultToObjectTrackerResult(v->get_cdata(), &cdata);
if (cdata == NULL) {
*Return = NULL;
return;
}
*Return = new ObjectTrackerResult(cdata);
}
inline ObjectTracker::ObjectTracker(easyar_ObjectTracker * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline ObjectTracker::~ObjectTracker()
{
if (cdata_) {
easyar_ObjectTracker__dtor(cdata_);
cdata_ = NULL;
}
}
inline ObjectTracker::ObjectTracker(const ObjectTracker & data)
:
cdata_(NULL)
{
easyar_ObjectTracker * cdata = NULL;
easyar_ObjectTracker__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ObjectTracker * ObjectTracker::get_cdata() const
{
return cdata_;
}
inline easyar_ObjectTracker * ObjectTracker::get_cdata()
{
return cdata_;
}
inline void ObjectTracker::init_cdata(easyar_ObjectTracker * cdata)
{
cdata_ = cdata;
}
inline bool ObjectTracker::isAvailable()
{
bool _return_value_ = easyar_ObjectTracker_isAvailable();
return _return_value_;
}
inline void ObjectTracker::feedbackFrameSink(/* OUT */ FeedbackFrameSink * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_FeedbackFrameSink * _return_value_ = NULL;
easyar_ObjectTracker_feedbackFrameSink(cdata_, &_return_value_);
*Return = new FeedbackFrameSink(_return_value_);
}
inline int ObjectTracker::bufferRequirement()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_ObjectTracker_bufferRequirement(cdata_);
return _return_value_;
}
inline void ObjectTracker::outputFrameSource(/* OUT */ OutputFrameSource * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_OutputFrameSource * _return_value_ = NULL;
easyar_ObjectTracker_outputFrameSource(cdata_, &_return_value_);
*Return = new OutputFrameSource(_return_value_);
}
inline void ObjectTracker::create(/* OUT */ ObjectTracker * * Return)
{
easyar_ObjectTracker * _return_value_ = NULL;
easyar_ObjectTracker_create(&_return_value_);
*Return = new ObjectTracker(_return_value_);
}
inline bool ObjectTracker::start()
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_ObjectTracker_start(cdata_);
return _return_value_;
}
inline void ObjectTracker::stop()
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTracker_stop(cdata_);
}
inline void ObjectTracker::close()
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTracker_close(cdata_);
}
inline void ObjectTracker::loadTarget(Target * arg0, CallbackScheduler * arg1, FunctorOfVoidFromTargetAndBool arg2)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTracker_loadTarget(cdata_, arg0->get_cdata(), arg1->get_cdata(), FunctorOfVoidFromTargetAndBool_to_c(arg2));
}
inline void ObjectTracker::unloadTarget(Target * arg0, CallbackScheduler * arg1, FunctorOfVoidFromTargetAndBool arg2)
{
if (cdata_ == NULL) {
return;
}
easyar_ObjectTracker_unloadTarget(cdata_, arg0->get_cdata(), arg1->get_cdata(), FunctorOfVoidFromTargetAndBool_to_c(arg2));
}
inline void ObjectTracker::targets(/* OUT */ ListOfTarget * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfTarget * _return_value_ = NULL;
easyar_ObjectTracker_targets(cdata_, &_return_value_);
*Return = new ListOfTarget(_return_value_);
}
inline bool ObjectTracker::setSimultaneousNum(int arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_ObjectTracker_setSimultaneousNum(cdata_, arg0);
return _return_value_;
}
inline int ObjectTracker::simultaneousNum()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_ObjectTracker_simultaneousNum(cdata_);
return _return_value_;
}
#ifndef __IMPLEMENTATION_EASYAR_LISTOFTARGETINSTANCE__
#define __IMPLEMENTATION_EASYAR_LISTOFTARGETINSTANCE__
inline ListOfTargetInstance::ListOfTargetInstance(easyar_ListOfTargetInstance * cdata)
: cdata_(cdata)
{
}
inline ListOfTargetInstance::~ListOfTargetInstance()
{
if (cdata_) {
easyar_ListOfTargetInstance__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfTargetInstance::ListOfTargetInstance(const ListOfTargetInstance & data)
: cdata_(static_cast<easyar_ListOfTargetInstance *>(NULL))
{
easyar_ListOfTargetInstance_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfTargetInstance * ListOfTargetInstance::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfTargetInstance * ListOfTargetInstance::get_cdata()
{
return cdata_;
}
inline ListOfTargetInstance::ListOfTargetInstance(easyar_TargetInstance * * begin, easyar_TargetInstance * * end)
: cdata_(static_cast<easyar_ListOfTargetInstance *>(NULL))
{
easyar_ListOfTargetInstance__ctor(begin, end, &cdata_);
}
inline int ListOfTargetInstance::size() const
{
return easyar_ListOfTargetInstance_size(cdata_);
}
inline TargetInstance * ListOfTargetInstance::at(int index) const
{
easyar_TargetInstance * _return_value_ = easyar_ListOfTargetInstance_at(cdata_, index);
easyar_TargetInstance__retain(_return_value_, &_return_value_);
return new TargetInstance(_return_value_);
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
#define __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
inline FunctorOfVoidFromTargetAndBool::FunctorOfVoidFromTargetAndBool(void * _state, void (* func)(void * _state, Target *, bool), void (* destroy)(void * _state))
{
this->_state = _state;
this->func = func;
this->destroy = destroy;
}
static void FunctorOfVoidFromTargetAndBool_func(void * _state, easyar_Target * arg0, bool arg1, /* OUT */ easyar_String * * _exception)
{
*_exception = NULL;
try {
easyar_Target__retain(arg0, &arg0);
Target * cpparg0 = new Target(arg0);
bool cpparg1 = arg1;
FunctorOfVoidFromTargetAndBool * f = reinterpret_cast<FunctorOfVoidFromTargetAndBool *>(_state);
f->func(f->_state, cpparg0, cpparg1);
delete cpparg0;
} catch (std::exception & ex) {
easyar_String_from_utf8_begin(ex.what(), _exception);
}
}
static void FunctorOfVoidFromTargetAndBool_destroy(void * _state)
{
FunctorOfVoidFromTargetAndBool * f = reinterpret_cast<FunctorOfVoidFromTargetAndBool *>(_state);
if (f->destroy) {
f->destroy(f->_state);
}
delete f;
}
static inline easyar_FunctorOfVoidFromTargetAndBool FunctorOfVoidFromTargetAndBool_to_c(FunctorOfVoidFromTargetAndBool f)
{
easyar_FunctorOfVoidFromTargetAndBool _return_value_ = {NULL, NULL, NULL};
_return_value_._state = new FunctorOfVoidFromTargetAndBool(f._state, f.func, f.destroy);
_return_value_.func = FunctorOfVoidFromTargetAndBool_func;
_return_value_.destroy = FunctorOfVoidFromTargetAndBool_destroy;
return _return_value_;
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_LISTOFTARGET__
#define __IMPLEMENTATION_EASYAR_LISTOFTARGET__
inline ListOfTarget::ListOfTarget(easyar_ListOfTarget * cdata)
: cdata_(cdata)
{
}
inline ListOfTarget::~ListOfTarget()
{
if (cdata_) {
easyar_ListOfTarget__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfTarget::ListOfTarget(const ListOfTarget & data)
: cdata_(static_cast<easyar_ListOfTarget *>(NULL))
{
easyar_ListOfTarget_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfTarget * ListOfTarget::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfTarget * ListOfTarget::get_cdata()
{
return cdata_;
}
inline ListOfTarget::ListOfTarget(easyar_Target * * begin, easyar_Target * * end)
: cdata_(static_cast<easyar_ListOfTarget *>(NULL))
{
easyar_ListOfTarget__ctor(begin, end, &cdata_);
}
inline int ListOfTarget::size() const
{
return easyar_ListOfTarget_size(cdata_);
}
inline Target * ListOfTarget::at(int index) const
{
easyar_Target * _return_value_ = easyar_ListOfTarget_at(cdata_, index);
easyar_Target__retain(_return_value_, &_return_value_);
return new Target(_return_value_);
}
#endif
}
#endif
fileFormatVersion: 2
guid: fd0b881bd36864e4ba7425758fb17ac9
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#import "easyar/types.oc.h"
#import "easyar/target.oc.h"
/// <summary>
/// Result of `ObjectTracker`_ .
/// </summary>
@interface easyar_ObjectTrackerResult : easyar_TargetTrackerResult
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Returns the list of `TargetInstance`_ contained in the result.
/// </summary>
- (NSArray<easyar_TargetInstance *> *)targetInstances;
/// <summary>
/// Sets the list of `TargetInstance`_ contained in the result.
/// </summary>
- (void)setTargetInstances:(NSArray<easyar_TargetInstance *> *)instances;
@end
/// <summary>
/// ObjectTracker implements 3D object target detection and tracking.
/// ObjectTracker occupies (1 + SimultaneousNum) buffers of camera. Use setBufferCapacity of camera to set an amount of buffers that is not less than the sum of amount of buffers occupied by all components. Refer to `Overview &lt;Overview.html&gt;`__ .
/// After creation, you can call start/stop to enable/disable the track process. start and stop are very lightweight calls.
/// When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
/// ObjectTracker inputs `FeedbackFrame`_ from feedbackFrameSink. `FeedbackFrameSource`_ shall be connected to feedbackFrameSink for use. Refer to `Overview &lt;Overview.html&gt;`__ .
/// Before a `Target`_ can be tracked by ObjectTracker, you have to load it using loadTarget/unloadTarget. You can get load/unload results from callbacks passed into the interfaces.
/// </summary>
@interface easyar_ObjectTracker : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Returns true.
/// </summary>
+ (bool)isAvailable;
/// <summary>
/// `FeedbackFrame`_ input port. The InputFrame member of FeedbackFrame must have raw image, timestamp, and camera parameters.
/// </summary>
- (easyar_FeedbackFrameSink *)feedbackFrameSink;
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
- (int)bufferRequirement;
/// <summary>
/// `OutputFrame`_ output port.
/// </summary>
- (easyar_OutputFrameSource *)outputFrameSource;
/// <summary>
/// Creates an instance.
/// </summary>
+ (easyar_ObjectTracker *)create;
/// <summary>
/// Starts the track algorithm.
/// </summary>
- (bool)start;
/// <summary>
/// Stops the track algorithm. Call start to start the track again.
/// </summary>
- (void)stop;
/// <summary>
/// Close. The component shall not be used after calling close.
/// </summary>
- (void)close;
/// <summary>
/// Load a `Target`_ into the tracker. A Target can only be tracked by tracker after a successful load.
/// This method is an asynchronous method. A load operation may take some time to finish and detection of a new/lost target may take more time during the load. The track time after detection will not be affected. If you want to know the load result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
- (void)loadTarget:(easyar_Target *)target callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_Target * target, bool status))callback;
/// <summary>
/// Unload a `Target`_ from the tracker.
/// This method is an asynchronous method. An unload operation may take some time to finish and detection of a new/lost target may take more time during the unload. If you want to know the unload result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
- (void)unloadTarget:(easyar_Target *)target callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_Target * target, bool status))callback;
/// <summary>
/// Returns current loaded targets in the tracker. If an asynchronous load/unload is in progress, the returned value will not reflect the result until all load/unload finish.
/// </summary>
- (NSArray<easyar_Target *> *)targets;
/// <summary>
/// Sets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
- (bool)setSimultaneousNum:(int)num;
/// <summary>
/// Gets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
- (int)simultaneousNum;
@end
fileFormatVersion: 2
guid: ff7704ba76a6c9b4e950b2095519d723
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#ifndef __EASYAR_RECORDER_H__
#define __EASYAR_RECORDER_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Returns true only on Android 4.3 or later, or on iOS.
/// </summary>
bool easyar_Recorder_isAvailable(void);
/// <summary>
/// Requests recording permissions from operating system. You can call this function or request permission directly from operating system. It is only available on Android and iOS. On other platforms, it will call the callback directly with status being granted. This function need to be called from the UI thread.
/// </summary>
void easyar_Recorder_requestPermissions(easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromPermissionStatusAndString permissionCallback);
/// <summary>
/// Creates an instance and initialize recording. statusCallback will dispatch event of status change and corresponding log.
/// </summary>
void easyar_Recorder_create(easyar_RecorderConfiguration * config, easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromRecordStatusAndString statusCallback, /* OUT */ easyar_Recorder * * Return);
/// <summary>
/// Start recording.
/// </summary>
void easyar_Recorder_start(easyar_Recorder * This);
/// <summary>
/// Update and record a frame using texture data.
/// </summary>
void easyar_Recorder_updateFrame(easyar_Recorder * This, easyar_TextureId * texture, int width, int height);
/// <summary>
/// Stop recording. When calling stop, it will wait for file write to end and returns whether recording is successful.
/// </summary>
bool easyar_Recorder_stop(easyar_Recorder * This);
void easyar_Recorder__dtor(easyar_Recorder * This);
void easyar_Recorder__retain(const easyar_Recorder * This, /* OUT */ easyar_Recorder * * Return);
const char * easyar_Recorder__typeName(const easyar_Recorder * This);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: c14f1d0ccddfd6140804b5de453d986d
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//=============================================================================================================================
#ifndef __EASYAR_RECORDER_HXX__
#define __EASYAR_RECORDER_HXX__
#include "easyar/types.hxx"
namespace easyar {
/// <summary>
/// Recorder implements recording for current rendering screen.
/// Currently Recorder only works on Android (4.3 or later) and iOS with OpenGL ES 2.0 context.
/// Due to the dependency to OpenGLES, every method in this class (except requestPermissions, including the destructor) has to be called in a single thread containing an OpenGLES context.
/// **Unity Only** If in Unity, Multi-threaded rendering is enabled, scripting thread and rendering thread will be two separate threads, which makes it impossible to call updateFrame in the rendering thread. For this reason, to use Recorder, Multi-threaded rendering option shall be disabled.
/// </summary>
class Recorder
{
protected:
easyar_Recorder * cdata_ ;
void init_cdata(easyar_Recorder * cdata);
virtual Recorder & operator=(const Recorder & data) { return *this; } //deleted
public:
Recorder(easyar_Recorder * cdata);
virtual ~Recorder();
Recorder(const Recorder & data);
const easyar_Recorder * get_cdata() const;
easyar_Recorder * get_cdata();
/// <summary>
/// Returns true only on Android 4.3 or later, or on iOS.
/// </summary>
static bool isAvailable();
/// <summary>
/// Requests recording permissions from operating system. You can call this function or request permission directly from operating system. It is only available on Android and iOS. On other platforms, it will call the callback directly with status being granted. This function need to be called from the UI thread.
/// </summary>
static void requestPermissions(CallbackScheduler * callbackScheduler, OptionalOfFunctorOfVoidFromPermissionStatusAndString permissionCallback);
/// <summary>
/// Creates an instance and initialize recording. statusCallback will dispatch event of status change and corresponding log.
/// </summary>
static void create(RecorderConfiguration * config, CallbackScheduler * callbackScheduler, OptionalOfFunctorOfVoidFromRecordStatusAndString statusCallback, /* OUT */ Recorder * * Return);
/// <summary>
/// Start recording.
/// </summary>
void start();
/// <summary>
/// Update and record a frame using texture data.
/// </summary>
void updateFrame(TextureId * texture, int width, int height);
/// <summary>
/// Stop recording. When calling stop, it will wait for file write to end and returns whether recording is successful.
/// </summary>
bool stop();
};
#ifndef __EASYAR_FUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
#define __EASYAR_FUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
struct FunctorOfVoidFromPermissionStatusAndString
{
void * _state;
void (* func)(void * _state, PermissionStatus, String *);
void (* destroy)(void * _state);
FunctorOfVoidFromPermissionStatusAndString(void * _state, void (* func)(void * _state, PermissionStatus, String *), void (* destroy)(void * _state));
};
static void FunctorOfVoidFromPermissionStatusAndString_func(void * _state, easyar_PermissionStatus, easyar_String *, /* OUT */ easyar_String * * _exception);
static void FunctorOfVoidFromPermissionStatusAndString_destroy(void * _state);
static inline easyar_FunctorOfVoidFromPermissionStatusAndString FunctorOfVoidFromPermissionStatusAndString_to_c(FunctorOfVoidFromPermissionStatusAndString f);
#endif
#ifndef __EASYAR_OPTIONALOFFUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
#define __EASYAR_OPTIONALOFFUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
struct OptionalOfFunctorOfVoidFromPermissionStatusAndString
{
bool has_value;
FunctorOfVoidFromPermissionStatusAndString value;
};
static inline easyar_OptionalOfFunctorOfVoidFromPermissionStatusAndString OptionalOfFunctorOfVoidFromPermissionStatusAndString_to_c(OptionalOfFunctorOfVoidFromPermissionStatusAndString o);
#endif
#ifndef __EASYAR_FUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
#define __EASYAR_FUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
struct FunctorOfVoidFromRecordStatusAndString
{
void * _state;
void (* func)(void * _state, RecordStatus, String *);
void (* destroy)(void * _state);
FunctorOfVoidFromRecordStatusAndString(void * _state, void (* func)(void * _state, RecordStatus, String *), void (* destroy)(void * _state));
};
static void FunctorOfVoidFromRecordStatusAndString_func(void * _state, easyar_RecordStatus, easyar_String *, /* OUT */ easyar_String * * _exception);
static void FunctorOfVoidFromRecordStatusAndString_destroy(void * _state);
static inline easyar_FunctorOfVoidFromRecordStatusAndString FunctorOfVoidFromRecordStatusAndString_to_c(FunctorOfVoidFromRecordStatusAndString f);
#endif
#ifndef __EASYAR_OPTIONALOFFUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
#define __EASYAR_OPTIONALOFFUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
struct OptionalOfFunctorOfVoidFromRecordStatusAndString
{
bool has_value;
FunctorOfVoidFromRecordStatusAndString value;
};
static inline easyar_OptionalOfFunctorOfVoidFromRecordStatusAndString OptionalOfFunctorOfVoidFromRecordStatusAndString_to_c(OptionalOfFunctorOfVoidFromRecordStatusAndString o);
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_RECORDER_HXX__
#define __IMPLEMENTATION_EASYAR_RECORDER_HXX__
#include "easyar/recorder.h"
#include "easyar/callbackscheduler.hxx"
#include "easyar/recorder_configuration.hxx"
#include "easyar/texture.hxx"
namespace easyar {
inline Recorder::Recorder(easyar_Recorder * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline Recorder::~Recorder()
{
if (cdata_) {
easyar_Recorder__dtor(cdata_);
cdata_ = NULL;
}
}
inline Recorder::Recorder(const Recorder & data)
:
cdata_(NULL)
{
easyar_Recorder * cdata = NULL;
easyar_Recorder__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_Recorder * Recorder::get_cdata() const
{
return cdata_;
}
inline easyar_Recorder * Recorder::get_cdata()
{
return cdata_;
}
inline void Recorder::init_cdata(easyar_Recorder * cdata)
{
cdata_ = cdata;
}
inline bool Recorder::isAvailable()
{
bool _return_value_ = easyar_Recorder_isAvailable();
return _return_value_;
}
inline void Recorder::requestPermissions(CallbackScheduler * arg0, OptionalOfFunctorOfVoidFromPermissionStatusAndString arg1)
{
easyar_Recorder_requestPermissions(arg0->get_cdata(), OptionalOfFunctorOfVoidFromPermissionStatusAndString_to_c(arg1));
}
inline void Recorder::create(RecorderConfiguration * arg0, CallbackScheduler * arg1, OptionalOfFunctorOfVoidFromRecordStatusAndString arg2, /* OUT */ Recorder * * Return)
{
easyar_Recorder * _return_value_ = NULL;
easyar_Recorder_create(arg0->get_cdata(), arg1->get_cdata(), OptionalOfFunctorOfVoidFromRecordStatusAndString_to_c(arg2), &_return_value_);
*Return = new Recorder(_return_value_);
}
inline void Recorder::start()
{
if (cdata_ == NULL) {
return;
}
easyar_Recorder_start(cdata_);
}
inline void Recorder::updateFrame(TextureId * arg0, int arg1, int arg2)
{
if (cdata_ == NULL) {
return;
}
easyar_Recorder_updateFrame(cdata_, arg0->get_cdata(), arg1, arg2);
}
inline bool Recorder::stop()
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_Recorder_stop(cdata_);
return _return_value_;
}
#ifndef __IMPLEMENTATION_EASYAR_OPTIONALOFFUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
#define __IMPLEMENTATION_EASYAR_OPTIONALOFFUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
static inline easyar_OptionalOfFunctorOfVoidFromPermissionStatusAndString OptionalOfFunctorOfVoidFromPermissionStatusAndString_to_c(OptionalOfFunctorOfVoidFromPermissionStatusAndString o)
{
if (o.has_value) {
easyar_OptionalOfFunctorOfVoidFromPermissionStatusAndString _return_value_ = {true, FunctorOfVoidFromPermissionStatusAndString_to_c(o.value)};
return _return_value_;
} else {
easyar_OptionalOfFunctorOfVoidFromPermissionStatusAndString _return_value_ = {false, {NULL, NULL, NULL}};
return _return_value_;
}
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
#define __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMPERMISSIONSTATUSANDSTRING__
inline FunctorOfVoidFromPermissionStatusAndString::FunctorOfVoidFromPermissionStatusAndString(void * _state, void (* func)(void * _state, PermissionStatus, String *), void (* destroy)(void * _state))
{
this->_state = _state;
this->func = func;
this->destroy = destroy;
}
static void FunctorOfVoidFromPermissionStatusAndString_func(void * _state, easyar_PermissionStatus arg0, easyar_String * arg1, /* OUT */ easyar_String * * _exception)
{
*_exception = NULL;
try {
PermissionStatus cpparg0 = static_cast<PermissionStatus>(arg0);
easyar_String_copy(arg1, &arg1);
String * cpparg1 = new String(arg1);
FunctorOfVoidFromPermissionStatusAndString * f = reinterpret_cast<FunctorOfVoidFromPermissionStatusAndString *>(_state);
f->func(f->_state, cpparg0, cpparg1);
delete cpparg1;
} catch (std::exception & ex) {
easyar_String_from_utf8_begin(ex.what(), _exception);
}
}
static void FunctorOfVoidFromPermissionStatusAndString_destroy(void * _state)
{
FunctorOfVoidFromPermissionStatusAndString * f = reinterpret_cast<FunctorOfVoidFromPermissionStatusAndString *>(_state);
if (f->destroy) {
f->destroy(f->_state);
}
delete f;
}
static inline easyar_FunctorOfVoidFromPermissionStatusAndString FunctorOfVoidFromPermissionStatusAndString_to_c(FunctorOfVoidFromPermissionStatusAndString f)
{
easyar_FunctorOfVoidFromPermissionStatusAndString _return_value_ = {NULL, NULL, NULL};
_return_value_._state = new FunctorOfVoidFromPermissionStatusAndString(f._state, f.func, f.destroy);
_return_value_.func = FunctorOfVoidFromPermissionStatusAndString_func;
_return_value_.destroy = FunctorOfVoidFromPermissionStatusAndString_destroy;
return _return_value_;
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_OPTIONALOFFUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
#define __IMPLEMENTATION_EASYAR_OPTIONALOFFUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
static inline easyar_OptionalOfFunctorOfVoidFromRecordStatusAndString OptionalOfFunctorOfVoidFromRecordStatusAndString_to_c(OptionalOfFunctorOfVoidFromRecordStatusAndString o)
{
if (o.has_value) {
easyar_OptionalOfFunctorOfVoidFromRecordStatusAndString _return_value_ = {true, FunctorOfVoidFromRecordStatusAndString_to_c(o.value)};
return _return_value_;
} else {
easyar_OptionalOfFunctorOfVoidFromRecordStatusAndString _return_value_ = {false, {NULL, NULL, NULL}};
return _return_value_;
}
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
#define __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMRECORDSTATUSANDSTRING__
inline FunctorOfVoidFromRecordStatusAndString::FunctorOfVoidFromRecordStatusAndString(void * _state, void (* func)(void * _state, RecordStatus, String *), void (* destroy)(void * _state))
{
this->_state = _state;
this->func = func;
this->destroy = destroy;
}
static void FunctorOfVoidFromRecordStatusAndString_func(void * _state, easyar_RecordStatus arg0, easyar_String * arg1, /* OUT */ easyar_String * * _exception)
{
*_exception = NULL;
try {
RecordStatus cpparg0 = static_cast<RecordStatus>(arg0);
easyar_String_copy(arg1, &arg1);
String * cpparg1 = new String(arg1);
FunctorOfVoidFromRecordStatusAndString * f = reinterpret_cast<FunctorOfVoidFromRecordStatusAndString *>(_state);
f->func(f->_state, cpparg0, cpparg1);
delete cpparg1;
} catch (std::exception & ex) {
easyar_String_from_utf8_begin(ex.what(), _exception);
}
}
static void FunctorOfVoidFromRecordStatusAndString_destroy(void * _state)
{
FunctorOfVoidFromRecordStatusAndString * f = reinterpret_cast<FunctorOfVoidFromRecordStatusAndString *>(_state);
if (f->destroy) {
f->destroy(f->_state);
}
delete f;
}
static inline easyar_FunctorOfVoidFromRecordStatusAndString FunctorOfVoidFromRecordStatusAndString_to_c(FunctorOfVoidFromRecordStatusAndString f)
{
easyar_FunctorOfVoidFromRecordStatusAndString _return_value_ = {NULL, NULL, NULL};
_return_value_._state = new FunctorOfVoidFromRecordStatusAndString(f._state, f.func, f.destroy);
_return_value_.func = FunctorOfVoidFromRecordStatusAndString_func;
_return_value_.destroy = FunctorOfVoidFromRecordStatusAndString_destroy;
return _return_value_;
}
#endif
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment