ctkXnatReconstructionFolder.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 "ctkXnatReconstructionFolder.h"
  16. #include "ctkXnatConnection.h"
  17. #include "ctkXnatExperiment.h"
  18. #include "ctkXnatReconstruction.h"
  19. ctkXnatReconstructionFolder::ctkXnatReconstructionFolder(ctkXnatObject* parent)
  20. : ctkXnatObject(parent)
  21. {
  22. }
  23. ctkXnatReconstructionFolder::~ctkXnatReconstructionFolder()
  24. {
  25. }
  26. void ctkXnatReconstructionFolder::fetch(ctkXnatConnection* connection)
  27. {
  28. connection->fetch(this);
  29. }
  30. void ctkXnatReconstructionFolder::download(ctkXnatConnection* connection, const QString& zipFileName)
  31. {
  32. connection->downloadReconstructionFiles(dynamic_cast<ctkXnatExperiment*>(getParent()), zipFileName);
  33. }
  34. void ctkXnatReconstructionFolder::add(ctkXnatConnection* connection, const QString& categoryEntry)
  35. {
  36. connection->addReconstruction(dynamic_cast<ctkXnatExperiment*>(getParent()), categoryEntry);
  37. }
  38. QString ctkXnatReconstructionFolder::getModifiableChildKind() const
  39. {
  40. return "reconstruction";
  41. }
  42. QString ctkXnatReconstructionFolder::getModifiableParentName() const
  43. {
  44. return getParent()->getName();
  45. }
  46. bool ctkXnatReconstructionFolder::isModifiable() const
  47. {
  48. return true;
  49. }
  50. QString ctkXnatReconstructionFolder::getKind() const
  51. {
  52. return "reconstruction";
  53. }
  54. QString ctkXnatReconstructionFolder::getModifiableChildKind(int parentIndex) const
  55. {
  56. return "resource";
  57. }
  58. QString ctkXnatReconstructionFolder::getModifiableParentName(int parentIndex) const
  59. {
  60. return this->childName(parentIndex);
  61. }
  62. bool ctkXnatReconstructionFolder::holdsFiles() const
  63. {
  64. return true;
  65. }
  66. bool ctkXnatReconstructionFolder::isModifiable(int parentIndex) const
  67. {
  68. return true;
  69. }
  70. bool ctkXnatReconstructionFolder::isDeletable() const
  71. {
  72. return true;
  73. }