RobinTrace
lpart.h
Go to the documentation of this file.
1 
2 #ifndef LPART_H
3 #define LPART_H
4 
5 #include "bun/bun.h"
6 #include "memory"
7 #include <string>
8 #include <sstream>
9 
12 class lpart {
13  public:
15  virtual std::unique_ptr<lpart> clone () const = 0;
21  virtual void apply (bun &b) = 0;
26  virtual void intersect (bun &b) = 0;
28  virtual bool is_transfer () = 0;
30  virtual bool is_renderable () = 0;
31 
32  private:
34  virtual std::string print_str () const = 0;
35 
37  friend std::ostream& operator<< (std::ostream &out, const lpart &lp) {
38  out << lp.print_str();
39  return out;
40  };
41 };
42 
43 #endif // LPART_H
Class for ray bundles.
Definition: bun.h:13
Virtual class for elementary optical parts which can be applied to ray bundles.
Definition: lpart.h:12
friend std::ostream & operator<<(std::ostream &out, const lpart &lp)
Printer.
Definition: lpart.h:37
virtual std::string print_str() const =0
String for printing the object.
virtual void intersect(bun &b)=0
Apply only the eventual intersection of the lpart with ray bundle b.
virtual void apply(bun &b)=0
Apply the lpart's operations to the ray bundle b.
virtual bool is_renderable()=0
Is the part renderable?
virtual std::unique_ptr< lpart > clone() const =0
Obtain a copy of the lpart.
virtual bool is_transfer()=0
Is the part a transfer?