DelaunayTriangulation
A C++ Object Oriented data structure with algorithms that could be used to generate a Delaunay triangulation
Vec.hpp
Go to the documentation of this file.
1//
2// Created by mitt on 01/12/2019.
3//
4
5#pragma once
6#include <iostream>
7#include <fstream>
17class Vec {
18private:
19 double x;
20 double y;
21 double z;
23public:
27 Vec() : x(0), y(0), z(0), dimensions(3) {};
32 explicit Vec(int dim) : x(0), y(0), z(0), dimensions(dim) {};
40 Vec(float x, float y, float z, int dim) : x(x), y(y), z(z), dimensions(dim) {};
45 double getX() const;
50 double getY() const;
55 double getZ() const;
60 int getDimensions() const;
66 bool operator==(const Vec &rhs) const;
72 bool operator!=(const Vec &rhs) const;
79 friend std::istream &operator>>(std::istream &is, Vec &vec);
86 friend std::ofstream &operator<<(std::ofstream &os, Vec &vec);
93 friend std::ostream &operator<<(std::ostream &os, Vec &vec);
94
95};
Class representing coordinates of a Vector.
Definition: Vec.hpp:17
double z
z coordinate
Definition: Vec.hpp:21
friend std::istream & operator>>(std::istream &is, Vec &vec)
Input stream operator.
Definition: Vec.cpp:34
Vec(float x, float y, float z, int dim)
Constructor populating all members.
Definition: Vec.hpp:40
friend std::ofstream & operator<<(std::ofstream &os, Vec &vec)
Output filestream operator.
Definition: Vec.cpp:51
bool operator==(const Vec &rhs) const
Equality operator.
Definition: Vec.cpp:20
int getDimensions() const
Accessor to private member dimensions.
Definition: Vec.cpp:30
double x
x coordinate
Definition: Vec.hpp:19
double getY() const
Accessor to private member y.
Definition: Vec.cpp:12
double y
y coordinate
Definition: Vec.hpp:20
bool operator!=(const Vec &rhs) const
Non-equality operator.
Definition: Vec.cpp:26
Vec(int dim)
Contstructor populating dimensions.
Definition: Vec.hpp:32
double getX() const
Accessor to private member x.
Definition: Vec.cpp:8
int dimensions
number of dimensions in mesh
Definition: Vec.hpp:22
Vec()
Default constructor.
Definition: Vec.hpp:27
double getZ() const
Accessor to private member z.
Definition: Vec.cpp:16