v_net_bridge.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. """
  2. ***************************************************************************
  3. v_net_bridge.py
  4. ---------------------
  5. Date : December 2015
  6. Copyright : (C) 2015 by Médéric Ribreux
  7. Email : medspx at medspx dot fr
  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__ = 'Médéric Ribreux'
  18. __date__ = 'December 2015'
  19. __copyright__ = '(C) 2015, Médéric Ribreux'
  20. from .v_net import incorporatePoints, variableOutput
  21. def processCommand(alg, parameters, context, feedback):
  22. incorporatePoints(alg, parameters, context, feedback)
  23. def processOutputs(alg, parameters, context, feedback):
  24. idx = alg.parameterAsInt(parameters, 'method', context)
  25. operations = alg.parameterDefinition('method').options()
  26. operation = operations[idx]
  27. if operation == 'articulation':
  28. outputParameter = {'output': ['output', 'point', 2, True]}
  29. elif operation == 'bridge':
  30. outputParameter = {'output': ['output', 'line', 1, False]}
  31. variableOutput(alg, outputParameter, parameters, context)