-
Notifications
You must be signed in to change notification settings - Fork 38
/
CalibrationFlagsGeneric.cs
42 lines (36 loc) · 1.07 KB
/
CalibrationFlagsGeneric.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
namespace ArucoUnity.Calibration
{
/// <summary>
/// Manages the flags of the <see cref="ArucoCameraCalibration"/> process. Generic class to use in scripts.
/// </summary>
public abstract class CalibrationFlagsGeneric<T> : CalibrationFlags
where T : struct, IConvertible, IComparable, IFormattable
{
// CameraCalibrationFlags properties
public override int Value
{
get { return Convert.ToInt32(Enum.Parse(typeof(T), Flags.ToString()) as Enum); }
set { Flags = (T)Enum.ToObject(typeof(T), value); }
}
// Properties
/// <summary>
/// Gets or sets the calibration flags enum and keeps updated the flag properties.
/// </summary>
public T Flags
{
get
{
UpdateCalibrationFlags();
return flags;
}
set
{
flags = value;
UpdateCalibrationOptions();
}
}
// Variables
protected T flags;
}
}