{
_LayerCounter::counter++;
Vocab vocab=get_param_vocab();
- Vocab::const_iterator viter;
- for(viter=vocab.begin();viter!=vocab.end();viter++)
- {
- static_params.insert(make_pair(viter->get_name(),false));
- }
+ fill_static(vocab);
}
Layer::LooseHandle
bool
Layer::set_param_static(const String ¶m, const bool x)
{
- Sparams::iterator iter;
-
- for(iter=static_params.begin();iter!=static_params.end();iter++)
+ Sparams::iterator iter=static_params.find(param);
+ if(iter!=static_params.end())
{
- if(iter->first == param)
- {
- iter->second = x;
- return true;
- }
+ iter->second=x;
+ return true;
}
- //SET_STATIC(z_depth,x)
-
return false;
}
-bool
-Layer::get_param_static(const String ¶m) const
+void Layer::fill_static(Vocab vocab)
{
-
- Sparams::const_iterator iter;
-
- for(iter=static_params.begin();iter!=static_params.end();iter++)
+ Vocab::const_iterator viter;
+ for(viter=vocab.begin();viter!=vocab.end();viter++)
{
- if(iter->first == param)
- {
- return iter->second;
- }
+ if(static_params.find(viter->get_name())==static_params.end())
+ static_params.insert(make_pair(viter->get_name(),false));
}
- //GET_STATIC(z_depth);
+}
+
+
+bool
+Layer::get_param_static(const String ¶m) const
+{
+ Sparams::const_iterator iter=static_params.find(param);
+ if(iter!=static_params.end())
+ return iter->second;
return false;
}
float z_depth;
//! True if zdepth is not affected when in animation mode
- //bool z_depth_static;
typedef std::map<String, bool> Sparams;
Sparams static_params;
virtual bool set_param_static(const String ¶m, const bool x);
virtual bool get_param_static(const String ¶m) const;
+ virtual void fill_static(Vocab vocab);
//! Sets a list of parameters
virtual bool set_param_list(const ParamList &);