示例#1
0
文件: Monopole.c 项目: RONNCC/pysoy
static void _vala_soy_fields_monopole_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soyfieldsMonopole * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_FIELDS_TYPE_MONOPOLE, soyfieldsMonopole);
	switch (property_id) {
		case SOY_FIELDS_MONOPOLE_MULTIPLIER:
		g_value_set_float (value, soy_fields_monopole_get_multiplier (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
示例#2
0
static void _vala_soy_fields_monopole_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soyfieldsMonopole * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_FIELDS_TYPE_MONOPOLE, soyfieldsMonopole);
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	switch (property_id) {
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		case SOY_FIELDS_MONOPOLE_MULTIPLIER:
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		g_value_set_float (value, soy_fields_monopole_get_multiplier (self));
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		break;
#line 727 "Monopole.c"
		default:
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		break;
#line 733 "Monopole.c"
	}
}
示例#3
0
static void soy_fields_monopole_real_commit (soyfieldsField* base) {
	soyfieldsMonopole * self;
	GeeArrayList* _tmp90_ = NULL;
#line 51 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	self = (soyfieldsMonopole*) base;
#line 227 "Monopole.c"
	{
		GeeArrayList* _other_list = NULL;
		GeeArrayList* _tmp0_ = NULL;
		GeeArrayList* _tmp1_ = NULL;
		gint _other_size = 0;
		GeeArrayList* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		gint _tmp4_ = 0;
		gint _other_index = 0;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp0_ = self->priv->_affected;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp1_ = _g_object_ref0 (_tmp0_);
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_other_list = _tmp1_;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp2_ = _other_list;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp4_ = _tmp3_;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_other_size = _tmp4_;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_other_index = -1;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		while (TRUE) {
#line 255 "Monopole.c"
			gint _tmp5_ = 0;
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			soybodiesBody* other = NULL;
			GeeArrayList* _tmp8_ = NULL;
			gint _tmp9_ = 0;
			gpointer _tmp10_ = NULL;
			gfloat xd = 0.0F;
			soybodiesBody* _tmp11_ = NULL;
			soyatomsPosition* _tmp12_ = NULL;
			soyatomsPosition* _tmp13_ = NULL;
			soyatomsPosition* _tmp14_ = NULL;
			gfloat _tmp15_ = 0.0F;
			gfloat _tmp16_ = 0.0F;
			soyatomsPosition* _tmp17_ = NULL;
			soyatomsPosition* _tmp18_ = NULL;
			soyatomsPosition* _tmp19_ = NULL;
			gfloat _tmp20_ = 0.0F;
			gfloat _tmp21_ = 0.0F;
			gfloat _tmp22_ = 0.0F;
			gfloat yd = 0.0F;
			soybodiesBody* _tmp23_ = NULL;
			soyatomsPosition* _tmp24_ = NULL;
			soyatomsPosition* _tmp25_ = NULL;
			soyatomsPosition* _tmp26_ = NULL;
			gfloat _tmp27_ = 0.0F;
			gfloat _tmp28_ = 0.0F;
			soyatomsPosition* _tmp29_ = NULL;
			soyatomsPosition* _tmp30_ = NULL;
			soyatomsPosition* _tmp31_ = NULL;
			gfloat _tmp32_ = 0.0F;
			gfloat _tmp33_ = 0.0F;
			gfloat _tmp34_ = 0.0F;
			gfloat zd = 0.0F;
			soybodiesBody* _tmp35_ = NULL;
			soyatomsPosition* _tmp36_ = NULL;
			soyatomsPosition* _tmp37_ = NULL;
			soyatomsPosition* _tmp38_ = NULL;
			gfloat _tmp39_ = 0.0F;
			gfloat _tmp40_ = 0.0F;
			soyatomsPosition* _tmp41_ = NULL;
			soyatomsPosition* _tmp42_ = NULL;
			soyatomsPosition* _tmp43_ = NULL;
			gfloat _tmp44_ = 0.0F;
			gfloat _tmp45_ = 0.0F;
			gfloat _tmp46_ = 0.0F;
			gfloat d2 = 0.0F;
			gfloat _tmp47_ = 0.0F;
			gfloat _tmp48_ = 0.0F;
			gfloat _tmp49_ = 0.0F;
			gfloat _tmp50_ = 0.0F;
			gfloat _tmp51_ = 0.0F;
			gfloat _tmp52_ = 0.0F;
			gfloat _tmp53_ = 0.0F;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp5_ = _other_index;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_other_index = _tmp5_ + 1;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp6_ = _other_index;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp7_ = _other_size;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			if (!(_tmp6_ < _tmp7_)) {
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				break;
#line 322 "Monopole.c"
			}
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp8_ = _other_list;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp9_ = _other_index;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			other = (soybodiesBody*) _tmp10_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp11_ = other;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp12_ = soy_bodies_body_get_position (_tmp11_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp13_ = _tmp12_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp14_ = _tmp13_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp15_ = soy_atoms_position_get_x (_tmp14_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp16_ = _tmp15_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp17_ = soy_bodies_body_get_position ((soybodiesBody*) self);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp18_ = _tmp17_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp19_ = _tmp18_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp20_ = soy_atoms_position_get_x (_tmp19_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp21_ = _tmp20_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp22_ = _tmp16_ - _tmp21_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp19_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp14_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			xd = _tmp22_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp23_ = other;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp24_ = soy_bodies_body_get_position (_tmp23_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp25_ = _tmp24_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp26_ = _tmp25_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp27_ = soy_atoms_position_get_y (_tmp26_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp28_ = _tmp27_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp29_ = soy_bodies_body_get_position ((soybodiesBody*) self);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp30_ = _tmp29_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp31_ = _tmp30_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp32_ = soy_atoms_position_get_y (_tmp31_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp33_ = _tmp32_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp34_ = _tmp28_ - _tmp33_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp31_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp26_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			yd = _tmp34_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp35_ = other;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp36_ = soy_bodies_body_get_position (_tmp35_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp37_ = _tmp36_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp38_ = _tmp37_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp39_ = soy_atoms_position_get_z (_tmp38_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp40_ = _tmp39_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp41_ = soy_bodies_body_get_position ((soybodiesBody*) self);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp42_ = _tmp41_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp43_ = _tmp42_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp44_ = soy_atoms_position_get_z (_tmp43_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp45_ = _tmp44_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp46_ = _tmp40_ - _tmp45_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp43_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp38_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			zd = _tmp46_;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp47_ = xd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp48_ = xd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp49_ = yd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp50_ = yd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp51_ = zd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp52_ = zd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			d2 = ((_tmp47_ * _tmp48_) + (_tmp49_ * _tmp50_)) + (_tmp51_ * _tmp52_);
#line 59 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp53_ = d2;
#line 59 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			if (_tmp53_ != ((gfloat) 0)) {
#line 440 "Monopole.c"
				gfloat d = 0.0F;
				gfloat _tmp54_ = 0.0F;
				gfloat _tmp55_ = 0.0F;
				gfloat mm2 = 0.0F;
				soybodiesBody* _tmp56_ = NULL;
				gfloat _tmp57_ = 0.0F;
				gfloat _tmp58_ = 0.0F;
				soybodiesBody* _tmp59_ = NULL;
				gfloat _tmp60_ = 0.0F;
				soybodiesBody* _tmp61_ = NULL;
				GeeHashMap* _tmp62_ = NULL;
				GeeHashMap* _tmp63_ = NULL;
				GeeHashMap* _tmp64_ = NULL;
				gboolean _tmp65_ = FALSE;
				gboolean _tmp66_ = FALSE;
				gfloat f = 0.0F;
				gfloat _tmp73_ = 0.0F;
				gfloat _tmp74_ = 0.0F;
				gfloat _tmp75_ = 0.0F;
				gfloat _tmp76_ = 0.0F;
				gfloat _tmp77_ = 0.0F;
				gfloat _tmp78_ = 0.0F;
				gfloat _tmp79_ = 0.0F;
				soybodiesBody* _tmp80_ = NULL;
				gfloat _tmp81_ = 0.0F;
				gfloat _tmp82_ = 0.0F;
				gfloat _tmp83_ = 0.0F;
				gfloat _tmp84_ = 0.0F;
				gfloat _tmp85_ = 0.0F;
				gfloat _tmp86_ = 0.0F;
				gfloat _tmp87_ = 0.0F;
				gfloat _tmp88_ = 0.0F;
				gfloat _tmp89_ = 0.0F;
#line 60 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp54_ = d2;
#line 60 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp55_ = sqrtf (_tmp54_);
#line 60 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				d = _tmp55_;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp56_ = other;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp57_ = soy_bodies_body_get_density (_tmp56_);
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp58_ = _tmp57_;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp59_ = other;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp60_ = soy_bodies_body_volume (_tmp59_);
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				mm2 = _tmp58_ * _tmp60_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp61_ = other;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp62_ = soy_bodies_body_get_tags (_tmp61_);
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp63_ = _tmp62_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp64_ = _tmp63_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp65_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp64_, "bmass");
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp66_ = _tmp65_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_g_object_unref0 (_tmp64_);
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				if (_tmp66_) {
#line 508 "Monopole.c"
					soybodiesBody* _tmp67_ = NULL;
					GeeHashMap* _tmp68_ = NULL;
					GeeHashMap* _tmp69_ = NULL;
					GeeHashMap* _tmp70_ = NULL;
					gpointer _tmp71_ = NULL;
					gfloat* _tmp72_ = NULL;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp67_ = other;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp68_ = soy_bodies_body_get_tags (_tmp67_);
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp69_ = _tmp68_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp70_ = _tmp69_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp71_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp70_, "bmass");
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp72_ = (gfloat*) _tmp71_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					mm2 = *_tmp72_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_g_free0 (_tmp72_);
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_g_object_unref0 (_tmp70_);
#line 533 "Monopole.c"
				}
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp73_ = soy_fields_monopole_get_multiplier (self);
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp74_ = _tmp73_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp75_ = soy_bodies_body_get_density ((soybodiesBody*) self);
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp76_ = _tmp75_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp77_ = soy_bodies_body_volume ((soybodiesBody*) self);
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp78_ = mm2;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp79_ = d2;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				f = (((_tmp74_ * _tmp76_) * _tmp77_) * _tmp78_) / _tmp79_;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp80_ = other;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp81_ = f;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp82_ = xd;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp83_ = d;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp84_ = f;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp85_ = yd;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp86_ = d;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp87_ = f;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp88_ = zd;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp89_ = d;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				soy_bodies_body_addForce (_tmp80_, (dReal) ((_tmp81_ * _tmp82_) / _tmp83_), (dReal) ((_tmp84_ * _tmp85_) / _tmp86_), (dReal) ((_tmp87_ * _tmp88_) / _tmp89_));
#line 573 "Monopole.c"
			}
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (other);
#line 577 "Monopole.c"
		}
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_g_object_unref0 (_other_list);
#line 581 "Monopole.c"
	}
#line 69 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	_tmp90_ = self->priv->_affected;
#line 69 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp90_);
#line 587 "Monopole.c"
}
示例#4
0
文件: Monopole.c 项目: RONNCC/pysoy
static void soy_fields_monopole_real_commit (soyfieldsField* base) {
	soyfieldsMonopole * self;
	GeeArrayList* _tmp91_;
	self = (soyfieldsMonopole*) base;
	{
		GeeArrayList* _tmp0_;
		GeeArrayList* _tmp1_;
		GeeArrayList* _other_list;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _other_size;
		gint _other_index;
		_tmp0_ = self->priv->_affected;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_other_list = _tmp1_;
		_tmp2_ = _other_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_other_size = _tmp4_;
		_other_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			GeeArrayList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_ = NULL;
			soybodiesBody* other;
			soybodiesBody* _tmp11_;
			soyatomsPosition* _tmp12_;
			soyatomsPosition* _tmp13_;
			soyatomsPosition* _tmp14_;
			gfloat _tmp15_;
			gfloat _tmp16_;
			soyatomsPosition* _tmp17_;
			soyatomsPosition* _tmp18_;
			soyatomsPosition* _tmp19_;
			gfloat _tmp20_;
			gfloat _tmp21_;
			gfloat _tmp22_;
			gfloat xd;
			soybodiesBody* _tmp23_;
			soyatomsPosition* _tmp24_;
			soyatomsPosition* _tmp25_;
			soyatomsPosition* _tmp26_;
			gfloat _tmp27_;
			gfloat _tmp28_;
			soyatomsPosition* _tmp29_;
			soyatomsPosition* _tmp30_;
			soyatomsPosition* _tmp31_;
			gfloat _tmp32_;
			gfloat _tmp33_;
			gfloat _tmp34_;
			gfloat yd;
			soybodiesBody* _tmp35_;
			soyatomsPosition* _tmp36_;
			soyatomsPosition* _tmp37_;
			soyatomsPosition* _tmp38_;
			gfloat _tmp39_;
			gfloat _tmp40_;
			soyatomsPosition* _tmp41_;
			soyatomsPosition* _tmp42_;
			soyatomsPosition* _tmp43_;
			gfloat _tmp44_;
			gfloat _tmp45_;
			gfloat _tmp46_;
			gfloat zd;
			gfloat _tmp47_;
			gfloat _tmp48_;
			gfloat _tmp49_;
			gfloat _tmp50_;
			gfloat _tmp51_;
			gfloat _tmp52_;
			gfloat d2;
			gfloat _tmp53_;
			_tmp5_ = _other_index;
			_other_index = _tmp5_ + 1;
			_tmp6_ = _other_index;
			_tmp7_ = _other_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _other_list;
			_tmp9_ = _other_index;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
			other = (soybodiesBody*) _tmp10_;
			_tmp11_ = other;
			_tmp12_ = soy_bodies_body_get_position (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = _tmp13_;
			_tmp15_ = soy_atoms_position_get_x (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = soy_bodies_body_get_position ((soybodiesBody*) self);
			_tmp18_ = _tmp17_;
			_tmp19_ = _tmp18_;
			_tmp20_ = soy_atoms_position_get_x (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = _tmp16_ - _tmp21_;
			_g_object_unref0 (_tmp19_);
			_g_object_unref0 (_tmp14_);
			xd = _tmp22_;
			_tmp23_ = other;
			_tmp24_ = soy_bodies_body_get_position (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = _tmp25_;
			_tmp27_ = soy_atoms_position_get_y (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = soy_bodies_body_get_position ((soybodiesBody*) self);
			_tmp30_ = _tmp29_;
			_tmp31_ = _tmp30_;
			_tmp32_ = soy_atoms_position_get_y (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = _tmp28_ - _tmp33_;
			_g_object_unref0 (_tmp31_);
			_g_object_unref0 (_tmp26_);
			yd = _tmp34_;
			_tmp35_ = other;
			_tmp36_ = soy_bodies_body_get_position (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = _tmp37_;
			_tmp39_ = soy_atoms_position_get_z (_tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = soy_bodies_body_get_position ((soybodiesBody*) self);
			_tmp42_ = _tmp41_;
			_tmp43_ = _tmp42_;
			_tmp44_ = soy_atoms_position_get_z (_tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = _tmp40_ - _tmp45_;
			_g_object_unref0 (_tmp43_);
			_g_object_unref0 (_tmp38_);
			zd = _tmp46_;
			_tmp47_ = xd;
			_tmp48_ = xd;
			_tmp49_ = yd;
			_tmp50_ = yd;
			_tmp51_ = zd;
			_tmp52_ = zd;
			d2 = ((_tmp47_ * _tmp48_) + (_tmp49_ * _tmp50_)) + (_tmp51_ * _tmp52_);
			_tmp53_ = d2;
			if (_tmp53_ != ((gfloat) 0)) {
				gfloat _tmp54_;
				gfloat _tmp55_ = 0.0F;
				gfloat d;
				soybodiesBody* _tmp56_;
				soyMass* _tmp57_;
				soyMass* _tmp58_;
				gfloat _tmp59_;
				gfloat _tmp60_;
				gfloat mm2;
				soybodiesBody* _tmp61_;
				GeeHashMap* _tmp62_;
				GeeHashMap* _tmp63_;
				GeeHashMap* _tmp64_;
				gboolean _tmp65_ = FALSE;
				gboolean _tmp66_;
				gfloat _tmp73_;
				gfloat _tmp74_;
				soyMass* _tmp75_;
				soyMass* _tmp76_;
				gfloat _tmp77_;
				gfloat _tmp78_;
				gfloat _tmp79_;
				gfloat _tmp80_;
				gfloat f;
				soybodiesBody* _tmp81_;
				gfloat _tmp82_;
				gfloat _tmp83_;
				gfloat _tmp84_;
				gfloat _tmp85_;
				gfloat _tmp86_;
				gfloat _tmp87_;
				gfloat _tmp88_;
				gfloat _tmp89_;
				gfloat _tmp90_;
				_tmp54_ = d2;
				_tmp55_ = sqrtf (_tmp54_);
				d = _tmp55_;
				_tmp56_ = other;
				_tmp57_ = soy_bodies_body_get_mass (_tmp56_);
				_tmp58_ = _tmp57_;
				_tmp59_ = soy_mass_get_mass (_tmp58_);
				_tmp60_ = _tmp59_;
				mm2 = _tmp60_;
				_tmp61_ = other;
				_tmp62_ = soy_bodies_body_get_tags (_tmp61_);
				_tmp63_ = _tmp62_;
				_tmp64_ = _tmp63_;
				_tmp65_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp64_, "bmass");
				_tmp66_ = _tmp65_;
				_g_object_unref0 (_tmp64_);
				if (_tmp66_) {
					soybodiesBody* _tmp67_;
					GeeHashMap* _tmp68_;
					GeeHashMap* _tmp69_;
					GeeHashMap* _tmp70_;
					gpointer _tmp71_ = NULL;
					gfloat* _tmp72_;
					_tmp67_ = other;
					_tmp68_ = soy_bodies_body_get_tags (_tmp67_);
					_tmp69_ = _tmp68_;
					_tmp70_ = _tmp69_;
					_tmp71_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp70_, "bmass");
					_tmp72_ = (gfloat*) _tmp71_;
					mm2 = *_tmp72_;
					_g_free0 (_tmp72_);
					_g_object_unref0 (_tmp70_);
				}
				_tmp73_ = soy_fields_monopole_get_multiplier (self);
				_tmp74_ = _tmp73_;
				_tmp75_ = soy_bodies_body_get_mass ((soybodiesBody*) self);
				_tmp76_ = _tmp75_;
				_tmp77_ = soy_mass_get_mass (_tmp76_);
				_tmp78_ = _tmp77_;
				_tmp79_ = mm2;
				_tmp80_ = d2;
				f = ((_tmp74_ * _tmp78_) * _tmp79_) / _tmp80_;
				_tmp81_ = other;
				_tmp82_ = f;
				_tmp83_ = xd;
				_tmp84_ = d;
				_tmp85_ = f;
				_tmp86_ = yd;
				_tmp87_ = d;
				_tmp88_ = f;
				_tmp89_ = zd;
				_tmp90_ = d;
				soy_bodies_body_addForce (_tmp81_, (dReal) ((_tmp82_ * _tmp83_) / _tmp84_), (dReal) ((_tmp85_ * _tmp86_) / _tmp87_), (dReal) ((_tmp88_ * _tmp89_) / _tmp90_));
			}
			_g_object_unref0 (other);
		}
		_g_object_unref0 (_other_list);
	}
	_tmp91_ = self->priv->_affected;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp91_);
}