site.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*************************************************************************
  2. * Copyright (c) 2011 AT&T Intellectual Property
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * https://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors: Details at https://graphviz.org
  9. *************************************************************************/
  10. #pragma once
  11. #include <stddef.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <neatogen/geometry.h>
  16. /* Sites are also used as vertices on line segments */
  17. typedef struct Site {
  18. Point coord;
  19. size_t sitenbr;
  20. unsigned refcnt;
  21. } Site;
  22. extern int siteidx;
  23. extern Site *bottomsite;
  24. extern void siteinit(void);
  25. extern Site *getsite(void);
  26. extern double dist(Site *, Site *); /* Distance between two sites */
  27. extern void deref(Site *); /* Increment refcnt of site */
  28. extern void ref(Site *); /* Decrement refcnt of site */
  29. extern void makevertex(Site *); /* Transform a site into a vertex */
  30. #ifdef __cplusplus
  31. }
  32. #endif