27 template<
typename Stream>
28 void loadFile(Stream &gStream,
const std::string &fileName) {
29 gStream.open(fileName.c_str(), std::ios::binary);
30 if (not gStream.is_open()) {
32 ss <<
"Could not open file \"" << fileName <<
"\".";
33 throw std::runtime_error(ss.str());
74 double area = triangle.
area();
75 return area * ((bar(0) * func(vecs[0].getX(), vecs[0].getY())) +
76 (bar(1) * func(vecs[1].getX(), vecs[1].getY())) +
77 (bar(2) * func(vecs[2].getX(), vecs[2].getY())));
virtual std::vector< Vec > resolvePoints(std::vector< vertInd > vertInds)=0
Resolves vector of vertex indices to vector of vertex pointers.
Class representing a polygon with 3 points and its member functions.
Definition: Triangle.hpp:17
double x
x coordinate of the circumcentre
Definition: Triangle.hpp:26
const circumcircle & getCc() const
Accessor for private member cc.
Definition: Triangle.cpp:175
Eigen::Vector3d barycentric(const Eigen::Vector2d &p) const
Get the barycentric coordinates of a point in relation to the triangle.
Definition: Triangle.cpp:153
double area() const
Calculate the area of the triangle in 2d (x & y coords)
Definition: Triangle.cpp:216
const std::vector< int > & getVertices() const
Accessor for private member vertices.
Definition: Triangle.cpp:25
IMesh * getOwner() const
Accessor for private member owner.
Definition: Triangle.cpp:224
double y
y coordinate of the circumcentre
Definition: Triangle.hpp:30
Namespace of utility functions.
Definition: utils.cpp:10
int lineLength(const std::string &line)
Find number of parameters in file import lines.
Definition: utils.cpp:11
double linearInterpolationApprox(T func, const Triangle &triangle)
Approximates integral of func over triangle using linear interpolation approximation.
Definition: utils.hpp:71
double constantValueApprox(T func, const Triangle &triangle)
Approximates integral of func over triangle using constant value approximation.
Definition: utils.hpp:51
void loadFile(Stream &gStream, const std::string &fileName)
Opens a stream with the specified file and verifies it has been opened correctly.
Definition: utils.hpp:28