simplemap.h
Go to the documentation of this file.
00001 #ifndef MAPAC_H
00002 #define MAPAC_H
00003 
00004 #include <iostream>
00005 #include <vector>
00006 #include <string>
00007 
00008 namespace RayTracer {
00009         
00010         using namespace std;
00011         
00012         struct Material {
00013                 string name;
00014                 
00015                 /* 0: transparent; 1: solid; in between: randomly */
00016                 double infrared_solid;
00017         };
00018         
00019         struct Stuff {
00020                 int group;
00021                 
00022                 Material * material;
00023                 
00025                 virtual bool ray_tracing(const double p[2], const double direction, double& out_distance, double &out_alpha) const = 0;         
00026                 virtual ~Stuff(){};
00027         };
00028         
00029         struct Segment: public Stuff {
00030                 double p0[2], p1[2];
00031                 
00032                 Segment() {}
00033                 virtual ~Segment(){};
00034                 
00035                 Segment(double x0,double y0,double x1,double y1) {
00036                         p0[0] = x0; p0[1] = y0;
00037                         p1[0] = x1; p1[1] = y1;
00038                 }
00039                 
00040                 
00041                 bool ray_tracing(const double p[2], const double direction, double& out_distance, double &out_alpha) const;
00042         };
00043 
00044         struct Circle: public Stuff {
00045                 virtual ~Circle(){};
00046                 
00047                 double p[2], radius;
00048                 
00049                 bool ray_tracing(const double p[2], const double direction,  double& out_distance, double &out_alpha) const;
00050         };
00051         
00052         struct Environment  {
00053                 std::vector<Stuff*> stuff;
00054 
00055                 bool ray_tracing(const double p[2], const double direction,  double& out_distance, double &out_alpha, int*stuff_id) const ;
00056                                 
00057         };
00058         
00059 
00060         
00061 }
00062 
00063 #endif


csm
Author(s): Andrea Censi
autogenerated on Mon Jan 16 2017 03:48:29