Cleanup: Forward declare some classes in mesh headers

Aiming to reduce cases of including headers in headers,
when the final definition might be unnecessary.
This commit is contained in:
Hans Goudey 2023-12-13 09:18:39 -05:00
parent 766b0ce820
commit 30d95966d5
8 changed files with 34 additions and 7 deletions

View File

@ -14,7 +14,6 @@
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
struct BMesh;
struct BMeshCreateParams;
struct BMeshFromMeshParams;

View File

@ -8,7 +8,14 @@
* \ingroup bke
*/
#include "BLI_index_mask.hh"
namespace blender {
namespace index_mask {
class IndexMask;
}
using index_mask::IndexMask;
} // namespace blender
#include "BLI_offset_indices.hh"
#include "BKE_mesh.h"
#include "BKE_mesh_types.hh"

View File

@ -10,6 +10,13 @@
#include <memory>
namespace blender {
namespace index_mask {
class IndexMask;
}
using index_mask::IndexMask;
} // namespace blender
#include "BLI_array.hh"
#include "BLI_bit_group_vector.hh"
#include "BLI_offset_indices.hh"

View File

@ -14,6 +14,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_enumerable_thread_specific.hh"
#include "BLI_index_mask.hh"
#include "BLI_math_bits.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"

View File

@ -6,7 +6,13 @@
#include <algorithm>
#include "BLI_index_mask.hh"
namespace blender {
namespace index_mask {
class IndexMask;
}
using index_mask::IndexMask;
} // namespace blender
#include "BLI_index_range.hh"
#include "BLI_span.hh"

View File

@ -12,6 +12,8 @@
#pragma once
#include "BLI_math_bits.h"
#include "DRW_render.h"
#include "draw_shader_shared.h"

View File

@ -11,6 +11,7 @@
#include <optional>
#include "BLI_math_vector_types.hh"
#include "BLI_offset_indices.hh"
#include "BLI_utility_mixins.hh"
#include "BLI_vector.hh"
#include "BLI_virtual_array.hh"

View File

@ -11,7 +11,6 @@
#include "DNA_ID.h"
#include "DNA_customdata_types.h"
#include "DNA_defs.h"
#include "DNA_meshdata_types.h"
#include "DNA_session_uuid_types.h"
/** Workaround to forward-declare C++ type in C header. */
@ -19,13 +18,18 @@
# include <optional>
# include "BLI_bounds_types.hh"
# include "BLI_math_vector_types.hh"
# include "BLI_offset_indices.hh"
namespace blender {
template<typename T> class Span;
template<typename T> class Bounds;
namespace offset_indices {
template<typename T> class GroupedSpan;
template<typename T> class OffsetIndices;
} // namespace offset_indices
using offset_indices::GroupedSpan;
using offset_indices::OffsetIndices;
template<typename T> class MutableSpan;
template<typename T> class Span;
namespace bke {
struct MeshRuntime;
class AttributeAccessor;