Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
IesFile.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <Common/primitive_type.h>
6
7#include <vector>
8#include <string>
9
10namespace ph
11{
12
19class IesFile final
20{
21public:
22 enum class EIesFileType
23 {
24 Unknown = 0,
28 };
29
31 {
38 A,
39
46 B,
47
54 C
55 };
56
57public:
58 explicit IesFile(const Path& iesFilePath);
59
60 bool load();
61
62 std::string getFilename() const;
63
64 // Retrieving file contents.
65
69
72 std::string getTestInfo() const;
73
74 std::string getLuminaireManufacturer() const;
75 std::string getLuminaireCatalogNumber() const;
76 std::string getLuminaireDescription() const;
77 std::string getLampCatalogNumber() const;
78 std::string getLampDescription() const;
79
82 std::string getUncategorizedInfo() const;
83
84 uint32 getNumLamps() const;
85 real getLumensPerLamp() const;
86 real getCandelaMultiplier() const;
87 uint32 getNumVerticalAngles() const;
88 uint32 getNumHorizontalAngles() const;
90
91 std::vector<real> getVerticalAngles() const;
92 std::vector<real> getHorizontalAngles() const;
93
97 std::vector<std::vector<real>> getCandelaValues() const;
98
99private:
100 Path m_path;
101
102 EIesFileType m_iesFileType;
103
107 std::string m_testInfo;
108 std::string m_luminaireManufacturer;
109 std::string m_luminaireCatalogNumber;
110 std::string m_luminaireDescription;
111 std::string m_lampCatalogNumber;
112 std::string m_lampDescription;
113 std::string m_uncategorizedInfo;
115
118 std::string m_tilt;
119
123 uint32 m_numLamps;
124 real m_lumensPerLamp;
125 real m_candelaMultiplier;
126 uint32 m_numVerticalAngles;
127 uint32 m_numHorizontalAngles;
128 EPhotometricWebType m_webType;
129 real m_luminaireOpeningArea;
131
135 real m_ballastFactor;
136 real m_ballastLampPhotometricFactor;
137 real m_inputWatts;
139
143 std::vector<real> m_verticalAngles;
144 std::vector<real> m_horizontalAngles;
145 std::vector<std::vector<real>> m_candelaValues;
147
148 bool parse(const std::vector<char>& data);
149 std::size_t parseFileType(const std::vector<std::string>& lines, std::size_t currentLine);
150 std::size_t parseLabelsAndKeywords(const std::vector<std::string>& lines, std::size_t currentLine);
151 std::size_t parseTiltLine(const std::vector<std::string>& lines, std::size_t currentLine);
152 std::size_t parseTiltData(const std::vector<std::string>& lines, std::size_t currentLine);
153 std::size_t parseMetadata1(const std::vector<std::string>& lines, std::size_t currentLine);
154 std::size_t parseMetadata2(const std::vector<std::string>& lines, std::size_t currentLine);
155 std::size_t parseAngles(const std::vector<std::string>& lines, std::size_t currentLine);
156 std::size_t parseCandelaValues(const std::vector<std::string>& lines, std::size_t currentLine);
157
158private:
159 static std::vector<std::string> retrieveLines(const std::vector<char>& data);
160};
161
162}// end namespace ph
Definition IesFile.h:20
std::string getLuminaireDescription() const
Definition IesFile.cpp:556
uint32 getNumVerticalAngles() const
Definition IesFile.cpp:591
EPhotometricWebType getPhotometricWebType() const
Definition IesFile.cpp:601
IesFile(const Path &iesFilePath)
Definition IesFile.cpp:16
std::string getLampCatalogNumber() const
Definition IesFile.cpp:561
std::string getFilename() const
Definition IesFile.cpp:531
EIesFileType getIesFileType() const
Gets the type of this IES file.
Definition IesFile.cpp:536
std::string getTestInfo() const
Gets the test report number and laboratory for the IES file.
Definition IesFile.cpp:541
std::vector< real > getVerticalAngles() const
Definition IesFile.cpp:606
std::string getLampDescription() const
Definition IesFile.cpp:566
std::string getLuminaireCatalogNumber() const
Definition IesFile.cpp:551
EIesFileType
Definition IesFile.h:23
std::string getLuminaireManufacturer() const
Definition IesFile.cpp:546
std::vector< std::vector< real > > getCandelaValues() const
Definition IesFile.cpp:616
EPhotometricWebType
Definition IesFile.h:31
real getCandelaMultiplier() const
Definition IesFile.cpp:586
std::vector< real > getHorizontalAngles() const
Definition IesFile.cpp:611
real getLumensPerLamp() const
Definition IesFile.cpp:581
std::string getUncategorizedInfo() const
Gets descriptions that are not categorized by the parser.
Definition IesFile.cpp:571
bool load()
Definition IesFile.cpp:21
uint32 getNumLamps() const
Definition IesFile.cpp:576
uint32 getNumHorizontalAngles() const
Definition IesFile.cpp:596
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
The root for all renderer implementations.
Definition EEngineProject.h:6