Classes | |
| class | CCircle |
| CCircle class, circle on the plane. More... | |
| class | CPoint |
| CPoint class, three dimensional point. More... | |
| class | CPoint2 |
| CPoint2 class, two dimensional point. More... | |
| class | CQrot |
| CQrot quaternion class. More... | |
| class | CDenseMatrix |
| struct | _Entry |
| Entry in the sparse matrix. More... | |
| class | CSparseMatrix |
| CSparseMatrix. More... | |
| class | CBaseMesh |
| CBaseMesh, base class for all types of mesh classes. More... | |
| class | CLoop |
| CLoop Boundary loop class. More... | |
| class | CBoundary |
| CBoundary Boundary class. More... | |
| class | CDynamicMesh |
| CDynamicMesh class : Dynamic mesh. More... | |
| class | CEdge |
| CEdge class, which is the base class of all kinds of edge classes. More... | |
| class | CEdgeKey |
| CEdgeKey class, which is used for sorting edges. More... | |
| class | CFace |
| CFace base class of all kinds of face classes. More... | |
| class | CHalfEdge |
| CHalfEdge Base class of all kinds of halfedges. More... | |
| class | VertexOutHalfedgeIterator |
| VertexOutHalfedgeIterator, transverse all the outgoing halfedges of a vertex ccwly. More... | |
| class | VertexInHalfedgeIterator |
| VertexInHalfedgeIterator, transverse all the incoming halfedges of a vertex ccwly. More... | |
| class | VertexVertexIterator |
| VertexVertexIterator, transverse all the neighboring vertices of a vertex ccwly. More... | |
| class | VertexEdgeIterator |
| VertexEdgeIterator, transverse all the neighboring edges of a vertex ccwly. More... | |
| class | VertexFaceIterator |
| VertexFaceIterator, transverse all the neighboring faces of a vertex ccwly. More... | |
| class | FaceHalfedgeIterator |
| FaceHalfedgeIterator, transverse all the halfedges of a face CCWly. More... | |
| class | FaceEdgeIterator |
| FaceEdgeIterator, transverse all the edges of a face CCWly. More... | |
| class | FaceVertexIterator |
| FaceVertexIterator, transverse all the vertices of a face CCWly. More... | |
| class | MeshVertexIterator |
| MeshVertexIterator, transverse all the vertices in the mesh. More... | |
| class | MeshFaceIterator |
| MeshFaceIterator, transverse all the faces in the mesh. More... | |
| class | MeshEdgeIterator |
| MeshEdgeIterator, transverse all the edges in the mesh. More... | |
| class | MeshHalfEdgeIterator |
| MeshHalfEdgeIterator, transverse all the halfedges in the mesh. More... | |
| class | CVertex |
| CVertex class, which is the base class of all kinds of vertex classes. More... | |
| class | CMobius |
| CMobius class, Mobius transformation. More... | |
| class | CToken |
| CToken class, key=(value), e.g. uv=(x y). More... | |
| class | CParser |
| CParser class. More... | |
| class | CArcball |
| CArcball Interface. More... | |
| class | CViewerFace |
| CViewerFace class. More... | |
| class | CViewerVertex |
| CViewerVertex class. More... | |
| class | CViewerMesh |
| CViewerMesh class. More... | |
Typedefs | |
| typedef std::complex< double > | Complex |
| typedef CViewerMesh < CViewerVertex, CEdge, CViewerFace, CHalfEdge > | CVMesh |
Functions | |
| CCircle | orthogonal (CCircle C[3]) |
| int | _circle_circle_intersection (CCircle C0, CCircle C1, CPoint2 &p0, CPoint2 &p1) |
| void | operator>> (const std::string &str, CPoint &p) |
| CPoint2 | operator+ (CPoint2 &uv0, CPoint2 &uv1) |
| CPoint2 | operator- (CPoint2 &uv0, CPoint2 &uv1) |
| CPoint2 | operator* (CPoint2 &uv0, const double s) |
| CPoint2 | operator/ (CPoint2 &uv0, const double s) |
| CPoint2 | operator+ (const CPoint2 &uv0, const CPoint2 &uv1) |
| CPoint2 | operator- (const CPoint2 &uv0, const CPoint2 &uv1) |
| CPoint2 | operator* (const CPoint2 &uv0, const double s) |
| CPoint2 | operator/ (const CPoint2 &uv0, const double s) |
| double | mag2 (CPoint2 &uv) |
| double | mag (CPoint2 &uv) |
| double | cross (CPoint2 uv1, CPoint2 uv2) |
| double | operator* (CPoint2 a, CPoint2 b) |
| double | operator^ (CPoint2 uv1, CPoint2 uv2) |
| void | operator>> (const std::string &str, CPoint2 &c) |
| double | _inner_product (double *v1, double *v2, int num) |
| void | _scale (double *v, double s, int num) |
| double | norm (double *v, int num) |
| void | _normalize (double *v, int num) |
| typedef std::complex<double> MeshLib::Complex |
| typedef CViewerMesh<CViewerVertex, CEdge, CViewerFace, CHalfEdge> MeshLib::CVMesh |
Definition at line 114 of file ViewerMesh.h.
| int MeshLib::_circle_circle_intersection | ( | CCircle | C0, | |
| CCircle | C1, | |||
| CPoint2 & | p0, | |||
| CPoint2 & | p1 | |||
| ) | [inline] |
Definition at line 113 of file Circle.h.
{
double x0 = C0.c()[0];
double y0 = C0.c()[1];
double r0 = C0.r();
double x1 = C1.c()[0];
double y1 = C1.c()[1];
double r1 = C1.r();
double a, dx, dy, d, h, rx, ry;
double x2, y2;
/* dx and dy are the vertical and horizontal distances between
* the circle centers.
*/
dx = x1 - x0;
dy = y1 - y0;
/* Determine the straight-line distance between the centers. */
d = sqrt((dy*dy) + (dx*dx));
/* Check for solvability. */
if (d > (r0 + r1))
{
/* no solution. circles do not intersect. */
return 0;
}
if (d < abs(r0 - r1))
{
/* no solution. one circle is contained in the other */
return 0;
}
/* 'point 2' is the point where the line through the circle
* intersection points crosses the line between the circle
* centers.
*/
/* Determine the distance from point 0 to point 2. */
a = ((r0*r0) - (r1*r1) + (d*d)) / (2.0 * d) ;
/* Determine the coordinates of point 2. */
x2 = x0 + (dx * a/d);
y2 = y0 + (dy * a/d);
/* Determine the distance from point 2 to either of the
* intersection points.
*/
h = sqrt((r0*r0) - (a*a));
/* Now determine the offsets of the intersection points from
* point 2.
*/
rx = -dy * (h/d);
ry = dx * (h/d);
/* Determine the absolute intersection points. */
p0 = CPoint2( x2 + rx, y2+ry);
p1 = CPoint2( x2 - rx, y2-ry);
return 1;
};

| double MeshLib::_inner_product | ( | double * | v1, | |
| double * | v2, | |||
| int | num | |||
| ) |
Definition at line 12 of file densematrix.h.
{
double sum = 0;
for( int i = 0; i < num; i ++ )
{
sum += v1[i] * v2[i];
}
return sum;
};

| void MeshLib::_normalize | ( | double * | v, | |
| int | num | |||
| ) |
Definition at line 36 of file densematrix.h.


| void MeshLib::_scale | ( | double * | v, | |
| double | s, | |||
| int | num | |||
| ) |
Definition at line 22 of file densematrix.h.
{
for( int i = 0; i < num; i ++ )
{
v[i] *= s;
}
};
| double MeshLib::cross | ( | CPoint2 | uv1, | |
| CPoint2 | uv2 | |||
| ) | [inline] |
| double MeshLib::mag | ( | CPoint2 & | uv | ) | [inline] |
| double MeshLib::mag2 | ( | CPoint2 & | uv | ) | [inline] |
| double MeshLib::norm | ( | double * | v, | |
| int | num | |||
| ) |
Definition at line 30 of file densematrix.h.
{
double inner_product = _inner_product( v,v, num );
return sqrt( inner_product );
};


| CPoint2 MeshLib::operator* | ( | const CPoint2 & | uv0, | |
| const double | s | |||
| ) | [inline] |
| CPoint2 MeshLib::operator* | ( | CPoint2 & | uv0, | |
| const double | s | |||
| ) | [inline] |
| double MeshLib::operator* | ( | CPoint2 | a, | |
| CPoint2 | b | |||
| ) | [inline] |
| CPoint2 MeshLib::operator+ | ( | const CPoint2 & | uv0, | |
| const CPoint2 & | uv1 | |||
| ) | [inline] |
| CPoint2 MeshLib::operator+ | ( | CPoint2 & | uv0, | |
| CPoint2 & | uv1 | |||
| ) | [inline] |
| CPoint2 MeshLib::operator- | ( | const CPoint2 & | uv0, | |
| const CPoint2 & | uv1 | |||
| ) | [inline] |
| CPoint2 MeshLib::operator- | ( | CPoint2 & | uv0, | |
| CPoint2 & | uv1 | |||
| ) | [inline] |
| CPoint2 MeshLib::operator/ | ( | const CPoint2 & | uv0, | |
| const double | s | |||
| ) | [inline] |
| CPoint2 MeshLib::operator/ | ( | CPoint2 & | uv0, | |
| const double | s | |||
| ) | [inline] |
| void MeshLib::operator>> | ( | const std::string & | str, | |
| CPoint2 & | c | |||
| ) | [inline] |
read in a CPoint2 from a string
| str | input string | |
| c | the reference to a point |
Definition at line 251 of file Point2.H.
{
std::string t = str;
t.erase(0, t.find_first_not_of("()") );
t.erase(t.find_last_not_of("()") + 1);
std::istringstream iss( t );
iss >> c[0] >> c[1];
}
| void MeshLib::operator>> | ( | const std::string & | str, | |
| CPoint & | p | |||
| ) | [inline] |
Read a CPoint from a string
| str | string | |
| p | three dimenionsal point |
Definition at line 189 of file Point.h.
{
std::string t = str;
t.erase(0, t.find_first_not_of("()") );
t.erase(t.find_last_not_of("()") + 1);
std::istringstream iss( t );
iss >> p[0] >> p[1] >> p[2];
}
| double MeshLib::operator^ | ( | CPoint2 | uv1, | |
| CPoint2 | uv2 | |||
| ) | [inline] |
| CCircle MeshLib::orthogonal | ( | CCircle | C[3] | ) | [inline] |
Computing a circle orthogonal to three other circles
Definition at line 62 of file Circle.h.
{
//The cricle C_i is : <p,p> - 2<p,c_i> = d_i
double d[3];
for( int i = 0; i < 3; i ++ )
{
d[i] = C[i].r()*C[i].r() - mag2( C[i].c());
}
//the common chord lines are <p,dc_k> = h_k
CPoint2 dc[2];
dc[0] = C[1].c() - C[0].c();
dc[1] = C[2].c() - C[1].c();
double h[2];
h[0] = ( d[0] - d[1] )/2.0;
h[1] = ( d[1] - d[2] )/2.0;
double m[2][2];
for( int i = 0; i < 2; i ++ )
for( int j = 0; j < 2; j ++ )
{
m[i][j] = dc[i]*dc[j];
}
double det = m[0][0] * m[1][1] - m[1][0] * m[0][1];
double inv[2][2];
inv[0][0] = m[1][1]/det;
inv[1][1] = m[0][0]/det;
inv[0][1] = -m[0][1]/det;
inv[1][0] = -m[1][0]/det;
double x[2];
x[0] = inv[0][0] * h[0] + inv[0][1] * h[1];
x[1] = inv[1][0] * h[0] + inv[1][1] * h[1];
CPoint2 center = dc[0] * x[0] + dc[1] * x[1];
double radius = sqrt( mag2(center-C[0].c()) - C[0].r()*C[0].r() );
//printf("%f %f %f\n", radius, sqrt( mag2(center-C[1].c()) - C[1].r()*C[1].r() ), sqrt( mag2(center-C[2].c()) - C[2].r()*C[2].r() ) );
return CCircle( center, radius );
};

1.7.1