pointset.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * @file
  3. * @ingroup common_utils
  4. * @brief @ref point containers @ref PointSet and @ref PointMap
  5. */
  6. /*************************************************************************
  7. * Copyright (c) 2011 AT&T Intellectual Property
  8. * All rights reserved. This program and the accompanying materials
  9. * are made available under the terms of the Eclipse Public License v1.0
  10. * which accompanies this distribution, and is available at
  11. * https://www.eclipse.org/legal/epl-v10.html
  12. *
  13. * Contributors: Details at https://graphviz.org
  14. *************************************************************************/
  15. #pragma once
  16. #include <cdt.h>
  17. #include <geom.h>
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. typedef Dict_t PointSet; ///< set of @ref pointf. Created by @ref newPS
  22. typedef Dict_t PointMap; ///< map of @ref point. Created by @ref newPM
  23. #ifdef GVDLL
  24. #ifdef GVC_EXPORTS
  25. #define POINTSET_API __declspec(dllexport)
  26. #else
  27. #define POINTSET_API __declspec(dllimport)
  28. #endif
  29. #endif
  30. /// @cond
  31. #ifndef POINTSET_API
  32. #define POINTSET_API /* nothing */
  33. #endif
  34. /// @endcond
  35. POINTSET_API PointSet *newPS(void);
  36. POINTSET_API void freePS(PointSet *);
  37. POINTSET_API void insertPS(PointSet *, pointf);
  38. POINTSET_API void addPS(PointSet *, double x, double y);
  39. POINTSET_API int inPS(PointSet *, pointf);
  40. POINTSET_API int isInPS(PointSet *, double x, double y);
  41. POINTSET_API int sizeOf(PointSet *);
  42. POINTSET_API pointf *pointsOf(PointSet *);
  43. POINTSET_API PointMap *newPM(void);
  44. POINTSET_API void clearPM(PointMap *);
  45. POINTSET_API void freePM(PointMap *);
  46. POINTSET_API int insertPM(PointMap *, int x, int y, int value);
  47. #undef POINTSET_API
  48. #ifdef __cplusplus
  49. }
  50. #endif