#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} |
Definition in file util.C.
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 | |||
) |
ostream& operator<< | ( | ostream & | stream, | |
Matrix | M | |||
) |
ostream& operator<< | ( | ostream & | stream, | |
const LinearData & | d | |||
) |
ostream& operator<< | ( | ostream & | stream, | |
const Vec3D & | p | |||
) |
ostream& operator<< | ( | ostream & | stream, | |
const Point2D & | p | |||
) |
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).
poly | The polygon to test in ccw order | |
size | The number of vertexs in the polygon |
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)
poly | The points of the vertexes of the polygon in ccw order | |
size | The number of vertexs in the polygon |
const double ALPHA[7] |
const double BETA[7] |
const double WEIGHT[7] |