本文整理汇总了C++中getSettingString函数的典型用法代码示例。如果您正苦于以下问题:C++ getSettingString函数的具体用法?C++ getSettingString怎么用?C++ getSettingString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSettingString函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSettingString
double SettingsBase::getSettingInMillimetersPerSecond(std::string key)
{
std::string value = getSettingString(key);
// return std::max(1.0, atof(value.c_str()));
return 1.0 > atof(value.c_str()) ? 1.0 : atof(value.c_str());
}
示例2: getSettingString
EPlatformAdhesion SettingsBaseVirtual::getSettingAsPlatformAdhesion(std::string key) const
{
std::string value = getSettingString(key);
if (value == "brim")
return EPlatformAdhesion::BRIM;
if (value == "raft")
return EPlatformAdhesion::RAFT;
return EPlatformAdhesion::SKIRT;
}
示例3: getSettingString
ESupportType SettingsBase::getSettingAsSupportType(std::string key)
{
std::string value = getSettingString(key);
if (value == "Everywhere")
return Support_Everywhere;
if (value == "Touching Buildplate")
return Support_PlatformOnly;
return Support_None;
}
示例4: getSettingString
FlowTempGraph SettingsBaseVirtual::getSettingAsFlowTempGraph(std::string key) const
{
FlowTempGraph ret;
const char* c_str = getSettingString(key).c_str();
char const* char_p = c_str;
while (*char_p != '[')
{
if (*char_p == '\0') //We've reached the end of string without encountering the first opening bracket.
{
return ret; //Empty at this point.
}
char_p++;
}
char_p++; // skip the '['
for (; *char_p != '\0'; char_p++)
{
while (*char_p != '[')
{
if (*char_p == '\0') //We've reached the end of string without finding the next opening bracket.
{
return ret; //Don't continue parsing this item then. Just stop and return.
}
char_p++;
}
char_p++; // skip the '['
char* end;
double first = strtod(char_p, &end); //If not a valid number, this becomes zero.
char_p = end;
while (*char_p != ',')
{
if (*char_p == '\0') //We've reached the end of string without finding the comma.
{
return ret; //This entry is incomplete.
}
char_p++;
}
char_p++; // skip the ','
double second = strtod(char_p, &end); //If not a valid number, this becomes zero.
ret.data.emplace_back(first, second);
char_p = end;
while (*char_p != ']')
{
if (*char_p == '\0') //We've reached the end of string without finding the closing bracket.
{
return ret; //This entry is probably complete and has been added, but stop searching.
}
char_p++;
}
char_p++; // skip the ']'
if (*char_p == ']' || *char_p == '\0')
{
break;
}
}
return ret;
}
示例5: stoul
unsigned int SettingsBaseVirtual::getSettingAsLayerNumber(std::string key) const
{
const unsigned int indicated_layer_number = stoul(getSettingString(key));
if (indicated_layer_number < 1) //Input checking: Layer 0 is not allowed.
{
cura::logWarning("Invalid layer number %i for setting %s.", indicated_layer_number, key.c_str());
return 0; //Assume layer 1.
}
return indicated_layer_number - 1; //Input starts counting at layer 1, but engine code starts counting at layer 0.
}
示例6: getSettingString
DraftShieldHeightLimitation SettingsBaseVirtual::getSettingAsDraftShieldHeightLimitation(const std::string key) const
{
const std::string value = getSettingString(key);
if (value == "full")
{
return DraftShieldHeightLimitation::FULL;
}
else if (value == "limited")
{
return DraftShieldHeightLimitation::LIMITED;
}
return DraftShieldHeightLimitation::FULL; //Default.
}
示例7: getSettingString
void Lightcone::write() {
stringstream ss;
ss << OUTPUT_PATH;
ss << getSettingString();
ss << "." << "csv";
outputFilePath = ss.str();
ofstream file(ss.str().c_str());
if (file.is_open()) {
file << "x, y, z, sid, id\n";
for (vector<Particle>::iterator it = mParticles.begin();
it != mParticles.end(); it++) {
file << it->x << ", " << it->y << ", " << it->z << ", " << it->sid
<< "," << it->id << "\n";
}
printf("[SUCCESS] Saved Lightcone file to %s\n", ss.str().c_str());
} else {
printf("[FAIL] Unable to write to %s\n", ss.str().c_str());
}
}
示例8: getSettingString
FlowTempGraph SettingsBaseVirtual::getSettingAsFlowTempGraph(std::string key)
{
FlowTempGraph ret;
const char* c_str = getSettingString(key).c_str();
char const* char_p = c_str;
while (*char_p != '[')
{
char_p++;
}
char_p++; // skip the '['
for (; *char_p != '\0'; char_p++)
{
while (*char_p != '[')
{
char_p++;
}
char_p++; // skip the '['
char* end;
double first = strtod(char_p, &end);
char_p = end;
while (*char_p != ',')
{
char_p++;
}
char_p++; // skip the ','
double second = strtod(char_p, &end);
char_p = end;
while (*char_p != ']')
{
char_p++;
}
char_p++; // skip the ']'
ret.data.emplace_back(first, second);
if (*char_p == ']')
{
break;
}
}
return ret;
}
示例9: getSettingString
String ProjectExporter::getLegacyModulePath() const
{
return getSettingString ("juceFolder");
}