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.

CBucketEnumVariables.f90 2.1 KiB

1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. module CBucketEnumVariables
  2. use CVoidEventHandlerCollection
  3. implicit none
  4. integer :: MudBucket = 0
  5. public
  6. type(VoidEventHandlerCollection) :: OnMudBucketChange
  7. enum, bind(c)
  8. !enumerator MUD_BUCKET_NEUTRAL
  9. enumerator MUD_BUCKET_REMOVE
  10. enumerator MUD_BUCKET_INSTALL
  11. end enum
  12. private :: MudBucket
  13. contains
  14. subroutine Set_MudBucket(v)
  15. use CManifolds, only: ToggleMudBox
  16. implicit none
  17. integer , intent(in) :: v
  18. #ifdef ExcludeExtraChanges
  19. if(MudBucket == v) return
  20. #endif
  21. MudBucket = v
  22. if (MudBucket == MUD_BUCKET_INSTALL) then
  23. call ToggleMudBox(.true.)
  24. else if (MudBucket == MUD_BUCKET_REMOVE) then
  25. call ToggleMudBox(.false.)
  26. endif
  27. #ifdef deb
  28. print*, 'MudBucket=', MudBucket
  29. #endif
  30. call OnMudBucketChange%RunAll()
  31. end subroutine
  32. integer function Get_MudBucket()
  33. implicit none
  34. Get_MudBucket = MudBucket
  35. end function
  36. subroutine Set_MudBucket_WN(v)
  37. !DEC$ ATTRIBUTES DLLEXPORT :: Set_MudBucket_WN
  38. !DEC$ ATTRIBUTES ALIAS: 'Set_MudBucket_WN' :: Set_MudBucket_WN
  39. implicit none
  40. integer , intent(in) :: v
  41. call Set_MudBucket(v)
  42. end subroutine
  43. integer function Get_MudBucket_WN()
  44. !DEC$ ATTRIBUTES DLLEXPORT :: Get_MudBucket_WN
  45. !DEC$ ATTRIBUTES ALIAS: 'Get_MudBucket_WN' :: Get_MudBucket_WN
  46. implicit none
  47. Get_MudBucket_WN = MudBucket
  48. end function
  49. logical function Get_RemoveMudBucket()
  50. !DEC$ ATTRIBUTES DLLEXPORT :: Get_RemoveMudBucket
  51. !DEC$ ATTRIBUTES ALIAS: 'Get_RemoveMudBucket' :: Get_RemoveMudBucket
  52. implicit none
  53. Get_RemoveMudBucket = .false. ! MudBucket == REMOVE_MUD_BUCKET
  54. end function
  55. logical function Get_InstallMudBucket()
  56. !DEC$ ATTRIBUTES DLLEXPORT :: Get_InstallMudBucket
  57. !DEC$ ATTRIBUTES ALIAS: 'Get_InstallMudBucket' :: Get_InstallMudBucket
  58. implicit none
  59. Get_InstallMudBucket = .false. ! MudBucket == INSTALL_MUD_BUCKET
  60. end function
  61. end module CBucketEnumVariables