本文整理汇总了C++中setContext函数的典型用法代码示例。如果您正苦于以下问题:C++ setContext函数的具体用法?C++ setContext怎么用?C++ setContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setContext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pt
void Selection3DDisplayCustom::queryContext( int x, int y )
{
float win_width = render_panel_->width();
float win_height = render_panel_->height();
//then send a raycast straight out from the camera at the mouse's position
Ogre::Ray mouseRay = this->render_panel_->getCamera()->getCameraToViewportRay((float)x/win_width, (float)y/win_height);
Ogre::Vector3 position;
Ogre::Vector3 pt(0,0,0);
Ogre::Quaternion ot(1,0,0,0);
transform(pt,ot,"/world",fixed_frame_.toUtf8().constData());
int type = -1;
std::string name;
if(raycast_utils_->RayCastFromPoint(mouseRay,pt,ot,position,type,name))
{
//ROS_ERROR("COLLIDED WITH %s %d",name.c_str(), type);
// type 0 -> UNKNOWN ENTITY
// type 1 -> POINT CLOUD
// type 2 -> WAYPOINT
// type 3 -> TEMPLATE
Q_EMIT setContext(type,name);
}
else
{
Q_EMIT setContext(-1,""); // NO_HIT
}
}
示例2: qDebug
/* call seq:init,setContext,create(start),reset,
chooseContext,glcx->makeCurrent(); */
void QGLWidget::init( QGLContext *context, const QGLWidget* shareWidget )
{
qDebug( "qgl_win.cpp; QGLWidget::init( QGLContext *context, const QGLWidget* shareWidget )" );
glcx = 0;
autoSwap = TRUE;
if ( shareWidget )
setContext( context, shareWidget->context() );
else
setContext( context );
setBackgroundMode( NoBackground ); //the widget is not cleared before paintEvent().
/*
if (isValid() && context->format().hasOverlay() ) {
QCString olcxName (name() );
olcxName+="-OGL_internal_overlay_widget";
olcx = new QGLWidget( QGLFormat::defaultOverlayFormat(),
this, olwName, shareWidget );
if ( olcx->isValid() ) {
olcx->setAutoBufferSwap( FALSE );
}
else {
delete olcx;
olcx = 0;
glcx->glFormat.setOverlay( FALSE );
}
}*/
}
示例3: size
QPixmap QGLWidget::renderPixmap( int w, int h, bool useContext )
{
QPixmap nullPm;
QSize sz = size();
if ( (w > 0) && (h > 0) )
sz = QSize( w, h );
QPixmap pm( sz );
glcx->doneCurrent();
bool success = TRUE;
if ( useContext && isValid() && renderCxPm( &pm ) )
return pm;
QGLFormat fmt = format();
fmt.setDirectRendering( FALSE ); // No direct rendering
fmt.setDoubleBuffer( FALSE ); // We don't need dbl buf
QGLContext* pcx = new QGLContext( fmt, &pm );
QGLContext* ocx = (QGLContext*)context();
setContext( pcx, 0, FALSE );
if ( pcx->isValid() )
updateGL();
else
success = FALSE;
setContext( ocx ); // Will delete pcx
if ( success )
return pm;
else
return nullPm;
}
示例4: QMT_CHECK
void DUpdateVisitor::visitMObject(const MObject *object)
{
auto dobject = dynamic_cast<DObject *>(m_target);
QMT_CHECK(dobject);
if (isUpdating(object->stereotypes() != dobject->stereotypes()))
dobject->setStereotypes(object->stereotypes());
const MObject *objectOwner = object->owner();
const MObject *diagramOwner = m_diagram->owner();
if (objectOwner && diagramOwner && objectOwner->uid() != diagramOwner->uid()) {
if (isUpdating(objectOwner->name() != dobject->context()))
dobject->setContext(objectOwner->name());
} else {
if (isUpdating(!dobject->context().isEmpty()))
dobject->setContext(QString());
}
if (isUpdating(object->name() != dobject->name()))
dobject->setName(object->name());
// TODO unlikely that this is called for all objects if hierarchy is modified
// PERFORM remove loop
int depth = 1;
const MObject *owner = object->owner();
while (owner) {
owner = owner->owner();
depth += 1;
}
if (isUpdating(depth != dobject->depth()))
dobject->setDepth(depth);
visitMElement(object);
}
示例5: kDebug
NavigationWidget::NavigationWidget(KDevelop::DeclarationPointer declaration, KDevelop::TopDUContextPointer topContext, const QString& /* htmlPrefix */, const QString& /* htmlSuffix */)
{
kDebug() << "Navigation widget for Declaration requested";
m_topContext = topContext;
initBrowser(400);
DeclarationNavigationContext* context = new DeclarationNavigationContext(declaration, m_topContext);
m_startContext = context;
setContext(m_startContext);
m_fullyQualifiedModuleIdentifier = context->m_fullyQualifiedModuleIdentifier;
kDebug() << "Identifier: " << m_fullyQualifiedModuleIdentifier;
if ( m_fullyQualifiedModuleIdentifier.length() ) {
kDebug() << "Checking wether doc server is running";
QTcpSocket* sock = new QTcpSocket();
sock->connectToHost(QHostAddress::LocalHost, 1050, QTcpSocket::ReadOnly);
bool running = sock->waitForConnected(300);
if ( ! running ) {
kDebug() << "Not running, starting pydoc server";
QProcess::startDetached("/usr/bin/env", QStringList() << "python" << QString(INSTALL_PATH) + "/pydoc.py" << "-p" << "1050");
usleep(100000); // give pydoc server 100ms to start up
}
else {
sock->disconnectFromHost();
}
delete sock;
m_documentationWebView = new QWebView(this);
m_documentationWebView->load(QUrl("http://localhost:1050/" + m_fullyQualifiedModuleIdentifier + ".html"));
connect( m_documentationWebView, SIGNAL(loadFinished(bool)), SLOT(addDocumentationData(bool)) );
}
}
示例6: d_func_dynamic
VariableDeclaration::VariableDeclaration(const KDevelop::RangeInRevision& range, KDevelop::DUContext* context)
: KDevelop::Declaration(*new VariableDeclarationData, range)
{
d_func_dynamic()->setClassId(this);
if (context)
setContext(context);
}
示例7: setContext
PythonEditor::PythonEditor(EditorWidget *editorWidget)
:BaseTextEditor(editorWidget)
{
setContext(Core::Context(Constants::C_PYTHONEDITOR_ID,
TextEditor::Constants::C_TEXTEDITOR));
setDuplicateSupported(true);
}
示例8: setContext
void X11Wnd::fillRects(Context* context, RECT* rects, int numRects)
{
setContext(context);
for (int i = 0; i < numRects; i++)
solidRect(rects[i],::GetTextColor(m_dc));
::InvalidateRect(m_hWnd,NULL,FALSE);
}
示例9: WebCLEvent
WebCLUserEvent::WebCLUserEvent(cl_event event, PassRefPtr<WebCLContext> context)
: WebCLEvent(event)
, m_eventStatusSituation(StatusUnset)
, m_executionStatus(0)
{
setContext(context);
}
示例10: setContext
void Console::setScriptEvaluator(const ScriptEvaluator &evaluator)
{
m_scriptEvaluator = evaluator;
m_consoleItemModel->setCanFetchMore(bool(m_scriptEvaluator));
if (!m_scriptEvaluator)
setContext(QString());
}
示例11: wxPaintDC
/* OGLCanvas::onPaint
* Called when the gfx canvas has to be redrawn
*******************************************************************/
void OGLCanvas::onPaint(wxPaintEvent& e) {
wxPaintDC(this);
if (IsShown()) {
// Set context to this window
#ifdef USE_SFML_RENDERWINDOW
#if SFML_VERSION_MAJOR < 2
sf::RenderWindow::SetActive();
Drawing::setRenderTarget(this);
SetView(sf::View(sf::FloatRect(0.0f, 0.0f, GetSize().x, GetSize().y)));
#else
sf::RenderWindow::setActive();
Drawing::setRenderTarget(this);
setView(sf::View(sf::FloatRect(0.0f, 0.0f, GetSize().x, GetSize().y)));
#endif//SFML_VERSION_MAJOR
#else
setContext();
#endif//USE_SFML_RENDERWINDOW
// Init if needed
if (!init_done)
init();
// Draw content
draw();
}
}
示例12: setAgent
AgentCallbackLoginAction::AgentCallbackLoginAction(const std::string& agent, const std::string& exten, const std::string& context, bool ackCall, long wrapupTime) {
setAgent(agent);
setExten(exten);
setContext(context);
setAckCall(ackCall);
setWrapupTime(wrapupTime);
}
示例13: findContext
bool QQmlAndroidContextual::initContext(QQmlAndroidContext *context)
{
if (!context)
context = findContext(this);
setContext(context);
return context;
}
示例14: ClassMemberDeclaration
AliasDeclaration::AliasDeclaration(const RangeInRevision& range, DUContext* context)
: ClassMemberDeclaration(*new AliasDeclarationData, range)
{
d_func_dynamic()->setClassId(this);
setKind(Alias);
if( context )
setContext( context );
}
示例15: setContext
void QQmlAndroidContextual::resolveContext()
{
if (!m_context) {
setContext(findContext(this));
if (!m_context)
qWarning() << "QQmlAndroidContextual: could not resolve context for" << this;
}
}