Blender V4.3
BlenderStrokeRenderer.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 "BLI_map.hh"
12
15
16extern "C" {
17struct Depsgraph;
18struct GHash;
19struct Main;
20struct Material;
21struct Object;
22struct Render;
23struct Scene;
24struct bContext;
25struct bNodeTree;
26}
27
28namespace Freestyle {
29
31 public:
32 BlenderStrokeRenderer(Render *re, int render_count);
33 virtual ~BlenderStrokeRenderer();
34
36 virtual void RenderStrokeRep(StrokeRep *iStrokeRep) const;
37 virtual void RenderStrokeRepBasic(StrokeRep *iStrokeRep) const;
38
39 Object *NewMesh() const;
40
41 struct StrokeGroup {
42 explicit StrokeGroup() : totvert(0), totedge(0), faces_num(0), totloop(0) {}
43 vector<StrokeRep *> strokes;
49 };
50 vector<StrokeGroup *> strokeGroups, texturedStrokeGroups;
51
52 int GenerateScene();
53 void GenerateStrokeMesh(StrokeGroup *group, bool hasTex);
54 void FreeStrokeGroups();
55
56 Render *RenderScene(Render *re, bool render);
57
58 static Material *GetStrokeShader(Main *bmain, bNodeTree *iNodeTree, bool do_id_user);
59
60 protected:
67 float _z, _z_delta;
71
72 static const char *uvNames[];
73
74 int get_stroke_count() const;
75 float get_stroke_vertex_z(void) const;
76 uint get_stroke_mesh_id(void) const;
77 bool test_triangle_visibility(StrokeVertexRep *svRep[3]) const;
78 void test_strip_visibility(Strip::vertex_container &strip_vertices,
79 int *visible_faces,
80 int *visible_segments) const;
81
82 vector<StrokeRep *> _strokeReps;
83
84#ifdef WITH_CXX_GUARDEDALLOC
85 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BlenderStrokeRenderer")
86#endif
87};
88
89} /* namespace Freestyle */
unsigned int uint
Configuration definitions.
void RenderScene()
Classes to render a stroke with OpenGL.
bool test_triangle_visibility(StrokeVertexRep *svRep[3]) const
vector< StrokeGroup * > texturedStrokeGroups
void test_strip_visibility(Strip::vertex_container &strip_vertices, int *visible_faces, int *visible_segments) const
void GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
static Material * GetStrokeShader(Main *bmain, bNodeTree *iNodeTree, bool do_id_user)
virtual void RenderStrokeRep(StrokeRep *iStrokeRep) const
BlenderStrokeRenderer(Render *re, int render_count)
virtual void RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
inherits from class Rep
Definition AppCanvas.cpp:20