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

update final design

parent 1444629e
fileFormatVersion: 2
guid: 6f7e7950d9b336645b2439a2876a18d3
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>
/// 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>
@interface easyar_Recorder : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Returns true only on Android 4.3 or later, or on iOS.
/// </summary>
+ (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>
+ (void)requestPermissions:(easyar_CallbackScheduler *)callbackScheduler permissionCallback:(void (^)(easyar_PermissionStatus status, NSString * value))permissionCallback;
/// <summary>
/// Creates an instance and initialize recording. statusCallback will dispatch event of status change and corresponding log.
/// </summary>
+ (easyar_Recorder *)create:(easyar_RecorderConfiguration *)config callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler statusCallback:(void (^)(easyar_RecordStatus status, NSString * value))statusCallback;
/// <summary>
/// Start recording.
/// </summary>
- (void)start;
/// <summary>
/// Update and record a frame using texture data.
/// </summary>
- (void)updateFrame:(easyar_TextureId *)texture width:(int)width height:(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;
@end
fileFormatVersion: 2
guid: 09b20887ae24f43448d406b458d8af5f
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_RECORDER_CONFIGURATION_H__
#define __EASYAR_RECORDER_CONFIGURATION_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void easyar_RecorderConfiguration__ctor(/* OUT */ easyar_RecorderConfiguration * * Return);
/// <summary>
/// Sets absolute path for output video file.
/// </summary>
void easyar_RecorderConfiguration_setOutputFile(easyar_RecorderConfiguration * This, easyar_String * path);
/// <summary>
/// Sets recording profile. Default value is Quality_720P_Middle.
/// This is an all-in-one configuration, you can control in more advanced mode with other APIs.
/// </summary>
bool easyar_RecorderConfiguration_setProfile(easyar_RecorderConfiguration * This, easyar_RecordProfile profile);
/// <summary>
/// Sets recording video size. Default value is Vid720p.
/// </summary>
void easyar_RecorderConfiguration_setVideoSize(easyar_RecorderConfiguration * This, easyar_RecordVideoSize framesize);
/// <summary>
/// Sets recording video bit rate. Default value is 2500000.
/// </summary>
void easyar_RecorderConfiguration_setVideoBitrate(easyar_RecorderConfiguration * This, int bitrate);
/// <summary>
/// Sets recording audio channel count. Default value is 1.
/// </summary>
void easyar_RecorderConfiguration_setChannelCount(easyar_RecorderConfiguration * This, int count);
/// <summary>
/// Sets recording audio sample rate. Default value is 44100.
/// </summary>
void easyar_RecorderConfiguration_setAudioSampleRate(easyar_RecorderConfiguration * This, int samplerate);
/// <summary>
/// Sets recording audio bit rate. Default value is 96000.
/// </summary>
void easyar_RecorderConfiguration_setAudioBitrate(easyar_RecorderConfiguration * This, int bitrate);
/// <summary>
/// Sets recording video orientation. Default value is Landscape.
/// </summary>
void easyar_RecorderConfiguration_setVideoOrientation(easyar_RecorderConfiguration * This, easyar_RecordVideoOrientation mode);
/// <summary>
/// Sets recording zoom mode. Default value is NoZoomAndClip.
/// </summary>
void easyar_RecorderConfiguration_setZoomMode(easyar_RecorderConfiguration * This, easyar_RecordZoomMode mode);
void easyar_RecorderConfiguration__dtor(easyar_RecorderConfiguration * This);
void easyar_RecorderConfiguration__retain(const easyar_RecorderConfiguration * This, /* OUT */ easyar_RecorderConfiguration * * Return);
const char * easyar_RecorderConfiguration__typeName(const easyar_RecorderConfiguration * This);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: fdf63cfd394103646830bee892d3f4f8
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_CONFIGURATION_HXX__
#define __EASYAR_RECORDER_CONFIGURATION_HXX__
#include "easyar/types.hxx"
namespace easyar {
/// <summary>
/// RecorderConfiguration is startup configuration for `Recorder`_ .
/// </summary>
class RecorderConfiguration
{
protected:
easyar_RecorderConfiguration * cdata_ ;
void init_cdata(easyar_RecorderConfiguration * cdata);
virtual RecorderConfiguration & operator=(const RecorderConfiguration & data) { return *this; } //deleted
public:
RecorderConfiguration(easyar_RecorderConfiguration * cdata);
virtual ~RecorderConfiguration();
RecorderConfiguration(const RecorderConfiguration & data);
const easyar_RecorderConfiguration * get_cdata() const;
easyar_RecorderConfiguration * get_cdata();
RecorderConfiguration();
/// <summary>
/// Sets absolute path for output video file.
/// </summary>
void setOutputFile(String * path);
/// <summary>
/// Sets recording profile. Default value is Quality_720P_Middle.
/// This is an all-in-one configuration, you can control in more advanced mode with other APIs.
/// </summary>
bool setProfile(RecordProfile profile);
/// <summary>
/// Sets recording video size. Default value is Vid720p.
/// </summary>
void setVideoSize(RecordVideoSize framesize);
/// <summary>
/// Sets recording video bit rate. Default value is 2500000.
/// </summary>
void setVideoBitrate(int bitrate);
/// <summary>
/// Sets recording audio channel count. Default value is 1.
/// </summary>
void setChannelCount(int count);
/// <summary>
/// Sets recording audio sample rate. Default value is 44100.
/// </summary>
void setAudioSampleRate(int samplerate);
/// <summary>
/// Sets recording audio bit rate. Default value is 96000.
/// </summary>
void setAudioBitrate(int bitrate);
/// <summary>
/// Sets recording video orientation. Default value is Landscape.
/// </summary>
void setVideoOrientation(RecordVideoOrientation mode);
/// <summary>
/// Sets recording zoom mode. Default value is NoZoomAndClip.
/// </summary>
void setZoomMode(RecordZoomMode mode);
};
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_RECORDER_CONFIGURATION_HXX__
#define __IMPLEMENTATION_EASYAR_RECORDER_CONFIGURATION_HXX__
#include "easyar/recorder_configuration.h"
namespace easyar {
inline RecorderConfiguration::RecorderConfiguration(easyar_RecorderConfiguration * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline RecorderConfiguration::~RecorderConfiguration()
{
if (cdata_) {
easyar_RecorderConfiguration__dtor(cdata_);
cdata_ = NULL;
}
}
inline RecorderConfiguration::RecorderConfiguration(const RecorderConfiguration & data)
:
cdata_(NULL)
{
easyar_RecorderConfiguration * cdata = NULL;
easyar_RecorderConfiguration__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_RecorderConfiguration * RecorderConfiguration::get_cdata() const
{
return cdata_;
}
inline easyar_RecorderConfiguration * RecorderConfiguration::get_cdata()
{
return cdata_;
}
inline void RecorderConfiguration::init_cdata(easyar_RecorderConfiguration * cdata)
{
cdata_ = cdata;
}
inline RecorderConfiguration::RecorderConfiguration()
:
cdata_(NULL)
{
easyar_RecorderConfiguration * _return_value_ = NULL;
easyar_RecorderConfiguration__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline void RecorderConfiguration::setOutputFile(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setOutputFile(cdata_, arg0->get_cdata());
}
inline bool RecorderConfiguration::setProfile(RecordProfile arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_RecorderConfiguration_setProfile(cdata_, static_cast<easyar_RecordProfile>(arg0));
return _return_value_;
}
inline void RecorderConfiguration::setVideoSize(RecordVideoSize arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setVideoSize(cdata_, static_cast<easyar_RecordVideoSize>(arg0));
}
inline void RecorderConfiguration::setVideoBitrate(int arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setVideoBitrate(cdata_, arg0);
}
inline void RecorderConfiguration::setChannelCount(int arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setChannelCount(cdata_, arg0);
}
inline void RecorderConfiguration::setAudioSampleRate(int arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setAudioSampleRate(cdata_, arg0);
}
inline void RecorderConfiguration::setAudioBitrate(int arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setAudioBitrate(cdata_, arg0);
}
inline void RecorderConfiguration::setVideoOrientation(RecordVideoOrientation arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setVideoOrientation(cdata_, static_cast<easyar_RecordVideoOrientation>(arg0));
}
inline void RecorderConfiguration::setZoomMode(RecordZoomMode arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_RecorderConfiguration_setZoomMode(cdata_, static_cast<easyar_RecordZoomMode>(arg0));
}
}
#endif
fileFormatVersion: 2
guid: bc4656c2a687f704b9380535d149b196
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>
/// RecorderConfiguration is startup configuration for `Recorder`_ .
/// </summary>
@interface easyar_RecorderConfiguration : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (easyar_RecorderConfiguration *) create;
/// <summary>
/// Sets absolute path for output video file.
/// </summary>
- (void)setOutputFile:(NSString *)path;
/// <summary>
/// Sets recording profile. Default value is Quality_720P_Middle.
/// This is an all-in-one configuration, you can control in more advanced mode with other APIs.
/// </summary>
- (bool)setProfile:(easyar_RecordProfile)profile;
/// <summary>
/// Sets recording video size. Default value is Vid720p.
/// </summary>
- (void)setVideoSize:(easyar_RecordVideoSize)framesize;
/// <summary>
/// Sets recording video bit rate. Default value is 2500000.
/// </summary>
- (void)setVideoBitrate:(int)bitrate;
/// <summary>
/// Sets recording audio channel count. Default value is 1.
/// </summary>
- (void)setChannelCount:(int)count;
/// <summary>
/// Sets recording audio sample rate. Default value is 44100.
/// </summary>
- (void)setAudioSampleRate:(int)samplerate;
/// <summary>
/// Sets recording audio bit rate. Default value is 96000.
/// </summary>
- (void)setAudioBitrate:(int)bitrate;
/// <summary>
/// Sets recording video orientation. Default value is Landscape.
/// </summary>
- (void)setVideoOrientation:(easyar_RecordVideoOrientation)mode;
/// <summary>
/// Sets recording zoom mode. Default value is NoZoomAndClip.
/// </summary>
- (void)setZoomMode:(easyar_RecordZoomMode)mode;
@end
fileFormatVersion: 2
guid: bee774a53dd5784428005ab27db4b429
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_SCENEMESH_H__
#define __EASYAR_SCENEMESH_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Get the number of vertices in `meshAll`.
/// </summary>
int easyar_SceneMesh_getNumOfVertexAll(easyar_SceneMesh * This);
/// <summary>
/// Get the number of indices in `meshAll`. Since every 3 indices form a triangle, the returned value should be a multiple of 3.
/// </summary>
int easyar_SceneMesh_getNumOfIndexAll(easyar_SceneMesh * This);
/// <summary>
/// Get the position component of the vertices in `meshAll` (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in `Buffer`_ by `x1, y1, z1, x2, y2, z2, ...` Each component is of `float` type.
/// </summary>
void easyar_SceneMesh_getVerticesAll(easyar_SceneMesh * This, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Get the normal component of vertices in `meshAll`. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in `Buffer`_ by `nx1, ny1, nz1, nx2, ny2, nz2,....` Each component is of `float` type.
/// </summary>
void easyar_SceneMesh_getNormalsAll(easyar_SceneMesh * This, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Get the index data in `meshAll`. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in `Buffer`_ by `ix1, iy1, iz1, ix2, iy2, iz2,...` Each component is of `int32` type.
/// </summary>
void easyar_SceneMesh_getIndicesAll(easyar_SceneMesh * This, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Get the number of vertices in `meshUpdated`.
/// </summary>
int easyar_SceneMesh_getNumOfVertexIncremental(easyar_SceneMesh * This);
/// <summary>
/// Get the number of indices in `meshUpdated`. Since every 3 indices form a triangle, the returned value should be a multiple of 3.
/// </summary>
int easyar_SceneMesh_getNumOfIndexIncremental(easyar_SceneMesh * This);
/// <summary>
/// Get the position component of the vertices in `meshUpdated` (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in `Buffer`_ by `x1, y1, z1, x2, y2, z2, ...` Each component is of `float` type.
/// </summary>
void easyar_SceneMesh_getVerticesIncremental(easyar_SceneMesh * This, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Get the normal component of vertices in `meshUpdated`. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in `Buffer`_ by `nx1, ny1, nz1, nx2, ny2, nz2,....` Each component is of `float` type.
/// </summary>
void easyar_SceneMesh_getNormalsIncremental(easyar_SceneMesh * This, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Get the index data in `meshUpdated`. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in `Buffer`_ by `ix1, iy1, iz1, ix2, iy2, iz2,...` Each component is of `int32` type.
/// </summary>
void easyar_SceneMesh_getIndicesIncremental(easyar_SceneMesh * This, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Gets the description object of `mesh block` in `meshUpdate`. The return value is an array of `BlockInfo`_ elements, each of which is a detailed description of a `mesh block`.
/// </summary>
void easyar_SceneMesh_getBlocksInfoIncremental(easyar_SceneMesh * This, /* OUT */ easyar_ListOfBlockInfo * * Return);
/// <summary>
/// Get the edge length of a `mesh block` in meters.
/// </summary>
float easyar_SceneMesh_getBlockDimensionInMeters(easyar_SceneMesh * This);
void easyar_SceneMesh__dtor(easyar_SceneMesh * This);
void easyar_SceneMesh__retain(const easyar_SceneMesh * This, /* OUT */ easyar_SceneMesh * * Return);
const char * easyar_SceneMesh__typeName(const easyar_SceneMesh * This);
void easyar_ListOfBlockInfo__ctor(easyar_BlockInfo const * begin, easyar_BlockInfo const * end, /* OUT */ easyar_ListOfBlockInfo * * Return);
void easyar_ListOfBlockInfo__dtor(easyar_ListOfBlockInfo * This);
void easyar_ListOfBlockInfo_copy(const easyar_ListOfBlockInfo * This, /* OUT */ easyar_ListOfBlockInfo * * Return);
int easyar_ListOfBlockInfo_size(const easyar_ListOfBlockInfo * This);
easyar_BlockInfo easyar_ListOfBlockInfo_at(const easyar_ListOfBlockInfo * This, int index);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: 1da120215af0cc343b0360dbe2372ee8
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_SCENEMESH_HXX__
#define __EASYAR_SCENEMESH_HXX__
#include "easyar/types.hxx"
namespace easyar {
/// <summary>
/// record
/// The dense reconstructed model is represented by triangle mesh, or simply denoted as mesh. Because mesh updates frequently, in order to ensure efficiency, the mesh of the whole reconstruction model is divided into many mesh blocks. A mesh block is composed of a cube about 1 meter long, with attributes such as vertices and indices.
///
/// BlockInfo is used to describe the content of a mesh block. (x, y, z) is the index of mesh block, the coordinates of a mesh block&#39;s origin in world coordinate system can be obtained by multiplying (x, y, z) by the physical size of mesh block. You may filter the part you want to display in advance by the mesh block&#39;s world coordinates for the sake of saving rendering time.
/// </summary>
struct BlockInfo
{
/// <summary>
/// x in index (x, y, z) of mesh block.
/// </summary>
int x;
/// <summary>
/// y in index (x, y, z) of mesh block.
/// </summary>
int y;
/// <summary>
/// z in index (x, y, z) of mesh block.
/// </summary>
int z;
/// <summary>
/// Number of vertices in a mesh block.
/// </summary>
int numOfVertex;
/// <summary>
/// startPointOfVertex is the starting position of the vertex data stored in the vertex buffer, indicating from where the stored vertices belong to current mesh block. It is not equal to the number of bytes of the offset from the beginning of vertex buffer. The offset is startPointOfVertex*3*4 bytes.
/// </summary>
int startPointOfVertex;
/// <summary>
/// The number of indices in a mesh block. Each of three consecutive vertices form a triangle.
/// </summary>
int numOfIndex;
/// <summary>
/// Similar to startPointOfVertex. startPointOfIndex is the starting position of the index data stored in the index buffer, indicating from where the stored indices belong to current mesh block. It is not equal to the number of bytes of the offset from the beginning of index buffer. The offset is startPointOfIndex*3*4 bytes.
/// </summary>
int startPointOfIndex;
/// <summary>
/// Version represents how many times the mesh block has updated. The larger the version, the newer the block. If the version of a mesh block increases after calling `DenseSpatialMap.updateSceneMesh`_ , it indicates that the mash block has changed.
/// </summary>
int version;
BlockInfo();
BlockInfo(int x, int y, int z, int numOfVertex, int startPointOfVertex, int numOfIndex, int startPointOfIndex, int version);
easyar_BlockInfo get_cdata();
};
/// <summary>
/// SceneMesh is used to manage and preserve the results of `DenseSpatialMap`_.
/// There are two kinds of meshes saved in SceneMesh, one is the mesh of the whole reconstructed scene, hereinafter referred to as `meshAll`, the other is the recently updated mesh, hereinafter referred to as `meshUpdated`. `meshAll` is a whole mesh, including all vertex data and index data, etc. `meshUpdated` is composed of several `mesh block` s, each `mesh block` is a cube, which contains the mesh formed by the object surface in the corresponding cube space.
/// `meshAll` is available only when the `DenseSpatialMap.updateSceneMesh`_ method is called specifying that all meshes need to be updated. If `meshAll` has been updated previously and not updated in recent times, the data in `meshAll` is remain the same.
/// </summary>
class SceneMesh
{
protected:
easyar_SceneMesh * cdata_ ;
void init_cdata(easyar_SceneMesh * cdata);
virtual SceneMesh & operator=(const SceneMesh & data) { return *this; } //deleted
public:
SceneMesh(easyar_SceneMesh * cdata);
virtual ~SceneMesh();
SceneMesh(const SceneMesh & data);
const easyar_SceneMesh * get_cdata() const;
easyar_SceneMesh * get_cdata();
/// <summary>
/// Get the number of vertices in `meshAll`.
/// </summary>
int getNumOfVertexAll();
/// <summary>
/// Get the number of indices in `meshAll`. Since every 3 indices form a triangle, the returned value should be a multiple of 3.
/// </summary>
int getNumOfIndexAll();
/// <summary>
/// Get the position component of the vertices in `meshAll` (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in `Buffer`_ by `x1, y1, z1, x2, y2, z2, ...` Each component is of `float` type.
/// </summary>
void getVerticesAll(/* OUT */ Buffer * * Return);
/// <summary>
/// Get the normal component of vertices in `meshAll`. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in `Buffer`_ by `nx1, ny1, nz1, nx2, ny2, nz2,....` Each component is of `float` type.
/// </summary>
void getNormalsAll(/* OUT */ Buffer * * Return);
/// <summary>
/// Get the index data in `meshAll`. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in `Buffer`_ by `ix1, iy1, iz1, ix2, iy2, iz2,...` Each component is of `int32` type.
/// </summary>
void getIndicesAll(/* OUT */ Buffer * * Return);
/// <summary>
/// Get the number of vertices in `meshUpdated`.
/// </summary>
int getNumOfVertexIncremental();
/// <summary>
/// Get the number of indices in `meshUpdated`. Since every 3 indices form a triangle, the returned value should be a multiple of 3.
/// </summary>
int getNumOfIndexIncremental();
/// <summary>
/// Get the position component of the vertices in `meshUpdated` (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in `Buffer`_ by `x1, y1, z1, x2, y2, z2, ...` Each component is of `float` type.
/// </summary>
void getVerticesIncremental(/* OUT */ Buffer * * Return);
/// <summary>
/// Get the normal component of vertices in `meshUpdated`. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in `Buffer`_ by `nx1, ny1, nz1, nx2, ny2, nz2,....` Each component is of `float` type.
/// </summary>
void getNormalsIncremental(/* OUT */ Buffer * * Return);
/// <summary>
/// Get the index data in `meshUpdated`. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in `Buffer`_ by `ix1, iy1, iz1, ix2, iy2, iz2,...` Each component is of `int32` type.
/// </summary>
void getIndicesIncremental(/* OUT */ Buffer * * Return);
/// <summary>
/// Gets the description object of `mesh block` in `meshUpdate`. The return value is an array of `BlockInfo`_ elements, each of which is a detailed description of a `mesh block`.
/// </summary>
void getBlocksInfoIncremental(/* OUT */ ListOfBlockInfo * * Return);
/// <summary>
/// Get the edge length of a `mesh block` in meters.
/// </summary>
float getBlockDimensionInMeters();
};
#ifndef __EASYAR_LISTOFBLOCKINFO__
#define __EASYAR_LISTOFBLOCKINFO__
class ListOfBlockInfo
{
private:
easyar_ListOfBlockInfo * cdata_;
virtual ListOfBlockInfo & operator=(const ListOfBlockInfo & data) { return *this; } //deleted
public:
ListOfBlockInfo(easyar_ListOfBlockInfo * cdata);
virtual ~ListOfBlockInfo();
ListOfBlockInfo(const ListOfBlockInfo & data);
const easyar_ListOfBlockInfo * get_cdata() const;
easyar_ListOfBlockInfo * get_cdata();
ListOfBlockInfo(easyar_BlockInfo * begin, easyar_BlockInfo * end);
int size() const;
BlockInfo at(int index) const;
};
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_SCENEMESH_HXX__
#define __IMPLEMENTATION_EASYAR_SCENEMESH_HXX__
#include "easyar/scenemesh.h"
#include "easyar/buffer.hxx"
namespace easyar {
inline BlockInfo::BlockInfo()
{
this->x = int();
this->y = int();
this->z = int();
this->numOfVertex = int();
this->startPointOfVertex = int();
this->numOfIndex = int();
this->startPointOfIndex = int();
this->version = int();
}
inline BlockInfo::BlockInfo(int x, int y, int z, int numOfVertex, int startPointOfVertex, int numOfIndex, int startPointOfIndex, int version)
{
this->x = x;
this->y = y;
this->z = z;
this->numOfVertex = numOfVertex;
this->startPointOfVertex = startPointOfVertex;
this->numOfIndex = numOfIndex;
this->startPointOfIndex = startPointOfIndex;
this->version = version;
}
inline easyar_BlockInfo BlockInfo::get_cdata()
{
easyar_BlockInfo _return_value_ = {x, y, z, numOfVertex, startPointOfVertex, numOfIndex, startPointOfIndex, version};
return _return_value_;
}
inline SceneMesh::SceneMesh(easyar_SceneMesh * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline SceneMesh::~SceneMesh()
{
if (cdata_) {
easyar_SceneMesh__dtor(cdata_);
cdata_ = NULL;
}
}
inline SceneMesh::SceneMesh(const SceneMesh & data)
:
cdata_(NULL)
{
easyar_SceneMesh * cdata = NULL;
easyar_SceneMesh__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_SceneMesh * SceneMesh::get_cdata() const
{
return cdata_;
}
inline easyar_SceneMesh * SceneMesh::get_cdata()
{
return cdata_;
}
inline void SceneMesh::init_cdata(easyar_SceneMesh * cdata)
{
cdata_ = cdata;
}
inline int SceneMesh::getNumOfVertexAll()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_SceneMesh_getNumOfVertexAll(cdata_);
return _return_value_;
}
inline int SceneMesh::getNumOfIndexAll()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_SceneMesh_getNumOfIndexAll(cdata_);
return _return_value_;
}
inline void SceneMesh::getVerticesAll(/* OUT */ Buffer * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Buffer * _return_value_ = NULL;
easyar_SceneMesh_getVerticesAll(cdata_, &_return_value_);
*Return = new Buffer(_return_value_);
}
inline void SceneMesh::getNormalsAll(/* OUT */ Buffer * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Buffer * _return_value_ = NULL;
easyar_SceneMesh_getNormalsAll(cdata_, &_return_value_);
*Return = new Buffer(_return_value_);
}
inline void SceneMesh::getIndicesAll(/* OUT */ Buffer * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Buffer * _return_value_ = NULL;
easyar_SceneMesh_getIndicesAll(cdata_, &_return_value_);
*Return = new Buffer(_return_value_);
}
inline int SceneMesh::getNumOfVertexIncremental()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_SceneMesh_getNumOfVertexIncremental(cdata_);
return _return_value_;
}
inline int SceneMesh::getNumOfIndexIncremental()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_SceneMesh_getNumOfIndexIncremental(cdata_);
return _return_value_;
}
inline void SceneMesh::getVerticesIncremental(/* OUT */ Buffer * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Buffer * _return_value_ = NULL;
easyar_SceneMesh_getVerticesIncremental(cdata_, &_return_value_);
*Return = new Buffer(_return_value_);
}
inline void SceneMesh::getNormalsIncremental(/* OUT */ Buffer * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Buffer * _return_value_ = NULL;
easyar_SceneMesh_getNormalsIncremental(cdata_, &_return_value_);
*Return = new Buffer(_return_value_);
}
inline void SceneMesh::getIndicesIncremental(/* OUT */ Buffer * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Buffer * _return_value_ = NULL;
easyar_SceneMesh_getIndicesIncremental(cdata_, &_return_value_);
*Return = new Buffer(_return_value_);
}
inline void SceneMesh::getBlocksInfoIncremental(/* OUT */ ListOfBlockInfo * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfBlockInfo * _return_value_ = NULL;
easyar_SceneMesh_getBlocksInfoIncremental(cdata_, &_return_value_);
*Return = new ListOfBlockInfo(_return_value_);
}
inline float SceneMesh::getBlockDimensionInMeters()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_SceneMesh_getBlockDimensionInMeters(cdata_);
return _return_value_;
}
#ifndef __IMPLEMENTATION_EASYAR_LISTOFBLOCKINFO__
#define __IMPLEMENTATION_EASYAR_LISTOFBLOCKINFO__
inline ListOfBlockInfo::ListOfBlockInfo(easyar_ListOfBlockInfo * cdata)
: cdata_(cdata)
{
}
inline ListOfBlockInfo::~ListOfBlockInfo()
{
if (cdata_) {
easyar_ListOfBlockInfo__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfBlockInfo::ListOfBlockInfo(const ListOfBlockInfo & data)
: cdata_(static_cast<easyar_ListOfBlockInfo *>(NULL))
{
easyar_ListOfBlockInfo_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfBlockInfo * ListOfBlockInfo::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfBlockInfo * ListOfBlockInfo::get_cdata()
{
return cdata_;
}
inline ListOfBlockInfo::ListOfBlockInfo(easyar_BlockInfo * begin, easyar_BlockInfo * end)
: cdata_(static_cast<easyar_ListOfBlockInfo *>(NULL))
{
easyar_ListOfBlockInfo__ctor(begin, end, &cdata_);
}
inline int ListOfBlockInfo::size() const
{
return easyar_ListOfBlockInfo_size(cdata_);
}
inline BlockInfo ListOfBlockInfo::at(int index) const
{
easyar_BlockInfo _return_value_ = easyar_ListOfBlockInfo_at(cdata_, index);
return BlockInfo(_return_value_.x, _return_value_.y, _return_value_.z, _return_value_.numOfVertex, _return_value_.startPointOfVertex, _return_value_.numOfIndex, _return_value_.startPointOfIndex, _return_value_.version);
}
#endif
}
#endif
fileFormatVersion: 2
guid: 0833d83867d94604991aece0112853eb
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.
//
//=============================================================================================================================
#import "easyar/types.oc.h"
/// <summary>
/// record
/// The dense reconstructed model is represented by triangle mesh, or simply denoted as mesh. Because mesh updates frequently, in order to ensure efficiency, the mesh of the whole reconstruction model is divided into many mesh blocks. A mesh block is composed of a cube about 1 meter long, with attributes such as vertices and indices.
///
/// BlockInfo is used to describe the content of a mesh block. (x, y, z) is the index of mesh block, the coordinates of a mesh block&#39;s origin in world coordinate system can be obtained by multiplying (x, y, z) by the physical size of mesh block. You may filter the part you want to display in advance by the mesh block&#39;s world coordinates for the sake of saving rendering time.
/// </summary>
@interface easyar_BlockInfo : NSObject
/// <summary>
/// x in index (x, y, z) of mesh block.
/// </summary>
@property (nonatomic) int x;
/// <summary>
/// y in index (x, y, z) of mesh block.
/// </summary>
@property (nonatomic) int y;
/// <summary>
/// z in index (x, y, z) of mesh block.
/// </summary>
@property (nonatomic) int z;
/// <summary>
/// Number of vertices in a mesh block.
/// </summary>
@property (nonatomic) int numOfVertex;
/// <summary>
/// startPointOfVertex is the starting position of the vertex data stored in the vertex buffer, indicating from where the stored vertices belong to current mesh block. It is not equal to the number of bytes of the offset from the beginning of vertex buffer. The offset is startPointOfVertex*3*4 bytes.
/// </summary>
@property (nonatomic) int startPointOfVertex;
/// <summary>
/// The number of indices in a mesh block. Each of three consecutive vertices form a triangle.
/// </summary>
@property (nonatomic) int numOfIndex;
/// <summary>
/// Similar to startPointOfVertex. startPointOfIndex is the starting position of the index data stored in the index buffer, indicating from where the stored indices belong to current mesh block. It is not equal to the number of bytes of the offset from the beginning of index buffer. The offset is startPointOfIndex*3*4 bytes.
/// </summary>
@property (nonatomic) int startPointOfIndex;
/// <summary>
/// Version represents how many times the mesh block has updated. The larger the version, the newer the block. If the version of a mesh block increases after calling `DenseSpatialMap.updateSceneMesh`_ , it indicates that the mash block has changed.
/// </summary>
@property (nonatomic) int version;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)create:(int)x y:(int)y z:(int)z numOfVertex:(int)numOfVertex startPointOfVertex:(int)startPointOfVertex numOfIndex:(int)numOfIndex startPointOfIndex:(int)startPointOfIndex version:(int)version;
@end
/// <summary>
/// SceneMesh is used to manage and preserve the results of `DenseSpatialMap`_.
/// There are two kinds of meshes saved in SceneMesh, one is the mesh of the whole reconstructed scene, hereinafter referred to as `meshAll`, the other is the recently updated mesh, hereinafter referred to as `meshUpdated`. `meshAll` is a whole mesh, including all vertex data and index data, etc. `meshUpdated` is composed of several `mesh block` s, each `mesh block` is a cube, which contains the mesh formed by the object surface in the corresponding cube space.
/// `meshAll` is available only when the `DenseSpatialMap.updateSceneMesh`_ method is called specifying that all meshes need to be updated. If `meshAll` has been updated previously and not updated in recent times, the data in `meshAll` is remain the same.
/// </summary>
@interface easyar_SceneMesh : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Get the number of vertices in `meshAll`.
/// </summary>
- (int)getNumOfVertexAll;
/// <summary>
/// Get the number of indices in `meshAll`. Since every 3 indices form a triangle, the returned value should be a multiple of 3.
/// </summary>
- (int)getNumOfIndexAll;
/// <summary>
/// Get the position component of the vertices in `meshAll` (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in `Buffer`_ by `x1, y1, z1, x2, y2, z2, ...` Each component is of `float` type.
/// </summary>
- (easyar_Buffer *)getVerticesAll;
/// <summary>
/// Get the normal component of vertices in `meshAll`. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in `Buffer`_ by `nx1, ny1, nz1, nx2, ny2, nz2,....` Each component is of `float` type.
/// </summary>
- (easyar_Buffer *)getNormalsAll;
/// <summary>
/// Get the index data in `meshAll`. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in `Buffer`_ by `ix1, iy1, iz1, ix2, iy2, iz2,...` Each component is of `int32` type.
/// </summary>
- (easyar_Buffer *)getIndicesAll;
/// <summary>
/// Get the number of vertices in `meshUpdated`.
/// </summary>
- (int)getNumOfVertexIncremental;
/// <summary>
/// Get the number of indices in `meshUpdated`. Since every 3 indices form a triangle, the returned value should be a multiple of 3.
/// </summary>
- (int)getNumOfIndexIncremental;
/// <summary>
/// Get the position component of the vertices in `meshUpdated` (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in `Buffer`_ by `x1, y1, z1, x2, y2, z2, ...` Each component is of `float` type.
/// </summary>
- (easyar_Buffer *)getVerticesIncremental;
/// <summary>
/// Get the normal component of vertices in `meshUpdated`. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in `Buffer`_ by `nx1, ny1, nz1, nx2, ny2, nz2,....` Each component is of `float` type.
/// </summary>
- (easyar_Buffer *)getNormalsIncremental;
/// <summary>
/// Get the index data in `meshUpdated`. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in `Buffer`_ by `ix1, iy1, iz1, ix2, iy2, iz2,...` Each component is of `int32` type.
/// </summary>
- (easyar_Buffer *)getIndicesIncremental;
/// <summary>
/// Gets the description object of `mesh block` in `meshUpdate`. The return value is an array of `BlockInfo`_ elements, each of which is a detailed description of a `mesh block`.
/// </summary>
- (NSArray<easyar_BlockInfo *> *)getBlocksInfoIncremental;
/// <summary>
/// Get the edge length of a `mesh block` in meters.
/// </summary>
- (float)getBlockDimensionInMeters;
@end
fileFormatVersion: 2
guid: 745e354317195b845aea1965912ee02c
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_SPARSESPATIALMAP_H__
#define __EASYAR_SPARSESPATIALMAP_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Obtain motion tracking status.
/// </summary>
easyar_MotionTrackingStatus easyar_SparseSpatialMapResult_getMotionTrackingStatus(const easyar_SparseSpatialMapResult * This);
/// <summary>
/// Returns pose of the origin of VIO system in camera coordinate system.
/// </summary>
easyar_OptionalOfMatrix44F easyar_SparseSpatialMapResult_getVioPose(const easyar_SparseSpatialMapResult * This);
/// <summary>
/// Returns the pose of origin of the map in camera coordinate system, when localization is successful.
/// Otherwise, returns pose of the origin of VIO system in camera coordinate system.
/// </summary>
easyar_OptionalOfMatrix44F easyar_SparseSpatialMapResult_getMapPose(const easyar_SparseSpatialMapResult * This);
/// <summary>
/// Returns true if the system can reliablly locate the pose of the device with regard to the map.
/// Once relocalization succeeds, relative pose can be updated by motion tracking module.
/// As long as the motion tracking module returns normal tracking status, the localization status is also true.
/// </summary>
bool easyar_SparseSpatialMapResult_getLocalizationStatus(const easyar_SparseSpatialMapResult * This);
/// <summary>
/// Returns current localized map ID.
/// </summary>
void easyar_SparseSpatialMapResult_getLocalizationMapID(const easyar_SparseSpatialMapResult * This, /* OUT */ easyar_String * * Return);
void easyar_SparseSpatialMapResult__dtor(easyar_SparseSpatialMapResult * This);
void easyar_SparseSpatialMapResult__retain(const easyar_SparseSpatialMapResult * This, /* OUT */ easyar_SparseSpatialMapResult * * Return);
const char * easyar_SparseSpatialMapResult__typeName(const easyar_SparseSpatialMapResult * This);
void easyar_castSparseSpatialMapResultToFrameFilterResult(const easyar_SparseSpatialMapResult * This, /* OUT */ easyar_FrameFilterResult * * Return);
void easyar_tryCastFrameFilterResultToSparseSpatialMapResult(const easyar_FrameFilterResult * This, /* OUT */ easyar_SparseSpatialMapResult * * Return);
/// <summary>
/// Constructor
/// </summary>
void easyar_PlaneData__ctor(/* OUT */ easyar_PlaneData * * Return);
/// <summary>
/// Returns the type of this plane.
/// </summary>
easyar_PlaneType easyar_PlaneData_getType(const easyar_PlaneData * This);
/// <summary>
/// Returns the pose of the center of the detected plane.The pose&#39;s transformed +Y axis will be point normal out of the plane, with the +X and +Z axes orienting the extents of the bounding rectangle.
/// </summary>
easyar_Matrix44F easyar_PlaneData_getPose(const easyar_PlaneData * This);
/// <summary>
/// Returns the length of this plane&#39;s bounding rectangle measured along the local X-axis of the coordinate space centered on the plane.
/// </summary>
float easyar_PlaneData_getExtentX(const easyar_PlaneData * This);
/// <summary>
/// Returns the length of this plane&#39;s bounding rectangle measured along the local Z-axis of the coordinate frame centered on the plane.
/// </summary>
float easyar_PlaneData_getExtentZ(const easyar_PlaneData * This);
void easyar_PlaneData__dtor(easyar_PlaneData * This);
void easyar_PlaneData__retain(const easyar_PlaneData * This, /* OUT */ easyar_PlaneData * * Return);
const char * easyar_PlaneData__typeName(const easyar_PlaneData * This);
/// <summary>
/// Constructor
/// </summary>
void easyar_SparseSpatialMapConfig__ctor(/* OUT */ easyar_SparseSpatialMapConfig * * Return);
/// <summary>
/// Sets localization configurations. See also `LocalizationMode`_.
/// </summary>
void easyar_SparseSpatialMapConfig_setLocalizationMode(easyar_SparseSpatialMapConfig * This, easyar_LocalizationMode _value);
/// <summary>
/// Returns localization configurations. See also `LocalizationMode`_.
/// </summary>
easyar_LocalizationMode easyar_SparseSpatialMapConfig_getLocalizationMode(const easyar_SparseSpatialMapConfig * This);
void easyar_SparseSpatialMapConfig__dtor(easyar_SparseSpatialMapConfig * This);
void easyar_SparseSpatialMapConfig__retain(const easyar_SparseSpatialMapConfig * This, /* OUT */ easyar_SparseSpatialMapConfig * * Return);
const char * easyar_SparseSpatialMapConfig__typeName(const easyar_SparseSpatialMapConfig * This);
/// <summary>
/// Check whether SparseSpatialMap is is available, always return true.
/// </summary>
bool easyar_SparseSpatialMap_isAvailable(void);
/// <summary>
/// Input port for input frame. For SparseSpatialMap to work, the inputFrame must include camera parameters, timestamp and spatial information. See also `InputFrameSink`_
/// </summary>
void easyar_SparseSpatialMap_inputFrameSink(easyar_SparseSpatialMap * This, /* OUT */ easyar_InputFrameSink * * Return);
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
int easyar_SparseSpatialMap_bufferRequirement(easyar_SparseSpatialMap * This);
/// <summary>
/// Output port for output frame. See also `OutputFrameSource`_
/// </summary>
void easyar_SparseSpatialMap_outputFrameSource(easyar_SparseSpatialMap * This, /* OUT */ easyar_OutputFrameSource * * Return);
/// <summary>
/// Construct SparseSpatialMap.
/// </summary>
void easyar_SparseSpatialMap_create(/* OUT */ easyar_SparseSpatialMap * * Return);
/// <summary>
/// Start SparseSpatialMap system.
/// </summary>
bool easyar_SparseSpatialMap_start(easyar_SparseSpatialMap * This);
/// <summary>
/// Stop SparseSpatialMap from running。Can resume running by calling start().
/// </summary>
void easyar_SparseSpatialMap_stop(easyar_SparseSpatialMap * This);
/// <summary>
/// Close SparseSpatialMap. SparseSpatialMap can no longer be used.
/// </summary>
void easyar_SparseSpatialMap_close(easyar_SparseSpatialMap * This);
/// <summary>
/// Returns the buffer of point cloud coordinate. Each 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space, each of which takes 4 bytes.
/// </summary>
void easyar_SparseSpatialMap_getPointCloudBuffer(easyar_SparseSpatialMap * This, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Returns detected planes in SparseSpatialMap.
/// </summary>
void easyar_SparseSpatialMap_getMapPlanes(easyar_SparseSpatialMap * This, /* OUT */ easyar_ListOfPlaneData * * Return);
/// <summary>
/// Perform hit test against the point cloud. The results are returned sorted by their distance to the camera in ascending order.
/// </summary>
void easyar_SparseSpatialMap_hitTestAgainstPointCloud(easyar_SparseSpatialMap * This, easyar_Vec2F cameraImagePoint, /* OUT */ easyar_ListOfVec3F * * Return);
/// <summary>
/// Performs ray cast from the user&#39;s device in the direction of given screen point.
/// Intersections with detected planes are returned. 3D positions on physical planes are sorted by distance from the device in ascending order.
/// 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 is in the world coordinate system.
/// </summary>
void easyar_SparseSpatialMap_hitTestAgainstPlanes(easyar_SparseSpatialMap * This, easyar_Vec2F cameraImagePoint, /* OUT */ easyar_ListOfVec3F * * Return);
/// <summary>
/// Get the map data version of the current SparseSpatialMap.
/// </summary>
void easyar_SparseSpatialMap_getMapVersion(/* OUT */ easyar_String * * Return);
/// <summary>
/// UnloadMap specified SparseSpatialMap data via callback function.The return value of callback indicates whether unload map succeeds (true) or fails (false).
/// </summary>
void easyar_SparseSpatialMap_unloadMap(easyar_SparseSpatialMap * This, easyar_String * mapID, easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromBool resultCallBack);
/// <summary>
/// Set configurations for SparseSpatialMap. See also `SparseSpatialMapConfig`_.
/// </summary>
void easyar_SparseSpatialMap_setConfig(easyar_SparseSpatialMap * This, easyar_SparseSpatialMapConfig * config);
/// <summary>
/// Returns configurations for SparseSpatialMap. See also `SparseSpatialMapConfig`_.
/// </summary>
void easyar_SparseSpatialMap_getConfig(easyar_SparseSpatialMap * This, /* OUT */ easyar_SparseSpatialMapConfig * * Return);
/// <summary>
/// Start localization in loaded maps. Should set `LocalizationMode`_ first.
/// </summary>
bool easyar_SparseSpatialMap_startLocalization(easyar_SparseSpatialMap * This);
/// <summary>
/// Stop localization in loaded maps.
/// </summary>
void easyar_SparseSpatialMap_stopLocalization(easyar_SparseSpatialMap * This);
void easyar_SparseSpatialMap__dtor(easyar_SparseSpatialMap * This);
void easyar_SparseSpatialMap__retain(const easyar_SparseSpatialMap * This, /* OUT */ easyar_SparseSpatialMap * * Return);
const char * easyar_SparseSpatialMap__typeName(const easyar_SparseSpatialMap * This);
void easyar_ListOfPlaneData__ctor(easyar_PlaneData * const * begin, easyar_PlaneData * const * end, /* OUT */ easyar_ListOfPlaneData * * Return);
void easyar_ListOfPlaneData__dtor(easyar_ListOfPlaneData * This);
void easyar_ListOfPlaneData_copy(const easyar_ListOfPlaneData * This, /* OUT */ easyar_ListOfPlaneData * * Return);
int easyar_ListOfPlaneData_size(const easyar_ListOfPlaneData * This);
easyar_PlaneData * easyar_ListOfPlaneData_at(const easyar_ListOfPlaneData * This, int index);
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: 5c0e96754ba1ab241b6ed71698c2137c
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_SPARSESPATIALMAP_HXX__
#define __EASYAR_SPARSESPATIALMAP_HXX__
#include "easyar/types.hxx"
#include "easyar/frame.hxx"
namespace easyar {
/// <summary>
/// Describes the result of mapping and localization. Updated at the same frame rate with OutputFrame.
/// </summary>
class SparseSpatialMapResult : public FrameFilterResult
{
protected:
easyar_SparseSpatialMapResult * cdata_ ;
void init_cdata(easyar_SparseSpatialMapResult * cdata);
virtual SparseSpatialMapResult & operator=(const SparseSpatialMapResult & data) { return *this; } //deleted
public:
SparseSpatialMapResult(easyar_SparseSpatialMapResult * cdata);
virtual ~SparseSpatialMapResult();
SparseSpatialMapResult(const SparseSpatialMapResult & data);
const easyar_SparseSpatialMapResult * get_cdata() const;
easyar_SparseSpatialMapResult * get_cdata();
/// <summary>
/// Obtain motion tracking status.
/// </summary>
MotionTrackingStatus getMotionTrackingStatus();
/// <summary>
/// Returns pose of the origin of VIO system in camera coordinate system.
/// </summary>
OptionalOfMatrix44F getVioPose();
/// <summary>
/// Returns the pose of origin of the map in camera coordinate system, when localization is successful.
/// Otherwise, returns pose of the origin of VIO system in camera coordinate system.
/// </summary>
OptionalOfMatrix44F getMapPose();
/// <summary>
/// Returns true if the system can reliablly locate the pose of the device with regard to the map.
/// Once relocalization succeeds, relative pose can be updated by motion tracking module.
/// As long as the motion tracking module returns normal tracking status, the localization status is also true.
/// </summary>
bool getLocalizationStatus();
/// <summary>
/// Returns current localized map ID.
/// </summary>
void getLocalizationMapID(/* OUT */ String * * Return);
static void tryCastFromFrameFilterResult(FrameFilterResult * v, /* OUT */ SparseSpatialMapResult * * Return);
};
class PlaneData
{
protected:
easyar_PlaneData * cdata_ ;
void init_cdata(easyar_PlaneData * cdata);
virtual PlaneData & operator=(const PlaneData & data) { return *this; } //deleted
public:
PlaneData(easyar_PlaneData * cdata);
virtual ~PlaneData();
PlaneData(const PlaneData & data);
const easyar_PlaneData * get_cdata() const;
easyar_PlaneData * get_cdata();
/// <summary>
/// Constructor
/// </summary>
PlaneData();
/// <summary>
/// Returns the type of this plane.
/// </summary>
PlaneType getType();
/// <summary>
/// Returns the pose of the center of the detected plane.The pose&#39;s transformed +Y axis will be point normal out of the plane, with the +X and +Z axes orienting the extents of the bounding rectangle.
/// </summary>
Matrix44F getPose();
/// <summary>
/// Returns the length of this plane&#39;s bounding rectangle measured along the local X-axis of the coordinate space centered on the plane.
/// </summary>
float getExtentX();
/// <summary>
/// Returns the length of this plane&#39;s bounding rectangle measured along the local Z-axis of the coordinate frame centered on the plane.
/// </summary>
float getExtentZ();
};
/// <summary>
/// Configuration used to set the localization mode.
/// </summary>
class SparseSpatialMapConfig
{
protected:
easyar_SparseSpatialMapConfig * cdata_ ;
void init_cdata(easyar_SparseSpatialMapConfig * cdata);
virtual SparseSpatialMapConfig & operator=(const SparseSpatialMapConfig & data) { return *this; } //deleted
public:
SparseSpatialMapConfig(easyar_SparseSpatialMapConfig * cdata);
virtual ~SparseSpatialMapConfig();
SparseSpatialMapConfig(const SparseSpatialMapConfig & data);
const easyar_SparseSpatialMapConfig * get_cdata() const;
easyar_SparseSpatialMapConfig * get_cdata();
/// <summary>
/// Constructor
/// </summary>
SparseSpatialMapConfig();
/// <summary>
/// Sets localization configurations. See also `LocalizationMode`_.
/// </summary>
void setLocalizationMode(LocalizationMode _value);
/// <summary>
/// Returns localization configurations. See also `LocalizationMode`_.
/// </summary>
LocalizationMode getLocalizationMode();
};
/// <summary>
/// Provides core components for SparseSpatialMap, can be used for sparse spatial map building as well as localization using existing map. Also provides utilities for point cloud and plane access.
/// SparseSpatialMap occupies 2 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;`__ .
/// </summary>
class SparseSpatialMap
{
protected:
easyar_SparseSpatialMap * cdata_ ;
void init_cdata(easyar_SparseSpatialMap * cdata);
virtual SparseSpatialMap & operator=(const SparseSpatialMap & data) { return *this; } //deleted
public:
SparseSpatialMap(easyar_SparseSpatialMap * cdata);
virtual ~SparseSpatialMap();
SparseSpatialMap(const SparseSpatialMap & data);
const easyar_SparseSpatialMap * get_cdata() const;
easyar_SparseSpatialMap * get_cdata();
/// <summary>
/// Check whether SparseSpatialMap is is available, always return true.
/// </summary>
static bool isAvailable();
/// <summary>
/// Input port for input frame. For SparseSpatialMap to work, the inputFrame must include camera parameters, timestamp and spatial information. See also `InputFrameSink`_
/// </summary>
void inputFrameSink(/* OUT */ InputFrameSink * * Return);
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
int bufferRequirement();
/// <summary>
/// Output port for output frame. See also `OutputFrameSource`_
/// </summary>
void outputFrameSource(/* OUT */ OutputFrameSource * * Return);
/// <summary>
/// Construct SparseSpatialMap.
/// </summary>
static void create(/* OUT */ SparseSpatialMap * * Return);
/// <summary>
/// Start SparseSpatialMap system.
/// </summary>
bool start();
/// <summary>
/// Stop SparseSpatialMap from running。Can resume running by calling start().
/// </summary>
void stop();
/// <summary>
/// Close SparseSpatialMap. SparseSpatialMap can no longer be used.
/// </summary>
void close();
/// <summary>
/// Returns the buffer of point cloud coordinate. Each 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space, each of which takes 4 bytes.
/// </summary>
void getPointCloudBuffer(/* OUT */ Buffer * * Return);
/// <summary>
/// Returns detected planes in SparseSpatialMap.
/// </summary>
void getMapPlanes(/* OUT */ ListOfPlaneData * * Return);
/// <summary>
/// Perform hit test against the point cloud. The results are returned sorted by their distance to the camera in ascending order.
/// </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 detected planes are returned. 3D positions on physical planes are sorted by distance from the device in ascending order.
/// 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 is in the world coordinate system.
/// </summary>
void hitTestAgainstPlanes(Vec2F cameraImagePoint, /* OUT */ ListOfVec3F * * Return);
/// <summary>
/// Get the map data version of the current SparseSpatialMap.
/// </summary>
static void getMapVersion(/* OUT */ String * * Return);
/// <summary>
/// UnloadMap specified SparseSpatialMap data via callback function.The return value of callback indicates whether unload map succeeds (true) or fails (false).
/// </summary>
void unloadMap(String * mapID, CallbackScheduler * callbackScheduler, OptionalOfFunctorOfVoidFromBool resultCallBack);
/// <summary>
/// Set configurations for SparseSpatialMap. See also `SparseSpatialMapConfig`_.
/// </summary>
void setConfig(SparseSpatialMapConfig * config);
/// <summary>
/// Returns configurations for SparseSpatialMap. See also `SparseSpatialMapConfig`_.
/// </summary>
void getConfig(/* OUT */ SparseSpatialMapConfig * * Return);
/// <summary>
/// Start localization in loaded maps. Should set `LocalizationMode`_ first.
/// </summary>
bool startLocalization();
/// <summary>
/// Stop localization in loaded maps.
/// </summary>
void stopLocalization();
};
#ifndef __EASYAR_OPTIONALOFMATRIX__F__
#define __EASYAR_OPTIONALOFMATRIX__F__
struct OptionalOfMatrix44F
{
bool has_value;
Matrix44F value;
};
static inline easyar_OptionalOfMatrix44F OptionalOfMatrix44F_to_c(OptionalOfMatrix44F o);
#endif
#ifndef __EASYAR_LISTOFPLANEDATA__
#define __EASYAR_LISTOFPLANEDATA__
class ListOfPlaneData
{
private:
easyar_ListOfPlaneData * cdata_;
virtual ListOfPlaneData & operator=(const ListOfPlaneData & data) { return *this; } //deleted
public:
ListOfPlaneData(easyar_ListOfPlaneData * cdata);
virtual ~ListOfPlaneData();
ListOfPlaneData(const ListOfPlaneData & data);
const easyar_ListOfPlaneData * get_cdata() const;
easyar_ListOfPlaneData * get_cdata();
ListOfPlaneData(easyar_PlaneData * * begin, easyar_PlaneData * * end);
int size() const;
PlaneData * at(int index) const;
};
#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
#ifndef __EASYAR_FUNCTOROFVOIDFROMBOOL__
#define __EASYAR_FUNCTOROFVOIDFROMBOOL__
struct FunctorOfVoidFromBool
{
void * _state;
void (* func)(void * _state, bool);
void (* destroy)(void * _state);
FunctorOfVoidFromBool(void * _state, void (* func)(void * _state, bool), void (* destroy)(void * _state));
};
static void FunctorOfVoidFromBool_func(void * _state, bool, /* OUT */ easyar_String * * _exception);
static void FunctorOfVoidFromBool_destroy(void * _state);
static inline easyar_FunctorOfVoidFromBool FunctorOfVoidFromBool_to_c(FunctorOfVoidFromBool f);
#endif
#ifndef __EASYAR_OPTIONALOFFUNCTOROFVOIDFROMBOOL__
#define __EASYAR_OPTIONALOFFUNCTOROFVOIDFROMBOOL__
struct OptionalOfFunctorOfVoidFromBool
{
bool has_value;
FunctorOfVoidFromBool value;
};
static inline easyar_OptionalOfFunctorOfVoidFromBool OptionalOfFunctorOfVoidFromBool_to_c(OptionalOfFunctorOfVoidFromBool o);
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_SPARSESPATIALMAP_HXX__
#define __IMPLEMENTATION_EASYAR_SPARSESPATIALMAP_HXX__
#include "easyar/sparsespatialmap.h"
#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 SparseSpatialMapResult::SparseSpatialMapResult(easyar_SparseSpatialMapResult * cdata)
:
FrameFilterResult(static_cast<easyar_FrameFilterResult *>(NULL)),
cdata_(NULL)
{
init_cdata(cdata);
}
inline SparseSpatialMapResult::~SparseSpatialMapResult()
{
if (cdata_) {
easyar_SparseSpatialMapResult__dtor(cdata_);
cdata_ = NULL;
}
}
inline SparseSpatialMapResult::SparseSpatialMapResult(const SparseSpatialMapResult & data)
:
FrameFilterResult(static_cast<easyar_FrameFilterResult *>(NULL)),
cdata_(NULL)
{
easyar_SparseSpatialMapResult * cdata = NULL;
easyar_SparseSpatialMapResult__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_SparseSpatialMapResult * SparseSpatialMapResult::get_cdata() const
{
return cdata_;
}
inline easyar_SparseSpatialMapResult * SparseSpatialMapResult::get_cdata()
{
return cdata_;
}
inline void SparseSpatialMapResult::init_cdata(easyar_SparseSpatialMapResult * cdata)
{
cdata_ = cdata;
{
easyar_FrameFilterResult * cdata_inner = NULL;
easyar_castSparseSpatialMapResultToFrameFilterResult(cdata, &cdata_inner);
FrameFilterResult::init_cdata(cdata_inner);
}
}
inline MotionTrackingStatus SparseSpatialMapResult::getMotionTrackingStatus()
{
if (cdata_ == NULL) {
return MotionTrackingStatus();
}
easyar_MotionTrackingStatus _return_value_ = easyar_SparseSpatialMapResult_getMotionTrackingStatus(cdata_);
return static_cast<MotionTrackingStatus>(_return_value_);
}
inline OptionalOfMatrix44F SparseSpatialMapResult::getVioPose()
{
if (cdata_ == NULL) {
return {false, Matrix44F()};
}
easyar_OptionalOfMatrix44F _return_value_ = easyar_SparseSpatialMapResult_getVioPose(cdata_);
return (_return_value_.has_value ? OptionalOfMatrix44F{true, Matrix44F(_return_value_.value.data[0], _return_value_.value.data[1], _return_value_.value.data[2], _return_value_.value.data[3], _return_value_.value.data[4], _return_value_.value.data[5], _return_value_.value.data[6], _return_value_.value.data[7], _return_value_.value.data[8], _return_value_.value.data[9], _return_value_.value.data[10], _return_value_.value.data[11], _return_value_.value.data[12], _return_value_.value.data[13], _return_value_.value.data[14], _return_value_.value.data[15])} : OptionalOfMatrix44F{false, {}});
}
inline OptionalOfMatrix44F SparseSpatialMapResult::getMapPose()
{
if (cdata_ == NULL) {
return {false, Matrix44F()};
}
easyar_OptionalOfMatrix44F _return_value_ = easyar_SparseSpatialMapResult_getMapPose(cdata_);
return (_return_value_.has_value ? OptionalOfMatrix44F{true, Matrix44F(_return_value_.value.data[0], _return_value_.value.data[1], _return_value_.value.data[2], _return_value_.value.data[3], _return_value_.value.data[4], _return_value_.value.data[5], _return_value_.value.data[6], _return_value_.value.data[7], _return_value_.value.data[8], _return_value_.value.data[9], _return_value_.value.data[10], _return_value_.value.data[11], _return_value_.value.data[12], _return_value_.value.data[13], _return_value_.value.data[14], _return_value_.value.data[15])} : OptionalOfMatrix44F{false, {}});
}
inline bool SparseSpatialMapResult::getLocalizationStatus()
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_SparseSpatialMapResult_getLocalizationStatus(cdata_);
return _return_value_;
}
inline void SparseSpatialMapResult::getLocalizationMapID(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_SparseSpatialMapResult_getLocalizationMapID(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void SparseSpatialMapResult::tryCastFromFrameFilterResult(FrameFilterResult * v, /* OUT */ SparseSpatialMapResult * * Return)
{
if (v == NULL) {
*Return = NULL;
return;
}
easyar_SparseSpatialMapResult * cdata = NULL;
easyar_tryCastFrameFilterResultToSparseSpatialMapResult(v->get_cdata(), &cdata);
if (cdata == NULL) {
*Return = NULL;
return;
}
*Return = new SparseSpatialMapResult(cdata);
}
inline PlaneData::PlaneData(easyar_PlaneData * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline PlaneData::~PlaneData()
{
if (cdata_) {
easyar_PlaneData__dtor(cdata_);
cdata_ = NULL;
}
}
inline PlaneData::PlaneData(const PlaneData & data)
:
cdata_(NULL)
{
easyar_PlaneData * cdata = NULL;
easyar_PlaneData__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_PlaneData * PlaneData::get_cdata() const
{
return cdata_;
}
inline easyar_PlaneData * PlaneData::get_cdata()
{
return cdata_;
}
inline void PlaneData::init_cdata(easyar_PlaneData * cdata)
{
cdata_ = cdata;
}
inline PlaneData::PlaneData()
:
cdata_(NULL)
{
easyar_PlaneData * _return_value_ = NULL;
easyar_PlaneData__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline PlaneType PlaneData::getType()
{
if (cdata_ == NULL) {
return PlaneType();
}
easyar_PlaneType _return_value_ = easyar_PlaneData_getType(cdata_);
return static_cast<PlaneType>(_return_value_);
}
inline Matrix44F PlaneData::getPose()
{
if (cdata_ == NULL) {
return Matrix44F();
}
easyar_Matrix44F _return_value_ = easyar_PlaneData_getPose(cdata_);
return Matrix44F(_return_value_.data[0], _return_value_.data[1], _return_value_.data[2], _return_value_.data[3], _return_value_.data[4], _return_value_.data[5], _return_value_.data[6], _return_value_.data[7], _return_value_.data[8], _return_value_.data[9], _return_value_.data[10], _return_value_.data[11], _return_value_.data[12], _return_value_.data[13], _return_value_.data[14], _return_value_.data[15]);
}
inline float PlaneData::getExtentX()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_PlaneData_getExtentX(cdata_);
return _return_value_;
}
inline float PlaneData::getExtentZ()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_PlaneData_getExtentZ(cdata_);
return _return_value_;
}
inline SparseSpatialMapConfig::SparseSpatialMapConfig(easyar_SparseSpatialMapConfig * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline SparseSpatialMapConfig::~SparseSpatialMapConfig()
{
if (cdata_) {
easyar_SparseSpatialMapConfig__dtor(cdata_);
cdata_ = NULL;
}
}
inline SparseSpatialMapConfig::SparseSpatialMapConfig(const SparseSpatialMapConfig & data)
:
cdata_(NULL)
{
easyar_SparseSpatialMapConfig * cdata = NULL;
easyar_SparseSpatialMapConfig__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_SparseSpatialMapConfig * SparseSpatialMapConfig::get_cdata() const
{
return cdata_;
}
inline easyar_SparseSpatialMapConfig * SparseSpatialMapConfig::get_cdata()
{
return cdata_;
}
inline void SparseSpatialMapConfig::init_cdata(easyar_SparseSpatialMapConfig * cdata)
{
cdata_ = cdata;
}
inline SparseSpatialMapConfig::SparseSpatialMapConfig()
:
cdata_(NULL)
{
easyar_SparseSpatialMapConfig * _return_value_ = NULL;
easyar_SparseSpatialMapConfig__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline void SparseSpatialMapConfig::setLocalizationMode(LocalizationMode arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_SparseSpatialMapConfig_setLocalizationMode(cdata_, static_cast<easyar_LocalizationMode>(arg0));
}
inline LocalizationMode SparseSpatialMapConfig::getLocalizationMode()
{
if (cdata_ == NULL) {
return LocalizationMode();
}
easyar_LocalizationMode _return_value_ = easyar_SparseSpatialMapConfig_getLocalizationMode(cdata_);
return static_cast<LocalizationMode>(_return_value_);
}
inline SparseSpatialMap::SparseSpatialMap(easyar_SparseSpatialMap * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline SparseSpatialMap::~SparseSpatialMap()
{
if (cdata_) {
easyar_SparseSpatialMap__dtor(cdata_);
cdata_ = NULL;
}
}
inline SparseSpatialMap::SparseSpatialMap(const SparseSpatialMap & data)
:
cdata_(NULL)
{
easyar_SparseSpatialMap * cdata = NULL;
easyar_SparseSpatialMap__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_SparseSpatialMap * SparseSpatialMap::get_cdata() const
{
return cdata_;
}
inline easyar_SparseSpatialMap * SparseSpatialMap::get_cdata()
{
return cdata_;
}
inline void SparseSpatialMap::init_cdata(easyar_SparseSpatialMap * cdata)
{
cdata_ = cdata;
}
inline bool SparseSpatialMap::isAvailable()
{
bool _return_value_ = easyar_SparseSpatialMap_isAvailable();
return _return_value_;
}
inline void SparseSpatialMap::inputFrameSink(/* OUT */ InputFrameSink * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_InputFrameSink * _return_value_ = NULL;
easyar_SparseSpatialMap_inputFrameSink(cdata_, &_return_value_);
*Return = new InputFrameSink(_return_value_);
}
inline int SparseSpatialMap::bufferRequirement()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_SparseSpatialMap_bufferRequirement(cdata_);
return _return_value_;
}
inline void SparseSpatialMap::outputFrameSource(/* OUT */ OutputFrameSource * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_OutputFrameSource * _return_value_ = NULL;
easyar_SparseSpatialMap_outputFrameSource(cdata_, &_return_value_);
*Return = new OutputFrameSource(_return_value_);
}
inline void SparseSpatialMap::create(/* OUT */ SparseSpatialMap * * Return)
{
easyar_SparseSpatialMap * _return_value_ = NULL;
easyar_SparseSpatialMap_create(&_return_value_);
*Return = new SparseSpatialMap(_return_value_);
}
inline bool SparseSpatialMap::start()
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_SparseSpatialMap_start(cdata_);
return _return_value_;
}
inline void SparseSpatialMap::stop()
{
if (cdata_ == NULL) {
return;
}
easyar_SparseSpatialMap_stop(cdata_);
}
inline void SparseSpatialMap::close()
{
if (cdata_ == NULL) {
return;
}
easyar_SparseSpatialMap_close(cdata_);
}
inline void SparseSpatialMap::getPointCloudBuffer(/* OUT */ Buffer * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Buffer * _return_value_ = NULL;
easyar_SparseSpatialMap_getPointCloudBuffer(cdata_, &_return_value_);
*Return = new Buffer(_return_value_);
}
inline void SparseSpatialMap::getMapPlanes(/* OUT */ ListOfPlaneData * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfPlaneData * _return_value_ = NULL;
easyar_SparseSpatialMap_getMapPlanes(cdata_, &_return_value_);
*Return = new ListOfPlaneData(_return_value_);
}
inline void SparseSpatialMap::hitTestAgainstPointCloud(Vec2F arg0, /* OUT */ ListOfVec3F * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfVec3F * _return_value_ = NULL;
easyar_SparseSpatialMap_hitTestAgainstPointCloud(cdata_, arg0.get_cdata(), &_return_value_);
*Return = new ListOfVec3F(_return_value_);
}
inline void SparseSpatialMap::hitTestAgainstPlanes(Vec2F arg0, /* OUT */ ListOfVec3F * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfVec3F * _return_value_ = NULL;
easyar_SparseSpatialMap_hitTestAgainstPlanes(cdata_, arg0.get_cdata(), &_return_value_);
*Return = new ListOfVec3F(_return_value_);
}
inline void SparseSpatialMap::getMapVersion(/* OUT */ String * * Return)
{
easyar_String * _return_value_ = NULL;
easyar_SparseSpatialMap_getMapVersion(&_return_value_);
*Return = new String(_return_value_);
}
inline void SparseSpatialMap::unloadMap(String * arg0, CallbackScheduler * arg1, OptionalOfFunctorOfVoidFromBool arg2)
{
if (cdata_ == NULL) {
return;
}
easyar_SparseSpatialMap_unloadMap(cdata_, arg0->get_cdata(), arg1->get_cdata(), OptionalOfFunctorOfVoidFromBool_to_c(arg2));
}
inline void SparseSpatialMap::setConfig(SparseSpatialMapConfig * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_SparseSpatialMap_setConfig(cdata_, arg0->get_cdata());
}
inline void SparseSpatialMap::getConfig(/* OUT */ SparseSpatialMapConfig * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_SparseSpatialMapConfig * _return_value_ = NULL;
easyar_SparseSpatialMap_getConfig(cdata_, &_return_value_);
*Return = new SparseSpatialMapConfig(_return_value_);
}
inline bool SparseSpatialMap::startLocalization()
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_SparseSpatialMap_startLocalization(cdata_);
return _return_value_;
}
inline void SparseSpatialMap::stopLocalization()
{
if (cdata_ == NULL) {
return;
}
easyar_SparseSpatialMap_stopLocalization(cdata_);
}
#ifndef __IMPLEMENTATION_EASYAR_OPTIONALOFMATRIX__F__
#define __IMPLEMENTATION_EASYAR_OPTIONALOFMATRIX__F__
static inline easyar_OptionalOfMatrix44F OptionalOfMatrix44F_to_c(OptionalOfMatrix44F o)
{
if (o.has_value) {
easyar_OptionalOfMatrix44F _return_value_ = {true, o.value.get_cdata()};
return _return_value_;
} else {
easyar_OptionalOfMatrix44F _return_value_ = {false, easyar_Matrix44F()};
return _return_value_;
}
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_LISTOFPLANEDATA__
#define __IMPLEMENTATION_EASYAR_LISTOFPLANEDATA__
inline ListOfPlaneData::ListOfPlaneData(easyar_ListOfPlaneData * cdata)
: cdata_(cdata)
{
}
inline ListOfPlaneData::~ListOfPlaneData()
{
if (cdata_) {
easyar_ListOfPlaneData__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfPlaneData::ListOfPlaneData(const ListOfPlaneData & data)
: cdata_(static_cast<easyar_ListOfPlaneData *>(NULL))
{
easyar_ListOfPlaneData_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfPlaneData * ListOfPlaneData::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfPlaneData * ListOfPlaneData::get_cdata()
{
return cdata_;
}
inline ListOfPlaneData::ListOfPlaneData(easyar_PlaneData * * begin, easyar_PlaneData * * end)
: cdata_(static_cast<easyar_ListOfPlaneData *>(NULL))
{
easyar_ListOfPlaneData__ctor(begin, end, &cdata_);
}
inline int ListOfPlaneData::size() const
{
return easyar_ListOfPlaneData_size(cdata_);
}
inline PlaneData * ListOfPlaneData::at(int index) const
{
easyar_PlaneData * _return_value_ = easyar_ListOfPlaneData_at(cdata_, index);
easyar_PlaneData__retain(_return_value_, &_return_value_);
return new PlaneData(_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
#ifndef __IMPLEMENTATION_EASYAR_OPTIONALOFFUNCTOROFVOIDFROMBOOL__
#define __IMPLEMENTATION_EASYAR_OPTIONALOFFUNCTOROFVOIDFROMBOOL__
static inline easyar_OptionalOfFunctorOfVoidFromBool OptionalOfFunctorOfVoidFromBool_to_c(OptionalOfFunctorOfVoidFromBool o)
{
if (o.has_value) {
easyar_OptionalOfFunctorOfVoidFromBool _return_value_ = {true, FunctorOfVoidFromBool_to_c(o.value)};
return _return_value_;
} else {
easyar_OptionalOfFunctorOfVoidFromBool _return_value_ = {false, {NULL, NULL, NULL}};
return _return_value_;
}
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMBOOL__
#define __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMBOOL__
inline FunctorOfVoidFromBool::FunctorOfVoidFromBool(void * _state, void (* func)(void * _state, bool), void (* destroy)(void * _state))
{
this->_state = _state;
this->func = func;
this->destroy = destroy;
}
static void FunctorOfVoidFromBool_func(void * _state, bool arg0, /* OUT */ easyar_String * * _exception)
{
*_exception = NULL;
try {
bool cpparg0 = arg0;
FunctorOfVoidFromBool * f = reinterpret_cast<FunctorOfVoidFromBool *>(_state);
f->func(f->_state, cpparg0);
} catch (std::exception & ex) {
easyar_String_from_utf8_begin(ex.what(), _exception);
}
}
static void FunctorOfVoidFromBool_destroy(void * _state)
{
FunctorOfVoidFromBool * f = reinterpret_cast<FunctorOfVoidFromBool *>(_state);
if (f->destroy) {
f->destroy(f->_state);
}
delete f;
}
static inline easyar_FunctorOfVoidFromBool FunctorOfVoidFromBool_to_c(FunctorOfVoidFromBool f)
{
easyar_FunctorOfVoidFromBool _return_value_ = {NULL, NULL, NULL};
_return_value_._state = new FunctorOfVoidFromBool(f._state, f.func, f.destroy);
_return_value_.func = FunctorOfVoidFromBool_func;
_return_value_.destroy = FunctorOfVoidFromBool_destroy;
return _return_value_;
}
#endif
}
#endif
fileFormatVersion: 2
guid: 52305d0f076c6f646a67e86b57db0000
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/frame.oc.h"
/// <summary>
/// Describes the result of mapping and localization. Updated at the same frame rate with OutputFrame.
/// </summary>
@interface easyar_SparseSpatialMapResult : easyar_FrameFilterResult
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Obtain motion tracking status.
/// </summary>
- (easyar_MotionTrackingStatus)getMotionTrackingStatus;
/// <summary>
/// Returns pose of the origin of VIO system in camera coordinate system.
/// </summary>
- (easyar_Matrix44F *)getVioPose;
/// <summary>
/// Returns the pose of origin of the map in camera coordinate system, when localization is successful.
/// Otherwise, returns pose of the origin of VIO system in camera coordinate system.
/// </summary>
- (easyar_Matrix44F *)getMapPose;
/// <summary>
/// Returns true if the system can reliablly locate the pose of the device with regard to the map.
/// Once relocalization succeeds, relative pose can be updated by motion tracking module.
/// As long as the motion tracking module returns normal tracking status, the localization status is also true.
/// </summary>
- (bool)getLocalizationStatus;
/// <summary>
/// Returns current localized map ID.
/// </summary>
- (NSString *)getLocalizationMapID;
@end
@interface easyar_PlaneData : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Constructor
/// </summary>
+ (easyar_PlaneData *) create;
/// <summary>
/// Returns the type of this plane.
/// </summary>
- (easyar_PlaneType)getType;
/// <summary>
/// Returns the pose of the center of the detected plane.The pose&#39;s transformed +Y axis will be point normal out of the plane, with the +X and +Z axes orienting the extents of the bounding rectangle.
/// </summary>
- (easyar_Matrix44F *)getPose;
/// <summary>
/// Returns the length of this plane&#39;s bounding rectangle measured along the local X-axis of the coordinate space centered on the plane.
/// </summary>
- (float)getExtentX;
/// <summary>
/// Returns the length of this plane&#39;s bounding rectangle measured along the local Z-axis of the coordinate frame centered on the plane.
/// </summary>
- (float)getExtentZ;
@end
/// <summary>
/// Configuration used to set the localization mode.
/// </summary>
@interface easyar_SparseSpatialMapConfig : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Constructor
/// </summary>
+ (easyar_SparseSpatialMapConfig *) create;
/// <summary>
/// Sets localization configurations. See also `LocalizationMode`_.
/// </summary>
- (void)setLocalizationMode:(easyar_LocalizationMode)_value;
/// <summary>
/// Returns localization configurations. See also `LocalizationMode`_.
/// </summary>
- (easyar_LocalizationMode)getLocalizationMode;
@end
/// <summary>
/// Provides core components for SparseSpatialMap, can be used for sparse spatial map building as well as localization using existing map. Also provides utilities for point cloud and plane access.
/// SparseSpatialMap occupies 2 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;`__ .
/// </summary>
@interface easyar_SparseSpatialMap : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Check whether SparseSpatialMap is is available, always return true.
/// </summary>
+ (bool)isAvailable;
/// <summary>
/// Input port for input frame. For SparseSpatialMap to work, the inputFrame must include camera parameters, timestamp and spatial information. See also `InputFrameSink`_
/// </summary>
- (easyar_InputFrameSink *)inputFrameSink;
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
- (int)bufferRequirement;
/// <summary>
/// Output port for output frame. See also `OutputFrameSource`_
/// </summary>
- (easyar_OutputFrameSource *)outputFrameSource;
/// <summary>
/// Construct SparseSpatialMap.
/// </summary>
+ (easyar_SparseSpatialMap *)create;
/// <summary>
/// Start SparseSpatialMap system.
/// </summary>
- (bool)start;
/// <summary>
/// Stop SparseSpatialMap from running。Can resume running by calling start().
/// </summary>
- (void)stop;
/// <summary>
/// Close SparseSpatialMap. SparseSpatialMap can no longer be used.
/// </summary>
- (void)close;
/// <summary>
/// Returns the buffer of point cloud coordinate. Each 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space, each of which takes 4 bytes.
/// </summary>
- (easyar_Buffer *)getPointCloudBuffer;
/// <summary>
/// Returns detected planes in SparseSpatialMap.
/// </summary>
- (NSArray<easyar_PlaneData *> *)getMapPlanes;
/// <summary>
/// Perform hit test against the point cloud. The results are returned sorted by their distance to the camera in ascending order.
/// </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 detected planes are returned. 3D positions on physical planes are sorted by distance from the device in ascending order.
/// 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 is in the world coordinate system.
/// </summary>
- (NSArray<easyar_Vec3F *> *)hitTestAgainstPlanes:(easyar_Vec2F *)cameraImagePoint;
/// <summary>
/// Get the map data version of the current SparseSpatialMap.
/// </summary>
+ (NSString *)getMapVersion;
/// <summary>
/// UnloadMap specified SparseSpatialMap data via callback function.The return value of callback indicates whether unload map succeeds (true) or fails (false).
/// </summary>
- (void)unloadMap:(NSString *)mapID callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler resultCallBack:(void (^)(bool))resultCallBack;
/// <summary>
/// Set configurations for SparseSpatialMap. See also `SparseSpatialMapConfig`_.
/// </summary>
- (void)setConfig:(easyar_SparseSpatialMapConfig *)config;
/// <summary>
/// Returns configurations for SparseSpatialMap. See also `SparseSpatialMapConfig`_.
/// </summary>
- (easyar_SparseSpatialMapConfig *)getConfig;
/// <summary>
/// Start localization in loaded maps. Should set `LocalizationMode`_ first.
/// </summary>
- (bool)startLocalization;
/// <summary>
/// Stop localization in loaded maps.
/// </summary>
- (void)stopLocalization;
@end
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