HObjectEntry.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using HalconDotNet;
  3. using System.Collections;
  4. namespace ViewWindow.Model
  5. {
  6. /// <summary>
  7. /// This class is an auxiliary class, which is used to
  8. /// link a graphical context to an HALCON object. The graphical
  9. /// context is described by a hashtable, which contains a list of
  10. /// graphical modes (e.g GC_COLOR, GC_LINEWIDTH and GC_PAINT)
  11. /// and their corresponding values (e.g "blue", "4", "3D-plot"). These
  12. /// graphical states are applied to the window before displaying the
  13. /// object.
  14. /// </summary>
  15. public class HObjectEntry
  16. {
  17. /// <summary>Hashlist defining the graphical context for HObj</summary>
  18. public Hashtable gContext;
  19. /// <summary>HALCON object</summary>
  20. public HObject HObj;
  21. /// <summary>Constructor</summary>
  22. /// <param name="obj">
  23. /// HALCON object that is linked to the graphical context gc.
  24. /// </param>
  25. /// <param name="gc">
  26. /// Hashlist of graphical states that are applied before the object
  27. /// is displayed.
  28. /// </param>
  29. public HObjectEntry(HObject obj, Hashtable gc)
  30. {
  31. gContext = gc;
  32. HObj = obj;
  33. }
  34. /// <summary>
  35. /// Clears the entries of the class members Hobj and gContext
  36. /// </summary>
  37. public void clear()
  38. {
  39. gContext.Clear();
  40. HObj.Dispose();
  41. }
  42. }//end of class
  43. }//end of namespace