void LoadModelInfo(TreeModel treeModel) { if (treeModel == null || treeModel.IsEmpty()) { return; //为空 } Init(); //基本信息 Name = treeModel.Name; InitStep = treeModel.InitStep; MaxStep = treeModel.MaxStep; //规则的输入 LSTree lstree = treeModel.RuleData; //公理 LRule += "@" + lstree.Axiom.ToString() + "\n"; //产生式 foreach (LRule production in lstree.ProductionGroup) { LRule += production.ToString() + "\n"; } //全局变量 GlobalVariables = lstree.GlobalVariablesList; //模型集合 Meshes = treeModel.Meshes; //枝干纹理 BranchTexturePath = treeModel.TexturePath; //用于判断是否为空,为空则不显示任何内容 isEmpty = false; }