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


C++ DBNetworkIF::Trim方法代码示例

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


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

示例1: RGISEditNetTrimCBK

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

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

	UIPauseDialogOpen ((char *) "Building Topological Networks");
	netIF->Trim ();
	workspace->CurrentData (netData);
	UIPauseDialogClose ();

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

示例2: main


//.........这里部分代码省略.........
        }
        if ((argv[argPos][0] == '-') && ((int) strlen(argv[argPos]) > 1)) {
            CMmsgPrint(CMmsgUsrError, "Unknown option: %s!", argv[argPos]);
            return (CMfailed);
        }
        argPos++;
    }

    if (argNum > 3) {
        CMmsgPrint(CMmsgUsrError, "Extra arguments!");
        return (CMfailed);
    }
    if (verbose) RGlibPauseOpen(argv[0]);

    if (expr != (char *) NULL) {
        operand = new DBMathOperand(expr);
        if (operand->Expand(variables) == DBFault) return (CMfailed);
    }

    data = new DBObjData();
    if (((argNum > 1) && (strcmp(argv[1], "-") != 0) ? data->Read(argv[1]) : data->Read(stdin)) == DBFault) {
        delete data;
        delete operand;
        return (CMfailed);
    }

    if (tableName == (char *) NULL) tableName = DBrNItems;
    if (strcmp (tableName,DBrNCells) == 0) netIF = new DBNetworkIF (data);

    if ((table = data->Table(tableName)) == (DBObjTable *) NULL) {
        CMmsgPrint(CMmsgUsrError, "Invalid table!");
        delete data;
        delete operand;
        return (CMfailed);
    }

    saveTable = new DBObjTable(*table);
    if (netIF != (DBNetworkIF *) NULL) {
        for (cellID = 0; cellID < table->ItemNum(); ++cellID) {
            record = table->Item(cellID);
            netIF->CellDelete(record);
        }
    }
    table->DeleteAll();
    if ((strcmp(tableName, DBrNItems) == 0) && ((groups = data->Table(DBrNGroups)) != (DBObjTable *) NULL)) {
        saveGroups = new DBObjTable(*groups);
        groups->DeleteAll();
    }

    if (expr != (char *) NULL) {
        if (operand->Configure(saveTable->Fields()) == DBFault) {
            delete data;
            delete operand;
            return (CMfailed);
        }

        for (recID = 0; recID < saveTable->ItemNum(); ++recID) {
            record = saveTable->Item(recID);
            if (operand->Int(record) == true) {
                if (!fromSelection) continue;
                if ((record->Flags() & DBObjectFlagSelected) == DBObjectFlagSelected) continue;
            }
            table->Add(new DBObjRecord(*record));
            if (groups != (DBObjTable *) NULL) groups->Add(new DBObjRecord(*(saveGroups->Item(recID))));
        }
    }
    else {
        if (fromSelection) {
            for (recID = 0; recID < saveTable->ItemNum(); ++recID) {
                record = saveTable->Item(recID);
                if ((record->Flags() & DBObjectFlagSelected) == DBObjectFlagSelected) {
                    table->Add(new DBObjRecord(*record));
                    if (groups != (DBObjTable *) NULL)
                        groups->Add(new DBObjRecord(*(saveGroups->Item(recID))));
                }
            }
        }
    }
    if (netIF != (DBNetworkIF *) NULL) {
        for (cellID = 0; cellID < netIF->CellNum(); ++cellID) {
            record = table->Item(cellID);
            netIF->CellAdd(record);
        }
    }

    if (expr != (char *) NULL) delete operand;
    delete variables;
    delete saveTable;
    if (groups != (DBObjTable *) NULL) delete saveGroups;

    if (netIF != (DBNetworkIF *) NULL) {
        netIF->Trim();
        netIF->Build();
        delete netIF;
    }
    ret = (argNum > 2) && (strcmp(argv[2], "-") != 0) ? data->Write(argv[2]) : data->Write(stdout);
    delete data;
    if (verbose) RGlibPauseClose();
    return (ret);
}
开发者ID:bmfekete,项目名称:RGIS,代码行数:101,代码来源:CMDtblDeleteRec.C


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