util.C File Reference

(r1659/r1653)

#include <iostream>
#include <cmath>
#include <cassert>
#include "util.h"
#include "predicates.h"

Include dependency graph for util.C:

Go to the source code of this file.

Functions

ostream & operator<< (ostream &stream, const Point2D &p)
ostream & operator<< (ostream &stream, const Vec3D &p)
ostream & operator<< (ostream &stream, const LinearData &d)
ostream & operator<< (ostream &stream, Matrix M)
int add_filename_extension (char *filename, const char *ext, char *buf, int buf_len)
 A function to add an extension to a filename, if not already present.
bool poly_convex (Point2D poly[], int size)
 Determine if a polygon is convex.
bool point_in_poly_kernel (Point2D poly[], int size, const Point2D &point)
 Determin if a point is within the kernel of a polygon.
ostream & operator<< (ostream &os, const ControlPoint &cp)

Variables

const double ALPHA [7]
const double BETA [7]
const double WEIGHT [7]
const double PI = 3.1415926535898
const double TWOPI = 2.0 * 3.1415926535898
const double HALFPI = 0.5 * 3.1415926535898
static double signa [2] = {1.0, -1.0}


Detailed Description

Author:
Mark J. Olah (mjo@andrew.cmu.edu)

Definition in file util.C.


Function Documentation

int add_filename_extension ( char *  filename,
const char *  ext,
char *  buf,
int  buf_len 
)

A function to add an extension to a filename, if not already present.

Definition at line 698 of file util.C.

References bzero.

Referenced by _wrap_add_filename_extension(), Visualization::write_jpeg(), Visualization::write_ppm(), and Visualization::write_tiff().

ostream & operator<< ( ostream &  os,
const ControlPoint cp 
)

Definition at line 752 of file util.C.

ostream& operator<< ( ostream &  stream,
Matrix  M 
)

Definition at line 684 of file util.C.

References Matrix::cols, Matrix::m, and Matrix::rows.

ostream& operator<< ( ostream &  stream,
const LinearData d 
)

Definition at line 274 of file util.C.

References LinearData::length.

ostream& operator<< ( ostream &  stream,
const Vec3D p 
)

Definition at line 89 of file util.C.

References Vec3D::coords.

ostream& operator<< ( ostream &  stream,
const Point2D p 
)

Definition at line 83 of file util.C.

References Point2D::coords.

bool point_in_poly_kernel ( Point2D  poly[],
int  size,
const Point2D point 
)

Determin if a point is within the kernel of a polygon.

The polygon must be specified with a counter-clockwise numbering.

A point is in the kerenal of a polygon if it can see every vertex of the polygon

This will return false if the point is internal to an edge segment (on the boundary).

Parameters:
poly The polygon to test in ccw order
size The number of vertexs in the polygon
Returns:
True if the point is in the kernel

Definition at line 739 of file util.C.

References Point2D::is_left_of().

Here is the call graph for this function:

bool poly_convex ( Point2D  poly[],
int  size 
)

Determine if a polygon is convex.

The polygon must be specified with a counter-clockwise numbering.

This will return false if any neighboring segments are colinear (180deg angles are not convex)

Parameters:
poly The points of the vertexes of the polygon in ccw order
size The number of vertexs in the polygon
Returns:
True if the polygon is convex

Definition at line 725 of file util.C.


Variable Documentation

const double ALPHA[7]

Initial value:

{0.33333333333333,
                       0.05971587178978,
                       0.47014206410511,
                       0.47014206410511,
                       0.79742698535310,
                       0.10128650732345,
                       0.10128650732345}

Definition at line 18 of file util.C.

const double BETA[7]

Initial value:

{ 0.33333333333333,
                       0.47014206410511,
                       0.05971587178978,
                       0.47014206410511,
                       0.10128650732345,
                       0.79742698535310,
                       0.10128650732345}

Definition at line 26 of file util.C.

const double HALFPI = 0.5 * 3.1415926535898

Definition at line 44 of file util.C.

const double PI = 3.1415926535898

Definition at line 42 of file util.C.

double signa[2] = {1.0, -1.0} [static]

Definition at line 389 of file util.C.

const double TWOPI = 2.0 * 3.1415926535898

Definition at line 43 of file util.C.

const double WEIGHT[7]

Initial value:

{0.11250000000000,
                        0.06619707639425,
                        0.06619707639425,
                        0.06619707639425,
                        0.06296959027241,
                        0.06296959027241,
                        0.06296959027241}

Definition at line 34 of file util.C.


Generated on Mon May 24 09:53:32 2010 for TUMBLE by  doxygen 1.5.2