pcb 4.1.1
An interactive printed circuit board layout editor.

iso.c File Reference

#include "gts.h"
Include dependency graph for iso.c:

Go to the source code of this file.

Data Structures

struct  OrientedVertex
struct  _GtsIsoSlice

Defines

#define SWAP(s1, s2, tmp)   (tmp = s1, s1 = s2, s2 = tmp)

Enumerations

enum  Orientation { LEFT = 0, RIGHT = 1 }

Functions

static void ** malloc2D (guint nx, guint ny, gulong size)
static void free2D (void **m, guint nx)
GtsGridPlanegts_grid_plane_new (guint nx, guint ny)
void gts_grid_plane_destroy (GtsGridPlane *g)
GtsIsoSlicegts_iso_slice_new (guint nx, guint ny)
void gts_iso_slice_fill (GtsIsoSlice *slice, GtsGridPlane *plane1, GtsGridPlane *plane2, gdouble **f1, gdouble **f2, gdouble iso, GtsVertexClass *klass)
void gts_iso_slice_fill_cartesian (GtsIsoSlice *slice, GtsCartesianGrid g, gdouble **f1, gdouble **f2, gdouble iso, GtsVertexClass *klass)
void gts_iso_slice_destroy (GtsIsoSlice *slice)
void gts_isosurface_slice (GtsIsoSlice *slice1, GtsIsoSlice *slice2, GtsSurface *surface)
void gts_isosurface_cartesian (GtsSurface *surface, GtsCartesianGrid g, GtsIsoCartesianFunc f, gpointer data, gdouble iso)

Variables

static guint c [12][4]
static guint edge [12][2][3]

Define Documentation

#define SWAP (   s1,
  s2,
  tmp 
)    (tmp = s1, s1 = s2, s2 = tmp)

Definition at line 389 of file iso.c.

Referenced by gts_isosurface_cartesian().


Enumeration Type Documentation

Enumerator:
LEFT 
RIGHT 

Definition at line 22 of file iso.c.


Function Documentation

static void free2D ( void **  m,
guint  nx 
) [static]

Definition at line 69 of file iso.c.

Referenced by gts_grid_plane_destroy(), gts_iso_slice_destroy(), and gts_isosurface_cartesian().

void gts_grid_plane_destroy ( GtsGridPlane g)

gts_grid_plane_destroy: :

Definition at line 103 of file iso.c.

References free2D(), _GtsGridPlane::nx, and _GtsGridPlane::p.

Here is the call graph for this function:

GtsGridPlane* gts_grid_plane_new ( guint  nx,
guint  ny 
)

gts_grid_plane_new: : :

Returns:

Definition at line 87 of file iso.c.

References malloc2D(), _GtsGridPlane::nx, _GtsGridPlane::ny, and _GtsGridPlane::p.

Here is the call graph for this function:

void gts_iso_slice_destroy ( GtsIsoSlice slice)

gts_iso_slice_destroy: : a GtsIsoSlice.

Free all memory allocated for .

Definition at line 303 of file iso.c.

References free2D(), _GtsIsoSlice::nx, and _GtsIsoSlice::vertices.

Referenced by gts_isosurface_cartesian().

Here is the call graph for this function:

void gts_iso_slice_fill ( GtsIsoSlice slice,
GtsGridPlane plane1,
GtsGridPlane plane2,
gdouble **  f1,
gdouble **  f2,
gdouble  iso,
GtsVertexClass klass 
)

gts_iso_slice_fill: : a GtsIsoSlice. : a GtsGridPlane. : another GtsGridPlane. : values of the function corresponding to . : values of the function corresponding to . : isosurface value. : a GtsVertexClass or one of its descendant to be used for the new vertices.

Fill with the coordinates of the vertices defined by f1 (x,y,z) = and f2 (x, y, z) = .

Definition at line 154 of file iso.c.

References gts_vertex_new(), LEFT, _GtsIsoSlice::nx, _GtsIsoSlice::ny, OrientedVertex::orientation, _GtsGridPlane::p, RIGHT, OrientedVertex::v, _GtsIsoSlice::vertices, x, and y.

Here is the call graph for this function:

void gts_iso_slice_fill_cartesian ( GtsIsoSlice slice,
GtsCartesianGrid  g,
gdouble **  f1,
gdouble **  f2,
gdouble  iso,
GtsVertexClass klass 
)

gts_iso_slice_fill_cartesian: : a GtsIsoSlice. : a GtsCartesianGrid. : values of the function for plane z = .z. : values of the function for plane z = .z + .dz. : isosurface value. : a GtsVertexClass.

Fill with the coordinates of the vertices defined by f1 (x,y,z) = and f2 (x, y, z) = .

Definition at line 241 of file iso.c.

References _GtsCartesianGrid::dx, _GtsCartesianGrid::dy, _GtsCartesianGrid::dz, gts_vertex_new(), LEFT, _GtsCartesianGrid::nx, _GtsCartesianGrid::ny, OrientedVertex::orientation, RIGHT, OrientedVertex::v, _GtsIsoSlice::vertices, _GtsCartesianGrid::x, x, _GtsCartesianGrid::y, y, and _GtsCartesianGrid::z.

Referenced by gts_isosurface_cartesian().

Here is the call graph for this function:

GtsIsoSlice* gts_iso_slice_new ( guint  nx,
guint  ny 
)

gts_iso_slice_new: : number of vertices in the x direction. : number of vertices in the y direction.

Returns: a new GtsIsoSlice.

Definition at line 118 of file iso.c.

References malloc2D(), _GtsIsoSlice::nx, _GtsIsoSlice::ny, and _GtsIsoSlice::vertices.

Referenced by gts_isosurface_cartesian().

Here is the call graph for this function:

void gts_isosurface_cartesian ( GtsSurface surface,
GtsCartesianGrid  g,
GtsIsoCartesianFunc  f,
gpointer  data,
gdouble  iso 
)

gts_isosurface_cartesian: : a GtsSurface. : a GtsCartesianGrid. : a GtsIsoCartesianFunc. : user data to be passed to . : isosurface value.

Adds to new faces defining the isosurface f(x,y,z) = . By convention, the normals to the surface are pointing toward the positive values of f(x,y,z) - .

The user function is called successively for each value of the z coordinate defined by . It must fill the corresponding (x,y) plane with the values of the function for which the isosurface is to be computed.

Definition at line 407 of file iso.c.

References free2D(), gts_iso_slice_destroy(), gts_iso_slice_fill_cartesian(), gts_iso_slice_new(), gts_isosurface_slice(), malloc2D(), _GtsCartesianGrid::nx, _GtsCartesianGrid::ny, _GtsCartesianGrid::nz, SWAP, and _GtsSurface::vertex_class.

Here is the call graph for this function:

void gts_isosurface_slice ( GtsIsoSlice slice1,
GtsIsoSlice slice2,
GtsSurface surface 
)

gts_isosurface_slice: : a GtsIsoSlice. : another GtsIsoSlice. : a GtsSurface.

Given two successive slices and link their vertices with segments and triangles which are added to .

Definition at line 323 of file iso.c.

References c, edge, _GtsSurface::edge_class, _GtsSurface::face_class, FALSE, GTS_EDGE, gts_edge_new(), gts_face_new(), GTS_OBJECT, gts_surface_add_face(), gts_vertices_are_connected(), m, _GtsIsoSlice::nx, _GtsIsoSlice::ny, OrientedVertex::orientation, TRUE, OrientedVertex::v, and _GtsIsoSlice::vertices.

Referenced by gts_isosurface_cartesian().

Here is the call graph for this function:

static void** malloc2D ( guint  nx,
guint  ny,
gulong  size 
) [static]

Definition at line 58 of file iso.c.

References m.

Referenced by gts_grid_plane_new(), gts_iso_slice_new(), and gts_isosurface_cartesian().


Variable Documentation

guint c[12][4] [static]
Initial value:
 {
  {0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 1}, {0, 0, 1, 0},
  {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 1, 0, 1}, {1, 1, 0, 0},
  {2, 0, 0, 0}, {2, 1, 0, 0}, {2, 1, 1, 0}, {2, 0, 1, 0}}

Definition at line 35 of file iso.c.

Referenced by __routebox_is_good(), ActionDJopt(), arc_ortho_projections(), bestpolygon(), BumpName(), calc_lon(), canonicalize_line(), check_line_callback(), classify_nets(), clear_marks(), cluster_create(), cluster_destroy(), cluster_grid_add_point(), ComputeCost(), connect_interior_loop(), container_destroy(), coords_on_line(), debumpify(), det(), det2x2(), diag_line(), ExpandFilename(), find_corner(), find_corner_if(), findpath(), gcode_do_export(), gerber_set_layer(), getstr(), gsvit_fill_circle(), gsvit_fill_polygon(), gts_cluster_new(), gts_containee_is_contained(), gts_container_size(), gts_delaunay_refine(), gts_file_getc(), gts_file_getc_scope(), gts_file_next_token(), gts_isosurface_slice(), gts_matrix_rotate(), gts_object_class_is_from_class(), gts_object_is_from_class(), gts_point_orientation_3d_sos(), gts_segment_triangle_intersection(), gts_vertex_principal_directions(), gts_volume_optimized_vertex(), incircleadapt(), InsCntr(), insphereadapt(), insphereexact(), IsPointInPolygon(), IsPolygonInPolygon(), lgbutton_expose(), LoadBackgroundFile(), miter(), orient2dadapt(), orient3dadapt(), orthopull(), orthopull_1(), penalty3(), pinsnap(), png_use_mask(), pointslope(), poly_CreateNode(), poly_InclContour(), poly_PreContour(), poly_Valid(), print_defaults_1(), ps_calibrate_1(), remove_corner(), scale_expansion_zeroelim(), search_footprint_hash(), segment_triangle_intersection(), sift_down(), simple_optimizations(), split_edge(), split_line(), square_therm(), SquarePadPoly(), tangent(), tempfile_name_new(), unjaggy_once(), UpdateXY(), use_gc(), vertices_on_line(), vianudge(), work_area_first_expose(), write_edge_oogl_boundary(), write_face_oogl(), and write_vertex_oogl().

guint edge[12][2][3] [static]
Initial value:
 {
  {{9, 1, 8}, {4, 3, 7}},   
  {{6, 2, 5}, {8, 0, 9}},   
  {{10, 3, 11}, {5, 1, 6}}, 
  {{7, 0, 4}, {11, 2, 10}}, 
  {{3, 7, 0}, {8, 5, 11}},  
  {{11, 4, 8}, {1, 6, 2}},  
  {{2, 5, 1}, {9, 7, 10}},  
  {{10, 6, 9}, {0, 4, 3}},  
  {{5, 11, 4}, {0, 9, 1}},  
  {{1, 8, 0}, {7, 10, 6}},  
  {{6, 9, 7}, {3, 11, 2}},  
  {{2, 10, 3}, {4, 8, 5}}   
}

Definition at line 43 of file iso.c.

Referenced by compute_candidate_points(), edge_destroy(), get_edge(), and gts_isosurface_slice().