Blender  V3.3
SceneHash.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
9 #include "IndexedFaceSet.h"
10 #include "NodeCamera.h"
11 #include "NodeViewLayer.h"
12 #include "SceneVisitor.h"
13 
14 #include "BLI_sys_types.h"
15 
16 #ifdef WITH_CXX_GUARDEDALLOC
17 # include "MEM_guardedalloc.h"
18 #endif
19 
20 namespace Freestyle {
21 
22 class SceneHash : public SceneVisitor {
23  public:
24  inline SceneHash() : SceneVisitor()
25  {
26  _sum = 1;
27  }
28 
29  virtual ~SceneHash()
30  {
31  }
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 unsigned char *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 */
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.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
VISIT_DECL(NodeViewLayer)
VISIT_DECL(NodeCamera)
virtual ~SceneHash()
Definition: SceneHash.h:29
VISIT_DECL(IndexedFaceSet)
inherits from class Rep
Definition: AppCanvas.cpp:18
unsigned int uint32_t
Definition: stdint.h:80