forked from UVMCS120BS2020/AB-LF-Project3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rectilinear_Lens.h
49 lines (41 loc) · 1.53 KB
/
Rectilinear_Lens.h
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
//
// Created by Luke on 1/20/2020.
//
#ifndef LF_PROJECT1_LENS_H
#define LF_PROJECT1_LENS_H
#include <iostream>
#include <iomanip>
#include <experimental/optional>
#include "Lens.h"
using std::experimental::optional;
using std::experimental::nullopt;
using std::experimental::make_optional;
using namespace std;
class Rectilinear_Lens : public Lens {
typedef optional<string> opt_string;
public:
// Default Constructor
// Requires: Nothing
// Modifies: f_stop, focal_length, name
// Effects: Sets field(s) to default values
Rectilinear_Lens();
// Constructor
// Requires: Non-negative, non-zero double, and string optional
// Modifies: f_stop, focal_length, name
// Effects: Sets field(s) to the specified values
Rectilinear_Lens(double focal_length_, double f_stop_, opt_string &name_);
// Destructor
// Requires: Nothing
// Modifies: Nothing
// Effects: Deletes object and deallocates it from memory.
~Rectilinear_Lens() override = default;
// Requires: Non-negative double magnification, non-negative double frame_width
// Modifies: Nothing
// Effects: Calculates field of view for the lens using frame dimensions, focal length, and object distance (focus distance)
double field_of_view_horizontal(double magnification, double frame_width) const override;
// Requires: ostream, Lens
// Modifies: Nothing
// Effects: Prints the specifications of the lens.
friend ostream& operator << (ostream& outs, const Rectilinear_Lens &lens);
};
#endif //LF_PROJECT1_LENS_H