Exemple #1
0
static int l_uc_A(lua_State* L)
{
	UnitCell* uc = lua_tounitcell(L, 1);
	if(!uc) return 0;

	lua_pushvector(L, new Vector(uc->A()));
	return 1;
}
Exemple #2
0
static int l_uc_copy(lua_State* L)
{
	UnitCell* uc = lua_tounitcell(L, 1);
	if(!uc) return 0;
	
	UnitCell* uc2 = new UnitCell();//uc->A(), uc->B(), uc->C());
	
	uc2->r2g = uc->r2g;
	uc2->g2r = uc->g2r;
	
	uc2->setA(uc->A());
	uc2->setB(uc->B());
	uc2->setC(uc->C());
	
	for(unsigned int i=0; i<uc->atoms.size(); i++)
	{
		uc2->addAtomGlobalCoorinates(new Atom(*uc->atoms[i]));
	}
	lua_pushunitcell(L, uc2);
	return 1;
}