Misc. source comment typos
This commit is contained in:
@@ -52,7 +52,7 @@ namespace geoff_geometry {
|
||||
#endif
|
||||
void Matrix::Unit()
|
||||
{
|
||||
// homogenous matrix - set as unit matrix
|
||||
// homogeneous matrix - set as unit matrix
|
||||
memset(e, 0, sizeof(e));
|
||||
e[0] = e[5] = e[10] = e[15] = 1;
|
||||
m_unit = true;
|
||||
@@ -109,12 +109,12 @@ namespace geoff_geometry {
|
||||
|
||||
|
||||
void Matrix::Rotate(double angle, int Axis)
|
||||
{ // Rotation (Axis 1 = x , 2 = y , 3 = z
|
||||
{ // Rotation (Axis 1 = x , 2 = y , 3 = z
|
||||
Rotate(sin(angle), cos(angle), Axis);
|
||||
}
|
||||
|
||||
void Matrix::Rotate(double sinang, double cosang, int Axis)
|
||||
{ // Rotation (Axis 1 = x , 2 = y , 3 = z
|
||||
{ // Rotation (Axis 1 = x , 2 = y , 3 = z
|
||||
Matrix rotate;
|
||||
rotate.Unit();
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace geoff_geometry {
|
||||
l = i - (k = (i % 4));
|
||||
ret.e[i] = m.e[l] * e[k] + m.e[l+1] * e[k+4] + m.e[l+2] * e[k+8] + m.e[l+3] * e[k+12];
|
||||
}
|
||||
|
||||
|
||||
*this = ret;
|
||||
this->IsUnit();
|
||||
}
|
||||
@@ -597,19 +597,19 @@ namespace geoff_geometry {
|
||||
|
||||
void Plane::Mirrored(Matrix* tmMirrored) {
|
||||
// calculates a mirror transformation that mirrors 2d about plane
|
||||
|
||||
|
||||
//Point3d p1 = this->Near(Point3d(0.,0.,0.));
|
||||
if(tmMirrored->m_unit == false) tmMirrored->Unit();
|
||||
|
||||
double nx = this->normal.getx();
|
||||
double ny = this->normal.gety();
|
||||
double nz = this->normal.getz();
|
||||
|
||||
|
||||
// the translation
|
||||
tmMirrored->e[ 3] = -2. * nx * this->d;
|
||||
tmMirrored->e[ 7] = -2. * ny * this->d;
|
||||
tmMirrored->e[11] = -2. * nz * this->d;
|
||||
|
||||
|
||||
// the rest
|
||||
tmMirrored->e[ 0] = 1. - 2. * nx * nx;
|
||||
tmMirrored->e[ 5] = 1. - 2. * ny * ny;
|
||||
@@ -617,7 +617,7 @@ namespace geoff_geometry {
|
||||
tmMirrored->e[ 1] = tmMirrored->e[ 4] = -2. * nx * ny;
|
||||
tmMirrored->e[ 2] = tmMirrored->e[ 8] = -2. * nz * nx;
|
||||
tmMirrored->e[ 6] = tmMirrored->e[ 9] = -2. * ny * nz;
|
||||
|
||||
|
||||
tmMirrored->m_unit = false;
|
||||
tmMirrored->m_mirrored = true;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
MES_INVALIDPLANE
|
||||
};
|
||||
|
||||
// homogenous 4 x 4 Matrix class
|
||||
// homogeneous 4 x 4 Matrix class
|
||||
class Matrix{
|
||||
protected:
|
||||
public:
|
||||
@@ -205,7 +205,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
friend wostream& operator << (wostream& op, Point& p);
|
||||
|
||||
public:
|
||||
bool ok; // true if this point is defined correctly
|
||||
bool ok; // true if this point is defined correctly
|
||||
double x; // x value
|
||||
double y; // y value
|
||||
|
||||
@@ -247,7 +247,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
class Point3d {
|
||||
friend wostream& operator <<(wostream& op, Point3d& p);
|
||||
public:
|
||||
// bool ok; // true if this point is defined correctly
|
||||
// bool ok; // true if this point is defined correctly
|
||||
double x; // x value
|
||||
double y; // y value
|
||||
double z; // z value
|
||||
@@ -292,7 +292,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
class Vector2d{
|
||||
friend wostream& operator <<(wostream& op, Vector2d& v);
|
||||
private:
|
||||
double dx, dy;
|
||||
double dx, dy;
|
||||
public:
|
||||
|
||||
// constructors
|
||||
@@ -346,7 +346,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
double temp = -dy * sina + dx * cosa;
|
||||
dy = dx * sina + cosa * dy;
|
||||
dx = temp;
|
||||
}
|
||||
}
|
||||
inline void Rotate(double angle) { if(FEQZ(angle) == true) return; Rotate(cos(angle), sin(angle));}
|
||||
void Transform( const Matrix& m); // transform vector
|
||||
|
||||
@@ -398,7 +398,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
return Vector3d(dy * v.dz - dz * v.dy, dz * v.dx - dx * v.dz, dx * v.dy - dy * v.dx);} // cross product vector
|
||||
|
||||
// = the vector perp to the plane of the 2 vectors
|
||||
// the z component magnitude is m0.m1.sin a
|
||||
// the z component magnitude is m0.m1.sin a
|
||||
// methods
|
||||
inline void get(double xyz[3])const {xyz[0] = dx; xyz[1] = dy; xyz[2] = dz;} // return to array
|
||||
inline double getx()const{return dx;}
|
||||
@@ -442,7 +442,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
inline CLine(const Point& p0, const Vector2d& v0, bool normalise = true) {p = p0; v = v0; if(normalise) Normalise();};
|
||||
inline CLine(const CLine& s) {p = s.p; v = s.v; ok = s.ok;} // copy constructor CLine s1(s2);
|
||||
inline CLine(const Point& p0, const Point& p1) {p = p0; v = Vector2d(p0, p1); Normalise();};
|
||||
CLine(const Span& sp);
|
||||
CLine(const Span& sp);
|
||||
|
||||
// operators
|
||||
const CLine operator~(void);// perp to left
|
||||
@@ -457,8 +457,8 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
#endif
|
||||
CLine Transform(Matrix& m); // transform a CLine
|
||||
Point Intof(const CLine& s); // intersection of 2 clines
|
||||
Point Intof(int NF, const Circle& c); // intersection of cline & circle
|
||||
Point Intof(int NF, const Circle& c, Point& otherInters); double Dist(const Point& p1)const; // ditto & other intersection
|
||||
Point Intof(int NF, const Circle& c); // intersection of cline & circle
|
||||
Point Intof(int NF, const Circle& c, Point& otherInters); double Dist(const Point& p1)const; // ditto & other intersection
|
||||
CLine Bisector(const CLine& s); // Bisector of 2 Clines
|
||||
|
||||
// destructor
|
||||
@@ -468,7 +468,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
#define HORIZ_CLINE CLine(geoff_geometry::Point(0,0), 1.0, 0.0, true)
|
||||
|
||||
|
||||
// 2D circle
|
||||
// 2D circle
|
||||
class Circle{
|
||||
friend wostream& operator <<(wostream& op, Circle& c);
|
||||
public:
|
||||
@@ -595,7 +595,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
|
||||
// operators
|
||||
// bool operator==(const Span &sp)const;
|
||||
// bool operator!=(const Span &sp)const { return !(*this == sp);}
|
||||
// bool operator!=(const Span &sp)const { return !(*this == sp);}
|
||||
};
|
||||
|
||||
// general
|
||||
@@ -697,11 +697,11 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
|
||||
// methods
|
||||
double Dist(const Point3d& p)const; // signed distance of point to plane
|
||||
bool Intof(const Line& l, Point3d& intof, double& t)const; // intersection of plane & line (0 >= t <= 1 if intersect within line)
|
||||
bool Intof(const Line& l, Point3d& intof, double& t)const; // intersection of plane & line (0 >= t <= 1 if intersect within line)
|
||||
bool Intof(const Plane& pl, Line& intof)const; // intersection of 2 planes
|
||||
bool Intof(const Plane& pl0, const Plane& pl1, Point3d& intof)const; // intersection of 3 planes
|
||||
Point3d Near(const Point3d& p)const; // returns near point to p on the plane
|
||||
void Mirrored(Matrix* m); // returns a matrix for a mirror about this
|
||||
void Mirrored(Matrix* m); // returns a matrix for a mirror about this
|
||||
};
|
||||
|
||||
|
||||
@@ -748,7 +748,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
public:
|
||||
int type[SPANSTORAGE]; // LINEAR CW or ACW // 0 straight (cw = -1 (T) acw = 1 (A) )
|
||||
int spanid[SPANSTORAGE]; // identification (eg wire offset span info)
|
||||
const SpanDataObject* index[SPANSTORAGE]; // other - pointer to
|
||||
const SpanDataObject* index[SPANSTORAGE]; // other - pointer to
|
||||
double x[SPANSTORAGE], y[SPANSTORAGE]; // vertex
|
||||
double xc[SPANSTORAGE], yc[SPANSTORAGE]; // centre of arc
|
||||
public:
|
||||
@@ -777,14 +777,14 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
class Kurve : public Matrix{
|
||||
friend wofstream& operator << (wofstream& op, Kurve& k);
|
||||
friend wifstream& operator >> (wifstream& op, Kurve& k);
|
||||
|
||||
|
||||
protected:
|
||||
vector<SpanVertex*> m_spans;
|
||||
bool m_started;
|
||||
int m_nVertices; // number of vertices in Kurve
|
||||
bool m_isReversed; // true if get spans reversed
|
||||
|
||||
public:
|
||||
public:
|
||||
// for comparing kurves
|
||||
struct spanCompare {
|
||||
int dir; // LINEAR, CW or ACW
|
||||
@@ -821,7 +821,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
bool Add(const Span& sp, bool AddNullSpans = true); // add a span
|
||||
bool Add(int type, const Point& p0, const Point& pc, bool AddNullSpans = true); // a span
|
||||
void AddSpanID(int ID);
|
||||
bool Add(const Point& p0, bool AddNullSpans = true); // linear
|
||||
bool Add(const Point& p0, bool AddNullSpans = true); // linear
|
||||
void Add(); // add a null span
|
||||
void Add(const Kurve* k, bool AddNullSpans = true); // a kurve
|
||||
void StoreAllSpans(std::vector<Span>& kSpans)const; // store all kurve spans in array, normally when fast access is reqd
|
||||
@@ -832,7 +832,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) >
|
||||
int GetSpanID(int spanVertexNumber) const; // for spanID (wire offset)
|
||||
int Get(int spanVertexNumber, Point& p, Point& pc) const;
|
||||
void Get(std::vector<Span> *all, bool ignoreNullSpans) const; // get all spans to vector
|
||||
int Get(int spanVertexNumber, Point3d& p, Point3d& pc) const
|
||||
int Get(int spanVertexNumber, Point3d& p, Point3d& pc) const
|
||||
{ Point p2d, pc2d; int d = Get(spanVertexNumber, p2d, pc2d); p = p2d; pc = pc2d; return d;}
|
||||
int Get(int spannumber, Span& sp, bool returnSpanProperties = false, bool transform = false) const;
|
||||
// int Get(int spannumber, Span3d& sp, bool returnSpanProperties = false, bool transform = false) const;
|
||||
@@ -994,7 +994,3 @@ public:
|
||||
|
||||
|
||||
} // End namespace geoff_geometry
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user