#include "symbolresources.h" #include "translator.h" #include SymbolResources::SymbolResources() { } void SymbolResources::setResources(UGResources *resources) { this->resources = resources; } //重新载入符号库 void SymbolResources::reLoading() { // UGString marker2DPath = _U("‪D:/supermap-iobjectscpp/MyProject/MapDisplay/Symbol/MarkerLib2D.sym"); // const UGString line2DPath = _U("D:/supermap-iobjectscpp/MyProject/MapDisplay/Symbol/LineLib2D.lsl"); // const UGString fill2DPath = _U("‪D:/supermap-iobjectscpp/MyProject/MapDisplay/Symbol/FillLib2D.bru"); UGString marker2DPath = _U("D:/Symbol/MarkerLib2D.sym"); UGString line2DPath = _U("D:/Symbol/LineLib2D.lsl"); UGString fill2DPath = _U("D:/Symbol/FillLib2D.bru"); UGMarkerSymbolLib* ms = resources->GetMarkerSymbolLib(); // bool s = ms->AppendFromFile(marker2DPath,true); bool s = ms->LoadFromFile(marker2DPath); // qDebug()<<"***********s:"<GetSymbolCount(); UGLineSymbolLib* ls = resources->GetLineSymbolLib(); bool s1 = ls->LoadFromFile(line2DPath); // qDebug()<<"***********s1:"<GetSymbolCount(); UGFillSymbolLib* fs = resources->GetFillSymbolLib(); bool s2 = fs->LoadFromFile(fill2DPath); // qDebug()<<"***********s2:"<GetSymbolCount(); ms = NULL; ls = NULL; fs = NULL; } void SymbolResources::addSymbol() { UGString symbolPath = _U("D:/Symbol/Plane.sym"); UGMarkerSymbolLib* ms = new UGMarkerSymbolLib(); bool ss = ms->LoadFromFile(symbolPath); qDebug()<<"***********msCount:"<GetSymbolCount(); for(int i = 0;iGetSymbolCount();i++) { resources->GetMarkerSymbolLib()->AddSymbol(ms->GetSymbolAt(i)); } // qDebug()<<"***********msCount:"<GetMarkerSymbolLib()->GetSymbolCount(); // bool s = resources->GetMarkerSymbolLib()->IsIDExisted(253268); // qDebug()<<"***********s2:"; // delete ms; }