Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
volume.h
Go to the documentation of this file.
1 /*
2  This file is part of Mitsuba, a physically based rendering system.
3 
4  Copyright (c) 2007-2014 by Wenzel Jakob and others.
5 
6  Mitsuba is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License Version 3
8  as published by the Free Software Foundation.
9 
10  Mitsuba is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #pragma once
20 #if !defined(__MITSUBA_RENDER_VOLUME_H_)
21 #define __MITSUBA_RENDER_VOLUME_H_
22 
23 #include <mitsuba/core/cobject.h>
24 #include <mitsuba/core/aabb.h>
25 
27 
28 /**
29  * \brief Generalized source of volumetric information
30  * \ingroup librender
31  */
33 public:
34  /// Serialize to a binary data stream.
35  virtual void serialize(Stream *stream, InstanceManager *manager) const;
36 
37  /// Return the bounding box
38  inline const AABB &getAABB() const {
39  return m_aabb;
40  }
41 
42  /// Are float-valued lookups permitted?
43  virtual bool supportsFloatLookups() const;
44 
45  /// Look up a floating point value by position
46  virtual Float lookupFloat(const Point &p) const;
47 
48  /// Are spectrum-valued lookups permitted?
49  virtual bool supportsSpectrumLookups() const;
50 
51  /// Look up a spectrum value by position
52  virtual Spectrum lookupSpectrum(const Point &p) const;
53 
54  /// Are vector-valued lookups permitted?
55  virtual bool supportsVectorLookups() const;
56 
57  /// Look up a vector value by position
58  virtual Vector lookupVector(const Point &p) const;
59 
60  /**
61  * \brief Return the recommended step size for numerical
62  * integration or inifinity if this is not known/applicable
63  */
64  virtual Float getStepSize() const = 0;
65 
66  /**
67  * \brief Return the maximum floating point value that
68  * could be returned by \ref lookupFloat.
69  *
70  * This is useful when implementing Woodcock-Tracking.
71  */
72  virtual Float getMaximumFloatValue() const = 0;
73 
75 protected:
76  /// Virtual destructor
77  virtual ~VolumeDataSource();
78 
79  /// Protected constructor
80  VolumeDataSource(const Properties &props);
81 
82  /// Unserialize from a binary data stream
83  VolumeDataSource(Stream *stream, InstanceManager *manager);
84 protected:
85  AABB m_aabb;
86 };
87 
89 
90 #endif /* __MITSUBA_RENDER_VOLUME_H_ */
const AABB & getAABB() const
Return the bounding box.
Definition: volume.h:38
Generic serializable object, which supports construction from a Properties instance.
Definition: cobject.h:40
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
Generalized source of volumetric information.
Definition: volume.h:32
virtual void serialize(Stream *stream, InstanceManager *manager) const
Serialize this object to a binary data stream.
Axis-aligned bounding box data structure in three dimensions.
Definition: aabb.h:437
Abstract seekable stream class.
Definition: stream.h:58
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Definition: fwd.h:96
Associative parameter map for constructing subclasses of ConfigurableObject.
Definition: properties.h:46
Definition: fwd.h:100
Coordinates the serialization and unserialization of object graphs.
Definition: serialization.h:65
#define MTS_EXPORT_RENDER
Definition: platform.h:109
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
#define MTS_NAMESPACE_END
Definition: platform.h:138