digit.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. \param window parent window for message dialog
  18. */
  19. Digit::Digit(DisplayDriver *ddriver, void *window)
  20. {
  21. display = ddriver;
  22. parentWin = (wxWindow *) window;
  23. if (display->mapInfo) {
  24. InitCats();
  25. }
  26. changesetCurrent = -2; // initial value for undo/redo
  27. changesetDead = -1;
  28. msgCaption = _("Digitization error");
  29. // avoid GUI crash
  30. // Vect_set_fatal_error(GV_FATAL_PRINT);
  31. }
  32. /**
  33. \brief Digit class destructor
  34. Frees changeset structure
  35. */
  36. Digit::~Digit()
  37. {
  38. for(int changeset = 0; changeset < (int) changesets.size(); changeset++) {
  39. FreeChangeset(changeset);
  40. }
  41. }
  42. /**
  43. \brief Update digit settings
  44. \param breakLines break lines on intersection
  45. */
  46. void Digit::UpdateSettings(bool breakLines)
  47. {
  48. settings.breakLines = breakLines;
  49. return;
  50. }