simplemap.h
Go to the documentation of this file.
1 #ifndef MAPAC_H
2 #define MAPAC_H
3 
4 #include <iostream>
5 #include <vector>
6 #include <string>
7 
8 namespace RayTracer {
9 
10  using namespace std;
11 
12  struct Material {
13  string name;
14 
15  /* 0: transparent; 1: solid; in between: randomly */
17  };
18 
19  struct Stuff {
20  int group;
21 
23 
25  virtual bool ray_tracing(const double p[2], const double direction, double& out_distance, double &out_alpha) const = 0;
26  virtual ~Stuff(){};
27  };
28 
29  struct Segment: public Stuff {
30  double p0[2], p1[2];
31 
32  Segment() {}
33  virtual ~Segment(){};
34 
35  Segment(double x0,double y0,double x1,double y1) {
36  p0[0] = x0; p0[1] = y0;
37  p1[0] = x1; p1[1] = y1;
38  }
39 
40 
41  bool ray_tracing(const double p[2], const double direction, double& out_distance, double &out_alpha) const;
42  };
43 
44  struct Circle: public Stuff {
45  virtual ~Circle(){};
46 
47  double p[2], radius;
48 
49  bool ray_tracing(const double p[2], const double direction, double& out_distance, double &out_alpha) const;
50  };
51 
52  struct Environment {
53  std::vector<Stuff*> stuff;
54 
55  bool ray_tracing(const double p[2], const double direction, double& out_distance, double &out_alpha, int*stuff_id) const ;
56 
57  };
58 
59 
60 
61 }
62 
63 #endif
std::vector< Stuff * > stuff
Definition: simplemap.h:53
virtual ~Stuff()
Definition: simplemap.h:26
virtual ~Segment()
Definition: simplemap.h:33
Segment(double x0, double y0, double x1, double y1)
Definition: simplemap.h:35
virtual ~Circle()
Definition: simplemap.h:45
double infrared_solid
Definition: simplemap.h:16
struct @0 p
Material * material
Definition: simplemap.h:22


csm
Author(s): Andrea Censi
autogenerated on Tue May 11 2021 02:18:23