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


C++ getSettingString函数代码示例

本文整理汇总了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());
}
开发者ID:fhln,项目名称:CuraEngine_vs,代码行数:7,代码来源:settings.cpp

示例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;
}
开发者ID:Latrocinium,项目名称:CuraEngine,代码行数:9,代码来源:settings.cpp

示例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;
}
开发者ID:Dyocius,项目名称:CuraEngine,代码行数:9,代码来源:settings.cpp

示例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;
}
开发者ID:Kiddo3D,项目名称:CuraEngine,代码行数:56,代码来源:settings.cpp

示例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.
}
开发者ID:josefpavlik,项目名称:CuraEngine,代码行数:10,代码来源:settings.cpp

示例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.
}
开发者ID:josefpavlik,项目名称:CuraEngine,代码行数:13,代码来源:settings.cpp

示例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());
	}
}
开发者ID:anthemEdge,项目名称:Cosmic-Lightcone,代码行数:20,代码来源:Lightcone.cpp

示例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;
}
开发者ID:victorsmallwu,项目名称:CuraEngine,代码行数:40,代码来源:settings.cpp

示例9: getSettingString

String ProjectExporter::getLegacyModulePath() const
{
    return getSettingString ("juceFolder");
}
开发者ID:Theadd,项目名称:Designi,代码行数:4,代码来源:ProjectExporter.cpp


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