patrick.xu
2021-06-01 aefe9f2572eac7c61f6d2952593ec18a700dfcf0
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using HalconDotNet;
using System.Collections;
 
 
 
namespace Bro.UI.HalconDisplay.ViewROI
{
 
    public enum HobjType
    {
        IMAGE,
        REGION,
        XLD,
        OTHER
    }
 
    /// <summary>
    /// This class is an auxiliary class, which is used to 
    /// link a graphical context to an HALCON object. The graphical 
    /// context is described by a hashtable, which contains a list of
    /// graphical modes (e.g GC_COLOR, GC_LINEWIDTH and GC_PAINT) 
    /// and their corresponding values (e.g "blue", "4", "3D-plot"). These
    /// graphical states are applied to the window before displaying the
    /// object.
    /// </summary>
    public class HObjectEntry
    {
        /// <summary>Hashlist defining the graphical context for HObj</summary>
        public Hashtable    gContext;
 
        /// <summary>HALCON object</summary>
        public HObject        HObj;
 
        public HobjType     Type;
 
        public string       ColorCode;
 
        /// <summary>
        /// <param name="obj">HALCON object that is linked to the graphical context gc. </param>
        /// <param name="gc">Hashlist of graphical states that are applied before the object is displayed. </param>
        /// </summary>
        public HObjectEntry(HObject obj, Hashtable gc,HobjType type = HobjType.OTHER,string code = "#e53019")
        {
            gContext = gc;
            HObj = obj;
            Type = type;
            ColorCode = code;
        }
 
        /// <summary>
        /// Clears the entries of the class members Hobj and gContext
        /// </summary>
        public void clear()
        {
            gContext.Clear();
            HObj.Dispose();
        }
 
    }//end of class
}//end of namespace