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


C++ VRTransformPtr::setPersistency方法代码示例

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


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

示例1: fillContainer

void FLogistics::fillContainer(shared_ptr<FContainer> c, int N, VRTransformPtr t) {
    for (int i=0; i<N; i++) {
        auto p = addProduct();
        t = static_pointer_cast<VRTransform>(t->duplicate(true));
        t->setVisible(true);
        t->setPersistency(0);
        p->setTransformation(t);
        c->add( p );
    }
}
开发者ID:Victor-Haefner,项目名称:polyvr,代码行数:10,代码来源:VRLogistics.cpp

示例2: FContainer

shared_ptr<FContainer> FLogistics::addContainer(VRTransformPtr t) {
    if (t == 0) return 0;
    auto c = shared_ptr<FContainer>(new FContainer());
    t = static_pointer_cast<VRTransform>(t->duplicate(true));
    t->setVisible(true);
    t->setPersistency(0);
    c->setTransformation(t);
    objects[c->getID()] = c;
    return c;
}
开发者ID:Victor-Haefner,项目名称:polyvr,代码行数:10,代码来源:VRLogistics.cpp

示例3: loadGeometry

PyObject* VRScriptManager::loadGeometry(VRScriptManager* self, PyObject *args, PyObject *kwargs) {
    const char* path = "";
    int ignoreCache = 0;
    const char* preset = "OSG";
    const char* parent = "";

    const char* kwlist[] = {"path", "cached", "preset", "parent", NULL};
    string format = "s|iss:loadGeometry";
    if (! PyArg_ParseTupleAndKeywords(args, kwargs, format.c_str(), (char**)kwlist, &path, &ignoreCache, &preset, &parent)) return NULL;

    VRObjectPtr prnt = VRSceneManager::getCurrent()->getRoot()->find( parent );

    VRTransformPtr obj = VRImport::get()->load( path, prnt, ignoreCache, preset);
    if (obj == 0) {
        VRGuiManager::get()->printInfo("Warning: " + string(path) + " not loaded!\n");
        Py_RETURN_NONE;
    }
    obj->setPersistency(0);
    return VRPyTypeCaster::cast(obj);
}
开发者ID:uagmw,项目名称:polyvr,代码行数:20,代码来源:VRScriptManager.cpp

示例4: loadVRML


//.........这里部分代码省略.........

    string line;
    while ( getline(file, line) ) {
        prog.update( line.size() );
        li++;

        for (auto d : states) {
            //if ( line[d.second.size()-1] != ' ') continue; // optimization
            if ( line.compare(0, d.second.size(), d.second) == 0) {
                //if (state != d.first) cout << "got on line " << li << ": " << states[d.first] << " instead of: " << states[state] << endl;
                switch (d.first) {
                    case 0: break;
                    case 1:
                        new_obj = true;
                        if (line.size() > 12) color = toVec3f( line.substr(12) );
                        if (mats.count(color) == 0) {
                            mats[color] = VRMaterial::create("fmat");
                            mats[color]->setDiffuse(color);
                        }

                        if (color != last_col) {
                            new_color = true;
                            last_col = color;
                        }
                        break;
                    case 2:
                        geo.updateN();
                        break;
                    case 3: break;
                    case 4: break;
                    case 5: break;
                }
                state = d.first+1;
                if (state == 7) state = 0;
                break;
            }
        }

        if (line[0] != ' ') continue;
        if (state == 6) continue; // skip color indices

        stringstream ss(line);
        switch (state) {
            case 3:
                while(ss >> v[0] && ss >> v[1] && ss >> v[2] && ss.get()) {
                    if (!new_color && new_obj) new_obj = !geo.inBB(v); // strange artifacts!!
                    geo.updateBB(v);

                    if (new_obj) {
                        new_obj = false;
                        new_color = false;
                        geo.init(geos, mats[color]);
                    }

                    geo.pos->addValue(v);
                }
                break;
            case 4:
                while(ss >> n[0] && ss >> n[1] && ss >> n[2] && ss.get()) geo.norms->addValue( n );
                break;
            case 5:
                while(ss >> i && ss.get()) if (i >= 0) geo.inds_p->addValue( geo.Np + i );
                break;
            case 0:
                while(ss >> i && ss.get()) if (i >= 0) geo.inds_n->addValue( geo.Nn + i );
                break;
        }
    }

    file.close();
    cout << "\nloaded " << geos.size() << " geometries" << endl;

    VRTransformPtr res = VRTransform::create("factory");
    res->setPersistency(0);

    for (auto g : geos) {
        //Vec3f d = g.vmax - g.vmin;
        //if (d.length() < 0.1) continue; // skip very small objects

        if (g.inds_n->size() != g.inds_p->size()) { // not happening
            cout << " wrong indices lengths: " << g.inds_p->size() << " " << g.inds_n->size() << endl;
            continue;
        }

        if (g.inds_p->size() == 0) { // not happening
            cout << " empty geo: " << g.inds_p->size() << " " << g.inds_n->size() << endl;
            continue;
        }

        res->addChild(g.geo);

        GeoUInt32PropertyRecPtr Length = GeoUInt32Property::create();
        Length->addValue(g.geo->getMesh()->getIndices()->size());
        g.geo->setLengths(Length);
    }

    cout << "\nloaded2 " << res->getChildrenCount() << " geometries" << endl;

    return res;
}
开发者ID:uagmw,项目名称:polyvr,代码行数:101,代码来源:VRFactory.cpp


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