Exemplo n.º 1
0
//***********************************************************************************************
void CParticleWorkspace::load()
{
	NLMISC::CIFile stream;
	stream.open(_Filename);
	NLMISC::CIXml xmlStream;
	xmlStream.init(stream);
	this->serial(xmlStream);
	clearModifiedFlag();
}
Exemplo n.º 2
0
// ***************************************************************************
UPrimitiveBlock *UPrimitiveBlock::createPrimitiveBlockFromFile(const std::string &fileName)
{

	NLMISC::CIFile input;
	if (input.open(fileName))
	{
		NLMISC::CIXml xmlInput;
		// Init
		if (xmlInput.init (input))
		{
			return createPrimitiveBlock(xmlInput);
		}
		else
		{
			throw NLMISC::Exception(std::string("Unable to init an xml input file from ") + fileName);
		}
	}
	return NULL;
}
Exemplo n.º 3
0
void CWaterPoolEditor::OnLoadPool() 
{	
	static char BASED_CODE szFilter[] = "NeL Water Pool Files (*.wpf)|*.wpf||";
	CFileDialog fileDlg( TRUE, ".wpf", "*.wpf", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter);
	if (fileDlg.DoModal()==IDOK)
	{				
		try
		{
			NLMISC::CIXml iXml;
			NLMISC::CIFile iF;
			if (iF.open((LPCTSTR) fileDlg.GetPathName()))
			{
				if (iXml.init (iF))
				{
					_Wpm->serial(iXml);
					iXml.release();
					iF.close();
					fillPoolList();
				}
				else
				{
					iF.close();
					MessageBox (("Unable to init xml stream from file : " + std::string((LPCTSTR) fileDlg.GetPathName())).c_str(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION);	
				}
			}
			else
			{
				MessageBox (("Unable to open file : " + std::string((LPCTSTR) fileDlg.GetPathName())).c_str(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION);
			}
		}
		catch (NLMISC::Exception& e)
		{
			MessageBox (e.what(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION);
		}
	}	
}