ctkXnatScanResource.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*=============================================================================
  2. Plugin: org.commontk.xnat
  3. Copyright (c) University College London,
  4. Centre for Medical Image Computing
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #include "ctkXnatScanResource.h"
  16. #include "ctkXnatConnection.h"
  17. #include "ctkXnatScanResourceFile.h"
  18. #include <QDebug>
  19. class ctkXnatScanResourcePrivate
  20. {
  21. public:
  22. QString resourceId;
  23. QString label;
  24. QString elementName;
  25. QString category;
  26. QString categoryId;
  27. QString categoryDescription;
  28. };
  29. ctkXnatScanResource::ctkXnatScanResource(ctkXnatObject* parent)
  30. : ctkXnatObject(parent)
  31. , d_ptr(new ctkXnatScanResourcePrivate())
  32. {
  33. }
  34. ctkXnatScanResource::~ctkXnatScanResource()
  35. {
  36. }
  37. const QString& ctkXnatScanResource::resourceId() const
  38. {
  39. Q_D(const ctkXnatScanResource);
  40. return d->resourceId;
  41. }
  42. void ctkXnatScanResource::setResourceId(const QString& resourceId)
  43. {
  44. Q_D(ctkXnatScanResource);
  45. d->resourceId = resourceId;
  46. }
  47. const QString& ctkXnatScanResource::label() const
  48. {
  49. Q_D(const ctkXnatScanResource);
  50. return d->label;
  51. }
  52. void ctkXnatScanResource::setLabel(const QString& label)
  53. {
  54. Q_D(ctkXnatScanResource);
  55. d->label = label;
  56. }
  57. const QString& ctkXnatScanResource::elementName() const
  58. {
  59. Q_D(const ctkXnatScanResource);
  60. return d->elementName;
  61. }
  62. void ctkXnatScanResource::setElementName(const QString& elementName)
  63. {
  64. Q_D(ctkXnatScanResource);
  65. d->elementName = elementName;
  66. }
  67. const QString& ctkXnatScanResource::category() const
  68. {
  69. Q_D(const ctkXnatScanResource);
  70. return d->category;
  71. }
  72. void ctkXnatScanResource::setCategory(const QString& category)
  73. {
  74. Q_D(ctkXnatScanResource);
  75. d->category = category;
  76. }
  77. const QString& ctkXnatScanResource::categoryId() const
  78. {
  79. Q_D(const ctkXnatScanResource);
  80. return d->categoryId;
  81. }
  82. void ctkXnatScanResource::setCategoryId(const QString& categoryId)
  83. {
  84. Q_D(ctkXnatScanResource);
  85. d->categoryId = categoryId;
  86. }
  87. const QString& ctkXnatScanResource::categoryDescription() const
  88. {
  89. Q_D(const ctkXnatScanResource);
  90. return d->categoryDescription;
  91. }
  92. void ctkXnatScanResource::setCategoryDescription(const QString& categoryDescription)
  93. {
  94. Q_D(ctkXnatScanResource);
  95. d->categoryDescription = categoryDescription;
  96. }
  97. void ctkXnatScanResource::fetch(ctkXnatConnection* connection)
  98. {
  99. connection->fetch(this);
  100. }
  101. void ctkXnatScanResource::download(ctkXnatConnection* connection, const QString& zipFileName)
  102. {
  103. connection->download(this, zipFileName);
  104. }
  105. bool ctkXnatScanResource::isFile() const
  106. {
  107. return true;
  108. }