2
/***************************************************************************
5
created : Mon Nov 22 0:10:00 CET 2004
6
copyright : (C) 2004 by Christos Dimitrakakis
7
email : dimitrak@idiap.ch
8
version : $Id: geometry.h,v 1.6 2005/04/10 23:37:01 olethros Exp $
10
***************************************************************************/
12
/***************************************************************************
14
* This program is free software; you can redistribute it and/or modify *
15
* it under the terms of the GNU General Public License as published by *
16
* the Free Software Foundation; either version 2 of the License, or *
17
* (at your option) any later version. *
19
***************************************************************************/
29
enum BoundsCheckingStatus {NO_CHECK_BOUNDS=0, CHECK_BOUNDS=1};
32
Vector (int N_, enum BoundsCheckingStatus check = NO_CHECK_BOUNDS);
33
Vector (const Vector& rhs);
35
Vector& operator= (const Vector& rhs);
37
float& operator[] (int index); ///< return element for read-write
38
const float& operator[] (int index) const; ///< return element for read
39
int Size() { return n;}
42
enum BoundsCheckingStatus checking_bounds;
46
float DotProd(Vector* A, Vector* B);
47
void Sub (Vector* A, Vector* B, Vector* R);
49
/// Represent a line as an origin vector and a direction vector.
53
Vector* Q; // direction
55
ParametricLine (Vector* A, Vector* B);
57
void PointCoords (float t, Vector* X);
60
class ParametricSphere
65
ParametricSphere(Vector* C, float r);
66
ParametricSphere(int N);
71
Vector* GetNormalToLine(Vector* R);
72
float IntersectLineLine(ParametricLine* A, ParametricLine* B);
73
float CalculateRadiusPoints (std::vector<Vector> P);
74
Vector* IntersectSphereLine(ParametricLine* line, Vector* C, float r);
76
void EstimateSphere (std::vector<Vector> P, ParametricSphere* sphere);