digit.cpp 1009 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 <clocale>
  13. #include "driver.h"
  14. #include "digit.h"
  15. /**
  16. \brief Initialize digit interface used by SWIG
  17. \param driver display driver instance
  18. */
  19. Digit::Digit(DisplayDriver *ddriver)
  20. {
  21. setlocale(LC_NUMERIC, "C");
  22. display = ddriver;
  23. if (display->mapInfo) {
  24. InitCats();
  25. }
  26. changesetCurrent = -2; // initial value for undo/redo
  27. changesetDead = -1;
  28. // avoid GUI crash
  29. // Vect_set_fatal_error(GV_FATAL_PRINT);
  30. }
  31. /**
  32. Digit class destructor
  33. Frees changeset structure
  34. */
  35. Digit::~Digit()
  36. {
  37. for(int changeset = 0; changeset < (int) changesets.size(); changeset++) {
  38. FreeChangeset(changeset);
  39. }
  40. }