ctkXnatReconstructionResourceFile.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 "ctkXnatReconstructionResourceFile.h"
  16. #include "ctkXnatConnection.h"
  17. class ctkXnatReconstructionResourceFilePrivate
  18. {
  19. public:
  20. QString name;
  21. QString size;
  22. QString uri;
  23. QString collection;
  24. QString fileTags;
  25. QString fileFormat;
  26. QString fileContent;
  27. QString categoryId;
  28. };
  29. ctkXnatReconstructionResourceFile::ctkXnatReconstructionResourceFile(ctkXnatObject* parent)
  30. : ctkXnatObject(parent)
  31. {
  32. }
  33. ctkXnatReconstructionResourceFile::~ctkXnatReconstructionResourceFile()
  34. {
  35. }
  36. const QString& ctkXnatReconstructionResourceFile::name() const
  37. {
  38. Q_D(const ctkXnatReconstructionResourceFile);
  39. return d->name;
  40. }
  41. void ctkXnatReconstructionResourceFile::setName(const QString& name)
  42. {
  43. Q_D(ctkXnatReconstructionResourceFile);
  44. d->name = name;
  45. }
  46. const QString& ctkXnatReconstructionResourceFile::size() const
  47. {
  48. Q_D(const ctkXnatReconstructionResourceFile);
  49. return d->size;
  50. }
  51. void ctkXnatReconstructionResourceFile::setSize(const QString& size)
  52. {
  53. Q_D(ctkXnatReconstructionResourceFile);
  54. d->size = size;
  55. }
  56. const QString& ctkXnatReconstructionResourceFile::uri() const
  57. {
  58. Q_D(const ctkXnatReconstructionResourceFile);
  59. return d->uri;
  60. }
  61. void ctkXnatReconstructionResourceFile::setUri(const QString& uri)
  62. {
  63. Q_D(ctkXnatReconstructionResourceFile);
  64. d->uri = uri;
  65. }
  66. const QString& ctkXnatReconstructionResourceFile::collection() const
  67. {
  68. Q_D(const ctkXnatReconstructionResourceFile);
  69. return d->collection;
  70. }
  71. void ctkXnatReconstructionResourceFile::setCollection(const QString& collection)
  72. {
  73. Q_D(ctkXnatReconstructionResourceFile);
  74. d->collection = collection;
  75. }
  76. const QString& ctkXnatReconstructionResourceFile::fileTags() const
  77. {
  78. Q_D(const ctkXnatReconstructionResourceFile);
  79. return d->fileTags;
  80. }
  81. void ctkXnatReconstructionResourceFile::setFileTags(const QString& fileTags)
  82. {
  83. Q_D(ctkXnatReconstructionResourceFile);
  84. d->fileTags = fileTags;
  85. }
  86. const QString& ctkXnatReconstructionResourceFile::fileFormat() const
  87. {
  88. Q_D(const ctkXnatReconstructionResourceFile);
  89. return d->fileFormat;
  90. }
  91. void ctkXnatReconstructionResourceFile::setFileFormat(const QString& fileFormat)
  92. {
  93. Q_D(ctkXnatReconstructionResourceFile);
  94. d->fileFormat = fileFormat;
  95. }
  96. const QString& ctkXnatReconstructionResourceFile::fileContent() const
  97. {
  98. Q_D(const ctkXnatReconstructionResourceFile);
  99. return d->fileContent;
  100. }
  101. void ctkXnatReconstructionResourceFile::setFileContent(const QString& fileContent)
  102. {
  103. Q_D(ctkXnatReconstructionResourceFile);
  104. d->fileContent = fileContent;
  105. }
  106. const QString& ctkXnatReconstructionResourceFile::categoryId() const
  107. {
  108. Q_D(const ctkXnatReconstructionResourceFile);
  109. return d->categoryId;
  110. }
  111. void ctkXnatReconstructionResourceFile::setCategoryId(const QString& categoryId)
  112. {
  113. Q_D(ctkXnatReconstructionResourceFile);
  114. d->categoryId = categoryId;
  115. }
  116. void ctkXnatReconstructionResourceFile::download(ctkXnatConnection* connection, const QString& zipFileName)
  117. {
  118. connection->download(this, zipFileName);
  119. }
  120. void ctkXnatReconstructionResourceFile::remove(ctkXnatConnection* connection)
  121. {
  122. connection->remove(this);
  123. }
  124. bool ctkXnatReconstructionResourceFile::isFile() const
  125. {
  126. return true;
  127. }
  128. bool ctkXnatReconstructionResourceFile::isDeletable() const
  129. {
  130. return true;
  131. }