1 /* === S I N F G =========================================================== */
3 ** \brief Template File
5 ** $Id: waypoint.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
32 #include "valuenode_const.h"
36 /* === U S I N G =========================================================== */
40 using namespace sinfg;
42 /* === M A C R O S ========================================================= */
44 /* === G L O B A L S ======================================================= */
46 /* === P R O C E D U R E S ================================================= */
48 /* === M E T H O D S ======================================================= */
50 Waypoint::Waypoint(ValueBase value, Time time):
52 before(INTERPOLATION_TCB),
53 after(INTERPOLATION_TCB),
54 value_node(ValueNode_Const::create(value)),
61 if(value.get_type()==ValueBase::TYPE_ANGLE)
62 after=before=INTERPOLATION_LINEAR;
65 Waypoint::Waypoint(ValueNode::Handle value_node, Time time):
67 before(INTERPOLATION_TCB),
68 after(INTERPOLATION_TCB),
69 value_node(value_node),
76 if(value_node->get_type()==ValueBase::TYPE_ANGLE)
77 after=before=INTERPOLATION_LINEAR;
82 before(INTERPOLATION_TCB),
83 after(INTERPOLATION_TCB),
92 Waypoint::set_value(const ValueBase &x)
94 if(!value_node && x.get_type()==ValueBase::TYPE_ANGLE)
95 after=before=INTERPOLATION_LINEAR;
97 value_node=ValueNode_Const::create(x);
101 Waypoint::set_value_node(const ValueNode::Handle &x)
103 if(!value_node && x->get_type()==ValueBase::TYPE_ANGLE)
104 after=before=INTERPOLATION_LINEAR;
110 Waypoint::is_static()const
112 return static_cast<bool>(ValueNode_Const::Handle::cast_dynamic(value_node)) && value_node && !value_node->is_exported();
116 Waypoint::set_time(const Time &x)
122 Waypoint::apply_model(const Model &x)
124 if(x.priority_flag) set_priority(x.get_priority());
125 if(x.before_flag) set_before(x.get_before());
126 if(x.after_flag) set_after(x.get_after());
127 if(x.tension_flag) set_tension(x.get_tension());
128 if(x.continuity_flag) set_continuity(x.get_continuity());
129 if(x.bias_flag) set_bias(x.get_bias());
130 if(x.temporal_tension_flag) set_temporal_tension(x.get_temporal_tension());
134 Waypoint::clone(const GUID& deriv_guid)const
138 if(!ret.value_node->is_exported())
139 ret.value_node=value_node->clone(deriv_guid);
145 Waypoint::get_value()const { return (*value_node)(0); }
148 Waypoint::get_value(const Time &t)const { return (*value_node)(t); }
151 Waypoint::get_guid()const
153 return GUID::hasher(get_uid());