Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/collada/BCAnimationCurve.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/collada/BCAnimationCurve.h')
-rw-r--r--source/blender/collada/BCAnimationCurve.h184
1 files changed, 91 insertions, 93 deletions
diff --git a/source/blender/collada/BCAnimationCurve.h b/source/blender/collada/BCAnimationCurve.h
index c01b3150dba..989ec1d0101 100644
--- a/source/blender/collada/BCAnimationCurve.h
+++ b/source/blender/collada/BCAnimationCurve.h
@@ -23,8 +23,7 @@
#include "collada_utils.h"
#include "BCSampleData.h"
-extern "C"
-{
+extern "C" {
#include "MEM_guardedalloc.h"
#include "BKE_fcurve.h"
#include "BKE_armature.h"
@@ -43,106 +42,105 @@ typedef std::vector<float> BCTimes;
typedef std::map<int, float> BCValueMap;
typedef enum BC_animation_type {
- BC_ANIMATION_TYPE_OBJECT,
- BC_ANIMATION_TYPE_BONE,
- BC_ANIMATION_TYPE_CAMERA,
- BC_ANIMATION_TYPE_MATERIAL,
- BC_ANIMATION_TYPE_LIGHT,
+ BC_ANIMATION_TYPE_OBJECT,
+ BC_ANIMATION_TYPE_BONE,
+ BC_ANIMATION_TYPE_CAMERA,
+ BC_ANIMATION_TYPE_MATERIAL,
+ BC_ANIMATION_TYPE_LIGHT,
} BC_animation_type;
class BCCurveKey {
-private:
- BC_animation_type key_type;
- std::string rna_path;
- int curve_array_index;
- int curve_subindex; /* only needed for materials */
-
-public:
-
- BCCurveKey();
- BCCurveKey(const BC_animation_type type, const std::string path, const int array_index, const int subindex = -1);
- void operator=(const BCCurveKey &other);
- const std::string get_full_path() const;
- const std::string get_path() const;
- const int get_array_index() const;
- const int get_subindex() const;
- void set_object_type(BC_animation_type object_type);
- const BC_animation_type get_animation_type() const;
- const bool operator<(const BCCurveKey &other) const;
-
+ private:
+ BC_animation_type key_type;
+ std::string rna_path;
+ int curve_array_index;
+ int curve_subindex; /* only needed for materials */
+
+ public:
+ BCCurveKey();
+ BCCurveKey(const BC_animation_type type,
+ const std::string path,
+ const int array_index,
+ const int subindex = -1);
+ void operator=(const BCCurveKey &other);
+ const std::string get_full_path() const;
+ const std::string get_path() const;
+ const int get_array_index() const;
+ const int get_subindex() const;
+ void set_object_type(BC_animation_type object_type);
+ const BC_animation_type get_animation_type() const;
+ const bool operator<(const BCCurveKey &other) const;
};
class BCBezTriple {
-public:
- BezTriple & bezt;
-
- BCBezTriple(BezTriple &bezt);
- const float get_frame() const;
- const float get_time(Scene *scene) const;
- const float get_value() const;
- const float get_angle() const;
- void get_in_tangent(Scene *scene, float point[2], bool as_angle) const;
- void get_out_tangent(Scene *scene, float point[2], bool as_angle) const;
- void get_tangent(Scene *scene, float point[2], bool as_angle, int index) const;
-
+ public:
+ BezTriple &bezt;
+
+ BCBezTriple(BezTriple &bezt);
+ const float get_frame() const;
+ const float get_time(Scene *scene) const;
+ const float get_value() const;
+ const float get_angle() const;
+ void get_in_tangent(Scene *scene, float point[2], bool as_angle) const;
+ void get_out_tangent(Scene *scene, float point[2], bool as_angle) const;
+ void get_tangent(Scene *scene, float point[2], bool as_angle, int index) const;
};
class BCAnimationCurve {
-private:
- BCCurveKey curve_key;
- float min = 0;
- float max = 0;
-
- bool curve_is_local_copy = false;
- FCurve *fcurve;
- PointerRNA id_ptr;
- void init_pointer_rna(Object *ob);
- void delete_fcurve(FCurve *fcu);
- FCurve *create_fcurve(int array_index, const char *rna_path);
- void create_bezt(float frame, float output);
- void update_range(float val);
- void init_range(float val);
-
-public:
- BCAnimationCurve();
- BCAnimationCurve(const BCAnimationCurve &other);
- BCAnimationCurve(const BCCurveKey &key, Object *ob);
- BCAnimationCurve(BCCurveKey key, Object *ob, FCurve *fcu);
- ~BCAnimationCurve();
-
- const bool is_of_animation_type(BC_animation_type type) const;
- const int get_interpolation_type(float sample_frame) const;
- bool is_animated();
- const bool is_transform_curve() const;
- const bool is_rotation_curve() const;
- bool is_keyframe(int frame);
- void adjust_range(int frame);
-
- const std::string get_animation_name(Object *ob) const; /* xxx: this is collada specific */
- const std::string get_channel_target() const;
- const int get_channel_index() const;
- const int get_subindex() const;
- const std::string get_rna_path() const;
- const FCurve *get_fcurve() const;
- const int sample_count() const;
-
- const float get_value(const float frame);
- void get_values(BCValues &values) const;
- void get_value_map(BCValueMap &value_map);
-
- void get_frames(BCFrames &frames) const;
-
- /* Curve edit functions create a copy of the underlaying FCurve */
- FCurve *get_edit_fcurve();
- bool add_value_from_rna(const int frame);
- bool add_value_from_matrix(const BCSample &sample, const int frame);
- void add_value(const float val, const int frame);
- void clean_handles();
-
- /* experimental stuff */
- const int closest_index_above(const float sample_frame, const int start_at) const;
- const int closest_index_below(const float sample_frame) const;
-
+ private:
+ BCCurveKey curve_key;
+ float min = 0;
+ float max = 0;
+
+ bool curve_is_local_copy = false;
+ FCurve *fcurve;
+ PointerRNA id_ptr;
+ void init_pointer_rna(Object *ob);
+ void delete_fcurve(FCurve *fcu);
+ FCurve *create_fcurve(int array_index, const char *rna_path);
+ void create_bezt(float frame, float output);
+ void update_range(float val);
+ void init_range(float val);
+
+ public:
+ BCAnimationCurve();
+ BCAnimationCurve(const BCAnimationCurve &other);
+ BCAnimationCurve(const BCCurveKey &key, Object *ob);
+ BCAnimationCurve(BCCurveKey key, Object *ob, FCurve *fcu);
+ ~BCAnimationCurve();
+
+ const bool is_of_animation_type(BC_animation_type type) const;
+ const int get_interpolation_type(float sample_frame) const;
+ bool is_animated();
+ const bool is_transform_curve() const;
+ const bool is_rotation_curve() const;
+ bool is_keyframe(int frame);
+ void adjust_range(int frame);
+
+ const std::string get_animation_name(Object *ob) const; /* xxx: this is collada specific */
+ const std::string get_channel_target() const;
+ const int get_channel_index() const;
+ const int get_subindex() const;
+ const std::string get_rna_path() const;
+ const FCurve *get_fcurve() const;
+ const int sample_count() const;
+
+ const float get_value(const float frame);
+ void get_values(BCValues &values) const;
+ void get_value_map(BCValueMap &value_map);
+
+ void get_frames(BCFrames &frames) const;
+
+ /* Curve edit functions create a copy of the underlaying FCurve */
+ FCurve *get_edit_fcurve();
+ bool add_value_from_rna(const int frame);
+ bool add_value_from_matrix(const BCSample &sample, const int frame);
+ void add_value(const float val, const int frame);
+ void clean_handles();
+
+ /* experimental stuff */
+ const int closest_index_above(const float sample_frame, const int start_at) const;
+ const int closest_index_below(const float sample_frame) const;
};
typedef std::map<BCCurveKey, BCAnimationCurve *> BCAnimationCurveMap;