当前位置: 首页>>代码示例>>C++>>正文


C++ DBDataset类代码示例

本文整理汇总了C++中DBDataset的典型用法代码示例。如果您正苦于以下问题:C++ DBDataset类的具体用法?C++ DBDataset怎么用?C++ DBDataset使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DBDataset类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RGISAnalysePointSTNCharCBK

void RGISAnalysePointSTNCharCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData = dataset->Data ();
	DBObjTable *pointTable = dbData->Table (DBrNItems);
	DBObjTableField *cellIDFLD			= pointTable->Field (RGlibCellID);
	DBObjTableField *basinFLD			= pointTable->Field (DBrNBasin);
	DBObjTableField *basinNameFLD		= pointTable->Field (RGlibBasinName);
	DBObjTableField *orderFLD			= pointTable->Field (DBrNOrder);
	DBObjTableField *colorFLD			= pointTable->Field (RGlibColor);
	DBObjTableField *basinCellsFLD	= pointTable->Field (RGlibCellNum);
	DBObjTableField *basinLengthFLD	= pointTable->Field (RGlibLength);
	DBObjTableField *basinAreaFLD		= pointTable->Field (RGlibArea);
	DBObjTableField *interAreaFLD		= pointTable->Field (RGlibInterStation);
	DBObjTableField *nextStationFLD	= pointTable->Field (RGlibNextStation);
	UITable *tableCLS = (UITable *) dbData->Display (UITableName (dbData,pointTable));

	UIPauseDialogOpen ((char *) "STN Characteristics");
	if ((RGlibPointSTNCharacteristics (dbData) == DBSuccess) && (tableCLS != (UITable *) NULL))
		{
		if (cellIDFLD      == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibCellID));
		if (basinFLD       == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (DBrNBasin));
		if (basinNameFLD   == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibBasinName));
		if (orderFLD       == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (DBrNOrder));
		if (colorFLD       == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibColor));
		if (basinCellsFLD  == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibCellNum));
		if (basinLengthFLD == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibLength));
		if (basinAreaFLD   == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibArea));
		if (interAreaFLD   == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibInterStation));
		if (nextStationFLD == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibNextStation));
		tableCLS->Draw ();
		}
	UIPauseDialogClose ();
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:35,代码来源:RGISAnPoint.C

示例2: RGISAnNetworkCellSlopesCBK

void RGISAnNetworkCellSlopesCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBObjData *inGridData, *outGridData;

	widget = widget; callData = callData;

	if ((inGridData = netData->LinkedData ()) == (DBObjData *) NULL)
		{ CMmsgPrint (CMmsgAppError,"Null Linked Data in: %s %d",__FILE__,__LINE__); return; }

	outGridData = DBNetworkToGrid (netData,DBTypeGridContinuous);
	outGridData->Document (DBDocGeoDomain,inGridData->Document (DBDocGeoDomain));
	outGridData->Document (DBDocSubject,"Slope");
	if (UIDataHeaderForm (outGridData))
		{
		UIPauseDialogOpen ((char *) "Calculating Slopes");
		if (RGlibNetworkCellSlopes (netData,inGridData,outGridData) == DBSuccess)
			workspace->CurrentData  (outGridData);
		else	delete outGridData;
		UIPauseDialogClose ();
	 	}
	else	delete outGridData;
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:25,代码来源:RGISAnNetwork.C

示例3: _RGISGrpPanelNewCBK

static void _RGISGrpPanelNewCBK (Widget widget,RGISGrpPanel *grpPanel,XmAnyCallbackStruct *callData)

	{
	char *groupName;
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData  = dataset->Data ();
	DBObjTable *groupTable = dbData->Table (DBrNGroups);
	DBObjTableField *group;
	DBObjRecord *record;

	if ((groupName = UIGetString ((char *) "Group Name",16)) == (char *) NULL) return;
	if (groupTable == (DBObjTable *) NULL)
		{
		DBObjTable *items  = dbData->Table (DBrNItems);
		DBObjectLIST<DBObjTable> *tables  = dbData->Tables ();

		DBTableFieldDefinition fieldDefs [] =	{
					DBTableFieldDefinition (groupName,	DBTableFieldInt,(char *) 	"%1d",sizeof (DBByte)),
					DBTableFieldDefinition () };
		tables->Add (groupTable = new DBObjTable (DBrNGroups,fieldDefs));
		grpPanel->Groups (groupTable->Fields ());
		group = groupTable->Field (groupName);
		for (record = items->First ();record != (DBObjRecord *) NULL;record = items->Next ())
			group->Int (groupTable->Add (record->Name ()),true);
		}
	else
		{
		groupTable->AddField (group = new DBObjTableField (groupName,DBTableFieldInt,"%1d",sizeof (DBByte)));
		for (record = groupTable->First ();record != (DBObjRecord *) NULL;record = groupTable->Next ())
			group->Int (record,true);
		}
	grpPanel->Add (group);
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:33,代码来源:RGISPanels.C

示例4: RGISAnNetworkBasinProfCBK

void RGISAnNetworkBasinProfCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBObjData *gridData, *tblData;

	widget = widget; callData = callData;

	if ((gridData = netData->LinkedData ()) == (DBObjData *) NULL)
		{ CMmsgPrint (CMmsgAppError, "Null Linked Data in: %s %d",__FILE__,__LINE__); return; }

	tblData  = new DBObjData ("",DBTypeTable);
	tblData->Document (DBDocGeoDomain,netData->Document (DBDocGeoDomain));
	tblData->Document (DBDocSubject,"Basin Profiles");

	if (UIDataHeaderForm (tblData))
		{
		UIPauseDialogOpen ((char *) "Creating Basin Profiles");
		if (RGlibNetworkBasinProf (netData,gridData,tblData) == DBSuccess)
			workspace->CurrentData  (tblData);
		else	delete tblData;
		UIPauseDialogClose ();
		}
	else delete tblData;
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:26,代码来源:RGISAnNetwork.C

示例5: RGISAnalysePointSubbasinHistCBK

void RGISAnalysePointSubbasinHistCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	char *selection;
	DBDataset *dataset  = UIDataset ();
	DBObjData *pntData  = dataset->Data ();
	DBObjData *grdData  = pntData->LinkedData ();
	DBObjData *netData;
	DBObjData *tblData;
	static Widget selectWidget = (Widget) NULL;

	if (selectWidget == (Widget) NULL) selectWidget = UISelectionCreate ((char *) "Select Network");
	if ((selection = UISelectObject (selectWidget,(DBObjectLIST<DBObject> *) dataset->DataList (),_RGISAnalyseTestNetwork)) == (char *) NULL) return;
	if ((netData = dataset->Data (selection)) == (DBObjData *) NULL) {  return; }

	tblData  = new DBObjData ("",DBTypeTable);
	tblData->Document (DBDocGeoDomain,pntData->Document (DBDocGeoDomain));
	tblData->Document (DBDocSubject,"Subbasin Histogram");
	if (UIDataHeaderForm (tblData))
		{
		UIPauseDialogOpen ((char *) "Calculating Histogram");
		if (RGlibPointSubbasinHist (pntData,netData,grdData,tblData) == DBSuccess)
			workspace->CurrentData  (tblData);
		else	delete tblData;
		UIPauseDialogClose ();
		}
	else	delete tblData;
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:28,代码来源:RGISAnPoint.C

示例6: RGISAnNetworkToGridCBK

void RGISAnNetworkToGridCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	char *selection;
	DBInt dataType;
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBObjTable *cellTable = netData->Table (DBrNCells);
	DBObjTableField *field;
	DBObjData *grdData;
	static Widget select = NULL;

	if (select == NULL) select = UISelectionCreate ((char *) "Field Selection");
	selection = UISelectObject (select,(DBObjectLIST<DBObject> *) (cellTable->Fields ()),DBTableFieldIsSimple);
	if (selection == (char *) NULL) return;
	if ((field = cellTable->Field (selection)) == (DBObjTableField *) NULL)
		{ CMmsgPrint (CMmsgAppError,"Corrupt Network Dataset in: %s %d",__FILE__,__LINE__); return; }

	if (DBTableFieldIsCategory (field) && DBTableFieldIsNumeric (field))
		{
		DBObjData *tmpData;
		tmpData = new DBObjData ("",DBTypeGrid);
		tmpData->Document (DBDocGeoDomain,netData->Document (DBDocGeoDomain));
		tmpData->Document (DBDocSubject,field->Name ());
		if (UIDataHeaderForm (tmpData))
			{
			grdData = DBNetworkToGrid (netData,tmpData->Type ());
			grdData->Name (tmpData->Name ());
			grdData->Document (DBDocGeoDomain,tmpData->Document (DBDocGeoDomain));
			grdData->Document (DBDocSubject,tmpData->Document (DBDocSubject));
			grdData->Document (DBDocVersion,tmpData->Document (DBDocVersion));
			grdData->Document (DBDocCitationRef,tmpData->Document (DBDocCitationRef));
			grdData->Document (DBDocCitationInst,tmpData->Document (DBDocCitationInst));
			grdData->Document (DBDocSourceInst,tmpData->Document (DBDocSourceInst));
			grdData->Document (DBDocSourcePerson,tmpData->Document (DBDocSourcePerson));
			grdData->Document (DBDocOwnerPerson,tmpData->Document (DBDocOwnerPerson));
			grdData->Document (DBDocComment,tmpData->Document (DBDocComment));
			delete tmpData;
			}
		else { return; }
		}
	else
		{
		if (DBTableFieldIsCategory (field))		dataType = DBTypeGridDiscrete;
		else if (DBTableFieldIsNumeric (field))	dataType = DBTypeGridContinuous;
		else
			{
			CMmsgPrint (CMmsgAppError,"Invalid field type in: %s %d",__FILE__,__LINE__);
			return;
			}
		grdData = DBNetworkToGrid (netData,dataType);
		if (UIDataHeaderForm (grdData) == false) { delete grdData; return; }
		}

	UIPauseDialogOpen ((char *) "Converting Network to Grid");
	if (RGlibNetworkToGrid (netData,field,grdData) == DBSuccess) workspace->CurrentData (grdData);
	else delete grdData;
	UIPauseDialogClose ();
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:59,代码来源:RGISAnNetwork.C

示例7: RGISAnNetworkCellSampleGridCBK

void RGISAnNetworkCellSampleGridCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData  = dataset->Data (), *grdData = netData->LinkedData ();

	UIPauseDialogOpen ((char *) "Cell Sampling");
	RGlibGridSampling (netData,grdData,true);
	UIPauseDialogClose ();
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:10,代码来源:RGISAnNetwork.C

示例8: main

int main(int argc, char *argv[]) {
    int i, verbose = false;
    char *ghaasMetaDB = (char *) NULL, metaFileName[DBDataFileNameLen];
    DBObjData *dbData;
    DBDataset *dbDataset;
    DBObjectLIST<DBObjMetaEntry> *metaList;
    DBObjMetaEntry *metaEntry;

    if (argc < 2) {
        Usage(argv[0]);
        return (0);
    }

    for (i = 1; i < argc; ++i) {
        if ((strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "--help") == 0)) {
            Usage(argv[0]);
            return (0);
        }
        else if ((strcmp(argv[i], "-V") == 0) || (strcmp(argv[i], "--verbose") == 0)) verbose = true;
        else if (((strcmp(argv[i], "-m") == 0) || (strcmp(argv[i], "--MetaDB") == 0)) && (argc > i + 1)) {
            if (++i < argc) {
                ghaasMetaDB = argv[i];
                break;
            } else {
                Usage(argv[0]);
                return (0);
            }
        }
    }
    if (i == argc) i = 0;
    if (verbose) RGlibPauseOpen(argv[0]);

    if (ghaasMetaDB == (char *) NULL) {
        sprintf(metaFileName, "%s/GHAASMetadb", getenv("GHAAS_DIR") == NULL ? getenv("HOME") : getenv("GHAAS_DIR"));
        ghaasMetaDB = metaFileName;
    }
    dbDataset = new DBDataset((char *) "GHAASmetadb", ghaasMetaDB);
    metaList = dbDataset->MetaList();

    for (; i < argc - 1; ++i) {
        dbData = new DBObjData();
        if (dbData->Read(argv[i + 1]) == DBSuccess) {
            dbData->FileName(argv[i + 1]);
            dbDataset->Data(dbData);
            printf("%s\n", dbData->Name());
            metaEntry = metaList->Item(dbData->Name());
            metaEntry->FileName(dbData->FileName());
            dbDataset->RemoveData(dbData);
        }
        delete dbData;
    }
    delete dbDataset;
    if (verbose) RGlibPauseClose();
    return (0);
}
开发者ID:,项目名称:,代码行数:55,代码来源:

示例9: RGISEditGridRemovePitsCBK

void RGISEditGridRemovePitsCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *grdData = dataset->Data ();
	DBObjData *netData = grdData->LinkedData ();

	UIPauseDialogOpen ((char *) "Removing Pits");
	RGlibGridRemovePits (netData,grdData);
	UIPauseDialogClose ();
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:11,代码来源:RGISEditGrid.C

示例10: _RGISMetaDBDeleteCBK

static void _RGISMetaDBDeleteCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	char *subjectSTR = strlen (workspace->Subject ()) > 0 ? workspace->Subject () : (char *) NULL;
	char *domainSTR  = strlen (workspace->Domain ())  > 0 ? workspace->Domain ()  : (char *) NULL;
	DBObjMetaEntry *metaEntry;
	DBDataset *dataset = UIDataset ();

	if ((metaEntry = UIDatasetMetaData (subjectSTR,domainSTR,DBFault)) != (DBObjMetaEntry *) NULL)
		dataset->DeleteMetaEntry (metaEntry);
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:11,代码来源:RGISMetaDB.C

示例11: _RGISToolsDuplicateCBK

static void _RGISToolsDuplicateCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData = dataset->Data (), *newData;

	if (dbData == (DBObjData *) NULL) return;
	widget = widget; callData = callData;
	if (UIDataHeaderForm (newData = new DBObjData (*dbData)))
		workspace->CurrentData  (newData);
	else delete newData;
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:12,代码来源:RGISTools.C

示例12: RGISEditNetDistToOceanCBK

void RGISEditNetDistToOceanCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBNetworkIF *netIF = new DBNetworkIF (netData);

	UIPauseDialogOpen ((char *) "Calculate Distance to Ocean");
	netIF->SetDistToOcean ();
	UIPauseDialogClose ();
	delete netIF;
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:12,代码来源:RGISEditNet.C

示例13: RGISEditGridStatsCBK

void RGISEditGridStatsCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData = dataset->Data ();
	DBGridIF *gridIF = new DBGridIF (dbData);
	UITable *tableCLS = (UITable *) dbData->Display (UITableName (dbData,dbData->Table (DBrNItems)));

	if (dbData->Type () == DBTypeGridContinuous)
			gridIF->RecalcStats ();
	else	gridIF->DiscreteStats ();
	if (tableCLS != (UITable *) NULL) tableCLS->Draw ();
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:13,代码来源:RGISEditGrid.C

示例14: RGISEditNetBuildCBK

void RGISEditNetBuildCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBNetworkIF *netIF = new DBNetworkIF (netData);

	UIPauseDialogOpen ((char *) "Building Topological Networks");
	netIF->Build ();
	UIPauseDialogClose ();

	delete netIF;
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:13,代码来源:RGISEditNet.C

示例15: RGISEditGridRenameLayerCBK

void RGISEditGridRenameLayerCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	char *layerName;
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData = dataset->Data ();
	DBGridIF *gridIF;

	if ((layerName = UIGetString ((char *) "Layer Name",DBStringLength)) == (char *) NULL) return;
	gridIF= new DBGridIF (dbData);
	gridIF->RenameLayer (layerName);
	delete gridIF;
	workspace->CurrentData (dbData);
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:14,代码来源:RGISEditGrid.C


注:本文中的DBDataset类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。