这篇教程C++ wp函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wp函数的典型用法代码示例。如果您正苦于以下问题:C++ wp函数的具体用法?C++ wp怎么用?C++ wp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wp函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: rpvoid Impl::Unlock(BytesPtr srcBytes, BytesPtr dstBytes){ bytes::read_proc rp(srcBytes); ProxyId id; rp(id); IDirect3DVertexBuffer9 *self = procMap_->getPtr<IDirect3DVertexBuffer9>(id); UINT offset, size; DWORD flags; rp(offset); rp(size); rp(flags); char *ptr = nullptr; HRESULT res; res = self->Lock(offset, size, reinterpret_cast<void**>(&ptr), flags); if (SUCCEEDED(res)) { rp.array(ptr, size); res = self->Unlock(); Assert(SUCCEEDED(res)); } else { vector<char> dump(size); rp.array(dump.data(), size); Assert(false); } bytes::write_proc wp(dstBytes); wp(res);}
开发者ID:vasily-knk,项目名称:D3Digger,代码行数:35,
示例2: WinMainint WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int){ try { dll_t("SciLexer.dll"); HACCEL haccel = LoadAccelerators(instance, "accel_main"); window_class_t wc("MAINFRAME", MainFrameProc); wc.install(); window_maker_t wm(wc); wm.create(); SetWindowText(wm.handle, "skeletype"); window_positioner_t wp(wm.handle); wp.setsize(782, 400); wp.center_to_screen(); UpdateWindow(wm.handle); ShowWindow(wm.handle, SW_SHOW); return win::run(wm.handle, haccel); } catch(error_t& e) { e.print(); } return -1;}
开发者ID:dejbug,项目名称:kronotope,代码行数:33,
示例3: wpvoid World::UnregisterObject(uint32 Id, PlayerSession *Reg){ stdext::hash_map<uint32, WorldObject*>::iterator itr = Registrated_Objects.find(Id); if(itr != Registrated_Objects.end()) { delete itr->second; Registrated_Objects.erase(itr); } if(GetSessionCount() > 1) { Reg->GetPlayer()->UpdateInRangePlayers(); if(Reg->GetPlayer()->m_inRangePlayers.size()) { for(set<Player*>::iterator itr = Reg->GetPlayer()->m_inRangePlayers.begin(); itr != Reg->GetPlayer()->m_inRangePlayers.end(); ++itr) { WorldPacket wp(SMSG_OBJECT_UNREGISTER,4); wp << Id; (*itr)->GetSession()->SendPacket(&wp); } } }}
开发者ID:DeaDSandro,项目名称:shadowfade,代码行数:25,
示例4: lockvoid active::schedule::own_thread::thread_fn(){ platform::unique_lock<platform::mutex> lock(m_mutex); while( !m_shutdown ) { if( m_object ) { any_object * obj = m_object; m_object = nullptr; lock.unlock(); obj->run(); lock.lock(); if(m_pool) m_pool->stop_work(); if( m_shared ) { platform::weak_ptr<any_object> wp(m_shared); platform::shared_ptr<any_object> shared; shared.swap(m_shared); lock.unlock(); shared.reset(); if( wp.expired() ) return; // Object destroyed lock.lock(); } } if( !m_object && !m_shutdown ) m_ready.wait(lock); }}
开发者ID:alarouche,项目名称:cppao,代码行数:28,
示例5: cpvoid KinectViewer::resetNavigation(void) { /* Calculate a bounding box around all projectors' points of interests: */ Geometry::Box<Vrui::Scalar,3> bbox=Geometry::Box<Vrui::Scalar,3>::empty; for(std::vector<KinectStreamer*>::iterator sIt=streamers.begin();sIt!=streamers.end();++sIt) { /* Calculate the world position of a point 1m in front of the streamer's projector: */ Kinect::FrameSource::ExtrinsicParameters::Point cp(0.0,0.0,-100.0); // 1m along projection line Vrui::Point wp((*sIt)->projector->getProjectorTransform().transform(cp)); #if KINECT_CONFIG_FRAMESOURCE_EXTRINSIC_PROJECTIVE Vrui::Vector ws(200.0,200.0,200.0); #else /* Calculate the projector's influence radius: */ Vrui::Scalar s((*sIt)->projector->getProjectorTransform().getScaling()*100.0); Vrui::Vector ws(s,s,s); #endif /* Add the projector's influence to the bounding box: */ bbox.addPoint(wp-ws); bbox.addPoint(wp+ws); } /* Center the resulting box in the view: */ Vrui::setNavigationTransformation(Geometry::mid(bbox.min,bbox.max),Math::div2(Geometry::dist(bbox.min,bbox.max))); }
开发者ID:KeckCAVES,项目名称:Kinect,代码行数:29,
示例6: CreateGridMeshvoid CreateGridMesh( const VoxelGrid<Discretizer>& vg, std::vector<Vector3>& vertices){ std::vector<Vector3> voxel_mesh; CreateBoxMesh(vg.res().x(), vg.res().y(), vg.res().z(), voxel_mesh); vertices.reserve(voxel_mesh.size() * vg.sizeX() * vg.sizeY() * vg.sizeZ()); for (int x = 0; x < vg.sizeX(); ++x) { for (int y = 0; y < vg.sizeY(); ++y) { for (int z = 0; z < vg.sizeZ(); ++z) { const MemoryCoord mc(x, y, z); const WorldCoord wc(vg.memoryToWorld(mc)); Vector3 wp(wc.x, wc.y, wc.z); std::printf("%d, %d, %d -> %0.3f, %0.3f, %0.3f/n", x, y, z, wc.x, wc.y, wc.z); // translate all triangles by the voxel position for (const Vector3& v : voxel_mesh) { vertices.push_back(v + wp); } } } }}
开发者ID:aurone,项目名称:sbpl_manipulation,代码行数:27,
示例7: mainint main(){ Regular_triangulation rt; for (int y=0 ; y<3 ; y++) for (int x=0 ; x<3 ; x++) rt.insert(Weighted_point(K::Point_2(x,y), 0)); //coordinate computation Weighted_point wp(K::Point_2(1.2, 0.7),2); Point_coordinate_vector coords; CGAL::Triple< std::back_insert_iterator<Point_coordinate_vector>, K::FT, bool> result = CGAL::regular_neighbor_coordinates_2(rt, wp, std::back_inserter(coords)); if(!result.third){ std::cout << "The coordinate computation was not successful." << std::endl; std::cout << "The point (" <<wp.point() << ") lies outside the convex hull." << std::endl; } K::FT norm = result.second; std::cout << "Coordinate computation successful." << std::endl; std::cout << "Normalization factor: " <<norm << std::endl; std::cout << "done" << std::endl; return 0;}
开发者ID:ArcEarth,项目名称:cgal,代码行数:29,
示例8: lockModWinList std::shared_ptr<Windows::Window>& WindowManager::addNewMainWindow(Windows::Window* other){ std::lock_guard<std::mutex> lockModWinList(modifyMangedWindows); d_managedWindows.push_back(std::shared_ptr<Windows::Window>(d_factory->createWindow(other))); std::lock_guard<std::mutex> lock(d_managedWindows.back()->windowMutex); std::weak_ptr<Windows::Window> wp(d_managedWindows.back()); std::for_each(d_managedWindows.back()->getEmbededWnd().begin(), d_managedWindows.back()->getEmbededWnd().end(), [&](std::unique_ptr<Windows::Window>& arg){arg->setParent(wp);}); return d_managedWindows.back(); }
开发者ID:0xBaca,项目名称:MiniReader,代码行数:8,
示例9: BM_WeakPtrIncDecRefstatic void BM_WeakPtrIncDecRef(benchmark::State& st) { auto sp = std::make_shared<int>(42); benchmark::DoNotOptimize(sp.get()); while (st.KeepRunning()) { std::weak_ptr<int> wp(sp); benchmark::ClobberMemory(); }}
开发者ID:Aj0Ay,项目名称:libcxx,代码行数:8,
示例10: wpvoid World::RegisterProjectileToServer(SFBullet *proj){ WorldPacket wp(CMSG_NEW_PROJECTILE, 12+12+4); wp << proj->GetInitialPos(); wp << proj->GetVelocity(); wp << (float)proj->GetLifeTime(); sCore.GetCharacterSession()->SendPacket(&wp);}
开发者ID:DeaDSandro,项目名称:shadowfade,代码行数:8,
示例11: wpIMPDISPLAY_BEGIN_NAMESPACEvoid WriteOptimizerState::write(WriterAdaptor w) const { IMP::OwnerPointer<Writer> wp(w); for (unsigned int i=0; i< get_number_of_geometries(); ++i) { get_geometry(i)->set_was_used(true); w->add_geometry(get_geometry(i)); }}
开发者ID:drussel,项目名称:imp,代码行数:9,
示例12: DeleteWordsvoid CPDF_VariableText::SetText(const FX_WCHAR* text, int32_t charset, const CPVT_SecProps* pSecProps, const CPVT_WordProps* pWordProps) { DeleteWords(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace())); CFX_WideString swText = text; CPVT_WordPlace wp(0, 0, -1); CPVT_SectionInfo secinfo; if (m_bRichText) { if (pSecProps) secinfo.pSecProps = new CPVT_SecProps(*pSecProps); if (pWordProps) secinfo.pWordProps = new CPVT_WordProps(*pWordProps); } if (CSection* pSection = m_SectionArray.GetAt(0)) pSection->m_SecInfo = secinfo; int32_t nCharCount = 0; for (int32_t i = 0, sz = swText.GetLength(); i < sz; i++) { if (m_nLimitChar > 0 && nCharCount >= m_nLimitChar) break; if (m_nCharArray > 0 && nCharCount >= m_nCharArray) break; uint16_t word = swText.GetAt(i); switch (word) { case 0x0D: if (m_bMultiLine) { if (swText.GetAt(i + 1) == 0x0A) i += 1; wp.nSecIndex++; wp.nLineIndex = 0; wp.nWordIndex = -1; AddSection(wp, secinfo); } break; case 0x0A: if (m_bMultiLine) { if (swText.GetAt(i + 1) == 0x0D) i += 1; wp.nSecIndex++; wp.nLineIndex = 0; wp.nWordIndex = -1; AddSection(wp, secinfo); } break; case 0x09: word = 0x20; default: wp = InsertWord(wp, word, charset, pWordProps); break; } nCharCount++; }}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:57,
示例13: MakeWaypointstatic WaypointMakeWaypoint(const TCHAR *name, int altitude, double longitude, double latitude){ Waypoint wp(GeoPoint(Angle::Degrees(longitude), Angle::Degrees(latitude))); wp.name = name; wp.elevation = fixed(altitude); return wp;}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:10,
示例14: wpvoidWayPointFile::add_waypoint(Waypoints &way_points, const Waypoint &new_waypoint){ // Append the new waypoint to the waypoint list and // return successful line parse Waypoint wp(new_waypoint); way_points.append(wp); return;}
开发者ID:galippi,项目名称:xcsoar,代码行数:10,
示例15: CHANGED_NETWORK_STATEvoid CNetPlayerInput::DoSetState(const SSerializedPlayerInput& input ){ m_newInterpolation |= (input.position != m_curInput.position) || (input.deltaMovement != m_curInput.deltaMovement); const bool wasSprinting = m_curInput.sprint; m_curInput = input; CHANGED_NETWORK_STATE(m_pPlayer, CPlayer::ASPECT_INPUT_CLIENT ); if(wasSprinting != input.sprint) { SInputEventData inputEventData( SInputEventData::EInputEvent_Sprint, m_pPlayer->GetEntityId(), CCryName("sprint"), input.sprint ? eAAM_OnPress : eAAM_OnRelease, 0.f ); m_pPlayer->StateMachineHandleEventMovement( SStateEventPlayerInput( &inputEventData ) ); } // not having these set seems to stop a remote avatars rotation being reflected m_curInput.aiming = true; m_curInput.allowStrafing = true; m_curInput.usinglookik = true; IAIActor* pAIActor = CastToIAIActorSafe(m_pPlayer->GetEntity()->GetAI()); if (pAIActor) pAIActor->GetState().bodystate=input.bodystate; CMovementRequest moveRequest; moveRequest.SetStance( (EStance)m_curInput.stance ); if(IsDemoPlayback()) { Vec3 localVDir(m_pPlayer->GetViewQuatFinal().GetInverted() * m_curInput.lookDirection); Ang3 deltaAngles(asinf(localVDir.z),0,atan2_tpl(-localVDir.x,localVDir.y)); moveRequest.AddDeltaRotation(deltaAngles*gEnv->pTimer->GetFrameTime()); } moveRequest.SetPseudoSpeed(CalculatePseudoSpeed()); moveRequest.SetAllowStrafing(input.allowStrafing); m_pPlayer->GetMovementController()->RequestMovement(moveRequest);#if !defined(_RELEASE) // debug.. if (g_pGameCVars->g_debugNetPlayerInput & 1) { IPersistantDebug * pPD = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug(); pPD->Begin( string("net_player_input_") + m_pPlayer->GetEntity()->GetName(), true ); pPD->AddSphere( moveRequest.GetLookTarget(), 0.5f, ColorF(1,0,1,1), 1.0f ); // pPD->AddSphere( moveRequest.GetMoveTarget(), 0.5f, ColorF(1,1,0,1), 1.0f ); Vec3 wp(m_pPlayer->GetEntity()->GetWorldPos() + Vec3(0,0,2)); pPD->AddDirection( wp, 1.5f, m_curInput.deltaMovement, ColorF(1,0,0,1), 1.0f ); pPD->AddDirection( wp, 1.5f, m_curInput.lookDirection, ColorF(0,1,0,1), 1.0f ); }#endif}
开发者ID:aronarts,项目名称:FireNET,代码行数:54,
示例16: mainint main(){ std::cout << std::boolalpha; Hx::shared_ptr<resource> sp(new resource); Hx::weak_ptr<resource> wp(sp); std::cout << "points to resource: " << wp.expired() << '/n'; sp.reset(); std::cout << "expired: " << wp.expired() << '/n'; return 0;}
开发者ID:hechenyu,项目名称:cpp_code,代码行数:11,
示例17: wpvoid DebuggerIPCServer::handleSetWatchpoint( PFPSimDebugger::SetWatchpointMsg msg) { std::string counter_name = msg.counter_name(); bool disabled = false; if (msg.disabled() == "1") { disabled = true; } Watchpoint wp(counter_name, disabled); data_manager->addWatchpoint(wp); sendGenericReply();}
开发者ID:pfpsim,项目名称:PFPSim,代码行数:11,
示例18: ROS_INFO_STREAM// Trash waypoint published by fake trash detector, add to waypoint map (overwriting same id entry as needed)void GlobalPlanner::cb_FakeTrashWaypoint(const global_planner::WaypointMsg::ConstPtr& msg){ ROS_INFO_STREAM("Received Fake Trash Waypoint " << msg->id); // Create waypoint from message Waypoint_Ptr wp(new WaypointWrapper()); global_planner::WaypointMsg data = *msg; wp->SetData(data); // Add waypoint to task master m_tm.AddWaypoint(wp);}
开发者ID:SquadCollaborativeRobotics,项目名称:global_planner,代码行数:12,
示例19: localVDirvoid CNetPlayerInput::DoSetState(const SSerializedPlayerInput& input ){ m_curInput = input; m_pPlayer->GetGameObject()->ChangedNetworkState( INPUT_ASPECT ); CMovementRequest moveRequest; moveRequest.SetStance( (EStance)m_curInput.stance ); if(IsDemoPlayback()) { Vec3 localVDir(m_pPlayer->GetViewQuatFinal().GetInverted() * m_curInput.lookDirection); Ang3 deltaAngles(asin(localVDir.z),0,cry_atan2f(-localVDir.x,localVDir.y)); moveRequest.AddDeltaRotation(deltaAngles*gEnv->pTimer->GetFrameTime()); } //else { moveRequest.SetLookTarget( m_pPlayer->GetEntity()->GetWorldPos() + 10.0f * m_curInput.lookDirection ); moveRequest.SetAimTarget(moveRequest.GetLookTarget()); } float pseudoSpeed = 0.0f; if (m_curInput.deltaMovement.len2() > 0.0f) { pseudoSpeed = m_pPlayer->CalculatePseudoSpeed(m_curInput.sprint); } moveRequest.SetPseudoSpeed(pseudoSpeed); moveRequest.SetAllowStrafing(true); float lean=0.0f; if (m_curInput.leanl) lean-=1.0f; if (m_curInput.leanr) lean+=1.0f; moveRequest.SetLean(lean); m_pPlayer->GetMovementController()->RequestMovement(moveRequest); // debug.. if (g_pGameCVars->g_debugNetPlayerInput & 1) { IPersistantDebug * pPD = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug(); pPD->Begin( string("net_player_input_") + m_pPlayer->GetEntity()->GetName(), true ); pPD->AddSphere( moveRequest.GetLookTarget(), 0.5f, ColorF(1,0,1,1), 1.0f ); // pPD->AddSphere( moveRequest.GetMoveTarget(), 0.5f, ColorF(1,1,0,1), 1.0f ); Vec3 wp(m_pPlayer->GetEntity()->GetWorldPos() + Vec3(0,0,2)); pPD->AddDirection( wp, 1.5f, m_curInput.deltaMovement, ColorF(1,0,0,1), 1.0f ); pPD->AddDirection( wp, 1.5f, m_curInput.lookDirection, ColorF(0,1,0,1), 1.0f ); }}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:50,
示例20: FormatStringbool CCompiler::run( const OJString & codeFile, const OJString & exeFile, const OJString & compileFile){ OJString cmdLine; FormatString(cmdLine, CompileArg::cmd.c_str(), codeFile.c_str(), exeFile.c_str()); IMUST::WindowsProcess wp(OJStr(""), compileFile); wp.create(cmdLine, CompileArg::limitTime, CompileArg::limitMemory); result_ = wp.getExitCodeEx(); return isAccept();}
开发者ID:111304037,项目名称:FreeJudger,代码行数:14,
示例21: wpvoid http_session::do_read(){ std::weak_ptr<http_session> wp(shared_Derived_from_this<http_session>()); //开始异步读取 socket_->async_read_some(boost::asio::buffer(data_ + pos_, max_length - pos_), [wp](const boost::system::error_code &ec, std::size_t length){ auto sp(wp.lock()); if (sp) { sp->onRead(ec, length); } });}
开发者ID:caosonglin,项目名称:MyWarehouse,代码行数:14,
示例22: gpvoidTaskWaypointTest::Run(){ GeoPoint gp(Angle::Degrees(fixed(20)), Angle::Degrees(fixed(50))); Waypoint wp(gp); wp.name = _T("Test"); wp.altitude = fixed(42); DummyTaskWaypoint tw(TaskPoint::AST, wp); const Waypoint &wp2 = tw.GetWaypoint(); ok1(wp2.name == _T("Test")); ok1(equals(tw.GetBaseElevation(), 42)); ok1(equals(tw.GetBaseElevation(), wp2.altitude)); ok1(equals(wp2.location, gp)); ok1(equals(tw.GetLocation(), gp));}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:17,
注:本文中的wp函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wpa_auth_sm_event函数代码示例 C++ world_thread函数代码示例 |