//=============================================================================================================================
//
// EasyAR Sense 3.1.0-final-7bf6504c6
// Copyright (c) 2015-2020 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"
///
/// ObjectTargetParameters represents the parameters to create a `ObjectTarget`_ .
///
@interface easyar_ObjectTargetParameters : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (easyar_ObjectTargetParameters *) create;
///
/// Gets `Buffer`_ dictionary.
///
- (easyar_BufferDictionary *)bufferDictionary;
///
/// 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.
///
- (void)setBufferDictionary:(easyar_BufferDictionary *)bufferDictionary;
///
/// Gets obj file path.
///
- (NSString *)objPath;
///
/// Sets obj file path.
///
- (void)setObjPath:(NSString *)objPath;
///
/// Gets target name. It can be used to distinguish targets.
///
- (NSString *)name;
///
/// Sets target name.
///
- (void)setName:(NSString *)name;
///
/// Gets the target uid. You can set this uid in the json config as a method to distinguish from targets.
///
- (NSString *)uid;
///
/// Sets target uid.
///
- (void)setUid:(NSString *)uid;
///
/// Gets meta data.
///
- (NSString *)meta;
///
/// Sets meta data。
///
- (void)setMeta:(NSString *)meta;
///
/// 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.)
///
- (float)scale;
///
/// 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.
///
- (void)setScale:(float)size;
@end
///
/// 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 should be setup using setup before any value is valid. And ObjectTarget can be tracked by `ObjectTracker`_ after a successful load into the `ObjectTracker`_ using `ObjectTracker.loadTarget`_ .
///
@interface easyar_ObjectTarget : easyar_Target
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (easyar_ObjectTarget *) create;
///
/// Creates a target from parameters.
///
+ (easyar_ObjectTarget *)createFromParameters:(easyar_ObjectTargetParameters *)parameters;
///
/// Creats a target from obj, mtl and jpg/png files.
///
+ (easyar_ObjectTarget *)createFromObjectFile:(NSString *)path storageType:(easyar_StorageType)storageType name:(NSString *)name uid:(NSString *)uid meta:(NSString *)meta scale:(float)scale;
///
/// Setup all targets listed in the json file or json string from path with storageType. This method only parses the json file or string.
/// If path is json file path, storageType should be `App` or `Assets` or `Absolute` indicating the path type. Paths inside json files should be absolute path or relative path to the json file.
/// See `StorageType`_ for more descriptions.
///
+ (NSArray *)setupAll:(NSString *)path storageType:(easyar_StorageType)storageType;
///
/// 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.)
///
- (float)scale;
///
/// The bounding box of object, it contains the 8 points of the box.
/// Vertices's indices are defined and stored following the rule:
/// ::
///
/// 4-----7
/// /| /|
/// 5-----6 | z
/// | | | | |
/// | 0---|-3 o---y
/// |/ |/ /
/// 1-----2 x
///
- (NSArray *)boundingBox;
///
/// 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`_.
///
- (bool)setScale:(float)scale;
///
/// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
///
- (int)runtimeID;
///
/// 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.
///
- (NSString *)uid;
///
/// Returns the target name. Name is used to distinguish targets in a json file.
///
- (NSString *)name;
///
/// Set name. It will erase previously set data or data from cloud.
///
- (void)setName:(NSString *)name;
///
/// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
///
- (NSString *)meta;
///
/// Set meta data. It will erase previously set data or data from cloud.
///
- (void)setMeta:(NSString *)data;
@end