本文整理汇总了C++中rt函数的典型用法代码示例。如果您正苦于以下问题:C++ rt函数的具体用法?C++ rt怎么用?C++ rt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: lt
Rect Transform::transform(const Rect& bounds) const
{
Rect r;
vec2 lt( bounds.left, bounds.top );
vec2 rt( bounds.right, bounds.top );
vec2 lb( bounds.left, bounds.bottom );
vec2 rb( bounds.right, bounds.bottom );
lt = transform(lt);
rt = transform(rt);
lb = transform(lb);
rb = transform(rb);
r.left = floorf(min(lt[0], rt[0], lb[0], rb[0]) + 0.5f);
r.top = floorf(min(lt[1], rt[1], lb[1], rb[1]) + 0.5f);
r.right = floorf(max(lt[0], rt[0], lb[0], rb[0]) + 0.5f);
r.bottom = floorf(max(lt[1], rt[1], lb[1], rb[1]) + 0.5f);
return r;
}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-native,代码行数:20,代码来源:Transform.cpp
示例2: opName
const char* ARMv7DOpcodeLoadStoreRegisterImmediate::format()
{
const char* instructionName = opName();
if (!instructionName)
return defaultFormat();
appendInstructionName(opName());
appendRegisterName(rt());
appendSeparator();
appendCharacter('[');
appendRegisterName(rn());
if (immediate5()) {
appendSeparator();
appendUnsignedImmediate(immediate5() << scale());
}
appendCharacter(']');
return m_formatBuffer;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:20,代码来源:ARMv7DOpcode.cpp
示例3: ASSERT
void CAlmanacDiagramCtrl::DrawStarPos(CDC *pDc, const CRect &rect)
{
ASSERT(pDc != NULL);
if (pDc==NULL || m_strDir.GetLength()!=4)
{
return;
}
CFont *OldFont = (CFont*)pDc->SelectObject(&m_TextFont);
for (int j=90; j<=360; j+=90)
{
POINT pt;
pt.x = m_centerCircle.x + m_iRadius * sin(j*PI/180);
pt.y = m_centerCircle.y - m_iRadius * cos(j*PI/180);
CRect rt;
rt.SetRect(pt.x-7, pt.y-7, pt.x+7, pt.y+7);
CString str;
str = m_strDir.Mid(j/90-1, 1);
pDc->DrawText(str, &rt, DT_SINGLELINE|DT_CENTER|DT_VCENTER);
}
pDc->SetBkMode(TRANSPARENT);
pDc->SelectObject(&m_StarFont);
for (int i=0; i<m_iStarNum; i++)
{
POINT pt = CalStarPos(m_StarData[i]);
if (m_StarData[i].tracked == 1)
{
pDc->DrawIcon(pt.x-Icon_Size/2, pt.y-Icon_Size/2, m_hSigStrong);
}
else
{
pDc->DrawIcon(pt.x-Icon_Size/2, pt.y-Icon_Size/2, m_hSigWeak);
}
CRect rt(pt.x-Icon_Size/2, pt.y-Icon_Size/2,
pt.x+Icon_Size/2, pt.y+Icon_Size/2);
CString str;
str.Format(_T("%d"), m_StarData[i].id);
pDc->DrawText(str, &rt, DT_SINGLELINE|DT_CENTER|DT_VCENTER);
}
pDc->SelectObject(OldFont);
}
开发者ID:gaojihao,项目名称:7520Inspru,代码行数:41,代码来源:AlmanacDiagramCtrl.cpp
示例4: main
int main(int, char**) {
bool not_done = true;
dds::Runtime rt("");
dds::Topic<TempSensorType> topic("TempSensorTopic");
dds::DataReader<TempSensorType> dr(topic);
//[NOTE #1]: Create an instance of the handler
TempSensorDataHandler handler;
auto func =
boost::bind(TempSensorDataHandler::handle_data, &handler, _1);
//[NOTE #2]: Register the handler for the relevant event
auto connection =
dr.connect<on_data_available>(func);
return 0;
}
开发者ID:ggandda,项目名称:simd-cxx,代码行数:21,代码来源:tssub-async.cpp
示例5: info
void FcitxQtConnectionPrivate::initialize() {
m_serviceWatcher->setConnection(QDBusConnection::sessionBus());
m_serviceWatcher->addWatchedService(m_serviceName);
QFileInfo info(socketFile());
QDir dir(info.path());
if (!dir.exists()) {
QDir rt(QDir::root());
rt.mkpath(info.path());
}
m_watcher->addPath(info.path());
if (info.exists()) {
m_watcher->addPath(info.filePath());
}
connect(m_watcher, &QFileSystemWatcher::fileChanged,
this, &FcitxQtConnectionPrivate::socketFileChanged);
connect(m_watcher, &QFileSystemWatcher::directoryChanged,
this, &FcitxQtConnectionPrivate::socketFileChanged);
m_initialized = true;
}
开发者ID:yuyichao,项目名称:fcitx-qt5,代码行数:21,代码来源:fcitxqtconnection.cpp
示例6: TEST
TEST(Type, RuntimeType) {
HPHP::Transl::RuntimeType rt(new StringData());
Type t = Type::fromRuntimeType(rt);
EXPECT_TRUE(t.subtypeOf(Type::Str));
EXPECT_FALSE(t.subtypeOf(Type::Int));
rt = HPHP::Transl::RuntimeType(HphpArray::GetStaticEmptyArray());
t = Type::fromRuntimeType(rt);
EXPECT_TRUE(t.subtypeOf(Type::Arr));
EXPECT_FALSE(t.subtypeOf(Type::Str));
rt = HPHP::Transl::RuntimeType(true);
t = Type::fromRuntimeType(rt);
EXPECT_TRUE(t.subtypeOf(Type::Bool));
EXPECT_FALSE(t.subtypeOf(Type::Obj));
rt = HPHP::Transl::RuntimeType((int64_t) 1);
t = Type::fromRuntimeType(rt);
EXPECT_TRUE(t.subtypeOf(Type::Int));
EXPECT_FALSE(t.subtypeOf(Type::Dbl));
rt = HPHP::Transl::RuntimeType(DataType::KindOfObject,
DataType::KindOfInvalid);
rt = rt.setKnownClass(SystemLib::s_TraversableClass);
t = Type::fromRuntimeType(rt);
EXPECT_TRUE(t.subtypeOf(Type::Obj));
EXPECT_FALSE(Type::Obj.subtypeOf(t));
EXPECT_FALSE(Type::Int.subtypeOf(t));
HPHP::Transl::RuntimeType rt1 =
HPHP::Transl::RuntimeType(DataType::KindOfObject,
DataType::KindOfInvalid);
rt1 = rt1.setKnownClass(SystemLib::s_IteratorClass);
Type t1 = Type::fromRuntimeType(rt1);
EXPECT_TRUE(t1.subtypeOf(Type::Obj));
EXPECT_TRUE(t1.subtypeOf(t));
EXPECT_FALSE(Type::Obj.subtypeOf(t1));
EXPECT_FALSE(t.subtypeOf(t1));
EXPECT_FALSE(t.subtypeOf(Type::Str));
EXPECT_FALSE(Type::Int.subtypeOf(t));
}
开发者ID:IMGM,项目名称:hiphop-php,代码行数:40,代码来源:type.cpp
示例7: SkDEBUGFAIL
sk_sp<GrRenderTargetContext> GrDrawingManager::makeRenderTargetContext(
sk_sp<GrRenderTargetProxy> rtp,
sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* surfaceProps) {
if (this->wasAbandoned()) {
return nullptr;
}
// SkSurface catches bad color space usage at creation. This check handles anything that slips
// by, including internal usage. We allow a null color space here, for read/write pixels and
// other special code paths. If a color space is provided, though, enforce all other rules.
if (colorSpace && !SkSurface_Gpu::Valid(fContext, rtp->config(), colorSpace.get())) {
SkDEBUGFAIL("Invalid config and colorspace combination");
return nullptr;
}
bool useDIF = false;
if (surfaceProps) {
useDIF = surfaceProps->isUseDeviceIndependentFonts();
}
if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() &&
rtp->isStencilBufferMultisampled()) {
// TODO: defer stencil buffer attachment for PathRenderingDrawContext
sk_sp<GrRenderTarget> rt(sk_ref_sp(rtp->instantiate(fContext->textureProvider())));
GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt.get());
if (sb) {
return sk_sp<GrRenderTargetContext>(new GrPathRenderingRenderTargetContext(
fContext, this, std::move(rtp),
std::move(colorSpace), surfaceProps,
fContext->getAuditTrail(), fSingleOwner));
}
}
return sk_sp<GrRenderTargetContext>(new GrRenderTargetContext(fContext, this, std::move(rtp),
std::move(colorSpace),
surfaceProps,
fContext->getAuditTrail(),
fSingleOwner));
}
开发者ID:aseprite,项目名称:skia,代码行数:40,代码来源:GrDrawingManager.cpp
示例8: run_priority_abp
///////////////////////////////////////////////////////////////////////
// priority abp scheduler: local priority deques for each OS thread,
// with work stealing from the "bottom" of each.
int run_priority_abp(startup_function_type const& startup,
shutdown_function_type const& shutdown,
util::command_line_handling& cfg, bool blocking)
{
ensure_hierarchy_arity_compatibility(cfg.vm_);
ensure_hwloc_compatibility(cfg.vm_);
std::size_t num_high_priority_queues = cfg.num_threads_;
if (cfg.vm_.count("hpx:high-priority-threads")) {
num_high_priority_queues =
cfg.vm_["hpx:high-priority-threads"].as<std::size_t>();
}
bool numa_sensitive = false;
if (cfg.vm_.count("hpx:numa-sensitive"))
numa_sensitive = true;
// scheduling policy
typedef hpx::threads::policies::abp_priority_queue_scheduler
abp_priority_queue_policy;
abp_priority_queue_policy::init_parameter_type init(
cfg.num_threads_, num_high_priority_queues, 1000,
numa_sensitive);
// Build and configure this runtime instance.
typedef hpx::runtime_impl<abp_priority_queue_policy> runtime_type;
HPX_STD_UNIQUE_PTR<hpx::runtime> rt(
new runtime_type(cfg.rtcfg_, cfg.mode_, cfg.num_threads_, init));
if (blocking) {
return run(*rt, cfg.hpx_main_f_, cfg.vm_, cfg.mode_, startup,
shutdown);
}
// non-blocking version
start(*rt, cfg.hpx_main_f_, cfg.vm_, cfg.mode_, startup, shutdown);
rt.release(); // pointer to runtime is stored in TLS
return 0;
}
开发者ID:fpelliccioni,项目名称:hpx,代码行数:43,代码来源:hpx_init.cpp
示例9: main
int main(int argc, char** argv) {
try {
std::string script = LoadScript(argc, argv);
rs::jsapi::Runtime rt(1024 * 1024 * 1024, true, true);
auto app = new Application(rt, "com.ripcordsoftware.examples.gtk", 1, argv);
rs::jsapi::Global::DefineProperty(rt, "app", *app);
auto builder = new Builder(rt);
rs::jsapi::Global::DefineProperty(rt, "builder", *builder);
rs::jsapi::Global::DefineFunction(rt, "trace",
[](const std::vector<rs::jsapi::Value>& args, rs::jsapi::Value& result){
for (auto arg : args) {
std::cout << arg.ToString();
}
if (args.size() > 0) {
std::cout << std::endl;
}
return true;
});
rt.Evaluate(script.c_str());
//rs::jsapi::Script scr(rt, script.c_str());
//scr.Compile();
//scr.Execute();
} catch (const rs::jsapi::ScriptException& ex) {
std::cerr <<
"ERROR: line " << ex.lineno << std::endl <<
ex.what() << std::endl <<
ex.linebuf << std::endl;
}
return 0;
}
开发者ID:dumganhar,项目名称:libjsapi,代码行数:40,代码来源:main.cpp
示例10: minimumSize
QSize K3ActiveLabel::minimumSizeHint() const
{
QSize ms = minimumSize();
if ((ms.width() > 0) && (ms.height() > 0))
return ms;
int w = 400;
if (ms.width() > 0)
w = ms.width();
QString txt = toHtml();
Q3SimpleRichText rt(txt, font());
rt.setWidth(w - 2*frameWidth() - 10);
w = 10 + rt.widthUsed() + 2*frameWidth();
if (w < ms.width())
w = ms.width();
int h = rt.height() + 2*frameWidth();
if ( h < ms.height())
h = ms.height();
return QSize(w, h);
}
开发者ID:ssj-gz,项目名称:emscripten-kdelibs,代码行数:22,代码来源:k3activelabel.cpp
示例11: rts
void MainWindow::newCellTest()
{
QString rts("root"), rrts("right of root and quite long at that"),
lrts("left of root");
ZZCell rt((cellID)1, 0, rts),
rrt((cellID)2, 0, rrts),
lrt((cellID)3, 0, lrts);
// QHash should make a copy for us
// since these guys will be dead soon
world.insert(1, rt);
world.insert(2, rrt);
world.insert(3, lrt);
// Construct our top-level squares
QGraphicsRectItem *rt_rect = new QGraphicsRectItem(0,0,100,20),
*rrt_rect = new QGraphicsRectItem(0,0,100,20),
*lrt_rect = new QGraphicsRectItem(0,0,100,20);
QGraphicsTextItem *rt_text = new QGraphicsTextItem(rt.getContent(), rt_rect),
*rrt_text = new QGraphicsTextItem(rrt.getContent(), rrt_rect),
*lrt_text = new QGraphicsTextItem(lrt.getContent(), lrt_rect);
rt_rect->setPos(420, 420);
rrt_rect->setPos(530, 420);
lrt_rect->setPos(310, 420);
// Add our toplevel squares to our scene
scene->addItem(rt_rect);
scene->addItem(rrt_rect);
scene->addItem(lrt_rect);
scene->update();
ui->zzViewWidget->show();
}
开发者ID:enkiv2,项目名称:dimscape-cc,代码行数:39,代码来源:mainwindow.cpp
示例12: rx
bool RegexSourceSink::StartAcquisition(QString dev)
{
QRegExp rx("(.+)/(.+)(\\..+)");
int pos=0;
pos=rx.indexIn(dev);
dir=rx.cap(1);
basename=rx.cap(2);
extension=rx.cap(3);
QRegExp rt("(\\d+$)");
pos=rt.indexIn(basename);
basename.truncate(pos);
// qDebug()<<dir<<basename<<rt.cap(1)<<extension;
QString regexString=basename+"\\d+"+extension;
// qDebug()<<"Will load files that match"<<regexString;
QRegExp movieRegex(regexString);
QDir basedir(dir);
if (!basedir.exists()) qDebug()<<"Extracted dir does not exist"<<dir;
QStringList filt;
filt<<"*"+extension;
basedir.setNameFilters(filt);
QStringList files=basedir.entryList();
goodFiles=new QStringList;
for (int i=0;i<files.count();i++) {
if (movieRegex.indexIn(files.at(i))!=-1) {
goodFiles->append(files.at(i));
}
}
if (goodFiles->count()==0) qDebug()<<"No matching files found";
index=0;
nFrames=goodFiles->count();
return true;
}
开发者ID:immermachen,项目名称:GigaViewer,代码行数:39,代码来源:regexsourcesink.cpp
示例13: clientMouseMove
virtual void clientMouseMove(const twPoint& pt){
if(m_drag!=-1){
twRect rt(twPoint(0,0),getClientRect().size());
bool newHover=rt&&pt;
int newDrag=pt.y/m_rowHeight;
if(newDrag<0)
newDrag=0;
if(newDrag>=(int)items().size())
newDrag=items().size()-1;
if(newHover!=m_hover || newDrag!=m_drag){
invalidateClientRect(rectForItem(m_drag));
invalidateClientRect(rectForItem(newDrag));
m_hover=newHover;
m_drag=newDrag;
}
}
}
开发者ID:yvt,项目名称:Agiletimbres,代码行数:22,代码来源:ATDropdownList.cpp
示例14: discardOutside
std::list<pBlock> ClearInterval::
discardOutside(Signal::Interval& I)
{
std::list<pBlock> discarded;
BlockCache::cache_t C = cache_->clone();
for (BlockCache::cache_t::value_type itr : C)
{
pBlock block(itr.second);
Signal::Interval blockInterval = block->getInterval();
Signal::Interval toKeep = I & blockInterval;
bool remove_entire_block = toKeep == Signal::Interval();
bool keep_entire_block = toKeep == blockInterval;
if ( remove_entire_block )
{
discarded.push_back (block);
}
else if ( keep_entire_block )
{
}
else
{
// clear partial block
if( I.first <= blockInterval.first && I.last < blockInterval.last )
{
Region ir = block->getRegion ();
ResampleTexture rt(block->glblock->glTexture ()->getOpenGlTextureId ());
ResampleTexture::Area A(ir.a.time, ir.a.scale, ir.b.time, ir.b.scale);
GlFrameBuffer::ScopeBinding sb = rt.enable(A);
float t = I.last / block->block_layout ().targetSampleRate();
A.x1 = t;
rt.drawColoredArea (A, 0.f);
(void)sb; // RAII
}
}
}
return discarded;
}
开发者ID:davidhesselbom,项目名称:freq,代码行数:39,代码来源:clearinterval.cpp
示例15: rt
void Ski_area_gui::draw_lines() const
{
int r = sa->get_r();
int c = sa->get_c();
for (int i = 0; i < r; ++i){
for (int j = 0; j < c; ++j){
Graph_lib::Rectangle rt(Point(pos.x + j*width, pos.y + i*height), width, height);
ostringstream oss;
oss << sa->get_height(i + 1, j + 1);
if (comment[i][j] != ""){
oss << '(' << comment[i][j] << ')';
}
Graph_lib::Text t(Point(pos.x + j*width + width / 2, pos.y + i*height + height), oss.str());
if (hl[i][j]){
t.set_color(Graph_lib::Color::white);
rt.set_fill_color(Graph_lib::Color::black);
}
rt.draw();
t.draw();
}
}
}
开发者ID:codeworm96,项目名称:SE105-Programming-1,代码行数:22,代码来源:ski_area_gui.cpp
示例16: throw
PlayRequest Session::play( const PlayRequest & rq ) throw( RTSP::Exception::ManagedError )
{
try
{
Session::Lock lk( *this );
Log::debug( "%s: pre-play", getLogName() );
// guess common parameters
PlayRequest rt( rq );
BOOST_FOREACH( SessionMap::iterator::reference sess, _sessions )
{
rt.merge( sess->second->eval( rq ) );
Log::debug("%s: merge: %s", getLogName(), rt.toString().c_str() );
}
Log::debug( "%s: play setup with %s", getLogName(), rt.toString().c_str() );
// set it up
BOOST_FOREACH( SessionMap::iterator::reference sess, _sessions )
sess->second->play( rt );
_playIssued = true;
return rt;
}
开发者ID:drubbo,项目名称:kinoglaz,代码行数:22,代码来源:session.cpp
示例17: operator
bool operator()(iterator texta, iterator texte, uint64_t pb) const
{
assert ( fs );
pb %= fs;
typename factory_type::wrapper_ptr_type cwb(factory_type::construct(filename,pb));
while ( texta != texte )
{
typename factory_type::int_type const ca = *(texta++);
typename factory_type::int_type const cb = cwb->get();
assert ( ca != factory_type::base_istream_type::traits_type::eof() );
assert ( cb != factory_type::base_istream_type::traits_type::eof() );
if ( ca != cb )
return ca < cb;
}
std::runtime_error rt("CircularSuffixComparator::operator(iterator,iterator,uint64_t): comparison extends beyond end of given text.");
throw rt;
}
开发者ID:allenday,项目名称:libmaus,代码行数:22,代码来源:CircularSuffixComparator.hpp
示例18: pixmap
void ListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
{
if (text(column).isNull()) {
K3ListViewItem::paintCell(p, cg, column, width, alignment);
int pad = 0;
if (pixmap(column)) {
pad = pixmap(column)->width() + 5;
}
Q3SimpleRichText rt(m_richText[column], p->font());
rt.draw(p, pad, 0, QRect(pad, 0, width, height()), cg);
} else if (m_colors.contains(column)) {
/*QColorGroup _cg(cg);
QColor c = _cg.text();
_cg.setColor(QColorGroup::Text, m_colors[column]);*/
K3ListViewItem::paintCell(p, cg, column, width, alignment);
//_cg.setColor(QColorGroup::Text, c);
} else {
K3ListViewItem::paintCell(p, cg, column, width, alignment);
}
}
开发者ID:netrunner-debian-kde-extras,项目名称:kftpgrabber,代码行数:23,代码来源:listviewitem.cpp
示例19: worker_proc
void worker_proc()
{
Runtime rt(NULL);
AsyncEvent* p;
m_idleWorkers.dec();
while (true) {
if (m_idleWorkers.inc() > m_max_idle) {
if (m_idleWorkers.dec() > 0)
break;
m_idleWorkers.inc();
}
p = m_pool.get();
if (m_idleWorkers.dec() == 0)
if (m_idleWorkers.CompareAndSwap(0, 1) == 0)
new_worker();
p->invoke();
}
}
开发者ID:lx6317648,项目名称:fibjs,代码行数:23,代码来源:acPool.cpp
示例20: data
//! Start subscriptions for this resource.
void ResourceCached::startSubscriptions()
{
OsSysLog::add(FAC_RLS, PRI_DEBUG,
"ResourceCached::startSubscriptions URI = '%s'",
data());
// Create the ContactSet.
mContactSetP = new ContactSet(this,
// The URI, which is the UtlString-nature
// of a RecourceCached.
*(static_cast <UtlString*> (this))
);
// Start the refresh timer.
// Choose a random time between 1/2 and 1 times
// ResourceListServer::getRefreshInterval().
int refresh_time =
(int) ((1.0 + ((float) sRandom.rand()) / RAND_MAX) / 2.0 *
getResourceListServer()->getRefreshInterval());
OsSysLog::add(FAC_RLS, PRI_DEBUG,
"ResourceCached::startSubscriptions refresh_time = %d",
refresh_time);
OsTime rt(refresh_time, 0);
mRefreshTimer.oneshotAfter(rt);
}
开发者ID:mranga,项目名称:sipxecs,代码行数:25,代码来源:ResourceCached.cpp
注:本文中的rt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论