ModelerScene.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. """
  2. ***************************************************************************
  3. ModelerScene.py
  4. ---------------------
  5. Date : August 2012
  6. Copyright : (C) 2012 by Victor Olaya
  7. Email : volayaf at gmail dot com
  8. ***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************
  16. """
  17. __author__ = 'Victor Olaya'
  18. __date__ = 'August 2012'
  19. __copyright__ = '(C) 2012, Victor Olaya'
  20. from qgis.gui import QgsModelGraphicsScene
  21. from processing.modeler.ModelerGraphicItem import (
  22. ModelerInputGraphicItem,
  23. ModelerOutputGraphicItem,
  24. ModelerChildAlgorithmGraphicItem
  25. )
  26. class ModelerScene(QgsModelGraphicsScene):
  27. """
  28. IMPORTANT! This is intentionally a MINIMAL class, only containing code which HAS TO BE HERE
  29. because it contains Python code for compatibility with deprecated methods ONLY.
  30. Don't add anything here -- edit the c++ base class instead!
  31. """
  32. def __init__(self, parent=None):
  33. super().__init__(parent)
  34. def createParameterGraphicItem(self, model, param):
  35. return ModelerInputGraphicItem(param.clone(), model)
  36. def createChildAlgGraphicItem(self, model, child):
  37. return ModelerChildAlgorithmGraphicItem(child.clone(), model)
  38. def createOutputGraphicItem(self, model, output):
  39. return ModelerOutputGraphicItem(output.clone(), model)