//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 读取属性 _isReversed = xconfig.GetBoolean("is_reversed", _isReversed); if (xconfig.Contains("reverse_direction")) { int reverseDirection = xconfig.GetInteger("reverse_direction"); _reverseDirection = IntToDirction(reverseDirection); } _frameDelay = xconfig.GetInteger("frame_delay", _frameDelay); // 读取剪辑集合 FXmlNode xframes = xconfig.Find("Frames"); if (xframes != null) { foreach (FXmlNode xnode in xframes.Nodes) { if (xnode.IsName("Frame")) { int index = xnode.GetInteger("index"); FRsResourceFrame frame = _frames.Get(index, null); if (frame != null) { frame.LoadConfig(xnode); } } } } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 //============================================================ public override void LoadConfig(FXmlNode xconfig) { base.LoadConfig(xconfig); // 读取属性 _optionAlpha = xconfig.GetBoolean("option_alpha", _optionAlpha); _optionPadding = xconfig.GetBoolean("option_padding", _optionPadding); _qualityCd = xconfig.Get("quality_cd", _qualityCd); _qualityPalette = xconfig.GetInteger("quality_palette", _qualityPalette); _qualityAlpha = xconfig.GetInteger("quality_alpha", _qualityAlpha); _frameDelay = xconfig.GetInteger("frame_delay", _frameDelay); // 读取剪辑集合 FXmlNode xclips = xconfig.Find("Clips"); if (xclips != null) { foreach (FXmlNode xnode in xclips.Nodes) { if (xnode.IsName("Clip")) { // 检查参数 if (!xnode.Contains("direction_cd")) { continue; } // 加载剪辑信息 int directionCd = xnode.GetInteger("direction_cd"); FRsResourceClip clip = _clips[directionCd]; if (clip != null) { clip.LoadConfig(xnode); } } } } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 // @author TYFNG 20120409 //============================================================ public override void LoadConfig(FXmlNode xconfig) { base.LoadConfig(xconfig); // 读取透明属性 if (xconfig.Contains("option_alpha")) { _optionAlpha = xconfig.GetBoolean("option_alpha"); } if (xconfig.Contains("alpha_cd")) { _optionAlpha = (xconfig.Get("alpha_cd") == "Able"); } // 读取文件属性 if (xconfig.Contains("option_padding")) { _optionPadding = xconfig.GetBoolean("option_padding"); } // 读取品质类型 _qualityCd = xconfig.Get("quality_cd", _qualityCd); // 读取品质调色板 if (xconfig.Contains("quality_palette")) { _qualityPalette = xconfig.GetInteger("quality_palette"); } // 读取品质透明 if (xconfig.Contains("quality_alpha")) { _qualityAlpha = xconfig.GetInteger("quality_alpha"); } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadModelConfig(FXmlNode config) { // 获得属性内容 _frameCount = config.GetInteger("frame_count"); _frameTick = config.GetInteger("frame_tick"); _frameStart = config.GetInteger("frame_start"); _frameEnd = config.GetInteger("frame_end"); // 获得跟踪列表 foreach (FXmlNode node in config.Nodes) { if (node.IsName("Track")) { // 加载跟踪 FDrTrack track = new FDrTrack(_model); track.LoadModelConfig(node); _tracks.Push(track); // 判断是否为关联器 if (track.Bone.Name.StartsWith("jn_")) { FDrJoiner joiner = new FDrJoiner(_model); joiner.Name = track.Bone.Name; joiner.Track = track; _joiners.Push(joiner); } } } // 根据内容排序 _tracks.Sort(new FDrTrack(_model)); }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 读取设置 _id = xconfig.GetInteger("id", 0); _name = xconfig.Get("name", _name); _modelName = xconfig.Nvl("model"); _modelName = _modelName.Replace('/', '\\'); _model = RContent3dManager.ModelConsole.Find(_modelName); if (null == _model) { RMoCore.TrackConsole.Write(this, "LoadConfig", "Model is not exists in tempalte. (template={0}, model={1})", _template.Name, _modelName); return; } _geometryName = xconfig.Nvl("geometry"); _geometry = _model.Mesh.Find(_geometryName); if (null == _geometry) { RMoCore.TrackConsole.Write(this, "LoadConfig", "Model geometry is not exists. (template={0}, model={1}, geometry={2})", _template.Name, _modelName, _geometryName); } else { _optionSelect = _geometry.OptionSelect; _optionGround = _geometry.OptionGround; _optionBoneScale = _geometry.OptionBoneScale; _optionInstnaced = _geometry.OptionInstanced; _instanceCount = _geometry.InstanceCount; _outline.min.Assign(_geometry.OutlineMin); _outline.max.Assign(_geometry.OutlineMax); } _materialName = xconfig.Nvl("material"); _materialName = _materialName.Replace('/', '\\'); _material = RContent3dManager.MaterialConsole.FindGroup(_materialName); if (null == _material) { RMoCore.TrackConsole.Write(this, "LoadConfig", "Material is not exists in tempalte. (template={0}, model={1}, material={2})", _template.Name, _modelName, _materialName); } else { if (!_material.Materials.IsEmpty) { FDrMaterial material = _material.Materials.First; _optionDynamic = material.OptionDynamic; _optionMerge = material.OptionMerge; } } _lightMapName = xconfig.Get("light_map", ""); // 读取选项 if (xconfig.Contains("option_visible")) { _optionVisible = xconfig.GetInteger("option_visible"); } // 读取矩阵 FXmlNode xmatrix = xconfig.Find("Matrix"); if (null != xmatrix) { _matrix.LoadSimpleConfig(xmatrix); } }
//============================================================ // <T>加载设置节点。</T> // // @param xconfig 配置节点 //============================================================ public override void LoadConfig(FXmlNode xconfig) { base.LoadConfig(xconfig); _color = Color.FromArgb(RInt.ParseHex(xconfig.Get("color"))); _alpha = xconfig.GetFloat("alpha"); _blurX = xconfig.GetInteger("blur_x"); _blurY = xconfig.GetInteger("blur_y"); _strength = xconfig.GetInteger("strength"); _quality = xconfig.GetInteger("quality"); _inner = xconfig.GetBoolean("inner"); _knockout = xconfig.GetBoolean("knockout"); }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { _name = xconfig.Nvl("name"); _playCd = xconfig.GetInteger("play_cd", _playCd); _frameBegin = xconfig.GetInteger("frame_begin"); _frameEnd = xconfig.GetInteger("frame_end"); if (xconfig.Contains("rate")) { _frameRate = xconfig.GetFloat("rate"); } if (xconfig.Contains("frame_rate")) { _frameRate = xconfig.GetFloat("frame_rate"); } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息x //============================================================ public void LoadConfig(FXmlNode config) { _name = config.Get("name"); _playCd = config.GetInteger("play_cd", _playCd); _frameBegin = config.GetInteger("frame_begin"); _frameEnd = config.GetInteger("frame_end"); if (config.Contains("frame_rate")) { _rate = config.GetFloat("frame_rate"); } else { _rate = config.GetFloat("rate"); } }
//============================================================ // <T>加载配置文件。</T> //============================================================ public void LoadConfig(FXmlNode config) { // 加载基本设置 _tid = config.GetInteger("tid", _tid); _name = config.Get("name", _name); _label = config.Get("label", _label); if (config.Contains("size")) { _size.Parse(config.Get("size")); } if (config.Contains("birth_location")) { _birthLocation.Parse(config.Get("birth_location")); } // 加载层 _layerListNode = config.Find("Layers"); if (null == _layerListNode) { return; } foreach (FXmlNode layerNode in _layerListNode.Nodes) { FDsMapLayer layer = new FDsMapLayer(); layer.Resource.LoadConfig(layerNode); _layers.Push(layer.Resource); } // 加载出生点 _birthListNode = config.Find("Births"); if (null == _birthListNode) { return; } foreach (FXmlNode birthNode in _birthListNode.Nodes) { FDsMapBirth birth = new FDsMapBirth(); birth.Resource.LoadConfig(birthNode); _births.Push(birth.Resource); } }
//============================================================ // <T>加载设置节点。</T> // // @param xconfig 配置节点 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 加载属性 _name = xconfig.Get("name"); if (xconfig.Contains("color")) { _color = Color.FromArgb(RInt.ParseHex(xconfig.Get("color"))); } _font = xconfig.Get("font", null); _size = xconfig.GetInteger("size", 0); _align = xconfig.Get("align", null); // 加载效果器集合 foreach (FXmlNode xnode in xconfig.Nodes) { if (xnode.IsName("Property")) { FTplStyleProperty property = new FTplStyleProperty(); property.LoadConfig(xnode); _properties.Push(property); } else if (xnode.IsName("Filter")) { string typeName = xnode.Get("type_name"); FTplFilter filter = CreateFilter(typeName); filter.LoadConfig(xnode); _filters.Push(filter); } } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 // @param name 名称 //============================================================ public void LoadConfig(FXmlNode xconfig, string name) { // 加载资源 if (xconfig.Contains(name + "_rid")) { _code = xconfig.GetInteger(name + "_rid"); } // 加载对齐 if (xconfig.Contains(name + "_align_cd")) { _alignCd = RUiPictureAlign.Parse(xconfig.Get(name + "_align_cd")); } // 加载位置 if (xconfig.Contains(name + "_location")) { _location.Parse(xconfig.Get(name + "_location")); } // 加载尺寸 if (xconfig.Contains(name + "_size")) { _size.Parse(xconfig.Get(name + "_size")); } // 加载边框 if (xconfig.Contains(name + "_padding")) { _padding.Parse(xconfig.Get(name + "_padding")); } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { string typeName = null; if (xconfig.Contains("type")) { typeName = xconfig.Get("type"); } else { typeName = xconfig.Get("type_name"); } _typeCd = EDrTexture.Parse(typeName); _source = xconfig.Nvl("source").Replace('/', '\\'); string sourceTypeName = xconfig.Nvl("source_type"); _sourceTypeCd = EDrTexture.Parse(typeName); _sourceIndex = xconfig.GetInteger("source_index", _sourceIndex); // 获得关联纹理 _texture = RContent3dManager.TextureConsole.Find(Source); if (null == _texture) { _texture = RContent3dManager.TextureConsole.Find(Source); RMoCore.TrackConsole.Write(this, "LoadConfig", "Texture source is not exists. (material={0}, texture={1})", _material.Code, SourceCode); return; } _textureBitmap = _texture.FindByTypeCd(_sourceTypeCd, _sourceIndex); }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadModelConfig(FXmlNode config) { // 读取属性信息 _boneId = config.GetInteger("bone_id"); _bone = _model.Skeleton.Bones.Get(_boneId); // 读取所有子节点 foreach (FXmlNode node in config.Nodes) { switch (node.Name) { case "LocalMatrix": _localMatrix.LoadSimpleAngleConfig(node); break; case "WorldMatrix": _worldMatrix.LoadSimpleAngleConfig(node); break; case "Types": break; case "Frames": case "FrameCollection": LoadFrameListConfig(node); break; } } }
public override void LoadConfig(FXmlNode config) { base.LoadConfig(config); if (config.Contains(PTY_MAX_COUNT)) { _maxCount = config.GetInteger(PTY_MAX_COUNT); } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 //============================================================ public void LoadConfig(FXmlNode config) { // 读取延时 if (config.Contains("delay")) { _delay = config.GetInteger("delay"); } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 加载编号 _id = xconfig.GetInteger("id"); // 加载名称 _name = xconfig.Get("name"); // 加载层数 _layerCount = xconfig.GetInteger("layer_count"); // 加载尺寸 _size.Parse(xconfig.Get("size")); // 加载切割尺寸 _range.Parse(xconfig.Get("range")); // 加载深度 _deep = xconfig.GetFloat("deep"); _incise = RInt.Parse(xconfig.GetFloat("deep")); //............................................................ // 加载高度纹理 FXmlNode xheight = xconfig.Find("Height"); if (null != xheight) { _textureHeight = xheight.Get("source"); } // 加载颜色纹理 FXmlNode xcolor = xconfig.Find("Color"); if (null != xcolor) { _textureColor = xcolor.Get("source"); } //............................................................ // 加载层信息 FXmlNode xlayers = xconfig.Find("Layers"); if (null != xlayers) { foreach (FXmlNode xlayer in xlayers.Nodes) { FDrMapLayer layer = new FDrMapLayer(); layer.Index = _layers.Count; layer.LoadConfig(xlayer); _layers.Push(layer); } } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadOrignConfig(FXmlNode xconfig) { // 获得属性 _typeName = xconfig.Get("type"); _interval = xconfig.GetInteger("tick"); _rotation.Parse(xconfig.Get("rotation")); _rotation.Mul(40); }
public void LoadConfig(FXmlNode config) { if (config.Contains("index")) { _index.Parse(config.Get("index")); } if (config.Contains("resource_id")) { _resourceId = config.GetInteger("resource_id"); } }
public override void LoadConfig(FXmlNode config) { base.LoadConfig(config); if (config.Contains(PTY_MIN_LENGTH)) { _minLength = config.GetInteger(PTY_MIN_LENGTH); } if (config.Contains(PTY_MAX_LENGTH)) { _maxLength = config.GetInteger(PTY_MAX_LENGTH); } if (config.Contains(PTY_MIN_EQUALS)) { _minEquals = config.GetBoolean(PTY_MIN_EQUALS); } if (config.Contains(PTY_MAX_EQUALS)) { _maxEquals = config.GetBoolean(PTY_MAX_EQUALS); } _description = config[PTY_DESCRIPTION]; }
//============================================================ public override void LoadConfig(FXmlNode config) { base.LoadConfig(config); // 读取编号 if (config.Contains("id")) { _id = config.GetInteger("id"); } // 读取唯一编号 if (config.Contains("guid")) { _guid = Guid.Parse(config.Get("guid")); } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置信息 //============================================================ public override void OnLoadConfig(FXmlNode xconfig) { base.OnLoadConfig(xconfig); // 读取数据 _optionHand = xconfig.GetBoolean("option_hand", _optionHand); _validInterval = xconfig.GetInteger("valid_interval", _validInterval); if (xconfig.Contains("text_align_cd")) { _textAlignCd = (ERcTextAlign)REnum.ToValue(typeof(ERcTextAlign), xconfig.Get("text_align_cd")); } _font.LoadConfig(xconfig, "font"); _text = xconfig.Get("text", _text); _groundResource.LoadConfig(xconfig, "ground"); // 读取事件 _onClickControl = xconfig.Get("on_click_control", _onClickControl); }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置信息 //============================================================ public override void OnLoadConfig(FXmlNode xconfig) { base.OnLoadConfig(xconfig); _designItemCount = xconfig.GetInteger("design_item_count", 1); _spreadCd = (ERcSpread)REnum.ToValue(typeof(ERcSpread), xconfig.Get("spread_cd", "None")); _horizontalCount = xconfig.GetInteger("horizontal_count", 1); _horizontalSpace = xconfig.GetInteger("horizontal_space", 0); _verticalCount = xconfig.GetInteger("vertical_count", 1); _verticalSpace = xconfig.GetInteger("vertical_space", 0); _initialCount = xconfig.GetInteger("initial_count", 0); }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadModelConfig(FXmlNode config) { _tick = config.GetInteger("time"); foreach (FXmlNode node in config.Nodes) { switch (node.Name) { case "LocalMatrix": _localMatrix.LoadSimpleAngleConfig(node); break; case "WorldMatrix": _worldMatrix.LoadSimpleAngleConfig(node); break; } } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadModelConfig(FXmlNode config) { // 读取基本属性 _id = config.GetInteger("bone_id"); _name = config.Get("name"); _model.Skeleton.Bones.Set(_id, this); // 读取子节点 foreach (FXmlNode node in config.Nodes) { if (node.IsName("Bone")) { FDrBone bone = new FDrBone(_model); bone.LoadModelConfig(node); _children.Push(bone); } } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { string typeName = null; // 读取类型 if (xconfig.Contains("type")) { typeName = xconfig.Get("type"); } else { typeName = xconfig.Get("type_name"); } _typeCd = EDrTexture.Parse(typeName); // 读取属性 _tick = xconfig.GetInteger("tick", _tick); }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { _optionLoaded = xconfig.GetInteger("option_loaded", EDrFlag.Inherit); _optionSelect = xconfig.GetInteger("option_select", EDrFlag.Inherit); _optionGround = xconfig.GetInteger("option_ground", EDrFlag.Inherit); if (xconfig.Contains("option_merge")) { _optionMergeVertex = xconfig.GetInteger("option_merge"); } if (xconfig.Contains("option_merge_vertex")) { _optionMergeVertex = xconfig.GetInteger("option_merge_vertex"); } _optionMergeMaterial = xconfig.GetInteger("option_merge_material", EDrFlag.Inherit); _optionLightMap = xconfig.GetInteger("option_light_map", EDrFlag.Inherit); //............................................................ //............................................................ // 加载引用列表 FXmlNode xreferences = xconfig.Find("References"); if (null != xreferences) { foreach (FXmlNode xreference in xreferences.Nodes) { if (xreference.IsName("Reference")) { FDrTemplateReference reference = new FDrTemplateReference(); reference.LoadConfig(xreference); _references.Push(reference); } } } //............................................................ // 加载动画列表 FXmlNode xanimation = xconfig.Find("Animation"); if (null != xanimation) { _animation.Model = _model; _animation.LoadConfig(xanimation); } //............................................................ // 材质集合排序 if (!_materials.IsEmpty) { _materials.Sort(_materials.First); } }
//============================================================= public void SaveDefineXmlPath(string fileName, string rootname) { FXmlDocument xml = new FXmlDocument(); FXmlNode root = xml.Root; FXmlNode defineNode = root.CreateNode("Define"); foreach (FXlsColumn value in _columns.Values) { FXmlNode node = defineNode.CreateNode("Field"); node.GetInteger(""); node.SetNvl("id", value.Id); node.SetNvl("label", value.Label); node.SetNvl("name", value.Name); node.SetNvl("type", value.Type); node.SetNvl("data_type", value.DataType); node.SetNvl("translate", value.Translate); node.SetNvl("length", value.Lenth); node.SetNvl("total", value.Total); node.SetNvl("note", value.Note); } FXmlNode dataNode = root.CreateNode(rootname + "List"); string id = _columns[0].Name; string rid = null; foreach (FXlsRow row in _rows) { FXmlNode node = dataNode.CreateNode("node"); foreach (string name in row.Names) { string excel = name; string value = row[excel].ToString(); if (id == excel) { rid = value; } node.Set(excel, value); node.Name = rootname; } } xml.SaveFile(fileName); _logger.Debug(this, "SaveXmlPath", "Save xml path. (file={0}, rows={1})", fileName, _rows.Count); }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 读取属性 _typeName = xconfig.Get("type_name"); // 读取配置 if (xconfig.Contains("option_track")) { _optionTrack = xconfig.GetInteger("option_track"); } // 读取节点集合 foreach (FXmlNode xnode in xconfig.Nodes) { // 读取阴影 if (xnode.IsName("Shadow")) { _shadow1.LoadConfig(xnode, "1"); _shadow2.LoadConfig(xnode, "2"); _shadow3.LoadConfig(xnode, "3"); _shadowAmbientMin = xnode.GetFloat("ambient_min", _shadowAmbientMin); _shadowAmbientMax = xnode.GetFloat("ambient_max", _shadowAmbientMax); _shadowAmbientThick = xnode.GetFloat("ambient_thick", _shadowAmbientThick); _shadowAmbientRange = xnode.GetFloat("ambient_range", _shadowAmbientRange); _shadowMerge1Base = xnode.GetFloat("merge1_base", _shadowMerge1Base); _shadowMerge1Rate = xnode.GetFloat("merge1_rate", _shadowMerge1Rate); _shadowMerge2Base = xnode.GetFloat("merge2_base", _shadowMerge2Base); _shadowMerge2Rate = xnode.GetFloat("merge2_rate", _shadowMerge2Rate); } // 读取材质 if (xnode.IsName("Material")) { _material.LoadConfig(xnode); } // 读取相机 if (xnode.IsName("Camera")) { _camera.LoadConfig(xnode); } } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 //============================================================ public virtual void LoadConfig(FXmlNode xconfig) { // 检查是否为设置文件 if (xconfig.Name != "Configuration") { return; } // 读取名称 if (xconfig.Contains("name")) { _name = xconfig.Get("name"); } // 读取标签 if (xconfig.Contains("label")) { _label = xconfig.Get("label"); } // 读取索引 if (xconfig.Contains("display_index")) { _displayIndex = xconfig.GetInteger("display_index"); } }
//============================================================ // <T>加载设置节点。</T> // // @param xconfig 配置节点 //============================================================ public override void LoadConfig(FXmlNode xconfig) { base.LoadConfig(xconfig); _distance = xconfig.GetInteger("distance"); _angle = xconfig.GetInteger("angle"); _blurX = xconfig.GetInteger("blur_x"); _blurY = xconfig.GetInteger("blur_y"); _strength = xconfig.GetInteger("strength"); _quality = xconfig.GetInteger("quality"); _type = xconfig.Get("type"); _knockout = xconfig.GetBoolean("knockout"); foreach (FXmlNode xnode in xconfig.Nodes) { if (xnode.IsName("Effect")) { STplEffect effect = new STplEffect(); effect.color = Color.FromArgb(RInt.ParseHex(xnode.Get("color"))); effect.alpha = xnode.GetFloat("alpha"); effect.ratio = xnode.GetInteger("ratio"); _effects.Push(effect); } } }