/usr/include/gmsh/GPoint.h is in libgmsh-dev 2.8.5+dfsg-1.1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | // Gmsh - Copyright (C) 1997-2014 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@geuz.org>.
#ifndef _GPOINT_H_
#define _GPOINT_H_
#include <math.h>
class GEntity;
class GPoint
{
private:
double X, Y, Z;
const GEntity *e;
double par[2];
bool success;
public:
inline double x() const { return X; }
inline double y() const { return Y; }
inline double z() const { return Z; }
inline double &x() { return X; }
inline double &y() { return Y; }
inline double &z() { return Z; }
inline double u() const { return par[0]; }
inline double v() const { return par[1]; }
inline const GEntity* g() const { return e; }
GPoint (double _x=0, double _y=0, double _z=0, const GEntity *onwhat=0)
: X(_x), Y(_y), Z(_z), e(onwhat), success(true)
{
par[0] = -1.;
par[1] = -1.;
}
GPoint (double _x, double _y, double _z, const GEntity *onwhat, double p)
: X(_x), Y(_y), Z(_z), e(onwhat), success(true)
{
par[0] = p;
par[1] = -1.;
}
GPoint (double _x, double _y, double _z, const GEntity *onwhat, double p[2])
: X(_x), Y(_y), Z(_z), e(onwhat), success(true)
{
par[0] = p[0];
par[1] = p[1];
}
double distance(GPoint &p)
{
double dx = X - p.x();
double dy = Y - p.y();
double dz = Z - p.z();
return sqrt(dx * dx + dy * dy + dz * dz);
}
bool succeeded() const{ return success; }
bool setNoSuccess(){ success = false; return success; }
};
#endif
|