Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CHeadEnumVariables.f90 2.2 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. module CHeadEnumVariables
  2. use CVoidEventHandlerCollection
  3. implicit none
  4. integer :: FillupHead = 0
  5. public
  6. type(VoidEventHandlerCollection) :: OnFillupHeadChange
  7. enum, bind(c)
  8. !enumerator FILLUP_HEAD_NEUTRAL
  9. enumerator FILLUP_HEAD_REMOVE
  10. enumerator FILLUP_HEAD_INSTALL
  11. end enum
  12. private :: FillupHead
  13. contains
  14. subroutine Set_FillupHead(v)
  15. use CManifolds, only: ToggleFillupHead
  16. implicit none
  17. integer , intent(in) :: v
  18. #ifdef ExcludeExtraChanges
  19. if(FillupHead == v) return
  20. #endif
  21. FillupHead = v
  22. if (FillupHead == FILLUP_HEAD_INSTALL) then
  23. call ToggleFillupHead(.true.)
  24. else if (FillupHead == FILLUP_HEAD_REMOVE) then
  25. call ToggleFillupHead(.false.)
  26. endif
  27. #ifdef deb
  28. print*, 'FillupHead=', FillupHead
  29. #endif
  30. call OnFillupHeadChange%RunAll()
  31. end subroutine
  32. integer function Get_FillupHead()
  33. implicit none
  34. Get_FillupHead = FillupHead
  35. end function
  36. subroutine Set_FillupHead_WN(v)
  37. !DEC$ ATTRIBUTES DLLEXPORT :: Set_FillupHead_WN
  38. !DEC$ ATTRIBUTES ALIAS: 'Set_FillupHead_WN' :: Set_FillupHead_WN
  39. implicit none
  40. integer , intent(in) :: v
  41. call Set_FillupHead(v)
  42. end subroutine
  43. integer function Get_FillupHead_WN()
  44. !DEC$ ATTRIBUTES DLLEXPORT :: Get_FillupHead_WN
  45. !DEC$ ATTRIBUTES ALIAS: 'Get_FillupHead_WN' :: Get_FillupHead_WN
  46. implicit none
  47. Get_FillupHead_WN = FillupHead
  48. end function
  49. logical function Get_RemoveFillupHead()
  50. !DEC$ ATTRIBUTES DLLEXPORT :: Get_RemoveFillupHead
  51. !DEC$ ATTRIBUTES ALIAS: 'Get_RemoveFillupHead' :: Get_RemoveFillupHead
  52. implicit none
  53. Get_RemoveFillupHead = .false. ! FillupHead == REMOVE_FILLUP_HEAD
  54. end function
  55. logical function Get_InstallFillupHead()
  56. !DEC$ ATTRIBUTES DLLEXPORT :: Get_InstallFillupHead
  57. !DEC$ ATTRIBUTES ALIAS: 'Get_InstallFillupHead' :: Get_InstallFillupHead
  58. implicit none
  59. Get_InstallFillupHead = .false. ! FillupHead == INSTALL_FILLUP_HEAD
  60. end function
  61. end module CHeadEnumVariables