[Bf-blender-cvs] [7485e8f9aa6] gpencil-new-data-proposal: Move GPLayerGroup function implementations to .cc file
Amelie Fondevilla
noreply at git.blender.org
Wed Nov 23 15:39:01 CET 2022
Commit: 7485e8f9aa6cd077ddd545249ed979c4855a86d9
Author: Amelie Fondevilla
Date: Wed Nov 23 15:09:29 2022 +0100
Branches: gpencil-new-data-proposal
https://developer.blender.org/rB7485e8f9aa6cd077ddd545249ed979c4855a86d9
Move GPLayerGroup function implementations to .cc file
===================================================================
M source/blender/blenkernel/intern/gpencil_new_proposal.cc
M source/blender/blenkernel/intern/gpencil_new_proposal.hh
===================================================================
diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal.cc b/source/blender/blenkernel/intern/gpencil_new_proposal.cc
index fefccfc101c..52a0a253c51 100644
--- a/source/blender/blenkernel/intern/gpencil_new_proposal.cc
+++ b/source/blender/blenkernel/intern/gpencil_new_proposal.cc
@@ -18,6 +18,36 @@
namespace blender::bke {
+GPLayerGroup::GPLayerGroup()
+{
+ this->children = nullptr;
+ this->children_size = 0;
+ this->layer_indices = nullptr;
+ this->layer_indices_size = 0;
+}
+
+GPLayerGroup::GPLayerGroup(const StringRefNull name) : GPLayerGroup()
+{
+ BLI_assert(name.size() < 128);
+ strcpy(this->name, name.c_str());
+}
+
+GPLayerGroup::~GPLayerGroup()
+{
+ /* Recursivly free the children of this layer group first. */
+ for (int i = 0; i < this->children_size; i++) {
+ MEM_delete(&this->children[i]);
+ }
+ /* Then free its data. */
+ MEM_SAFE_FREE(this->children);
+ MEM_SAFE_FREE(this->layer_indices);
+}
+
+IndexMask GPLayerGroup::layers_index_mask()
+{
+ return {reinterpret_cast<int64_t>(this->layer_indices), this->layer_indices_size};
+}
+
Span<float3> GPStroke::points_positions() const
{
return {geometry_->positions().begin() + offset_, points_num_};
diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal.hh b/source/blender/blenkernel/intern/gpencil_new_proposal.hh
index 70692148e01..27850f0e5df 100644
--- a/source/blender/blenkernel/intern/gpencil_new_proposal.hh
+++ b/source/blender/blenkernel/intern/gpencil_new_proposal.hh
@@ -152,35 +152,12 @@ namespace blender::bke {
class GPLayerGroup : ::GPLayerGroup { /* Unused for now. Placeholder class. */
public:
- GPLayerGroup()
- {
- this->children = nullptr;
- this->children_size = 0;
- this->layer_indices = nullptr;
- this->layer_indices_size = 0;
- }
-
- GPLayerGroup(const StringRefNull name) : GPLayerGroup()
- {
- BLI_assert(name.size() < 128);
- strcpy(this->name, name.c_str());
- }
+ GPLayerGroup();
+ GPLayerGroup(const StringRefNull name);
- ~GPLayerGroup()
- {
- /* Recursivly free the children of this layer group first. */
- for (int i = 0; i < this->children_size; i++) {
- MEM_delete(&this->children[i]);
- }
- /* Then free its data. */
- MEM_SAFE_FREE(this->children);
- MEM_SAFE_FREE(this->layer_indices);
- }
+ ~GPLayerGroup();
- IndexMask layers_index_mask()
- {
- return {reinterpret_cast<int64_t>(this->layer_indices), this->layer_indices_size};
- }
+ IndexMask layers_index_mask();
};
class GPDataRuntime {
More information about the Bf-blender-cvs
mailing list