这篇教程C++ vb函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vb函数的典型用法代码示例。如果您正苦于以下问题:C++ vb函数的具体用法?C++ vb怎么用?C++ vb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vb函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main(){ { typedef std::vector<bool> T; typedef std::hash<T> H; static_assert((std::is_base_of<std::unary_function<T, std::size_t>, H>::value), ""); bool ba[] = {true, false, true, true, false}; T vb(std::begin(ba), std::end(ba)); H h; assert(h(vb) != 0); }#if __cplusplus >= 201103L || defined(_LIBCPP_MSVC) { typedef std::vector<bool, min_allocator<bool>> T; typedef std::hash<T> H; static_assert((std::is_base_of<std::unary_function<T, std::size_t>, H>::value), ""); bool ba[] = {true, false, true, true, false}; T vb(std::begin(ba), std::end(ba)); H h; assert(h(vb) != 0); }#endif}
开发者ID:K-ballo,项目名称:libcxx,代码行数:25,
示例2: vavoid TargetObject::BuildMesh() { int nverts = 8; int nfaces = 12; Point3 va(-sz,-sz,-sz); Point3 vb( sz, sz, sz); mesh.setNumVerts(nverts); mesh.setNumFaces(nfaces); mesh.setVert(0, Point3( va.x, va.y, va.z)); mesh.setVert(1, Point3( vb.x, va.y, va.z)); mesh.setVert(2, Point3( va.x, vb.y, va.z)); mesh.setVert(3, Point3( vb.x, vb.y, va.z)); mesh.setVert(4, Point3( va.x, va.y, vb.z)); mesh.setVert(5, Point3( vb.x, va.y, vb.z)); mesh.setVert(6, Point3( va.x, vb.y, vb.z)); mesh.setVert(7, Point3( vb.x, vb.y, vb.z)); MakeQuad(&(mesh.faces[ 0]), 0,2,3,1, 1); MakeQuad(&(mesh.faces[ 2]), 2,0,4,6, 2); MakeQuad(&(mesh.faces[ 4]), 3,2,6,7, 4); MakeQuad(&(mesh.faces[ 6]), 1,3,7,5, 8); MakeQuad(&(mesh.faces[ 8]), 0,1,5,4, 16); MakeQuad(&(mesh.faces[10]), 4,5,7,6, 32); mesh.buildNormals(); mesh.EnableEdgeList(1); }
开发者ID:artemeliy,项目名称:inf4715,代码行数:27,
示例3: get bool get(std::string key, XmlRpc::XmlRpcValue& val) { try { bool v; if (get(key,v)){ XmlRpc::XmlRpcValue vb(v); val = vb; return (val.valid()); } double vd; if (get(key,vd)){ val = vd; return (val.valid()); } int vi; if (get(key,vi)){ val=vi; return (val.valid()); } std::string vs; if (get(key, vs)){ val=vs.c_str(); return (val.valid()); } } catch (...) { return false; } return false; }
开发者ID:LucaGemma87,项目名称:pacman_vision,代码行数:32,
示例4: vb //---------------------------------------------------------------------- // //---------------------------------------------------------------------- IVertexBuffer* GLGraphicsDevice::createVertexBuffer( LNVertexElemenst* elements, lnU32 vertexCount, const void* data, bool isDynamic ) { LRefPtr<GLVertexBuffer> vb( LN_NEW GLVertexBuffer() ); vb->create( this, elements, vertexCount, data, isDynamic ); vb->addRef(); return vb; }
开发者ID:lriki,项目名称:LightNote,代码行数:10,
示例5: surfaceQVector<QVector3D> SurfaceItem::vertices() const{ QSize size = surface()->size(); qreal w = (m_height * size.width()) / size.height(); qreal h = m_height; QVector3D pos = m_pos + m_normal * m_depthOffset; QVector2D center(pos.x(), pos.z()); QVector3D perp = QVector3D::crossProduct(QVector3D(0, 1, 0), m_normal); QVector2D delta = w * QVector2D(perp.x(), perp.z()).normalized() / 2; qreal scale = qMin(1.0, m_time.elapsed() * 0.002); qreal top = m_pos.y() + h * 0.5 * scale; qreal bottom = m_pos.y() - h * 0.5 * scale; QVector2D left = center - delta * scale; QVector2D right = center + delta * scale; QVector3D va(left.x(), top, left.y()); QVector3D vb(right.x(), top, right.y()); QVector3D vc(right.x(), bottom, right.y()); QVector3D vd(left.x(), bottom, left.y()); QVector<QVector3D> result; result << va << vb << vc << vd; return result;}
开发者ID:paulolav,项目名称:mazecompositor,代码行数:31,
示例6: SplitPointInfo Split( PointInfo &a, PointInfo &b, TLITVERTEX &vec1, TLITVERTEX &vec2, int lineno ){ LineEuqationType l; l.x = b.y-a.y; l.y = a.x-b.x; l.d = -(l.x*b.x+(l.y)*b.y); double cDot = (vec1.x*l.x + vec1.y*l.y); double dDot = (vec2.x*l.x + vec2.y*l.y); double scale = ( - l.d - cDot) / ( dDot - cDot ); v3 va(vec1.x, vec1.y, vec1.z); v3 vb(vec2.x, vec2.y, vec2.z); v3 vc = va + ((vb - va) * (float)scale ); PointInfo d = {vc.x, vc.y, vc.z, -1, lineno}; if( a.onLine == b.onLine && a.onLine >= 0 ) { if( a.onLine == 0 && lineno == 1 ) d.onVtx = 0; else if ( a.onLine == 0 && lineno == 2 ) d.onVtx = 1; else if( a.onLine == 1 && lineno == 0 ) d.onVtx = 0; else if( a.onLine == 1 && lineno == 2 ) d.onVtx = 2; else if( a.onLine == 2 && lineno == 0 ) d.onVtx = 1; else if( a.onLine == 2 && lineno == 1 ) d.onVtx = 2; } return d;}
开发者ID:death-droid,项目名称:Rice-Video,代码行数:34,
示例7: vbint agentppSimDeleteTableContents::prepare_set_request(Request* req, int& ind){ int status; if ((status = MibLeaf::prepare_set_request(req, ind)) != SNMP_ERROR_SUCCESS) return status; Oidx toid; Vbx vb(req->get_value(ind)); if (vb.get_value(toid) != SNMP_CLASS_SUCCESS) return SNMP_ERROR_WRONG_TYPE; MibEntryPtr entry = 0; status = #ifdef _SNMPv3 mib->find_managing_object(mib->get_context(req->get_context()), toid, entry, req);#else mib->find_managing_object(mib->get_default_context(), toid, entry, req);#endif if (status != SNMP_ERROR_SUCCESS) return SNMP_ERROR_WRONG_VALUE; if (entry->type() != AGENTPP_TABLE) return SNMP_ERROR_WRONG_VALUE; return SNMP_ERROR_SUCCESS;}
开发者ID:shining-yang,项目名称:snmpxx-agentxx,代码行数:26,
示例8: vb UINT32 ScriptVirtualButton::internal_InitVirtualButton(MonoString* name) { String nameStr = MonoUtil::monoToString(name); VirtualButton vb(nameStr); return vb.buttonIdentifier; }
开发者ID:AlfHub,项目名称:BansheeEngine,代码行数:7,
示例9: main// runs the raytrace over all tests and saves the corresponding imagesint main(int argc, char** argv) { // test that glfw and glew are linked properly uiloop(); message("GLFW and GLEW seem to work/n/n"); // test max_component function vec3f v(1,2,-3); float max_val = max_component(v); message("Result of max_component: %f/n", max_val); // test sum of three vectors vec3f va(1,0,0); vec3f vb(0,4,0); vec3f vc(0,0,2); vec3f vabc = sum_three(va, vb, vc); message("Result of sum_three: %s/n", tostring(vabc).c_str()); // test sum of vectors vector<vec3f> vs = { {3.14,1.5,2.7}, {2.71,8.2,8.2}, {1.61,8.0,3.4}, {1.41,4.2,1.4}, }; vec3f vsum = sum_many(vs); message("Result of sum_many: %s/n", tostring(vsum).c_str()); message("/nThis message indicates a successful build!/n/n"); return 0;}
开发者ID:HanyuX,项目名称:Dart-Graphics-Assign00,代码行数:33,
|