Blender  V2.93
BCSampleData.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
22 #include <algorithm>
23 #include <map>
24 #include <string>
25 
26 #include "BCMath.h"
27 #include "BCSampleData.h"
28 #include "ExportSettings.h"
29 
30 #include "BKE_object.h"
31 
32 #include "BLI_math_rotation.h"
33 
34 #include "DNA_armature_types.h"
35 #include "DNA_camera_types.h"
36 #include "DNA_light_types.h"
37 #include "DNA_material_types.h"
38 #include "DNA_object_types.h"
39 
40 typedef std::map<Bone *, BCMatrix *> BCBoneMatrixMap;
41 
42 class BCSample {
43  private:
44  BCMatrix obmat;
45  BCBoneMatrixMap bonemats; /* For Armature animation */
46 
47  public:
48  BCSample(Object *ob) : obmat(ob)
49  {
50  }
51 
52  ~BCSample();
53 
54  void add_bone_matrix(Bone *bone, Matrix &mat);
55 
56  bool get_value(std::string channel_target, const int array_index, float *val) const;
57  const BCMatrix &get_matrix() const;
58  const BCMatrix *get_matrix(Bone *bone) const; /* returns NULL if bone is not animated */
59 };
60 
61 typedef std::map<Object *, BCSample *> BCSampleMap;
62 typedef std::map<int, const BCSample *> BCFrameSampleMap;
63 typedef std::map<int, const BCMatrix *> BCMatrixSampleMap;
std::map< Bone *, BCMatrix * > BCBoneMatrixMap
Definition: BCSampleData.h:40
std::map< int, const BCSample * > BCFrameSampleMap
Definition: BCSampleData.h:62
std::map< Object *, BCSample * > BCSampleMap
Definition: BCSampleData.h:61
std::map< int, const BCMatrix * > BCMatrixSampleMap
Definition: BCSampleData.h:63
General operations, lookup, etc. for blender objects.
Object is a sort of wrapper for general info.
BCSample(Object *ob)
Definition: BCSampleData.h:48
const BCMatrix & get_matrix() const
void add_bone_matrix(Bone *bone, Matrix &mat)
bool get_value(std::string channel_target, const int array_index, float *val) const