ToolInterface.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #include "Tool.h"
  2. #include "../../Common/DllToolCommon.h"
  3. DLL_TOOL_DESC m_Description;
  4. ///////////////////////////////////////////////////////////////////
  5. // 获取工具描述
  6. const DLL_TOOL_DESC& ToolImpl::Description()
  7. {
  8. // 生成dll描述
  9. m_Description.Type = TOOL_TYPE::TOOL_TYPE_STANDARD;
  10. m_Description.strCategory = ("AI 工具");
  11. m_Description.strName = ("SK_Class");
  12. m_Description.strAliasName = "SK_Class";
  13. m_Description.strVersion = ("1.3");
  14. m_Description.strInfo = ("This Info");
  15. return m_Description;
  16. }
  17. /////////////////////////////////////////////////
  18. // 生成默认的接口描述
  19. void ToolImpl::InitDefaultInterfaces(bool withValue)
  20. {
  21. // 接口
  22. DLL_INF inf;
  23. inf.strName = ("Image");
  24. inf.Direction = INF_DIRECTION::INF_DIR_IN;
  25. inf.Type = INF_TYPE::INF_TYPE_STANDARD;
  26. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  27. inf.value.type = VALUE_TYPE::Type_HImage;
  28. if (withValue)
  29. {
  30. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Image;
  31. }
  32. m_Interfaces.push_back(inf);
  33. inf.reset();//////////////////////////////////////////////////////////////////////////
  34. inf.strName = ("Int2.in");
  35. inf.Direction = INF_DIRECTION::INF_DIR_IN;
  36. inf.Type = INF_TYPE::INF_TYPE_STANDARD;
  37. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  38. inf.value.type = VALUE_TYPE::Type_Int;
  39. if (withValue)
  40. {
  41. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Value2;
  42. }
  43. m_Interfaces.push_back(inf);
  44. inf.reset();//////////////////////////////////////////////////////////////////////////
  45. inf.strName = ("Int1.out");
  46. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  47. inf.Type = INF_TYPE::INF_TYPE_STANDARD;
  48. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  49. inf.value.type = VALUE_TYPE::Type_Int;
  50. if (withValue)
  51. {
  52. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Value3;
  53. }
  54. m_Interfaces.push_back(inf);
  55. inf.reset();//////////////////////////////////////////////////////////////////////////
  56. inf.strName = ("QImage");
  57. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  58. inf.Type = INF_TYPE::INF_TYPE_STANDARD;
  59. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  60. inf.value.type = VALUE_TYPE::Type_QImage;
  61. if (withValue)
  62. {
  63. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_QImage;
  64. }
  65. m_Interfaces.push_back(inf);
  66. inf.reset();//////////////////////////////////////////////////////////////////////////
  67. inf.strName = ("HImage");
  68. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  69. inf.Type = INF_TYPE::INF_TYPE_STANDARD;
  70. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  71. inf.value.type = VALUE_TYPE::Type_HImage;
  72. if (withValue)
  73. {
  74. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Image;
  75. }
  76. m_Interfaces.push_back(inf);
  77. inf.reset();//////////////////////////////////////////////////////////////////////////
  78. }