Blender V4.3
ScenePrettyPrinter.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2012-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#include <iomanip>
11
12#include "IndexedFaceSet.h"
13#include "ScenePrettyPrinter.h"
14
15#include "BLI_sys_types.h"
16
17namespace Freestyle {
18
19#define VISIT(CLASS) \
20 void ScenePrettyPrinter::visit##CLASS(CLASS &) \
21 { \
22 _ofs << _space << #CLASS << endl; \
23 }
24
26VISIT(NodeShape)
27VISIT(NodeGroup)
28VISIT(NodeLight)
29VISIT(NodeDrawingStyle)
30VISIT(NodeTransform)
31
32void ScenePrettyPrinter::visitNodeShapeBefore(NodeShape & /*shape*/)
33{
34 increaseSpace();
35}
36
41
46
51
56
61
66
71
76
77void ScenePrettyPrinter::visitIndexedFaceSet(IndexedFaceSet &ifs)
78{
79 const float *vertices = ifs.vertices();
80 uint vsize = ifs.vsize();
81
82 _ofs << _space << "IndexedFaceSet" << endl;
83 const float *p = vertices;
84 for (uint i = 0; i < vsize / 3; i++) {
85 _ofs << _space << " " << setw(3) << setfill('0') << i << ": " << p[0] << ", " << p[1] << ", "
86 << p[2] << endl;
87 p += 3;
88 }
89}
90
91} /* namespace Freestyle */
unsigned int uint
A Set of indexed faces to represent a surface object.
#define VISIT(CLASS)
Class to display textual information about a scene graph.
virtual const uint 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 &)
inherits from class Rep
Definition AppCanvas.cpp:20