• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SaveFileForSearch

JBoolean
CBSearchTextDialog::BuildSearchFileList
	(
	JPtrArray<JString>* fileList,
	JPtrArray<JString>* nameList
	)
	const
{
	(JXGetApplication())->DisplayBusyCursor();

	fileList->SetCleanUpAction(JPtrArrayT::kDeleteAll);
	fileList->SetCompareFunction(JCompareStringsCaseSensitive);

	nameList->SetCleanUpAction(JPtrArrayT::kDeleteAll);
	nameList->SetCompareFunction(JCompareStringsCaseSensitive);

	if (itsMultifileCB->IsChecked())
		{
		const JPtrArray<JString>& fullNameList = itsFileList->GetFullNameList();

		const JSize count = fullNameList.GetElementCount();
		for (JIndex i=1; i<=count; i++)
			{
			SaveFileForSearch(*(fullNameList.NthElement(i)), fileList, nameList);
			}
		}

	JBoolean ok = kJTrue;

	JString path, fileFilter, pathFilter;
	if (GetSearchDirectory(&path, &fileFilter, &pathFilter))
		{
		JRegex* fileRegex = NULL;
		JString regexStr;
		if (JDirInfo::BuildRegexFromWildcardFilter(fileFilter, &regexStr))
			{
			fileRegex = jnew JRegex(regexStr);
			assert( fileRegex != NULL );
			fileRegex->SetCaseSensitive(kJFalse);
			}

		JRegex* pathRegex = NULL;
		if (JDirInfo::BuildRegexFromWildcardFilter(pathFilter, &regexStr))
			{
			pathRegex = jnew JRegex(regexStr);
			assert( pathRegex != NULL );
			pathRegex->SetCaseSensitive(kJFalse);
			}

		JLatentPG pg(100);
		pg.VariableLengthProcessBeginning("Collecting files...", kJTrue, kJFalse);
		ok = SearchDirectory(path, fileRegex, pathRegex, fileList, nameList, pg);
		pg.ProcessFinished();

		jdelete fileRegex;
		jdelete pathRegex;
		}

	return JI2B( ok && !fileList->IsEmpty() );
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:60,代码来源:CBSearchTextDialog.cpp


示例2: cVillage

	cVillage(
		int a_Seed,
		int a_GridX, int a_GridZ,
		int a_OriginX, int a_OriginZ,
		int a_MaxRoadDepth,
		int a_MaxSize,
		int a_Density,
		cVillagePiecePool & a_Prefabs,
		cTerrainHeightGenPtr a_HeightGen
	) :
		super(a_GridX, a_GridZ, a_OriginX, a_OriginZ),
		m_Seed(a_Seed),
		m_Noise(a_Seed),
		m_MaxSize(a_MaxSize),
		m_Density(a_Density),
		m_Borders(a_OriginX - a_MaxSize, 0, a_OriginZ - a_MaxSize, a_OriginX + a_MaxSize, cChunkDef::Height - 1, a_OriginZ + a_MaxSize),
		m_Prefabs(a_Prefabs),
		m_HeightGen(a_HeightGen)
	{
		// Generate the pieces for this village; don't care about the Y coord:
		cBFSPieceGenerator pg(*this, a_Seed);
		pg.PlacePieces(a_OriginX, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces);
		if (m_Pieces.empty())
		{
			return;
		}
	}
开发者ID:Haxi52,项目名称:cuberite,代码行数:27,代码来源:VillageGen.cpp


示例3: convert

void
MainWindow::on_actionInsertRandomPoints_triggered()
{
  QRectF rect = CGAL::Qt::viewportsBbox(&m_scene);
  CGAL::Qt::Converter<Kernel> convert;  
  Iso_rectangle_2 isor = convert(rect);
  CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
  bool ok = false;
  const int number_of_points = 
    QInputDialog::getInteger(this, 
                             tr("Number of random points"),
                             tr("Enter number of random points"),
			     100,
			     0,
			     (std::numeric_limits<int>::max)(),
			     1,
			     &ok);

  if(!ok) {
    return;
  }

  // wait cursor
  QApplication::setOverrideCursor(Qt::WaitCursor);
  for(int i = 0; i < number_of_points; ++i){
    m_sites.push_back(*pg++);
  }
  calculate_envelope();
  // default cursor
  QApplication::restoreOverrideCursor();
  emit(changed());
}
开发者ID:BijanZarif,项目名称:mshr,代码行数:32,代码来源:L1_voronoi_diagram_2.cpp


示例4: pg

void Test_PG_Output::testGet_JSON_vertex_ids_first() {
   ProductGraph pg(f,s);
    pg.setProductGraph(p);
    std::string result = PG_Output::get_JSON_vertex_ids_first(pg, clique);
    std::string check = "[\n\t10,\n\t20,\n\t30,\n\t40\n]";
    CPPUNIT_ASSERT(result == check);
}
开发者ID:dfsp-spirit,项目名称:vplg,代码行数:7,代码来源:Test_PG_Output.cpp


示例5: pg

Vector<Real, STATE_NF> State::scalar_y_flux(const _3Vec& X) const {
	Vector<Real, STATE_NF> flux = 0.0;
#ifdef USE_LZ
	flux[sx_index] = pg(X);
#endif
	return flux;
}
开发者ID:STEllAR-GROUP,项目名称:3d-eulerian-amr,代码行数:7,代码来源:state.cpp


示例6: pg

DH::DH(RandomNumberGenerator &rng, unsigned int pbits)
{
	PrimeAndGenerator pg(1, rng, pbits);
	p = pg.Prime();
	g = pg.Generator();
	gpc.Precompute(p, g, ExponentBitLength(), 1);
}
开发者ID:AmesianX,项目名称:encryption-library,代码行数:7,代码来源:dh.cpp


示例7: convert

void
MainWindow::on_actionInsertRandomPoints_triggered()
{
  QRectF rect = CGAL::Qt::viewportsBbox(&scene);
  CGAL::Qt::Converter<K> convert;  
  Iso_rectangle_2 isor = convert(rect);
  CGAL::Random_points_in_iso_rectangle_2<Point_2> pg(isor.min(), isor.max());
  bool ok = false;
  const int number_of_points = 
    QInputDialog::getInteger(this, 
                             tr("Number of random points"),
                             tr("Enter number of random points"),
			     100,
			     0,
			     std::numeric_limits<int>::max(),
			     1,
			     &ok);

  if(!ok) {
    return;
  }

  // wait cursor
  QApplication::setOverrideCursor(Qt::WaitCursor);
  std::vector<Point_2> points;
  points.reserve(number_of_points);
  for(int i = 0; i < number_of_points; ++i){
    points.push_back(*pg++);
  }
  dt.insert(points.begin(), points.end());
  // default cursor
  QApplication::restoreOverrideCursor();
  emit(changed());
}
开发者ID:mvdan,项目名称:geoc-viewer,代码行数:34,代码来源:Delaunay_triangulation_2.cpp


示例8: pg

void VirtualKeyboardContainer::showVirtualKeyboard(QWidget *w)
{
    if ( w )
    {       
        QPoint pg(w->mapToGlobal( QPoint( 0, 0 ) ) );
        QPoint pd(parent->mapFromGlobal( pg ) );

        int origin = pd.y();
        int keyboardWidth = parent->width() - 10;
        int keyboardHeight = std::min(vk.heightForWidth( keyboardWidth ), parent->height() - w->height() - 5);

        QRect kRect;
        if ( origin + w->height() + keyboardHeight <= parent->height() )
        {
            // keyboard can be placed below the widget
            kRect = QRect( 0, origin + w->height(), keyboardWidth, keyboardHeight );
        }
        else
        if ( origin - keyboardHeight >= 0 )
        {
            // keyboard can be placed above the widget
            kRect = QRect( 0, origin - keyboardHeight, keyboardWidth, keyboardHeight );
        }
        else
        {
            // we need to resize the dialog to place the keyboard below the widget
            int remainHeight = parent->height() - origin - w->height();
            extraSize = keyboardHeight - remainHeight;
            QPoint p(parent->pos());
            parent->move( p.x(), p.y() - extraSize );
            QSize s(parent->size());
            parent->resize( s.width(), s.height() + extraSize );
            kRect = QRect( 0, origin + w->height(), keyboardWidth, keyboardHeight );
        }

        if ( kRect.isValid() )
        {
            vk.setGeometry( kRect );
            vk.raise();
            vk.show();
        }
        else
        {
            vk.hide();
        }
    }
    else
    {
        if ( extraSize > 0 )
        {
            QPoint p(parent->pos());
            parent->move( p.x(), p.y() + extraSize );
            QSize s(parent->size());
            parent->resize( s.width(), s.height() - extraSize );
            extraSize = 0;
        }
        vk.hide();
    }
    vk.setBuddy(w);
}
开发者ID:timofonic,项目名称:cr3,代码行数:60,代码来源:VirtualKeyboardContainer.cpp


示例9: pc

ompl::geometric::PathGeometric ompl::control::PathControl::asGeometric(void) const
{
    PathControl pc(*this);
    pc.interpolate();
    geometric::PathGeometric pg(si_);
    pg.getStates().swap(pc.states_);
    return pg;
}
开发者ID:megan-starr9,项目名称:UAV_Aiolos,代码行数:8,代码来源:PathControl.cpp


示例10: pg

ElGamalDecryptor::ElGamalDecryptor(RandomNumberGenerator &rng, unsigned int pbits)
{
	PrimeAndGenerator pg(1, rng, pbits);
	m_p = pg.Prime();
	m_g = pg.Generator();
	m_x.Randomize(rng, ExponentBitLength());
	m_gpc.SetModulusAndBase(m_p, m_g);
	m_y = m_gpc.Exponentiate(m_x);
	m_ypc.SetModulusAndBase(m_p, m_y);
}
开发者ID:freegroup,项目名称:DigitalSimulator,代码行数:10,代码来源:elgamal.cpp


示例11: pg

marathon_group::ptr_t mesos_state_t::add_group(const Json::Value& group, marathon_group::ptr_t to_group, const std::string& framework_id)
{
	Json::Value group_id = group["id"];
	if(!group_id.isNull())
	{
		std::string id = group_id.asString();
		std::ostringstream os;
		os << "Adding Marathon group [" + id + ']';
		if(to_group)
		{
			os << " to group [" + to_group->get_id() << ']';
		}
		g_logger.log(os.str(), sinsp_logger::SEV_INFO);
		marathon_group::ptr_t pg(new marathon_group(id));
		marathon_group::ptr_t p_group = add_or_replace_group(pg, to_group);
		if(!framework_id.empty())
		{
			Json::Value apps = group["apps"];
			if(!apps.isNull())
			{
				for(const auto& app : apps)
				{
					Json::Value app_id = app["id"];
					if(!app_id.isNull())
					{
						marathon_app::ptr_t p_app = get_app(app_id.asString());
						if(!p_app)
						{
							p_app = add_app(app, framework_id);
						}
						if(p_app)
						{
							p_group->add_or_replace_app(p_app);
							for(const auto& task : get_tasks(framework_id))
							{
								if(task.second->get_marathon_app_id() == app_id.asString())
								{
									add_task_to_app(p_app, task.first);
								}
							}
						}
						else
						{
							g_logger.log("An error occured adding app [" + app_id.asString() +
										"] to group [" + id + ']', sinsp_logger::SEV_ERROR);
						}
					}
				}
			}
		}
		return p_group;
	}
	return 0;
}
开发者ID:bmandrade,项目名称:sysdig,代码行数:54,代码来源:mesos_state.cpp


示例12: pg

NRDigestSigner::NRDigestSigner(RandomNumberGenerator &rng, unsigned int pbits)
{
	PrimeAndGenerator pg(1, rng, pbits, 2*DiscreteLogWorkFactor(pbits));
	m_p = pg.Prime();
	m_q = pg.SubPrime();
	m_g = pg.Generator();
	m_x.Randomize(rng, 1, m_q-1, Integer::ANY);
	m_gpc.SetModulusAndBase(m_p, m_g);
	m_y = m_gpc.Exponentiate(m_x);
	m_ypc.SetModulusAndBase(m_p, m_y);
}
开发者ID:freegroup,项目名称:DigitalSimulator,代码行数:11,代码来源:nr.cpp


示例13: pg

int KQtTester::testPathgradientFillRectPath()
{
	QPainterPath path;
	path.addRect(0, 0, 500, 500);
	QPathGradient pg(path);
	pg.setColorAt(0, Qt::red);
	pg.setColorAt(0.5, Qt::green);
	pg.setColorAt(1.0, Qt::blue);

	return testFillRectPath(QBrush(pg));
}
开发者ID:okenjian,项目名称:coding,代码行数:11,代码来源:qttester.cpp


示例14: NdbMutex_Destroy

MultiNdbWakeupHandler::~MultiNdbWakeupHandler()
{
  if (localWakeupMutexPtr)
  {
    NdbMutex_Destroy(localWakeupMutexPtr);
    localWakeupMutexPtr = NULL;
  }
  PollGuard pg(* wakeNdb->theImpl);
  bool rc = wakeNdb->theImpl->m_transporter_facade->
    unregisterForWakeup(wakeNdb->theImpl);
  require(rc);
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:12,代码来源:WakeupHandler.cpp


示例15: platform_cpu_get_interrupt

int platform_cpu_get_interrupt( elua_int_id id, elua_int_resnum resnum )
{
  elua_int_p_get_status pg;

  if( id < ELUA_INT_FIRST_ID || id > INT_ELUA_LAST )
    return PLATFORM_INT_INVALID;
  if( ( pg = elua_int_table[ id - ELUA_INT_FIRST_ID ].int_get_status ) == NULL )
    return PLATFORM_INT_NOT_HANDLED;
  if( id == INT_TMR_MATCH )
    return cmn_tmr_int_get_status( resnum );
  return pg( resnum );
}
开发者ID:nuraci,项目名称:eLuaWebServer,代码行数:12,代码来源:common.c


示例16: JAccessDenied

JError
JDirInfo::BuildInfo()
{
	if (!JDirectoryReadable(*itsCWD))
		{
		return JAccessDenied(*itsCWD);
		}

	const JString origDir = JGetCurrentDirectory();

	JError err = JChangeDirectory(*itsCWD);
	if (!err.OK())
		{
		return err;
		}

	// clear old information

	itsDirEntries->CleanOut();

	// update instance variables

	JStripTrailingDirSeparator(itsCWD);		// keep Windows happy

	ACE_stat stbuf;
	ACE_OS::stat(*itsCWD, &stbuf);
	itsIsValidFlag    = kJTrue;
	itsIsWritableFlag = JDirectoryWritable(*itsCWD);
	itsModTime        = stbuf.st_mtime;
	itsStatusTime     = stbuf.st_ctime;

	JAppendDirSeparator(itsCWD);

	// process files in the directory

	JLatentPG pg(itsContentRegex == NULL ? 100 : 10);
	if (itsPG != NULL)
		{
		pg.SetPG(itsPG, kJFalse);
		}
	pg.VariableLengthProcessBeginning("Scanning directory...", kJTrue, kJFalse);

	BuildInfo1(pg);

	pg.ProcessFinished();

	err = JChangeDirectory(origDir);
	assert_ok( err );

	ApplyFilters(kJFalse);
	return JNoError();
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:52,代码来源:JDirInfo.cpp


示例17: wakeNdb

MultiNdbWakeupHandler::MultiNdbWakeupHandler(Ndb* _wakeNdb)
  : wakeNdb(_wakeNdb)
{
  localWakeupMutexPtr = NdbMutex_Create();
  assert(localWakeupMutexPtr);
  /* Register the waiter Ndb to receive wakeups for all Ndbs in the group */
  PollGuard pg(* wakeNdb->theImpl);
  woken = false;
  ignore_wakeups();
  bool rc = wakeNdb->theImpl->m_transporter_facade->registerForWakeup(wakeNdb->theImpl);
  require(rc);
  wakeNdb->theImpl->wakeHandler = this;
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:13,代码来源:WakeupHandler.cpp


示例18: group

QStringList ProfileManager::availableProfiles(QString profileType)
{
    KConfigGroup group(krConfig, "Private");
    QStringList profiles = group.readEntry(profileType, QStringList());
    QStringList profileNames;

    for (int i = 0; i != profiles.count() ; i++) {
        KConfigGroup pg(krConfig, profileType + " - " + profiles[ i ]);
        profileNames.append(pg.readEntry("Name"));
    }

    return profileNames;
}
开发者ID:aremai,项目名称:krusader,代码行数:13,代码来源:profilemanager.cpp


示例19: doc

void PaletteGenerator_Test::initial()
{
    Doc doc(this, m_fixtureDefCache);
    QList <Fixture*> list;
    list << new Fixture(&doc);
    list << new Fixture(&doc);
    list << new Fixture(&doc);

    PaletteGenerator pg(&doc, list);
    QCOMPARE(pg.m_doc, &doc);
    QCOMPARE(pg.m_fixtures.size(), 3);
    QCOMPARE(pg.m_scenes.size(), 0);
}
开发者ID:alexpaulzor,项目名称:qlc,代码行数:13,代码来源:palettegenerator_test.cpp


示例20: vz

Vector<Real, STATE_NF> State::vector_z_flux(const _3Vec& X, const _3Vec& V) const {
	Vector<Real, STATE_NF> flux = 0.0;
	Real v, v0, p;
	v = vz(X);
	v0 = v - V[2];
	p = pg(X);
	for (int i = 0; i < STATE_NF; i++) {
		flux[i] = (*this)[i] * v0;
	}
	flux[sz_index] += p;
	flux[et_index] += v * p;
	return flux;
}
开发者ID:STEllAR-GROUP,项目名称:3d-eulerian-amr,代码行数:13,代码来源:state.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pg_database_encoding_max_length函数代码示例发布时间:2022-05-30
下一篇:
C++ pfree函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap