22 #ifndef EULERIANPOINT_HPP
23 #define EULERIANPOINT_HPP
25 #include <LbmLib/include/Field.hpp>
72 virtual std::string
getType()
const = 0;
88 template <
typename Po
int1,
typename Po
int2>
89 double getSquaredDistance(
93 (pt1.getXPos() - pt2.getXPos()) * (pt1.getXPos() - pt2.getXPos()) +
94 (pt1.getYPos() - pt2.getYPos()) * (pt1.getYPos() - pt2.getYPos())
104 template <
typename Po
int1,
typename Po
int2>
108 return std::sqrt(getSquaredDistance(pt1, pt2));
117 template <
typename Po
int1,
typename Po
int2>
118 Field<double> getDistanceField(
121 return Field<double>(pt2.getXPos() - pt1.getXPos(),
122 pt2.getYPos() - pt1.getYPos());
132 std::ostream& operator<<(
134 const EulerianPoint* pt);
144 template <
typename Pt1,
typename Pt2,
typename Pt3,
typename Pt4>
145 bool isPointInTriangle(
152 ((pt2.getYPos() - pt3.getYPos()) * (pt4.getXPos() - pt3.getXPos()) +
154 pt2.getXPos()) * (pt4.getYPos() - pt3.getYPos())) /
155 ((pt2.getYPos() - pt3.getYPos()) * (pt1.getXPos() - pt3.getXPos()) +
156 (pt3.getXPos() - pt2.getXPos()) * (pt1.getYPos() - pt3.getYPos()));
158 ((pt3.getYPos() - pt1.getYPos()) * (pt4.getXPos() - pt3.getXPos()) +
160 pt3.getXPos()) * (pt4.getYPos() - pt3.getYPos())) /
161 ((pt2.getYPos() - pt3.getYPos()) * (pt1.getXPos() - pt3.getXPos()) +
162 (pt3.getXPos() - pt2.getXPos()) * (pt1.getYPos() - pt3.getYPos()));
163 double lambda3 = 1 - lambda1 - lambda2;
165 if ((lambda1 <= 0) || (lambda2 <= 0) || (lambda3 <= 0) || (lambda1 >= 1) ||
166 (lambda2 >= 1) || (lambda3 >= 1) ) {
173 #endif // EULERIANPOINT_HPP
The EulerianPoint class The base class for all points with an integer position and no speed...
EulerianPoint(int x, int y)
EulerianPoint Constructs a new EulerianPoint.
virtual std::string getType() const =0
getType The type of a node class
int getXPos() const
getXPos Getter for the X position
Field< int > getPos() const
getPos Getter for the pos
virtual ~EulerianPoint()
~Point vitual Destructor
int getYPos() const
getYPos Getter for the Y position