ctkDicomAppService.cpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 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 "ctkSimpleSoapClient.h"
  17. #include "ctkDicomAppHostingTypesHelper.h"
  18. //----------------------------------------------------------------------------
  19. ctkDicomAppService::ctkDicomAppService(ushort port, QString path)
  20. : ctkDicomExchangeService(port, path)
  21. {
  22. }
  23. //----------------------------------------------------------------------------
  24. ctkDicomAppService::~ctkDicomAppService()
  25. {
  26. }
  27. //----------------------------------------------------------------------------
  28. ctkDicomAppHosting::State ctkDicomAppService::getState()
  29. {
  30. const QtSoapType & result = submitSoapRequest("GetState", NULL);
  31. return ctkDicomSoapState::getState(result);
  32. }
  33. //----------------------------------------------------------------------------
  34. bool ctkDicomAppService::setState(ctkDicomAppHosting::State newState)
  35. {
  36. QtSoapType* input = new ctkDicomSoapState("state", newState);
  37. const QtSoapType & result = submitSoapRequest("SetState", input);
  38. return ctkDicomSoapBool::getBool(result);
  39. }
  40. //----------------------------------------------------------------------------
  41. bool ctkDicomAppService::bringToFront(const QRect& requestedScreenArea)
  42. {
  43. QtSoapType* input = new ctkDicomSoapRectangle("RequestedScreenArea", requestedScreenArea);
  44. const QtSoapType & result = submitSoapRequest("BringToFront", input);
  45. return ctkDicomSoapBool::getBool(result);
  46. }
  47. //----------------------------------------------------------------------------
  48. // Exchange methods
  49. //----------------------------------------------------------------------------
  50. bool ctkDicomAppService::notifyDataAvailable(const ctkDicomAppHosting::AvailableData& data, bool lastData)
  51. {
  52. return ctkDicomExchangeService::notifyDataAvailable(data, lastData);
  53. }
  54. //----------------------------------------------------------------------------
  55. QList<ctkDicomAppHosting::ObjectLocator> ctkDicomAppService::getData(
  56. const QList<QUuid>& objectUUIDs,
  57. const QList<QString>& acceptableTransferSyntaxUIDs,
  58. bool includeBulkData)
  59. {
  60. return ctkDicomExchangeService::getData(objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
  61. }
  62. //----------------------------------------------------------------------------
  63. void ctkDicomAppService::releaseData(const QList<QUuid>& objectUUIDs)
  64. {
  65. ctkDicomExchangeService::releaseData(objectUUIDs);
  66. }