Blender V5.3
BKE_pose.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "BLI_array.hh"
8#include "BLI_assert.hh"
9#include "BLI_map.hh"
10#include "BLI_string_ref.hh"
11
12#include <concepts>
13#include <type_traits>
14
20
21namespace blender {
22struct bArmature;
23struct Bone;
24struct bPoseChannel;
25} // namespace blender
26
27namespace blender::bke {
28
47
60template<typename PoseChannelT, typename BoneT> struct PChanBoneT {
61 PoseChannelT *pchan;
62 BoneT *bone;
63
64 PChanBoneT(PoseChannelT *pchan, BoneT *bone) : pchan(pchan), bone(bone)
65 {
66 BLI_assert_msg((pchan == nullptr) == (bone == nullptr),
67 "either both pointers should be nil, or none of them should be");
68 }
69
76
77 /* Implicit conversion from the non-const variant to the const variant.
78 * Enabled only when that direction actually adds const, so the reverse
79 * (const -> non-const) remains forbidden. */
80 template<typename OtherPChan, typename OtherBone>
81 requires std::convertible_to<OtherPChan *, PoseChannelT *> &&
82 std::convertible_to<OtherBone *, BoneT *>
84 {
85 }
86};
87
90
91} // namespace blender::bke
#define BLI_assert_msg(a, msg)
PChanBoneT< bPoseChannel, Bone > PChanBone
Definition BKE_pose.hh:88
PChanBoneT< const bPoseChannel, const Bone > PChanBoneConst
Definition BKE_pose.hh:89
BMesh Iterators.
PChanBoneT(const PChanBoneT< OtherPChan, OtherBone > &other)
Definition BKE_pose.hh:83
PChanBoneT(PoseChannelT *pchan, BoneT *bone)
Definition BKE_pose.hh:64
Map< StringRef, bPoseChannel * > chanhash
Definition BKE_pose.hh:36
Array< bPoseChannel * > chan_array
Definition BKE_pose.hh:42