1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_BLINEPOINT_H
26 #define __SYNFIG_BLINEPOINT_H
28 /* === H E A D E R S ======================================================= */
34 /* === M A C R O S ========================================================= */
36 /* === T Y P E D E F S ===================================================== */
38 /* === C L A S S E S & S T R U C T S ======================================= */
42 class BLinePoint : public UniqueID
59 split_tangent_(false),
62 { tangent_[0] = Point(0,0); tangent_[1] = Point(0,0); }
64 const Point& get_vertex()const { return vertex_; }
65 void set_vertex(const Point& x) { vertex_=x; }
68 const Vector& get_tangent1()const { return tangent_[0]; }
69 const Vector& get_tangent2()const { return tangent_[1]; }
70 void set_tangent(const Vector& x) { tangent_[0]=tangent_[1]=x; }
71 void set_tangent1(const Vector& x) { tangent_[0]=x; normalize(1);}
72 void set_tangent2(const Vector& x) { tangent_[1]=x; normalize(0);}
75 const float& get_width()const { return width_; }
76 void set_width(float x) { width_=x; }
78 // We store the origin offset by 0.5 so that
79 // can have the origin set to the default by zeroing
81 float get_origin()const { return origin_+0.5f; }
82 void set_origin(float x) { origin_=x-0.5f; }
85 const bool& get_split_tangent_flag()const { return split_tangent_; }
86 void set_split_tangent_flag(bool x=true) { link_radius_=link_theta_=!x; normalize();}
88 const bool& get_link_radius_flag()const { return link_radius_; }
89 void set_link_radius_flag(bool x=true) { link_radius_=x; normalize();}
91 const bool& get_link_theta_flag()const { return link_theta_; }
92 void set_link_theta_flag(bool x=true) { link_theta_=x; normalize();}
94 //normalize tangents, i.e. make sure their values correspond to the linkage
95 void normalize(int i=0);
99 }; // END of class BLinePoint
101 }; // END of namespace synfig
103 /* === E N D =============================================================== */