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


C++ tgt::ivec4方法代码示例

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


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

示例1: result

tgt::vec4 TransFunc1DKeys::getMeanValue(float segStart, float segEnd) const {
    ivec4 result(0);
    float width = static_cast<float>(tex_->getWidth());
    for (int i = static_cast<int>(segStart*width); i < segEnd*width; ++i)
        result += ivec4(tex_->texel<col4>(i));

    return static_cast<tgt::vec4>(result)/(segEnd*width-segStart*width);
}
开发者ID:molsimmsu,项目名称:3mview,代码行数:8,代码来源:transfunc1dkeys.cpp

示例2: result

tgt::vec4 TransFunc1DKeys::getMeanValue(float segStart, float segEnd) const {
    ivec4 result(0);
    if (!tex_ || textureInvalid_) {
        LWARNING("getMeanValue(): texture is invalid");
        return result;
    }

    float width = static_cast<float>(tex_->getWidth());
    for (int i = static_cast<int>(segStart*width); i < segEnd*width; ++i)
        result += ivec4(tex_->texel<col4>(i));

    return static_cast<tgt::vec4>(result)/(segEnd*width-segStart*width);
}
开发者ID:emmaai,项目名称:fractalM,代码行数:13,代码来源:transfunc1dkeys.cpp

示例3: createType

Serializable* KeyValueFactory::createType(const std::string& typeString) {
    using tgt::ivec2;
    using tgt::ivec3;
    using tgt::ivec4;
    using tgt::vec2;
    using tgt::vec3;
    using tgt::vec4;
    using tgt::mat2;
    using tgt::mat3;
    using tgt::mat4;

    if (typeString == "KeyValue_float")
        return new PropertyKeyValue<float>(0, 0);
    else if (typeString == "KeyValue_int")
        return new PropertyKeyValue<int>(0, 0);
    else if (typeString == "KeyValue_bool")
        return new PropertyKeyValue<bool>(0, 0);
    else if (typeString == "KeyValue_ivec2")
        return new PropertyKeyValue<ivec2>(ivec2(0), 0);
    else if (typeString == "KeyValue_ivec3")
        return new PropertyKeyValue<ivec3>(ivec3(0), 0);
    else if (typeString == "KeyValue_ivec4")
        return new PropertyKeyValue<ivec4>(ivec4(0), 0);
    else if (typeString == "KeyValue_vec2")
        return new PropertyKeyValue<vec2>(vec2(0.0f), 0);
    else if (typeString == "KeyValue_vec3")
        return new PropertyKeyValue<vec3>(vec3(0.0f), 0);
    else if (typeString == "KeyValue_vec4")
        return new PropertyKeyValue<vec4>(vec4(0.0f), 0);
    else if (typeString == "KeyValue_mat2")
        return new PropertyKeyValue<mat2>(mat2(0.0f), 0);
    else if (typeString == "KeyValue_mat3")
        return new PropertyKeyValue<mat3>(mat3(0.0f), 0);
    else if (typeString == "KeyValue_mat4")
        return new PropertyKeyValue<mat4>(mat4(0.0f), 0);
    else if (typeString == "KeyValue_Camera")
        return new PropertyKeyValue<tgt::Camera>(tgt::Camera(vec3(0.0f), vec3(0.0f), vec3(0.0f)), 0);
    else if (typeString == "KeyValue_string")
        return new PropertyKeyValue<std::string>("", 0);
    else if (typeString == "KeyValue_ShaderSource")
        return new PropertyKeyValue<ShaderSource>(ShaderSource(), 0);
    else if (typeString == "KeyValue_TransFunc")
        return new PropertyKeyValue<TransFunc*>(new TransFunc(), 0);
    else if (typeString == "KeyValue_VolumeCollection")
        return new PropertyKeyValue<VolumeCollection*>(new VolumeCollection(), 0);
    else if (typeString == "KeyValue_VolumeHandle")
        return new PropertyKeyValue<VolumeHandle*>(new VolumeHandle(), 0);
    else
        return 0;
}
开发者ID:alvatar,项目名称:smartmatter,代码行数:50,代码来源:serializationfactories.cpp


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