void animation::add_mask(const char *name,bool enabled) { if(!name) return; if(!m_shared.is_valid()) return; if(m_shared->anim.get_bone_idx(name)<0) return; if(enabled) { if(!m_mask.is_valid()) return; m_mask->data[name]=true; update_version(); } else { if(!m_mask.is_valid()) { m_mask.allocate(); for(int i=0;i<m_shared->anim.get_bones_count();++i) m_mask->data[m_shared->anim.get_bone_name(i)]=true; } std::map<std::string,bool>::iterator it=m_mask->data.find(name); if(it!=m_mask->data.end()) m_mask->data.erase(it); update_version(); } }
void mixable_versioned_table::push_impl( const std::vector<std::string>& diff) { model_ptr table = get_model(); for (uint64_t i = 0; i < diff.size(); ++i) { const version_t version = table->set_row(diff[i]); update_version(version); } }
void animation::create(const shared_animation &res) { scene_shared::create(res); m_range_from=0; m_range_to=m_shared->anim.get_duration(); m_speed=m_weight=1.0f; update_version(); m_mask.free(); }
void animation::mask_all(bool enabled) { if(enabled) { if(m_mask.is_valid()) { m_mask.free(); update_version(); } } else { if(!m_mask.is_valid()) m_mask.allocate(); else m_mask->data.clear(); update_version(); } }
void mlogit_set_all_offset(struct mlogit *m, const double *offset) { size_t len = mlogit_ncat(m) * sizeof(*m->offset); if (offset) { memcpy(m->offset, offset, len); } else { memset(m->offset, 0, len); } recompute_all(m); update_version(m); }
void mlogit_set_coefs(struct mlogit *m, const double *beta) { size_t len = mlogit_dim(m) * sizeof(*m->beta); if (beta) { memcpy(m->beta, beta, len); } else { memset(m->beta, 0, len); } recompute_all(m); update_version(m); }
void mlogit_set_all_x(struct mlogit *m, const double *x) { size_t len = mlogit_ncat(m) * mlogit_dim(m) * sizeof(*m->x); if (x) { memcpy(m->x, x, len); } else { memset(m->x, 0, len); } uintset_clear(&m->ind); recompute_all(m); update_version(m); }
void mlogit_set_moments(struct mlogit *m, int k) { assert(k >= 0); int k0 = m->moments; m->moments = k; if (k0 < k) { if (k0 <= 0) recompute_mean(m); if (k0 <= 1) recompute_cov(m); } update_version(m); }
void mlogit_set_x(struct mlogit *m, size_t i, size_t off, size_t len, const double *x) { assert(i < mlogit_ncat(m)); assert(x || len == 0); assert(off + len <= mlogit_dim(m)); size_t dim = mlogit_dim(m); double *dst = m->x + i * dim + off; store_x0(m, i); /* store x0[i] if not already present */ memcpy(dst, x, len * sizeof(double)); update_version(m); }
void mlogit_set_offset(struct mlogit *m, size_t i, double offset) { assert(i < mlogit_ncat(m)); assert(offset < INFINITY); // offset[i] := offset m->offset[i] = offset; if (uintset_count(&m->ind)) { /* can't handle updates to both offset and x at same time; * flush updates to x right now */ uintset_clear(&m->ind); } recompute_all(m); update_version(m); }
bool animation::load(const char *name) { default_load_function(load_vmd); default_load_function(load_nan); if(!scene_shared<shared_animation>::load(name)) return false; if(!m_shared.is_valid()) return false; m_range_from=0; m_range_to=m_shared->anim.get_duration(); m_speed=m_weight=1.0f; update_version(); m_mask.free(); return true; }
int check_image_version(void) { if (is_version_check_enabled() == 0) { printf("Version check is not enabled, upgrade to continue !!!\n"); return 1; } if (is_image_version_higher() == 0) { printf("New image versions are lower than existing image, upgrade to STOP !!!\n"); return 0; } if (update_version() != 1) { printf("Error while updating verison information\n"); return 0; } printf("Update completed!\n"); return 1; }
void Element::system_moved() { if (_system) _system->transform_cache_flush(*this); update_version(); }