//============================================================s public FDxTechnique Get(FDxDevice3D device, string type) { FDxTechnique technique = _techniques.Find(type); if (null == technique) { technique = Create(type); technique.Device = device; technique.Setup(); _techniques.Set(type, technique); } return(technique); }
//============================================================ // <T>生成设计颜色。</T> // // @param color 颜色 // @return 颜色 //============================================================ public FUiColor BuildDesignColor(Color color) { string code = color.ToArgb().ToString(); FUiColor result = _designColors.Find(code); if (result == null) { result = new FUiColor(); result.Set(color.R, color.G, color.B, color.A); result.brush = _context.Device.CreateSolidBrush(result); _designColors.Set(code, result); } return(result); }
static void FilterProject(string projectName, string path) { // 获得项目文件集合 FDictionary <SFileInfo> infos = new FDictionary <SFileInfo>(); foreach (string fileName in RDirectory.ListFiles(path)) { if (fileName.EndsWith(".h") || fileName.EndsWith(".cpp")) { string formatName = fileName.Replace('\\', '/'); string name = RString.Right(formatName, "/"); SFileInfo info = new SFileInfo(); info.fileName = formatName; info.include = false; infos.Set(name, info); } } // 查找使用中的文件集合 string configFileName = path + "/vcproject/" + projectName + ".vcxproj"; FXmlDocument document = new FXmlDocument(configFileName); foreach (FXmlNode xnode in document.Root.Nodes) { if (xnode.IsName("ItemGroup")) { foreach (FXmlNode xfile in xnode.Nodes) { if (xfile.IsName("ClInclude") || xfile.IsName("ClCompile")) { string include = xfile.Get("Include"); string name = RString.Right(include, "\\"); SFileInfo info = infos.Find(name); if (info != null) { info.include = true; } } } } } // 查找删除集合 foreach (SFileInfo info in infos.Values) { if (!info.include) { RLogger.Find(typeof(SFileInfo)).Debug(null, "FilterProject", info.fileName); File.Delete(info.fileName); } } // 查找没用目录 RDirectory.Delete(path + "/build"); RDirectory.Delete(path + "/dist"); RDirectory.Delete(path + "/nbproject/private"); RDirectory.Delete(path + "/maproject/libs"); RDirectory.Delete(path + "/maproject/obj"); RDirectory.Delete(path + "/vcproject/Debug"); RDirectory.Delete(path + "/vcproject/Release"); RDirectory.Delete(path + "/vcproject/x64"); File.Delete(path + "/vcproject/" + projectName + ".vcxproj.user"); }
//============================================================ // <T>同步属性编辑器</T> // // @param typeName 类型 // @return 属性编辑器 //============================================================ public QUiProperty SyncProperty(string typeName, FRcObject resource, bool type) { QUiProperty property = _properties.Find(typeName); if (property == null) { property = new QUiProperty(); property.Dock = DockStyle.Top; IUiPropertyEditor editor = CreateProperty(typeName); editor.Setup(); editor.PropertyChanged += OnPropertyChanged; UserControl control = editor as UserControl; property.LinkPanel(control); _properties.Set(typeName, property); } if (type) { property.LoadResource(resource); property.Visible = true; } else { property.Visible = false; } return(property); }
//============================================================ // <T>根据指定颜色生成默认色刷。</T> // // @param color 颜色 // @return 色刷 //============================================================ public FDxSolidBrush BuildSoldBrush(int color) { string code = color.ToString(); FDxSolidBrush brush = _designColors.Find(code); if (brush == null) { brush = _device.CreateSolidBrush(Color.FromArgb(color)); _designColors.Set(code, brush); } return(brush); }
//============================================================ public FDxRsTemplate Get(string code) { FDxRsTemplate template = _templates.Find(code); if (null == template) { template = new FDxRsTemplate(); string fileName = MakeFileName(code); template.LoadFile(fileName); _templates.Set(code, template); } return(template); }
//============================================================ public FDxRsModel Get(string code) { FDxRsModel model = _models.Find(code); if (null == model) { model = new FDxRsModel(); string fileName = MakeFileName(code); model.LoadFile(fileName); _models.Set(code, model); } return(model); }
//============================================================ // <T>根据名称打开界面。</T> // // @param name 名称 // @return 界面 //============================================================ public FUiFrame OpenFrame(string name) { FUiFrame frame = _frames.Find(name); if (frame == null) { FRcFrame resource = RContent2dManager.FrameConsole.OpenFrame(name); frame = CreateComponent(resource.TypeName) as FUiFrame; frame.LoadResource(resource); _frames.Set(name, frame); } return(frame); }
//============================================================ public FDxRsTexturePack Get(string code) { FDxRsTexturePack texture = _textures.Find(code); if (null == texture) { texture = new FDxRsTexturePack(); string fileName = MakeFileName(code); texture.LoadFile(fileName); _textures.Set(code, texture); } return(texture); }
//============================================================s public FDxEffect Get(FDxDevice3D device, string type) { FDxEffect effect = _effects.Find(type); if (null == effect) { effect = Create(type); effect.Device = device; effect.LoadFile(_path + "\\" + type + ".fx"); effect.Setup(); _effects.Set(type, effect); } return(effect); }
//============================================================ // <T>根据类型名称创建界面组件。</T> // // @param typeName 类型名称 //============================================================ public QUiDesignForm OpenDesignForm(string name) { // 弹出画面 QUiDesignForm form = _frameForms.Find(name); if (form == null) { FUiFrame frame = OpenFrame(name); form = new QUiDesignForm(); form.LoadFrame(frame); _frameForms.Set(name, form); } return(form); }
//============================================================ public FDxModel Get(FDxDevice3D device, string code) { FDxModel model = _models.Find(code); if (null == model) { // 创建模型 model = new FDxModel(); model.Device = device; // 加载模型资源 FDxRsModel rsModel = RDxCore.ModelResourceConsole.Get(code); model.LoadResource(rsModel); // 存储模型 _models.Set(code, model); } return(model); }
//============================================================ public FDxModelTexture Get(FDxDevice3D device, string code, int typeCd) { string name = code + "|" + typeCd; FDxModelTexture texture = _textures.Find(name); if (null == texture) { // 创建模型 texture = new FDxModelTexture(); texture.Device = device; // 加载模型资源 FDxRsTexturePack rsTexture = RDxCore.TextureResourceConsole.Get(code); FDxRsTextureBitmapPack rsPack = rsTexture.Packs[typeCd]; texture.LoadResource(rsPack); // 存储模型 _textures.Set(name, texture); } return(texture); }
//============================================================ // <T>根据名称查找模型。</T> // // @param name 名称 // @return 模型 //============================================================ public FDrModel Find(string name) { string code = RDrUtil.FormatPathToCode(name); return(_models.Find(code)); }
//============================================================ // <T>根据名称获得样式。</T> // // @param name 名称 // @return 样式 //============================================================ public FTplThemeStyle FindStyle(string name) { return(_styles.Find(name)); }
//============================================================ // <T>根据代码查找资源组对象。</T> // // @param code 代码 // @return 资源组对象 //============================================================ public FDrResourceGroup Find(string code) { return(_resourceGroups.Find(code)); }
//============================================================ // <T>根据名称查找材质。</T> // // @param name 名称 // @return 材质 //============================================================ public FDrMaterialGroup FindGroup(string name) { string code = RDrUtil.FormatPathToCode(name); return(_materials.Find(code)); }
//============================================================ // <T>根据名称获得主题。</T> // // @param name 名称 // @return 主题 //============================================================ public FTplTheme FindTheme(string name) { return(_themes.Find(name)); }
//============================================================ // <T>根据名称查找纹理。</T> // // @param name 名称 // @return 纹理 //============================================================ public FDrTexture Find(string name) { string code = RDrUtil.FormatPathToCode(name); return(_textures.Find(code)); }
//============================================================ // <T>根据名称查找模板。</T> // // @param name 名称 // @return 模板 //============================================================ public FDrCamera Find(string name) { string code = RDrUtil.FormatPathToCode(name); return(_cameras.Find(code)); }
//============================================================ // <T>根据名称查找界面资源。</T> // // @param name 名称 // @return 界面资源 //============================================================ public FRcFrame FindFrame(string name) { return(_frames.Find(name)); }
//============================================================ // <T>根据名称查找场景。</T> // // @param name 名称 // @return 场景 //============================================================ public FDrSceneGroup Find(string name) { string code = RDrUtil.FormatPathToCode(name); return(_sceneGroups.Find(code)); }
//============================================================ // <T>根据名称获得属性。</T> // // @param name 名称 // @return 属性 //============================================================ public FTplThemeStyleProperty FindProperty(string name) { return(_properties.Find(name)); }
//============================================================ public FDrModelMaterial FindByName(string name) { return(_names.Find(name)); }
//============================================================ // <T>根据名称查找几何体。</T> // // @return 几何体 //============================================================ public FDrGeometry Find(string name) { return(_geometryDictionary.Find(name)); }