ctkDicomAppService.cpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 2010 German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  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 "ctkDicomAppService.h"
  16. #include "ctkDicomServicePrivate.h"
  17. #include "ctkDicomWG23TypesHelper.h"
  18. ctkDicomAppService::ctkDicomAppService(ushort port, QString path):
  19. service(port, path), d(new ctkDicomServicePrivate(port, path))
  20. {
  21. }
  22. ctkDicomAppService::~ctkDicomAppService()
  23. {
  24. }
  25. ctkDicomWG23::State ctkDicomAppService::getState()
  26. {
  27. //Q_D(ctkDicomService);
  28. const QtSoapType & result = d->askHost("getState", NULL);
  29. return ctkDicomSoapState::getState(result);
  30. }
  31. bool ctkDicomAppService::setState(ctkDicomWG23::State newState)
  32. {
  33. //Q_D(ctkDicomService);
  34. QtSoapType* input = new ctkDicomSoapState("newState", newState);
  35. const QtSoapType & result = d->askHost("setState", input);
  36. return ctkDicomSoapBool::getBool(result);
  37. }
  38. bool ctkDicomAppService::bringToFront(const QRect& requestedScreenArea)
  39. {
  40. //Q_D(ctkDicomService);
  41. QtSoapType* input = new ctkDicomSoapRectangle("requestedScreenArea", requestedScreenArea);
  42. const QtSoapType & result = d->askHost("bringToFront", input);
  43. return ctkDicomSoapBool::getBool(result);
  44. }
  45. // Exchange methods
  46. bool ctkDicomAppService::notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData)
  47. {
  48. return service.notifyDataAvailable(data, lastData);
  49. }
  50. QList<ctkDicomWG23::ObjectLocator>* ctkDicomAppService::getData(
  51. QList<QUuid> objectUUIDs,
  52. QList<QString> acceptableTransferSyntaxUIDs,
  53. bool includeBulkData)
  54. {
  55. return service.getData(objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
  56. }
  57. void ctkDicomAppService::releaseData(QList<QUuid> objectUUIDs)
  58. {
  59. service.releaseData(objectUUIDs);
  60. }