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


C++ ParamSet类代码示例

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


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

示例1: StratifiedSampler

    StratifiedSampler(const ParamSet& paramSet)
    {
        size_t desiredSampleCount = (size_t) paramSet.getInteger("sampleCount", 1);

        size_t i = 1;
        while (i * i < desiredSampleCount)
            ++i;

        m_resolution = i;
        m_sampleCount = m_resolution * m_resolution;

        if (m_sampleCount != desiredSampleCount)
            std::cout << "Sample count should be a perfect square -- rounding to "
                      << m_sampleCount << std::endl;

        m_depth = paramSet.getInteger("depth", 3);
        m_permutations1D = new size_t*[m_depth];
        m_permutations2D = new size_t*[m_depth];

        for (int i = 0; i < m_depth; ++i)
        {
            m_permutations1D[i] = new size_t[m_sampleCount];
            m_permutations2D[i] = new size_t[m_sampleCount];
        }

        m_invResolution = 1.0f / (float)m_resolution;
        m_invResolutionSquare = 1.0f / (float) m_sampleCount;
        m_random = new Random();
        m_sampleIndex = 0;
    }
开发者ID:marwan-abdellah,项目名称:Wisp,代码行数:30,代码来源:stratified.cpp

示例2: HeterogeneousMedium

 HeterogeneousMedium(const ParamSet& paramSet)
 {
     m_albedo = paramSet.getColor("albedo");
     m_filename = paramSet.getString("filename");
     m_densityMultiplier = paramSet.getFloat("densityMultiplier", 1.0f);
     m_worldToMedium = paramSet.getTransform("toWorld", Transform()).inverse();
 }
开发者ID:marwan-abdellah,项目名称:Wisp,代码行数:7,代码来源:heterogeneous.cpp

示例3: meshName

void LuxRenderer::createAreaLightMesh(mtlu_MayaObject *obj)
{
	MString meshName("");
	MFnDependencyNode depFn(obj->mobject);
	MObject otherSideObj = getOtherSideNode(MString("mtlu_areaLight_geo"), obj->mobject);
	if( otherSideObj != MObject::kNullObj)
	{


	}else{
		int indices[6] = {0,1,2,2,3,0};
		float floatPointArray[12] = {-1, -1, 0,
									 -1,  1, 0,
									  1,  1, 0,
									  1, -1, 0};

		float floatNormalArray[12] = {0,0,-1,
									  0,0,-1,
									  0,0,-1,
									  0,0,-1};

		ParamSet triParams = CreateParamSet();
		triParams->AddInt("indices", indices, 6);
		triParams->AddPoint("P", floatPointArray, 4);
		triParams->AddNormal("N", floatNormalArray, 4);
		
		lux->transformBegin();
		float fm[16];
		MMatrix tm = obj->transformMatrices[0];
		setZUp(tm, fm);
		this->lux->transform(fm);
		this->lux->shape("trianglemesh", boost::get_pointer(triParams));
		lux->transformEnd();
	}
}
开发者ID:MassW,项目名称:OpenMaya,代码行数:35,代码来源:LuxGeometry.cpp

示例4: CreatePointLight

std::shared_ptr<PointLight> CreatePointLight(const Transform &light2world,
                                             const Medium *medium,
                                             const ParamSet &paramSet) {
    Spectrum I = paramSet.FindOneSpectrum("I", Spectrum(1.0));
    Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
    Point3f P = paramSet.FindOnePoint3f("from", Point3f(0, 0, 0));
    Transform l2w = Translate(Vector3f(P.x, P.y, P.z)) * light2world;
    return std::make_shared<PointLight>(l2w, medium, I * sc);
}
开发者ID:AndreaLoforte,项目名称:pbrt-v3,代码行数:9,代码来源:point.cpp

示例5: CreateGoniometricLight

std::shared_ptr<GonioPhotometricLight> CreateGoniometricLight(
    const Transform &light2world, const Medium *medium,
    const ParamSet &paramSet) {
    Spectrum I = paramSet.FindOneSpectrum("I", Spectrum(1.0));
    Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
    std::string texname = paramSet.FindOneFilename("mapname", "");
    return std::make_shared<GonioPhotometricLight>(light2world, medium, I * sc,
                                                   texname);
}
开发者ID:KojiNakamaru,项目名称:pbrt-v3,代码行数:9,代码来源:goniometric.cpp

示例6: CreateDistantLight

std::shared_ptr<DistantLight> CreateDistantLight(const Transform &light2world,
                                                 const ParamSet &paramSet) {
    Spectrum L = paramSet.FindOneSpectrum("L", Spectrum(1.0));
    Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
    Point3f from = paramSet.FindOnePoint3f("from", Point3f(0, 0, 0));
    Point3f to = paramSet.FindOnePoint3f("to", Point3f(0, 0, 1));
    Vector3f dir = from - to;
    return std::make_shared<DistantLight>(light2world, L * sc, dir);
}
开发者ID:KojiNakamaru,项目名称:pbrt-v3,代码行数:9,代码来源:distant.cpp

示例7: CreateInfiniteLight

std::shared_ptr<InfiniteAreaLight> CreateInfiniteLight(
    const Transform &light2world, const ParamSet &paramSet) {
    Spectrum L = paramSet.FindOneSpectrum("L", Spectrum(1.0));
    Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
    std::string texmap = paramSet.FindOneFilename("mapname", "");
    int nSamples = paramSet.FindOneInt("nsamples", 1);
    if (PbrtOptions.quickRender) nSamples = std::max(1, nSamples / 4);
    return std::make_shared<InfiniteAreaLight>(light2world, L * sc, nSamples,
                                               texmap);
}
开发者ID:udyankhurana,项目名称:pbrt-v3,代码行数:10,代码来源:infinite.cpp

示例8: CreateProjectionLight

std::shared_ptr<ProjectionLight> CreateProjectionLight(
    const Transform &light2world, const Medium *medium,
    const ParamSet &paramSet) {
    Spectrum I = paramSet.FindOneSpectrum("I", Spectrum(1.0));
    Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
    Float fov = paramSet.FindOneFloat("fov", 45.);
    std::string texname = paramSet.FindOneFilename("mapname", "");
    return std::make_shared<ProjectionLight>(light2world, medium, I * sc,
                                             texname, fov);
}
开发者ID:syoyo,项目名称:pbrt-v3,代码行数:10,代码来源:projection.cpp

示例9: CreateHyperboloidShape

std::shared_ptr<Shape> CreateHyperboloidShape(const Transform *o2w,
                                              const Transform *w2o,
                                              bool reverseOrientation,
                                              const ParamSet &params) {
    Point3f p1 = params.FindOnePoint3f("p1", Point3f(0, 0, 0));
    Point3f p2 = params.FindOnePoint3f("p2", Point3f(1, 1, 1));
    Float phimax = params.FindOneFloat("phimax", 360);
    return std::make_shared<Hyperboloid>(o2w, w2o, reverseOrientation, p1, p2,
                                         phimax);
}
开发者ID:KojiNakamaru,项目名称:pbrt-v3,代码行数:10,代码来源:hyperboloid.cpp

示例10: CreateDiffuseAreaLight

std::shared_ptr<AreaLight> CreateDiffuseAreaLight(
    const Transform &light2world, const Medium *medium,
    const ParamSet &paramSet, const std::shared_ptr<Shape> &shape) {
    Spectrum L = paramSet.FindOneSpectrum("L", Spectrum(1.0));
    Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
    int nSamples = paramSet.FindOneInt("nsamples", 1);
    if (PbrtOptions.quickRender) nSamples = std::max(1, nSamples / 4);
    return std::make_shared<DiffuseAreaLight>(light2world, medium, L * sc,
                                              nSamples, shape);
}
开发者ID:Graphics3D,项目名称:pbrt-v3,代码行数:10,代码来源:diffuse.cpp

示例11: CreateCylinderShape

std::shared_ptr<Cylinder> CreateCylinderShape(const Transform *o2w,
                                              const Transform *w2o,
                                              bool reverseOrientation,
                                              const ParamSet &params) {
    Float radius = params.FindOneFloat("radius", 1);
    Float zmin = params.FindOneFloat("zmin", -1);
    Float zmax = params.FindOneFloat("zmax", 1);
    Float phimax = params.FindOneFloat("phimax", 360);
    return std::make_shared<Cylinder>(o2w, w2o, reverseOrientation, radius,
                                      zmin, zmax, phimax);
}
开发者ID:yangjiaqian,项目名称:pbrt-v3,代码行数:11,代码来源:cylinder.cpp

示例12: CreateDiskShape

std::shared_ptr<Disk> CreateDiskShape(const Transform *o2w,
                                      const Transform *w2o,
                                      bool reverseOrientation,
                                      const ParamSet &params) {
    Float height = params.FindOneFloat("height", 0.);
    Float radius = params.FindOneFloat("radius", 1);
    Float inner_radius = params.FindOneFloat("innerradius", 0);
    Float phimax = params.FindOneFloat("phimax", 360);
    return std::make_shared<Disk>(o2w, w2o, reverseOrientation, height, radius,
                                  inner_radius, phimax);
}
开发者ID:KojiNakamaru,项目名称:pbrt-v3,代码行数:11,代码来源:disk.cpp

示例13: GaussianFilter

    GaussianFilter(const ParamSet& paramSet)
    {
        float radius = paramSet.getFloat("radius", 2.0f);
        m_size.x = m_size.y = radius;

        float stddev = paramSet.getFloat("stddev", 0.5f);
        m_alpha = 1.0f / (2.0f * stddev * stddev);

        m_expX = exp(-m_alpha * m_size.x * m_size.x);
        m_expY = exp(-m_alpha * m_size.y * m_size.y);
    }
开发者ID:marwan-abdellah,项目名称:Wisp,代码行数:11,代码来源:gaussian.cpp

示例14: CreateSphereShape

std::shared_ptr<Shape> CreateSphereShape(const Transform *o2w,
                                         const Transform *w2o,
                                         bool reverseOrientation,
                                         const ParamSet &params) {
    Float radius = params.FindOneFloat("radius", 1.f);
    Float zmin = params.FindOneFloat("zmin", -radius);
    Float zmax = params.FindOneFloat("zmax", radius);
    Float phimax = params.FindOneFloat("phimax", 360.f);
    return std::make_shared<Sphere>(o2w, w2o, reverseOrientation, radius, zmin,
                                    zmax, phimax);
}
开发者ID:yangjiaqian,项目名称:pbrt-v3,代码行数:11,代码来源:sphere.cpp

示例15: evaluatedOverrindingParams

 inline ParamSet evaluatedOverrindingParams(ParamSet eventContext,
                                            TaskInstance instance) const {
   ParamSet overridingParams;
   TaskInstancePseudoParamsProvider ppp = instance.pseudoParams();
   ParamsProviderMerger ppm = ParamsProviderMerger(eventContext)(&ppp);
   foreach (QString key, _overridingParams.keys())
     overridingParams.setValue(key, _overridingParams.value(key, &ppm));
   //Log::fatal() << "******************* " << eventContext << overridingParams
   //             << _overridingParams;
   return overridingParams;
 }
开发者ID:g76r,项目名称:libqron,代码行数:11,代码来源:requesttaskaction.cpp


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