Blender  V3.3
ScenePrettyPrinter.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 #include <iomanip>
9 
10 #include "IndexedFaceSet.h"
11 #include "ScenePrettyPrinter.h"
12 
13 namespace Freestyle {
14 
15 #define VISIT(CLASS) \
16  void ScenePrettyPrinter::visit##CLASS(CLASS &) \
17  { \
18  _ofs << _space << #CLASS << endl; \
19  }
20 
21 VISIT(Node)
22 VISIT(NodeShape)
23 VISIT(NodeGroup)
24 VISIT(NodeLight)
25 VISIT(NodeDrawingStyle)
26 VISIT(NodeTransform)
27 
28 void ScenePrettyPrinter::visitNodeShapeBefore(NodeShape &UNUSED(shape))
29 {
30  increaseSpace();
31 }
32 
34 {
35  decreaseSpace();
36 }
37 
39 {
40  increaseSpace();
41 }
42 
44 {
45  decreaseSpace();
46 }
47 
49 {
50  increaseSpace();
51 }
52 
54 {
55  decreaseSpace();
56 }
57 
59 {
60  increaseSpace();
61 }
62 
64 {
65  decreaseSpace();
66 }
67 
72 
73 void ScenePrettyPrinter::visitIndexedFaceSet(IndexedFaceSet &ifs)
74 {
75  const float *vertices = ifs.vertices();
76  unsigned vsize = ifs.vsize();
77 
78  _ofs << _space << "IndexedFaceSet" << endl;
79  const float *p = vertices;
80  for (unsigned int i = 0; i < vsize / 3; i++) {
81  _ofs << _space << " " << setw(3) << setfill('0') << i << ": " << p[0] << ", " << p[1] << ", "
82  << p[2] << endl;
83  p += 3;
84  }
85 }
86 
87 } /* namespace Freestyle */
#define UNUSED(x)
A Set of indexed faces to represent a surface object.
#define VISIT(CLASS)
Class to display textual information about a scene graph.
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
virtual const unsigned vsize() const
virtual const float * vertices() const
virtual void visitNodeGroupBefore(NodeGroup &)
virtual void visitNodeDrawingStyleBefore(NodeDrawingStyle &)
virtual void visitNodeDrawingStyleAfter(NodeDrawingStyle &)
virtual void visitNodeShapeAfter(NodeShape &)
virtual void visitNodeGroupAfter(NodeGroup &)
virtual void visitNodeTransformBefore(NodeTransform &)
virtual void visitNodeTransformAfter(NodeTransform &)
SyclQueue void void size_t num_bytes void
inherits from class Rep
Definition: AppCanvas.cpp:18