Blender V4.3
BlenderFileLoader.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 <float.h>
12#include <string.h>
13
14#include "../geometry/BBox.h"
15#include "../geometry/Geom.h"
24
25#include "MEM_guardedalloc.h"
26
27#include "DNA_material_types.h"
28#include "DNA_mesh_types.h"
29#include "DNA_modifier_types.h"
30#include "DNA_object_types.h"
31#include "DNA_scene_types.h"
32
33#include "render_types.h"
34
35#include "BKE_lib_id.hh"
36#include "BKE_material.h"
37#include "BKE_mesh.h"
38#include "BKE_scene.hh"
39
40#include "BLI_iterator.h"
41#include "BLI_listbase.h"
42
44
45#ifdef WITH_CXX_GUARDEDALLOC
46# include "MEM_guardedalloc.h"
47#endif
48
49namespace Freestyle {
50
51class NodeGroup;
52
65
67 public:
69 BlenderFileLoader(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph);
70 virtual ~BlenderFileLoader();
71
73 NodeGroup *Load();
74
77 {
78 return _numFacesRead;
79 }
80
81#if 0
83 inline real minEdgeSize()
84 {
85 return _minEdgeSize;
86 }
87#endif
88
90 inline void setRenderMonitor(RenderMonitor *iRenderMonitor)
91 {
92 _pRenderMonitor = iRenderMonitor;
93 }
94
95 protected:
96 void insertShapeNode(Object *ob, Mesh *mesh, int id);
97 int testDegenerateTriangle(float v1[3], float v2[3], float v3[3]);
98 int countClippedFaces(float v1[3], float v2[3], float v3[3], int clip[3]);
99 void clipLine(float v1[3], float v2[3], float c[3], float z);
100 void clipTriangle(int numTris,
101 float triCoords[][3],
102 float v1[3],
103 float v2[3],
104 float v3[3],
105 float triNormals[][3],
106 float n1[3],
107 float n2[3],
108 float n3[3],
109 bool edgeMarks[5],
110 bool em1,
111 bool em2,
112 bool em3,
113 const int clip[3]);
114 void addTriangle(struct LoaderState *ls,
115 float v1[3],
116 float v2[3],
117 float v3[3],
118 float n1[3],
119 float n2[3],
120 float n3[3],
121 bool fm,
122 bool em1,
123 bool em2,
124 bool em3);
125
126 protected:
127 struct detri_t {
128 uint viA, viB, viP; // 0 <= viA, viB, viP < viSize
131 };
133 Depsgraph *_depsgraph;
136#if 0
137 real _minEdgeSize;
138#endif
139 bool _smooth; /* if true, face smoothness is taken into account */
142
144
145#ifdef WITH_CXX_GUARDEDALLOC
146 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BlenderFileLoader")
147#endif
148};
149
150} /* namespace Freestyle */
A class to hold a bounding box.
General operations, lookup, etc. for materials.
unsigned int uint
Object is a sort of wrapper for general info.
Configuration definitions.
Class to define a cleaner of geometry providing a set of useful tools.
Various tools for geometry.
Vectors and Matrices (useful type definitions)
A Set of indexed faces to represent a surface object.
Read Guarded memory(de)allocation.
Class to represent a group node. This node can contains several children.
Class to build a shape node. It contains a Rep, which is the shape geometry.
Class to represent a transform node. A Transform node contains one or several children,...
Classes defining the basic "Iterator" design pattern.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
void setRenderMonitor(RenderMonitor *iRenderMonitor)
BlenderFileLoader(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph)
void clipLine(float v1[3], float v2[3], float c[3], float z)
void addTriangle(struct LoaderState *ls, float v1[3], float v2[3], float v3[3], float n1[3], float n2[3], float n3[3], bool fm, bool em1, bool em2, bool em3)
int testDegenerateTriangle(float v1[3], float v2[3], float v3[3])
void insertShapeNode(Object *ob, Mesh *mesh, int id)
void clipTriangle(int numTris, float triCoords[][3], float v1[3], float v2[3], float v3[3], float triNormals[][3], float n1[3], float n2[3], float n3[3], bool edgeMarks[5], bool em1, bool em2, bool em3, const int clip[3])
int countClippedFaces(float v1[3], float v2[3], float v3[3], int clip[3])
const Depsgraph * depsgraph
inherits from class Rep
Definition AppCanvas.cpp:20
static uint c
Definition RandGen.cpp:87
double real
Definition Precision.h:14
IndexedFaceSet::FaceEdgeMark * pm