|
|
|
|
|
|
string m_OutputDirectoryPath; |
|
|
|
|
|
|
|
JsonSerializer m_AnnotationSerializer; |
|
|
|
|
|
|
|
public bool IsRunning { get; private set; } |
|
|
|
|
|
|
|
public string OutputDirectory |
|
|
|
|
|
|
m_AnnotationSerializer = JsonSerializer.CreateDefault(); |
|
|
|
m_AnnotationSerializer.Converters.Add(new Vector3Converter()); |
|
|
|
m_AnnotationSerializer.Converters.Add(new QuaternionConverter()); |
|
|
|
|
|
|
|
m_OutputDirectoryName = outputDirectory; |
|
|
|
IsRunning = true; |
|
|
|
} |
|
|
|
|
|
|
{ |
|
|
|
var q = Quaternion.identity; |
|
|
|
reader.Read(); // open [ token
|
|
|
|
q.x = (float)reader.ReadAsDecimal(); |
|
|
|
q.x = (float)reader.ReadAsDecimal(); |
|
|
|
q.y = (float)reader.ReadAsDecimal(); |
|
|
|
q.z = (float)reader.ReadAsDecimal(); |
|
|
|
q.w = (float)reader.ReadAsDecimal(); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[SuppressMessage("ReSharper", "PossibleInvalidOperationException")] |
|
|
|
public class Vector3Converter : JsonConverter<Vector3> |
|
|
|
{ |
|
|
|
|
|
|
return outVector; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var jArray = values == null ? null : JArray.FromObject(values, m_AnnotationSerializer); |
|
|
|
|
|
|
|
JArray jArray = null; |
|
|
|
|
|
|
|
if (values != null) |
|
|
|
{ |
|
|
|
jArray = new JArray(); |
|
|
|
foreach (var value in values) |
|
|
|
{ |
|
|
|
if (value != null) |
|
|
|
jArray.Add(new JRaw(DatasetJsonUtility.ToJToken(value))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ReportAsyncAnnotationResult<T>(asyncAnnotation, filename, jArray); |
|
|
|
} |
|
|
|
|
|
|
|