本文整理汇总了C++中CSG_MetaData::Cmp_Name方法的典型用法代码示例。如果您正苦于以下问题:C++ CSG_MetaData::Cmp_Name方法的具体用法?C++ CSG_MetaData::Cmp_Name怎么用?C++ CSG_MetaData::Cmp_Name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSG_MetaData
的用法示例。
在下文中一共展示了CSG_MetaData::Cmp_Name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read_ToolChain
//---------------------------------------------------------
int CTL_Extract::Read_ToolChain(const SG_Char *File, CSG_Table &Elements)
{
//-----------------------------------------------------
CSG_MetaData Chain;
if( Chain.Load(File) )
{
Process_Set_Text(CSG_String::Format("%s: %s", SG_T("scanning"), File));
//-------------------------------------------------
if( Chain.Cmp_Name("toolchains") )
{
GET_XML_CONTENT(Chain, "name" );
GET_XML_CONTENT(Chain, "menu" );
// GET_XML_CONTENT(Chain, "description");
return( 1 );
}
//-------------------------------------------------
if( Chain.Cmp_Name("toolchain") )
{
GET_XML_CONTENT(Chain, "name" );
GET_XML_CONTENT(Chain, "menu" );
// GET_XML_CONTENT(Chain, "description");
if( Chain("parameters") )
{
for(int i=0; i<Chain["parameters"].Get_Children_Count(); i++)
{
const CSG_MetaData &Parameter = Chain["parameters"][i];
GET_XML_CONTENT(Parameter, "name" );
GET_XML_CONTENT(Parameter, "description");
}
}
return( 1 );
}
}
return( 0 );
}
示例2: _Load_Map
//---------------------------------------------------------
bool CWKSP_Project::_Load_Map(CSG_MetaData &Entry, const wxString &ProjectDir)
{
TSG_Rect Extent;
if( !Entry.Cmp_Name("MAP")
|| !Entry.Get_Child("XMIN") || !Entry.Get_Child("XMIN")->Get_Content().asDouble(Extent.xMin)
|| !Entry.Get_Child("XMAX") || !Entry.Get_Child("XMAX")->Get_Content().asDouble(Extent.xMax)
|| !Entry.Get_Child("YMIN") || !Entry.Get_Child("YMIN")->Get_Content().asDouble(Extent.yMin)
|| !Entry.Get_Child("YMAX") || !Entry.Get_Child("YMAX")->Get_Content().asDouble(Extent.yMax) )
{
return( false );
}
//-----------------------------------------------------
CSG_MetaData *pNode = Entry.Get_Child("LAYERS");
if( pNode == NULL || pNode->Get_Children_Count() <= 0 )
{
return( false );
}
//-----------------------------------------------------
int i, n;
for(i=0, n=0; i<pNode->Get_Children_Count(); i++)
{
if( pNode->Get_Child(i)->Cmp_Name("FILE") )
{
wxString FileName(pNode->Get_Child(i)->Get_Content().w_str());
if( FileName.Find("PGSQL") != 0 )
{
FileName = Get_FilePath_Absolute(ProjectDir, FileName);
}
CWKSP_Base_Item *pItem = _Get_byFileName(FileName);
if( pItem &&
( pItem->Get_Type() == WKSP_ITEM_Grid
|| pItem->Get_Type() == WKSP_ITEM_Grids
|| pItem->Get_Type() == WKSP_ITEM_TIN
|| pItem->Get_Type() == WKSP_ITEM_PointCloud
|| pItem->Get_Type() == WKSP_ITEM_Shapes) )
{
n++;
}
}
}
if( n == 0 )
{
return( false );
}
//-----------------------------------------------------
CWKSP_Map *pMap = new CWKSP_Map;
pMap->Get_Parameter("CRS_CHECK")->Set_Value(false);
for(int i=0; i<pNode->Get_Children_Count(); i++)
{
if( pNode->Get_Child(i)->Cmp_Name("FILE") )
{
wxString FileName(pNode->Get_Child(i)->Get_Content().w_str());
if( FileName.Find("PGSQL") != 0 )
{
FileName = Get_FilePath_Absolute(ProjectDir, FileName);
}
CWKSP_Base_Item *pItem = _Get_byFileName(FileName);
if( pItem &&
( pItem->Get_Type() == WKSP_ITEM_Grid
|| pItem->Get_Type() == WKSP_ITEM_Grids
|| pItem->Get_Type() == WKSP_ITEM_TIN
|| pItem->Get_Type() == WKSP_ITEM_PointCloud
|| pItem->Get_Type() == WKSP_ITEM_Shapes) )
{
g_pMaps->Add((CWKSP_Layer *)pItem, pMap);
}
}
else if( pNode->Get_Child(i)->Cmp_Name("PARAMETERS") )
{
if( pNode->Get_Child(i)->Cmp_Property("name", "GRATICULE") )
{
pMap->Add_Graticule(pNode->Get_Child(i));
}
if( pNode->Get_Child(i)->Cmp_Property("name", "BASEMAP") )
{
pMap->Add_BaseMap (pNode->Get_Child(i));
}
}
}
pMap->Get_Parameter("CRS_CHECK")->Set_Value(true);
//-----------------------------------------------------
//.........这里部分代码省略.........
示例3: _Load_Data
//---------------------------------------------------------
bool CWKSP_Project::_Load_Data(CSG_MetaData &Entry, const wxString &ProjectDir, bool bLoad, const CSG_String &Version)
{
if( !Entry.Cmp_Name("DATASET") || !Entry("FILE") || Entry["FILE"].Get_Content().is_Empty() )
{
return( false );
}
TSG_Data_Object_Type Type =
Entry.Cmp_Property("type", "GRID" ) ? SG_DATAOBJECT_TYPE_Grid
: Entry.Cmp_Property("type", "GRIDS" ) ? SG_DATAOBJECT_TYPE_Grids
: Entry.Cmp_Property("type", "TABLE" ) ? SG_DATAOBJECT_TYPE_Table
: Entry.Cmp_Property("type", "SHAPES") ? SG_DATAOBJECT_TYPE_Shapes
: Entry.Cmp_Property("type", "TIN" ) ? SG_DATAOBJECT_TYPE_TIN
: Entry.Cmp_Property("type", "POINTS") ? SG_DATAOBJECT_TYPE_PointCloud
: SG_DATAOBJECT_TYPE_Undefined;
if( Type == SG_DATAOBJECT_TYPE_Undefined )
{
return( false );
}
//-----------------------------------------------------
wxString File = Entry("FILE")->Get_Content().c_str();
if( File.Find("PGSQL") != 0 && wxFileExists(Get_FilePath_Absolute(ProjectDir, File)) )
{
File = Get_FilePath_Absolute(ProjectDir, File);
}
//-----------------------------------------------------
CWKSP_Base_Item *pItem = NULL;
if( bLoad )
{
if( Type == SG_DATAOBJECT_TYPE_Grid && Entry("PARAMETERS"))
{
for(int i=0; i<Entry["PARAMETERS"].Get_Children_Count() && !pItem; i++)
{
if( Entry["PARAMETERS"][i].Cmp_Property("id", "FILE_CACHE") )
{
bool bCached = Entry["PARAMETERS"][i].Cmp_Content("TRUE", true);
pItem = g_pData->Add(SG_Create_Grid(&File, SG_DATATYPE_Undefined, bCached));
}
}
}
}
if( !pItem )
{
pItem = bLoad ? g_pData->Open(File, Type) : _Get_byFileName(File);
}
//-----------------------------------------------------
if( !pItem || !pItem->Get_Parameters() || !Entry.Get_Child("PARAMETERS") )
{
if( bLoad )
{
MSG_Error_Add(wxString::Format("%s [%s]", _TL("failed to load data"), File.c_str()));
}
return( false );
}
//-----------------------------------------------------
CSG_MetaData *pEntry = Entry("PARAMETERS");
for(int i=0; i<pEntry->Get_Children_Count(); i++)
{
if( !pEntry->Get_Child(i)->Get_Name().CmpNoCase("DATA") && !pEntry->Get_Child(i)->Get_Content().is_Empty() && pEntry->Get_Child(i)->Get_Content().BeforeFirst(':').CmpNoCase("PGSQL") )
{
wxString File(Get_FilePath_Absolute(ProjectDir, pEntry->Get_Child(i)->Get_Content().w_str()));
pEntry->Get_Child(i)->Set_Content(&File);
// if( SG_Compare_SAGA_Version(Version) < 0 )
{
if( pEntry->Get_Child(i)->Cmp_Property("id", "OVERLAY_1") )
{
pEntry->Get_Child(i)->Set_Property("id", "OVERLAY_G");
}
if( pEntry->Get_Child(i)->Cmp_Property("id", "OVERLAY_2") )
{
pEntry->Get_Child(i)->Set_Property("id", "OVERLAY_B");
}
}
}
}
pItem->Get_Parameters()->Serialize(*Entry.Get_Child("PARAMETERS"), false);
//-----------------------------------------------------
if( SG_Compare_Version(Version, "7.0.0") < 0 ) // inter-version-compatibility
{
CSG_Parameter *pParameter = pItem->Get_Parameter("COLORS_TYPE");
if( pParameter && Type == SG_DATAOBJECT_TYPE_Grid )
{
//.........这里部分代码省略.........