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


C++ SliceDataStorage::getSettingAsCount方法代码示例

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


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

示例1: computePrimeTowerMax

void PrimeTower::computePrimeTowerMax(SliceDataStorage& storage)
{   // compute storage.max_object_height_second_to_last_extruder, which is used to determine the highest point in the prime tower

    extruder_count = storage.getSettingAsCount("machine_extruder_count");

    int max_object_height_per_extruder[extruder_count];
    {   // compute max_object_height_per_extruder
        memset(max_object_height_per_extruder, -1, sizeof(max_object_height_per_extruder));
        for (SliceMeshStorage& mesh : storage.meshes)
        {
            max_object_height_per_extruder[mesh.getSettingAsIndex("extruder_nr")] =
                std::max(   max_object_height_per_extruder[mesh.getSettingAsIndex("extruder_nr")]
                            ,   mesh.layer_nr_max_filled_layer  );
        }
        int support_extruder_nr = storage.getSettingAsIndex("support_extruder_nr"); // TODO: support extruder should be configurable per object
        max_object_height_per_extruder[support_extruder_nr] =
            std::max(   max_object_height_per_extruder[support_extruder_nr]
                        ,   storage.support.layer_nr_max_filled_layer  );
        int support_roof_extruder_nr = storage.getSettingAsIndex("support_roof_extruder_nr"); // TODO: support roof extruder should be configurable per object
        max_object_height_per_extruder[support_roof_extruder_nr] =
            std::max(   max_object_height_per_extruder[support_roof_extruder_nr]
                        ,   storage.support.layer_nr_max_filled_layer  );
    }
    {   // // compute max_object_height_second_to_last_extruder
        int extruder_max_object_height = 0;
        for (int extruder_nr = 1; extruder_nr < extruder_count; extruder_nr++)
        {
            if (max_object_height_per_extruder[extruder_nr] > max_object_height_per_extruder[extruder_max_object_height])
            {
                extruder_max_object_height = extruder_nr;
            }
        }
        int extruder_second_max_object_height = -1;
        for (int extruder_nr = 0; extruder_nr < extruder_count; extruder_nr++)
        {
            if (extruder_nr == extruder_max_object_height) {
                continue;
            }
            if (max_object_height_per_extruder[extruder_nr] > max_object_height_per_extruder[extruder_second_max_object_height])
            {
                extruder_second_max_object_height = extruder_nr;
            }
        }
        if (extruder_second_max_object_height < 0)
        {
            storage.max_object_height_second_to_last_extruder = -1;
        }
        else
        {
            storage.max_object_height_second_to_last_extruder = max_object_height_per_extruder[extruder_second_max_object_height];
        }
    }

}
开发者ID:victorsmallwu,项目名称:CuraEngine,代码行数:54,代码来源:PrimeTower.cpp


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