blob: 7e73760ad5b48795a795cbb611b99b0c9a4ecf83 (
plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup freestyle
*/
#include "IndexedFaceSet.h"
#include "NodeCamera.h"
#include "NodeViewLayer.h"
#include "SceneVisitor.h"
#include "BLI_sys_types.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
namespace Freestyle {
class SceneHash : public SceneVisitor {
public:
inline SceneHash() : SceneVisitor()
{
_sum = 1;
}
virtual ~SceneHash()
{
}
VISIT_DECL(NodeCamera);
VISIT_DECL(NodeViewLayer);
VISIT_DECL(IndexedFaceSet);
string toString();
inline bool match()
{
return _sum == _prevSum;
}
inline void store()
{
_prevSum = _sum;
}
inline void reset()
{
_sum = 1;
}
private:
void adler32(const unsigned char *data, int size);
uint32_t _sum;
uint32_t _prevSum;
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SceneHash")
#endif
};
} /* namespace Freestyle */
|