本文整理汇总了C++中base::Reference::SetInt方法的典型用法代码示例。如果您正苦于以下问题:C++ Reference::SetInt方法的具体用法?C++ Reference::SetInt怎么用?C++ Reference::SetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base::Reference
的用法示例。
在下文中一共展示了Reference::SetInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveSettings
void DlgImportExportIges::saveSettings()
{
int unit = ui->comboBoxUnits->currentIndex();
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES");
hGrp->SetInt("Unit", unit);
switch (unit) {
case 1:
Interface_Static::SetCVal("write.iges.unit","M");
break;
case 2:
Interface_Static::SetCVal("write.iges.unit","IN");
break;
default:
Interface_Static::SetCVal("write.iges.unit","MM");
break;
}
hGrp->SetBool("BrepMode", bg->checkedId() == 1);
Interface_Static::SetIVal("write.iges.brep.mode", bg->checkedId());
// Import
hGrp->SetBool("SkipBlankEntities", ui->checkSkipBlank->isChecked());
// header info
hGrp->SetASCII("Company", ui->lineEditCompany->text().toLatin1());
hGrp->SetASCII("Author", ui->lineEditAuthor->text().toLatin1());
//hGrp->SetASCII("Product", ui->lineEditProduct->text().toLatin1());
Interface_Static::SetCVal("write.iges.header.company", ui->lineEditCompany->text().toLatin1());
Interface_Static::SetCVal("write.iges.header.author", ui->lineEditAuthor->text().toLatin1());
//Interface_Static::SetCVal("write.iges.header.product", ui->lineEditProduct->text().toLatin1());
}
示例2: setInt
Py::Object ParameterGrpPy::setInt(const Py::Tuple& args)
{
char *pstr;
int Int;
if (!PyArg_ParseTuple(args.ptr(), "si", &pstr,&Int))
throw Py::Exception();
_cParamGrp->SetInt(pstr,Int);
return Py::None();
}
示例3:
PyObject *ParameterGrpPy::PySetInt(PyObject *args)
{
char *pstr;
long Int;
if (!PyArg_ParseTuple(args, "si", &pstr,&Int)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
_cParamGrp->SetInt(pstr,Int);
Py_Return;
}PY_CATCH;
}
示例4: insertTo
void ParameterGrp::insertTo(Base::Reference<ParameterGrp> Grp)
{
// copy group
std::vector<Base::Reference<ParameterGrp> > Grps = GetGroups();
std::vector<Base::Reference<ParameterGrp> >::iterator It1;
for (It1 = Grps.begin();It1 != Grps.end();++It1)
(*It1)->insertTo(Grp->GetGroup((*It1)->GetGroupName()));
// copy strings
std::vector<std::pair<std::string,std::string> > StringMap = GetASCIIMap();
std::vector<std::pair<std::string,std::string> >::iterator It2;
for (It2 = StringMap.begin();It2 != StringMap.end();++It2)
Grp->SetASCII(It2->first.c_str(),It2->second.c_str());
// copy bool
std::vector<std::pair<std::string,bool> > BoolMap = GetBoolMap();
std::vector<std::pair<std::string,bool> >::iterator It3;
for (It3 = BoolMap.begin();It3 != BoolMap.end();++It3)
Grp->SetBool(It3->first.c_str(),It3->second);
// copy int
std::vector<std::pair<std::string,long> > IntMap = GetIntMap();
std::vector<std::pair<std::string,long> >::iterator It4;
for (It4 = IntMap.begin();It4 != IntMap.end();++It4)
Grp->SetInt(It4->first.c_str(),It4->second);
// copy float
std::vector<std::pair<std::string,double> > FloatMap = GetFloatMap();
std::vector<std::pair<std::string,double> >::iterator It5;
for (It5 = FloatMap.begin();It5 != FloatMap.end();++It5)
Grp->SetFloat(It5->first.c_str(),It5->second);
// copy uint
std::vector<std::pair<std::string,unsigned long> > UIntMap = GetUnsignedMap();
std::vector<std::pair<std::string,unsigned long> >::iterator It6;
for (It6 = UIntMap.begin();It6 != UIntMap.end();++It6)
Grp->SetUnsigned(It6->first.c_str(),It6->second);
}