forked from wjakob/nori
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject.cpp
40 lines (29 loc) · 1.36 KB
/
object.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
This file is part of Nori, a simple educational ray tracer
Copyright (c) 2015 by Wenzel Jakob
Nori is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Nori is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <nori/object.h>
NORI_NAMESPACE_BEGIN
void NoriObject::addChild(NoriObject *) {
throw NoriException(
"NoriObject::addChild() is not implemented for objects of type '%s'!",
classTypeName(getClassType()));
}
void NoriObject::activate() { /* Do nothing */ }
void NoriObject::setParent(NoriObject *) { /* Do nothing */ }
std::map<std::string, NoriObjectFactory::Constructor> *NoriObjectFactory::m_constructors = nullptr;
void NoriObjectFactory::registerClass(const std::string &name, const Constructor &constr) {
if (!m_constructors)
m_constructors = new std::map<std::string, NoriObjectFactory::Constructor>();
(*m_constructors)[name] = constr;
}
NORI_NAMESPACE_END