Blender V4.3
SceneHash.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11#include "IndexedFaceSet.h"
12#include "NodeCamera.h"
13#include "NodeViewLayer.h"
14#include "SceneVisitor.h"
15
16#include "BLI_sys_types.h"
17
18#ifdef WITH_CXX_GUARDEDALLOC
19# include "MEM_guardedalloc.h"
20#endif
21
22namespace Freestyle {
23
24class SceneHash : public SceneVisitor {
25 public:
27 {
28 _sum = 1;
29 }
30
31 virtual ~SceneHash() {}
32
36
37 string toString();
38
39 inline bool match()
40 {
41 return _sum == _prevSum;
42 }
43
44 inline void store()
45 {
46 _prevSum = _sum;
47 }
48
49 inline void reset()
50 {
51 _sum = 1;
52 }
53
54 private:
55 void adler32(const uchar *data, int size);
56
57 uint32_t _sum;
58 uint32_t _prevSum;
59
60#ifdef WITH_CXX_GUARDEDALLOC
61 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SceneHash")
62#endif
63};
64
65} /* namespace Freestyle */
unsigned char uchar
A Set of indexed faces to represent a surface object.
Read Guarded memory(de)allocation.
Class to represent a light node.
Class to represent a view layer in Blender.
Class to visit (without doing anything) a scene graph structure.
VISIT_DECL(NodeViewLayer)
VISIT_DECL(NodeCamera)
virtual ~SceneHash()
Definition SceneHash.h:31
VISIT_DECL(IndexedFaceSet)
inherits from class Rep
Definition AppCanvas.cpp:20
unsigned int uint32_t
Definition stdint.h:80