1 /* === S I N F G =========================================================== */
3 ** \brief Template File
5 ** $Id: timepointcollect.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 ======================================================= */
31 #include "timepointcollect.h"
32 #include "valuenode_animated.h"
39 /* === U S I N G =========================================================== */
43 using namespace sinfg;
45 /* === M A C R O S ========================================================= */
47 /* === G L O B A L S ======================================================= */
49 /* === P R O C E D U R E S ================================================= */
51 /* === M E T H O D S ======================================================= */
55 sinfg::waypoint_collect(set<Waypoint, std::less<UniqueID> >& waypoint_set,const Time& time, const etl::handle<Node>& node)
57 const TimePointSet& timepoint_set(node->get_times());
59 // Check to see if there is anything in here at the given time
60 if(timepoint_set.find(time)==timepoint_set.end())
63 // Check if we are a linkable value node
64 LinkableValueNode::Handle linkable_value_node;
65 linkable_value_node=linkable_value_node.cast_dynamic(node);
66 if(linkable_value_node)
68 const int link_count(linkable_value_node->link_count());
70 for(i=0;i<link_count;i++)
72 ret+=waypoint_collect(waypoint_set,time,linkable_value_node->get_link(i).get());
77 // Check if we are a layer
79 layer=layer.cast_dynamic(node);
82 const Layer::DynamicParamList& dyn_param_list(layer->dynamic_param_list());
83 Layer::DynamicParamList::const_iterator iter;
85 for(iter=dyn_param_list.begin();iter!=dyn_param_list.end();++iter)
87 ret+=waypoint_collect(waypoint_set,time,iter->second);
89 ValueBase canvas_value(layer->get_param("canvas"));
90 if(canvas_value.get_type()==ValueBase::TYPE_CANVAS)
92 ret+=waypoint_collect(waypoint_set,time,Canvas::Handle(canvas_value.get(Canvas::Handle())));
97 // Check if we are a canvas
98 Canvas::Handle canvas;
99 canvas=canvas.cast_dynamic(node);
102 Canvas::const_iterator iter;
104 for(iter=canvas->begin();iter!=canvas->end();++iter)
105 ret+=waypoint_collect(waypoint_set,time,*iter);
109 // Check if we are an animated value node
110 ValueNode_Animated::Handle value_node_animated;
111 value_node_animated=value_node_animated.cast_dynamic(node);
112 if(value_node_animated)
115 Waypoint waypoint=*value_node_animated->find(time);
117 // If it is already in the waypoint set, then
118 // don't bother adding it again
119 if(waypoint_set.find(waypoint)!=waypoint_set.end())
123 waypoint_set.insert(waypoint);
136 sinfg::activepoint_collect(set<Activepoint, std::less<UniqueID> >& activepoint_set,const Time& time, const etl::handle<Node>& node)
138 const TimePointSet& timepoint_set(node->get_times());
140 // Check to see if there is anything in here at the given time
141 if(timepoint_set.find(time)==timepoint_set.end());