Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
primitives.h
1 /*
2  Lightmetrica : A research-oriented renderer
3 
4  Copyright (c) 2014 Hisanari Otsu
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 #ifndef LIB_LIGHTMETRICA_PRIMITIVES_H
22 #define LIB_LIGHTMETRICA_PRIMITIVES_H
23 
24 #include "component.h"
25 #include "math.types.h"
26 #include "aabb.h"
27 
28 LM_NAMESPACE_BEGIN
29 
30 class Assets;
31 class ConfigNode;
32 struct Primitive;
33 struct Ray;
34 struct Intersection;
35 class Camera;
36 class Light;
37 class Scene;
38 
43 class Primitives : public Component
44 {
45 public:
46 
47  LM_COMPONENT_INTERFACE_DEF("primitives");
48 
49 public:
50 
51  Primitives() {}
52  virtual ~Primitives() {}
53 
54 private:
55 
56  LM_DISABLE_COPY_AND_MOVE(Primitives);
57 
58 public:
59 
69  virtual bool Load(const ConfigNode& node, const Assets& assets) = 0;
70 
77  virtual bool PostConfigure(const Scene& scene) = 0;
78 
87  virtual bool IntersectEmitterShapes(Ray& ray, Intersection& isect) const = 0;
88 
91  virtual AABB GetAABBEmitterShapes() const = 0;
92 
97  virtual void Reset() = 0;
98 
103  virtual int NumPrimitives() const = 0;
104 
110  virtual const Primitive* PrimitiveByIndex(int index) const = 0;
111 
118  virtual const Primitive* PrimitiveByID(const std::string& id) const = 0;
119 
124  virtual const Camera* MainCamera() const = 0;
125 
130  virtual int NumLights() const = 0;
131 
137  virtual const Light* LightByIndex(int index) const = 0;
138 
139 };
140 
141 LM_NAMESPACE_END
142 
143 #endif // LIB_LIGHTMETRICA_PRIMITIVES_H
virtual const Primitive * PrimitiveByIndex(int index) const =0
Definition: component.h:45
virtual void Reset()=0
Definition: light.h:32
virtual int NumLights() const =0
Definition: primitive.h:39
Definition: camera.h:35
virtual const Primitive * PrimitiveByID(const std::string &id) const =0
Definition: scene.h:47
Definition: assets.h:39
virtual const Light * LightByIndex(int index) const =0
virtual const Camera * MainCamera() const =0
virtual bool IntersectEmitterShapes(Ray &ray, Intersection &isect) const =0
Definition: ray.h:33
virtual bool Load(const ConfigNode &node, const Assets &assets)=0
Definition: intersection.h:39
Definition: confignode.h:37
Definition: aabb.h:28
virtual int NumPrimitives() const =0
virtual bool PostConfigure(const Scene &scene)=0
Definition: primitives.h:43