digit.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. \file digit.cpp
  3. \brief Experimental C++ interace for vector digitization used
  4. by wxPython GUI.
  5. This program is free software under the GNU General Public
  6. License (>=v2). Read the file COPYING that comes with GRASS
  7. for details.
  8. \author (C) by the GRASS Development Team
  9. Martin Landa <landa.martin gmail.com>
  10. \date 2008
  11. */
  12. #include "driver.h"
  13. #include "digit.h"
  14. /**
  15. \brief Initialize digit interface used by SWIG
  16. \param driver display driver instance
  17. */
  18. Digit::Digit(DisplayDriver *ddriver)
  19. {
  20. display = ddriver;
  21. if (display->mapInfo) {
  22. InitCats();
  23. }
  24. changesetCurrent = -2; // initial value for undo/redo
  25. changesetDead = -1;
  26. // avoid GUI crash
  27. // Vect_set_fatal_error(GV_FATAL_PRINT);
  28. }
  29. /**
  30. \brief Digit class destructor
  31. Frees changeset structure
  32. */
  33. Digit::~Digit()
  34. {
  35. for(int changeset = 0; changeset < (int) changesets.size(); changeset++) {
  36. FreeChangeset(changeset);
  37. }
  38. }
  39. /**
  40. \brief Update digit settings
  41. \param breakLines break lines on intersection
  42. */
  43. void Digit::UpdateSettings(bool breakLines)
  44. {
  45. settings.breakLines = breakLines;
  46. return;
  47. }