bindings-gts-0.0.3: Low level bindings supporting GTS, the GNU Triangulated Surface Library

Bindings.GTS

Description

Bindings DSL file for the Gnu Triangulated Surface Library

Synopsis

Documentation

data C'GList Source

Constructors

C'GList 

Instances

Eq C'GList 
Show C'GList 
Storable C'GList

Allocate a node in a GSList from gobject. Note this function should not be used as the append/insert functions call it internally

p'g_slist_alloc :: FunPtr (IO (Ptr C'GSList))Source

Free all the nodes in an GSList. See the glib library

p'g_slist_free :: FunPtr (Ptr C'GSList -> IO ())Source

Free one node in a GSList

p'g_slist_free_1 :: FunPtr (Ptr C'GSList -> IO ())Source

Get the pointer to the next element in the GSList

c'g_slist_last :: Ptr C'GSList -> IO (Ptr C'GSList)Source

Get the pointer to the last element in the GSList

p'g_slist_last :: FunPtr (Ptr C'GSList -> IO (Ptr C'GSList))Source

Get the length of the GSList

p'g_slist_length :: FunPtr (Ptr C'GSList -> IO C'guint)Source

Get the n-th element of the GSList counting from 0

p'g_slist_nth :: FunPtr (Ptr C'GSList -> C'guint -> IO (Ptr C'GSList))Source

Append a new node to a GSList

p'g_slist_append :: FunPtr (Ptr C'GSList -> C'gpointer -> IO (Ptr C'GSList))Source

Insert a new node in a GSList before the referenced node

p'g_slist_insert_before :: FunPtr (Ptr C'GSList -> Ptr C'GSList -> C'gpointer -> IO (Ptr C'GSList))Source

Insert a new node in a GSList at the specified position

p'g_slist_insert :: FunPtr (Ptr C'GSList -> C'gpointer -> C'gint -> IO (Ptr C'GSList))Source

Callback for the GTS Object class initialization - don't use this unless you know what you are doing

type C'GtsObjectInitFunc = FunPtr (Ptr C'GtsObject -> IO ())Source

Callback for the GTS Object initialization - don't use this unless you know what you are doing

type C'GtsArgSetFunc = FunPtr (Ptr C'GtsObject -> IO ())Source

Callback for the GTS argument set method - don't use this unless you know what you are doing

type C'GtsArgGetFunc = FunPtr (Ptr C'GtsObject -> IO ())Source

Callback for the GTS argument get method - don't use this unless you know what you are doing

data C'GtsVector Source

Type of the GTS Vector object in Haskell

Constructors

C'GtsVector 

Instances

Eq C'GtsVector 
Show C'GtsVector 
Storable C'GtsVector

Type of the GTS Matrix object in Haskell

data C'GtsMatrix Source

Constructors

C'GtsMatrix 

Instances

Eq C'GtsMatrix 
Show C'GtsMatrix 
Storable C'GtsMatrix

Create a new GTS Matrix 4x4 object and return the pointer to it.

p'gts_matrix_assign :: FunPtr (Ptr C'GtsMatrix -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> C'gdouble -> IO (Ptr C'GtsMatrix))Source

Destroy a GTS matrix and free the associated memory - Use this with ForeignPtr for GC

p'gts_matrix_destroy :: FunPtr (Ptr C'GtsMatrix -> IO ())Source

Set a GTS matrix to the Zero matrix (if the matrix is NULL a new one is allocated)

p'gts_matrix_zero :: FunPtr (Ptr C'GtsMatrix -> IO (Ptr C'GtsMatrix))Source

Set a GTS matrix to the Identity matrix (if the matrix is NULL a new one is allocated)

p'gts_matrix_identity :: FunPtr (Ptr C'GtsMatrix -> IO (Ptr C'GtsMatrix))Source

Transpose a GTS Matrix and return the newly allocated matrix

p'gts_matrix_transpose :: FunPtr (Ptr C'GtsMatrix -> IO (Ptr C'GtsMatrix))Source

Invert a GTS Matrix and return the newly allocated matrix or NULL if the matrix can't be inverted

p'gts_matrix_inverse :: FunPtr (Ptr C'GtsMatrix -> IO (Ptr C'GtsMatrix))Source

Calculate the product of two matricies and return the newly allocated matrix

p'gts_matrix_scale :: FunPtr (Ptr C'GtsMatrix -> Ptr C'GtsVector -> IO (Ptr C'GtsMatrix))Source

Translate the GTS Matrix by the GTS Vector (If the Matrix is NULL a new one is allocated and translated)

p'gts_matrix_translate :: FunPtr (Ptr C'GtsMatrix -> Ptr C'GtsVector -> IO (Ptr C'GtsMatrix))Source

Rotate the GTS Matrix around the vector by the

p'gts_matrix_rotate :: FunPtr (Ptr C'GtsMatrix -> Ptr C'GtsVector -> C'gdouble -> IO (Ptr C'GtsMatrix))Source

Type for an (r,g,b) triple in GTS (floating point)

data C'GtsColor Source

Instances

Eq C'GtsColor 
Show C'GtsColor 
Storable C'GtsColor

Callback for most GTS visitors

type C'GtsVertexMergeFunc = FunPtr (Ptr C'GtsVertex -> Ptr C'GtsVertex -> IO C'gboolean)Source

Callback for gts_vertices_merge

data C'GtsFile Source

Instances

Eq C'GtsFile 
Show C'GtsFile 
Storable C'GtsFile

A GTS formatted data file variable

p'fopen :: FunPtr (CString -> CString -> IO (Ptr CFile))Source

Close a C file

p'fclose :: FunPtr (Ptr CFile -> IO Int)Source

Create a new GTS file handle from an C file

p'gts_file_new :: FunPtr (Ptr CFile -> IO (Ptr C'GtsFile))Source

Create a new GTS file handle from a C String. Note this method doesn't seem to work

p'gts_file_new_from_string :: FunPtr (Ptr C'gchar -> IO (Ptr C'GtsFile))Source

Get a character from a GTS file (Don't use this)

p'gts_file_getc :: FunPtr (Ptr C'GtsFile -> IO C'gint)Source

Destroy a GTS file handle and free the memory

data C'GtsTriangle Source

Instances

Eq C'GtsTriangle 
Show C'GtsTriangle 
Storable C'GtsTriangle

Create a triangle which is guarenteed to enclose all the points in the list

p'gts_triangle_enclosing :: FunPtr (Ptr C'GtsTriangleClass -> Ptr C'GSList -> C'gdouble -> IO (Ptr C'GtsTriangle))Source

Get the class descriptor for the GTS Triangle class

p'gts_triangle_class :: FunPtr (IO (Ptr C'GtsTriangleClass))Source

Create a new triangle from 3 edges

p'gts_triangle_new :: FunPtr (Ptr C'GtsTriangleClass -> Ptr C'GtsEdge -> Ptr C'GtsEdge -> Ptr C'GtsEdge -> IO (Ptr C'GtsTriangle))Source

Discard the existing edges of the triangle and replace with the new ones

p'gts_triangle_area :: FunPtr (Ptr C'GtsTriangle -> IO C'gdouble)Source

Get the perimeter of this triangle

p'gts_triangle_perimeter :: FunPtr (Ptr C'GtsTriangle -> IO C'gdouble)Source

Get a measure of the quality of this triangle (how close to equilateral it is?)

p'gts_triangle_quality :: FunPtr (Ptr C'GtsTriangle -> IO C'gdouble)Source

Get the normal to the plane of this triangle

p'gts_triangle_normal :: FunPtr (Ptr C'GtsTriangle -> Ptr C'gdouble -> Ptr C'gdouble -> Ptr C'gdouble -> IO ())Source

Changes the orientation of triangle t, turning it inside out

p'gts_range_update :: FunPtr (Ptr C'GtsRange -> IO ())Source

GLib class pointer for the GTS point object class

p'gts_point_class :: FunPtr (IO (Ptr C'GtsPointClass))Source

Create a new GTS point in 3d space

p'gts_point_new :: FunPtr (Ptr C'GtsPointClass -> C'gdouble -> C'gdouble -> C'gdouble -> IO (Ptr C'GtsPoint))Source

Set the value of a GTS point in 3d space

p'gts_point_set :: FunPtr (Ptr C'GtsPoint -> C'gdouble -> C'gdouble -> C'gdouble -> IO ())Source

True iff the point is within or on the boundary of the box defined by the two other points

c'gts_vertex_class :: IO (Ptr C'GtsVertexClass)Source

GLib class pointer for the GTS vertex class (vertex derives from point)

p'gts_vertex_class :: FunPtr (IO (Ptr C'GtsVertexClass))Source

Create a new GTS vertex in 3d space

p'gts_vertex_new :: FunPtr (Ptr C'GtsVertexClass -> C'gdouble -> C'gdouble -> C'gdouble -> IO (Ptr C'GtsVertex))Source

True if this vertex is not part of a GTS segment

p'gts_vertex_is_unattached :: FunPtr (Ptr C'GtsVertex -> IO C'gboolean)Source

Return the number of connected triangles sharing the vertex, if second parameter is true then sever the connection

p'gts_vertex_is_contact :: FunPtr (Ptr C'GtsVertex -> C'gboolean -> IO C'guint)Source

Null unless two vertices are the endpoints of the same segment, in which case return the segment

p'gts_vertices_are_connected :: FunPtr (Ptr C'GtsVertex -> Ptr C'GtsVertex -> IO (Ptr C'GtsSegment))Source

Replace a vertex with another vertex and update all objects using it

p'gts_vertex_replace :: FunPtr (Ptr C'GtsVertex -> Ptr C'GtsVertex -> IO ())Source

Adds to list all the GtsVertex connected to v by a GtsSegment and not already in list. If surface is not NULL only the vertices connected to v by an edge belonging to surface are considered.

p'gts_vertex_neighbors :: FunPtr (Ptr C'GtsVertex -> Ptr C'GSList -> Ptr C'GtsSurface -> IO (Ptr C'GSList))Source

Adds all the GtsTriangle which share v as a vertex and do not already belong to list.

p'gts_vertex_triangles :: FunPtr (Ptr C'GtsVertex -> Ptr C'GSList -> IO (Ptr C'GSList))Source

Adds all the GtsFace belonging to surface (if not NULL) which share v as a vertex and do not already belong to list.

p'gts_vertex_faces :: FunPtr (Ptr C'GtsVertex -> Ptr C'GtsSurface -> Ptr C'GSList -> IO (Ptr C'GSList))Source

A list of GtsEdge describing in counterclockwise order the boundary of the fan of summit v, the faces of the fan belonging to surface

p'gts_vertex_fan_oriented :: FunPtr (Ptr C'GtsVertex -> Ptr C'GtsSurface -> IO (Ptr C'GSList))Source

TRUE if v is strictly contained in the diametral circle of e, FALSE otherwise

p'gts_vertex_encroaches_edge :: FunPtr (Ptr C'GtsVertex -> Ptr C'GtsEdge -> IO C'gboolean)Source

For each vertex v in vertices look if there are any vertex of vertices contained in a box centered on v of size 2*epsilon. If there are and if check is not NULL and returns TRUE, replace them with v (using gts_vertex_replace()), destroy them and remove them from list. This is done efficiently using Kd-Trees.

p'gts_surface_class :: FunPtr (IO (Ptr C'GtsSurfaceClass))Source

Create a new empty surface which uses the specified types of sub-object

p'gts_surface_add_face :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsFace -> IO ())Source

Read a surface from a GTS formatted file

p'gts_surface_read :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsFile -> IO C'guint)Source

Remove a face from a surface

p'gts_surface_remove_face :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsFace -> IO ())Source

Get the surface area of all triangles in the surface

p'gts_surface_area :: FunPtr (Ptr C'GtsSurface -> IO C'gdouble)Source

Get some statistics on the surface

p'gts_surface_stats :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsSurfaceStats -> IO ())Source

Get some statistics on the quality of the triangles making up the surface

p'gts_surface_quality_stats :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsSurfaceQualityStats -> IO ())Source

Invoke a function for each vertex in the surface

p'gts_surface_foreach_vertex :: FunPtr (Ptr C'GtsSurface -> C'GtsFunc -> C'gpointer -> IO ())Source

Invoke a function for each edge in the surface

p'gts_surface_foreach_edge :: FunPtr (Ptr C'GtsSurface -> C'GtsFunc -> C'gpointer -> IO ())Source

Invoke a function for each face in the surface

p'gts_surface_foreach_face :: FunPtr (Ptr C'GtsSurface -> C'GtsFunc -> C'gpointer -> IO ())Source

Invoke a function for each face in the surface and remove the face afterwards

p'gts_surface_foreach_face_remove :: FunPtr (Ptr C'GtsSurface -> C'GtsFunc -> C'gpointer -> IO C'guint)Source

Generate a surface which is a tessalated model of a sphere

p'gts_surface_generate_sphere :: FunPtr (Ptr C'GtsSurface -> C'guint -> IO (Ptr C'GtsSurface))Source

Add a copy of all the faces, edges and vertices of s2 to s1.

p'gts_surface_copy :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsSurface -> IO (Ptr C'GtsSurface))Source

Adds all the faces of with which do not already belong to s to s.

p'gts_surface_merge :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsSurface -> IO ())Source

True iff the surface describes a manifold

p'gts_surface_is_manifold :: FunPtr (Ptr C'GtsSurface -> IO C'gboolean)Source

True iff the surface is closed

p'gts_surface_is_closed :: FunPtr (Ptr C'GtsSurface -> IO C'gboolean)Source

True iff all the faces of the surface have a compatible orientation

p'gts_surface_is_orientable :: FunPtr (Ptr C'GtsSurface -> IO C'gboolean)Source

Return the volume of the domain bounded by the surface, only valid if the surface is closed and orientable

p'gts_surface_volume :: FunPtr (Ptr C'GtsSurface -> IO C'gdouble)Source

Return the center of mass of the domain bounded by the surface s, only valid if the surface is closed and orientable

p'gts_surface_center_of_mass :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsVector -> IO C'gdouble)Source

Return the center of area of the surface (all faces should be co-planar)

data C'GNode Source

Constructors

C'GNode 

Instances

Eq C'GNode 
Show C'GNode 
Storable C'GNode

Create a new GTS Face from the 3 edges

p'gts_face_new :: FunPtr (Ptr C'GtsFaceClass -> Ptr C'GtsEdge -> Ptr C'GtsEdge -> Ptr C'GtsEdge -> IO (Ptr C'GtsFace))Source

Get the class for a surface intersection

p'gts_surface_inter_class :: FunPtr (IO (Ptr C'GtsSurfaceInterClass))Source

Create a new surface intersection from the two surfaces and the precomputed face bounding box trees

p'gts_surface_inter_new :: FunPtr (Ptr C'GtsSurfaceInterClass -> Ptr C'GtsSurface -> Ptr C'GtsSurface -> Ptr C'GNode -> Ptr C'GNode -> C'gboolean -> C'gboolean -> IO (Ptr C'GtsSurfaceInter))Source

True iff the edges in the intersection form a closed curve

p'gts_surface_inter_check :: FunPtr (Ptr C'GtsSurfaceInter -> Ptr C'gboolean -> IO C'gboolean)Source

Adds to surface the part of the surface described by si and op.

p'gts_surface_inter_boolean :: FunPtr (Ptr C'GtsSurfaceInter -> Ptr C'GtsSurface -> C'guint -> IO ())Source

A new GtsSurface containing the faces of s which are self-intersecting or NULL if no faces of s are self-intersecting.

p'gts_surface_is_self_intersecting :: FunPtr (Ptr C'GtsSurface -> IO (Ptr C'GtsSurface))Source

A list of GtsEdge defining the curve intersection of the two surfaces.

p'gts_bb_tree_destroy :: FunPtr (Ptr C'GNode -> C'gboolean -> IO ())Source

TRUE if the ray starting at p and ending at (+infty, p-> y, p-> z) intersects with bb, FALSE otherwise.

p'gts_bb_tree_stabbed :: FunPtr (Ptr C'GNode -> Ptr C'GtsPoint -> IO (Ptr C'GSList))Source

Destroy a GTS object and free the associated memory. This is the generic version, see the typed helper functions

p'gts_point_locate :: FunPtr (Ptr C'GtsPoint -> Ptr C'GtsSurface -> Ptr C'GtsFace -> IO (Ptr C'GtsFace))Source

Create a new edge from a pair of vertices

p'gts_edge_new :: FunPtr (Ptr C'GtsEdgeClass -> Ptr C'GtsVertex -> Ptr C'GtsVertex -> IO (Ptr C'GtsEdge))Source

Replaces e with with. For each triangle which uses e as an edge, e is replaced with with. The with-> triangles list is updated appropriately and the e-> triangles list is freed and set to NULL

p'gts_edge_replace :: FunPtr (Ptr C'GtsEdge -> Ptr C'GtsEdge -> IO ())Source

Performs an edge swap on the two triangles sharing e and belonging to s.

p'gts_segment_triangle_intersection :: FunPtr (Ptr C'GtsSegment -> Ptr C'GtsTriangle -> C'gboolean -> IO (Ptr C'GtsPoint))Source

Tests if the planar projection (x, y) of p is inside or outside the circumcircle of the planar projection of t. This function is geometrically robust.

p'gts_point_in_triangle_circle :: FunPtr (Ptr C'GtsPoint -> Ptr C'GtsTriangle -> IO C'gdouble)Source

Checks for orientation of the projection of three points on the (x,y) plane. The result is also an approximation of twice the signed area of the triangle defined by the three points. This function uses adaptive floating point arithmetic and is consequently geometrically robust.

p'gts_point_orientation :: FunPtr (Ptr C'GtsPoint -> Ptr C'GtsPoint -> Ptr C'GtsPoint -> IO C'gdouble)Source

TRUE if p is inside the surface defined by tree, FALSE otherwise.

p'gts_point_is_inside_surface :: FunPtr (Ptr C'GtsPoint -> Ptr C'GNode -> C'gboolean -> IO C'gboolean)Source

Tests if the planar projection (x, y) of p is inside or outside the circle defined by the planar projection of p1, p2 and p3.

p'gts_point_in_circle :: FunPtr (Ptr C'GtsPoint -> Ptr C'GtsPoint -> Ptr C'GtsPoint -> Ptr C'GtsPoint -> IO C'gdouble)Source

Checks if p4 lies above, below or on the plane passing through the points p1, p2 and p3. Below is defined so that p1, p2 and p3 appear in counterclockwise order when viewed from above the plane. The returned value is an approximation of six times the signed volume of the tetrahedron defined by the four points. This function uses adaptive floating point arithmetic and is consequently geometrically robust.

data C'GtsBBox Source

Instances

Eq C'GtsBBox 
Show C'GtsBBox 
Storable C'GtsBBox

A list of triangle strips containing all the triangles of s. A triangle strip is itself a list of successive triangles having one edge in common.

p'gts_surface_strip :: FunPtr (Ptr C'GtsSurface -> IO (Ptr C'GSList))Source

Using the gts_bb_tree_surface_distance() and gts_bb_tree_surface_boundary_distance() functions fills face_range and boundary_range with the min, max and average Euclidean (minimum) distances between the faces of s1 and the faces of s2 and between the boundary edges of s1 and s2.

p'gts_surface_distance :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsSurface -> C'gdouble -> Ptr C'GtsRange -> Ptr C'GtsRange -> IO ())Source

A new GtsBBox bounding box of surface.

p'gts_bbox_surface :: FunPtr (Ptr C'GtsBBoxClass -> Ptr C'GtsSurface -> IO (Ptr C'GtsBBox))Source

TRUE if the bounding boxes bb1 and bb2 are overlapping (including just touching), FALSE otherwise.

p'gts_bboxes_are_overlapping :: FunPtr (Ptr C'GtsBBox -> Ptr C'GtsBBox -> IO C'gboolean)Source

Add a constraint edge to a Delaunay surface

p'gts_delaunay_add_constraint :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsEdge -> IO (Ptr C'GSList))Source

NULL if the planar projection of surface is a Delaunay triangulation (unconstrained), a GtsFace violating the Delaunay property otherwise.

p'gts_delaunay_check :: FunPtr (Ptr C'GtsSurface -> IO (Ptr C'GtsFace))Source

Removes all the edges of the boundary of surface which are not constraints.

p'gts_delaunay_remove_hull :: FunPtr (Ptr C'GtsSurface -> IO ())Source

Recursively split constraints of surface which are encroached by vertices of surface (see Shewchuk 96 for details). The split constraints are destroyed and replaced by a set of new constraints of the same class. If gts_vertex_encroaches_edge() is used for encroaches, the resulting surface will be Delaunay conforming. If steiner_max is positive or nul, the recursive splitting procedure will stop when this maximum number of Steiner points is reached. In that case the resulting surface will not necessarily be Delaunay conforming.

p'gts_delaunay_conform :: FunPtr (Ptr C'GtsSurface -> C'gint -> C'GtsEncroachFunc -> C'gpointer -> IO C'guint)Source

An implementation of the refinement algorithm described in Ruppert (1995) and Shewchuk (1996).

p'gts_delaunay_refine :: FunPtr (Ptr C'GtsSurface -> C'gint -> C'GtsEncroachFunc -> C'gpointer -> C'GtsKeyFunc -> C'gpointer -> IO C'guint)Source

Add one vertex to a Delaunay triangulation preserving the Delaunay property

p'gts_delaunay_add_vertex :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsVertex -> Ptr C'GtsFace -> IO (Ptr C'GtsVertex))Source

Add one vertex to a face of a Delaunay triangulation preserving the Delaunay property

p'gts_delaunay_add_vertex_to_face :: FunPtr (Ptr C'GtsSurface -> Ptr C'GtsVertex -> Ptr C'GtsFace -> IO (Ptr C'GtsVertex))Source

Removes v from the Delaunay triangulation defined by surface and restores the Delaunay property. Vertex v must not be used by any constrained edge otherwise the triangulation is not guaranteed to be Delaunay.

c'gts_finalize :: IO ()Source

Shutdown GTS and free all memory NOTE: after calling this method no other GTS functions may be called