geometry_menu_pane.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ////////////////////////////////////////////////////////////////////////////
  2. // System Pre-define Functions
  3. // 95099372-ef3e-11ea-9c81-bf848405c62e
  4. //Callback of data preparation stage before UI is fully loaded.
  5. function OnInitializeData(reload, preview) {
  6. PUI(()=>{
  7. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  8. //The 'pui' variable is valid in all functions of this document.
  9. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  10. });
  11. }
  12. //Callback after UI is fully loaded and displayed.
  13. function OnReady(reload, preview) {
  14. PUI(()=>{
  15. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  16. //The 'pui' variable is valid in all functions of this document.
  17. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  18. });
  19. }
  20. function OnCloseForm() {
  21. }
  22. function OnException(err) {
  23. //ui.MessageBox('Error', '' + err, MessageBox.Icon.Critical, MessageBox.Button.Ok);
  24. }
  25. //////////////////////////////////////////////////////////////////////////
  26. // Callback Functions.
  27. // 641a254c-ef3e-11ea-bc8a-379bb908bdd7
  28. function OnLinePoi(){
  29. unit.form.mainfrm.menu(34);
  30. }
  31. function OnCenter(){
  32. unit.form.mainfrm.menu(33);
  33. }
  34. function OnCut(){
  35. unit.form.mainfrm.menu(32);
  36. }
  37. function OnRevolve(){
  38. unit.form.mainfrm.menu(30);
  39. unit.form.mainfrm.OnCueline('设置旋转的坐标值,添加到界面中!', 'blue');
  40. }
  41. function OnMark(){
  42. unit.form.mainfrm.menu(22);
  43. unit.form.mainfrm.OnCueline('设置标记的内容、字体、颜色、位置等,添加到界面中!', 'blue');
  44. }
  45. function OnNode(){
  46. unit.form.mainfrm.menu(21);
  47. unit.form.mainfrm.OnCueline('设置点的三维坐标,创建点!', 'blue');
  48. }
  49. function OnImportModel(){
  50. unit.form.tree.OnChangeMenu(4);
  51. }
  52. function OnModelCheck(){
  53. unit.form.mainfrm.menu(1);
  54. unit.form.mainfrm.OnCueline('模型检测,检测模型水密性!', 'blue');
  55. }
  56. //The message corresponding callback executed by the docker pane.
  57. // when calling [side_pane].fireEvent(type,para) in the main form.
  58. function OnParentDockerMessage(type, para) {
  59. }
  60. //////////////////////////////////////////////////////////////////////////
  61. // Utils Functions.
  62. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  63. function onDragFile(filepath) {
  64. }
  65. function PUI(cb) {
  66. if(pui){cb();}
  67. }
  68. /*Usage of BLOCK_EVENT
  69. BLOCK_EVENT(()=>{
  70. ui.[name].[var] = ...;
  71. });
  72. */
  73. function BLOCK_EVENT(cb) {
  74. ui.block_event = true;
  75. cb();
  76. ui.block_event = false;
  77. }
  78. //////////////////////////////////////////////////////////////////////////
  79. // template codes for cw callback js.
  80. function CW_DeclareVariable(name, setter, getter) {
  81. if(typeof(__DeclareVariable) === 'function') {
  82. __DeclareVariable(name, setter, getter);
  83. }
  84. }
  85. function CW_DeclareOuterVariable(name) {
  86. if(typeof(__DeclareOuterVariable) === 'function') {
  87. __DeclareOuterVariable(name);
  88. }
  89. }