[Bf-blender-cvs] [6cde60cb98e] collada: Refactor Collada: Changed BCAnimationCurve methods to const methods

Gaia Clary noreply at git.blender.org
Thu Apr 19 18:56:31 CEST 2018


Commit: 6cde60cb98e6ad718d83afedc55b3dea54305f30
Author: Gaia Clary
Date:   Thu Apr 19 18:38:55 2018 +0200
Branches: collada
https://developer.blender.org/rB6cde60cb98e6ad718d83afedc55b3dea54305f30

Refactor Collada: Changed BCAnimationCurve methods to const methods

===================================================================

M	source/blender/collada/BCAnimationCurve.cpp
M	source/blender/collada/BCAnimationCurve.h

===================================================================

diff --git a/source/blender/collada/BCAnimationCurve.cpp b/source/blender/collada/BCAnimationCurve.cpp
index 6bf4b864ede..9c2ca7f9aa6 100644
--- a/source/blender/collada/BCAnimationCurve.cpp
+++ b/source/blender/collada/BCAnimationCurve.cpp
@@ -687,37 +687,37 @@ const bool BCCurveKey::operator<(const BCCurveKey &other) const
 BCBezTriple::BCBezTriple(BezTriple bezt) :
 	bezt(bezt) {}
 
-float BCBezTriple::get_frame()
+const float BCBezTriple::get_frame() const
 {
 	return bezt.vec[1][0];
 }
 
-float BCBezTriple::get_time(Scene *scene)
+const float BCBezTriple::get_time(Scene *scene) const
 {
 	return FRA2TIME(bezt.vec[1][0]);
 }
 
-float BCBezTriple::get_value()
+const float BCBezTriple::get_value() const
 {
 	return bezt.vec[1][1];
 }
 
-float BCBezTriple::get_angle()
+const float BCBezTriple::get_angle() const
 {
 	return RAD2DEGF(get_value());
 }
 
-void BCBezTriple::get_in_tangent(Scene *scene, float point[2], bool as_angle)
+void BCBezTriple::get_in_tangent(Scene *scene, float point[2], bool as_angle) const
 {
 	get_tangent(scene, point, as_angle, 0);
 }
 
-void BCBezTriple::get_out_tangent(Scene *scene, float point[2], bool as_angle)
+void BCBezTriple::get_out_tangent(Scene *scene, float point[2], bool as_angle) const
 {
 	get_tangent(scene, point, as_angle, 2);
 }
 
-void BCBezTriple::get_tangent(Scene *scene, float point[2], bool as_angle, int index)
+void BCBezTriple::get_tangent(Scene *scene, float point[2], bool as_angle, int index) const
 {
 	point[0] = FRA2TIME(bezt.vec[index][0]);
 	if (bezt.ipo != BEZT_IPO_BEZ) {
diff --git a/source/blender/collada/BCAnimationCurve.h b/source/blender/collada/BCAnimationCurve.h
index a341230695d..2f15bced4af 100644
--- a/source/blender/collada/BCAnimationCurve.h
+++ b/source/blender/collada/BCAnimationCurve.h
@@ -83,13 +83,13 @@ public:
 	BezTriple & bezt;
 
 	BCBezTriple(BezTriple bezt);
-	float get_frame();
-	float get_time(Scene *scene);
-	float get_value();
-	float get_angle();
-	void get_in_tangent(Scene *scene, float point[2], bool as_angle);
-	void get_out_tangent(Scene *scene, float point[2], bool as_angle);
-	void get_tangent(Scene *scene, float point[2], bool as_angle, int index);
+	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;
 
 };



More information about the Bf-blender-cvs mailing list