コード例 #1
0
ファイル: test-segments.cpp プロジェクト: LLNL/RAJA
TEST(SegmentTest, constructors)
{
  {
    RAJA::RangeStrideSegment first(0, 10, 2);
    RAJA::RangeStrideSegment copied(first);
    ASSERT_EQ(first, copied);
    RAJA::RangeStrideSegment moved(std::move(first));
    ASSERT_EQ(moved, copied);
  }

  {
    RAJA::RangeSegment first(0, 10);
    RAJA::RangeSegment copied(first);
    ASSERT_EQ(first, copied);
    RAJA::RangeSegment moved(std::move(first));
    ASSERT_EQ(moved, copied);
  }

  {
    RAJA::ListSegment first(RAJA::RangeSegment(0, 10));
    ASSERT_EQ(RAJA::Owned, first.getIndexOwnership());

    RAJA::ListSegment copied(first);
    ASSERT_EQ(RAJA::Owned, copied.getIndexOwnership());

    ASSERT_EQ(first, copied);
    RAJA::ListSegment moved(std::move(first));
    ASSERT_EQ(moved, copied);

    RAJA::ListSegment empty(nullptr, 100);
    RAJA::ListSegment empty2(first.begin(), -5);
    ASSERT_EQ(empty, empty2);
  }
}
コード例 #2
0
ファイル: plotsdialog.cpp プロジェクト: oabdelaziz/SorpSim
void plotsDialog::resetZoomer(int i)
{

    Plot* currentPlot = dynamic_cast<Plot*>(tabs->currentWidget());

    d_zoomer[0] = new Zoomer( QwtPlot::xBottom, QwtPlot::yLeft,
                              currentPlot->canvas() );
    d_zoomer[0]->setRubberBand( QwtPicker::RectRubberBand );
    d_zoomer[0]->setRubberBandPen( QColor( Qt::green ) );
    d_zoomer[0]->setTrackerMode( QwtPicker::ActiveOnly );
    d_zoomer[0]->setTrackerPen( QColor( Qt::white ) );

    d_zoomer[1] = new Zoomer( QwtPlot::xTop, QwtPlot::yRight,
                              currentPlot->canvas() );

    d_panner = new QwtPlotPanner( currentPlot->canvas() );
    d_panner->setMouseButton( Qt::MidButton );

    d_picker = new QwtPlotPicker( QwtPlot::xBottom, QwtPlot::yLeft,
                                  QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn,
                                  currentPlot->canvas() );
    d_picker->setStateMachine( new QwtPickerDragPointMachine() );
    d_picker->setRubberBandPen( QColor( Qt::green ) );
    d_picker->setRubberBand( QwtPicker::CrossRubberBand );
    d_picker->setTrackerPen( QColor( Qt::white ) );

    connect(d_picker,SIGNAL(moved(QPoint)),SLOT(moved(QPoint)));

    ui->overlayButton->setHidden(currentPlot->isParametric);
    ui->dataSelectButton->setHidden(!currentPlot->isParametric);

    enableZoomMode(false);
}
コード例 #3
0
ファイル: trackerobserver.cpp プロジェクト: volthouse/desktop
TrackerObserver::TrackerObserver(DataView *view, CurveTracker *t1, CurveTracker *t2) : QObject()
{
    this->view = view;
    this->t1 = t1;
    this->t2 = t2;

    connect(t1, SIGNAL(moved(QPointF)), this, SLOT(trackerMoved(QPointF)));
    connect(t2, SIGNAL(moved(QPointF)), this, SLOT(trackerMoved(QPointF)));
}
コード例 #4
0
void TemporalScenarioView::movedAsked(const QPointF& p)
{
    QRectF r = QRectF{m_previousPoint.x(), m_previousPoint.y() , 1, 1};
    ensureVisible(mapRectFromScene(r), 30, 30);
    emit moved(p);
    m_previousPoint = p; // we use the last pos, because if not there's a larsen and crash
}
コード例 #5
0
void
FormMoveHandle::mouseReleaseEvent( QGraphicsSceneMouseEvent * event )
{
	FormAction::instance()->form()->snapItem()->setSnapPos(
		event->scenePos() );

	if( event->button() == Qt::LeftButton )
	{
		d->m_pressed = false;

		if( FormAction::instance()->isSnapEnabled() )
		{
			const QPointF delta =
				FormAction::instance()->form()->snapItem()->snapPos() -
				mapToScene( d->m_pos ) + d->m_touchDelta;

			setPos( pos() + delta );

			moved( delta );

			released( this );
		}
	}

	if( !d->m_ignoreMouse )
		event->accept();
	else
		event->ignore();
}
コード例 #6
0
bool QIconView::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: selectionChanged(); break;
    case 1: selectionChanged((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 2: currentChanged((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 3: clicked((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 4: clicked((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 5: pressed((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: pressed((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 7: doubleClicked((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 8: returnPressed((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 9: rightButtonClicked((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 10: rightButtonPressed((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 11: mouseButtonPressed((int)static_QUType_int.get(_o+1),(QIconViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break;
    case 12: mouseButtonClicked((int)static_QUType_int.get(_o+1),(QIconViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break;
    case 13: contextMenuRequested((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 14: dropped((QDropEvent*)static_QUType_ptr.get(_o+1),(const QValueList<QIconDragItem>&)*((const QValueList<QIconDragItem>*)static_QUType_ptr.get(_o+2))); break;
    case 15: moved(); break;
    case 16: onItem((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 17: onViewport(); break;
    case 18: itemRenamed((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QString&)static_QUType_QString.get(_o+2)); break;
    case 19: itemRenamed((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    default:
	return QScrollView::qt_emit(_id,_o);
    }
    return TRUE;
}
コード例 #7
0
bool BoardItem::reposition(PieceItem* piece)
{
    QList<QGraphicsItem *> items = piece->collidingItems();

    QMap<double , SquareItem *> rects;

    {
        SquareItem *currentSquareItem = d->squares[piece->currentSquare()];

        foreach(QGraphicsItem *it, items)
        {
            if(SquareItem*square =  qgraphicsitem_cast<SquareItem*>(it))
            {
// 				if( square == currentSquareItem ) continue;

                QRectF intersect = square->sceneBoundingRect().intersect(piece->sceneBoundingRect());

                rects.insert( intersect.height() * intersect.width(), square );
            }
        }
    }

    QList<double> heights = rects.keys();

    double max = -1;

    foreach(double p, heights)
    {
        if( p > max )
        {
            max = p;
        }
    }

    if( max > 0 )
    {
        Game::Board board = d->game->board();

        Game::Square from = piece->currentSquare();
        Game::Square to = rects[max]->logicalIndex();

        Game::Move move(board, from, to);


        if ((to < 8 || to > 55) && (board.at(from) == Game::WhitePawn || board.at(from) == Game::BlackPawn))
        {
            qWarning("PROMOTION!!!!!!");
        }


        if (board.isLegal(move))
        {
            doMove(piece, move);
            emit moved(board.moveToSAN(move));
            return true;
        }
    }

    return false;
}
コード例 #8
0
void MainWindow::onNewCamera(void)
{
    connect(mController.getEngine()->getCamera(), SIGNAL(moved()),
            this, SLOT(updateViewCamera()));

    updateViewCamera();
}
コード例 #9
0
ファイル: demo_ruler.cpp プロジェクト: Jinxiaohai/QT
void Demo_Ruler::init()
{
    setWindowTitle (m_title);
    setWindowOpacity (1);
    setWindowFlags (Qt::FramelessWindowHint);
    setAttribute (Qt::WA_TranslucentBackground);

    ui->widget->setOrientation(Qt::Horizontal);

    m_pActionOrn = new QAction(this);
    m_pActionOrn->setText (QString ("垂直"));
    connect (m_pActionOrn,SIGNAL(triggered(bool)),SLOT(slotOnOrn()));

    m_pActionAlign = new QAction(this);
    m_pActionAlign->setText (QString ("对齐"));
    connect (m_pActionAlign,SIGNAL(toggled(bool)),this,SLOT(slotOnAlign()));

    addAction (m_pActionOrn);
    addAction (m_pActionAlign);
    this->setContextMenuPolicy (Qt::ActionsContextMenu);

    resize (ui->widget->sizeHint ());

    connect (ui->widget,SIGNAL(moved(QPoint)),
             this,SLOT(slotOnMove(QPoint)));
}
コード例 #10
0
ファイル: kinotifytest.cpp プロジェクト: stream009/baloo
void KInotifyTest::testRenameFolder()
{
    // create some test files
    QTemporaryDir dir;
    const QString f1(QStringLiteral("%1/randomJunk1").arg(dir.path()));
    mkdir(f1);

    // start the inotify watcher
    KInotify kn(nullptr /*no config*/);
    kn.addWatch(dir.path(), KInotify::EventAll);

    // listen to the desired signal
    QSignalSpy spy(&kn, SIGNAL(moved(QString,QString)));

    // actually move the file
    const QString f2(QStringLiteral("%1/randomJunk2").arg(dir.path()));
    QFile::rename(f1, f2);

    // check the desired signal
    QVERIFY(spy.wait());
    QCOMPARE(spy.count(), 1);
    QList<QVariant> args = spy.takeFirst();
    QCOMPARE(args.at(0).toString(), f1);
    QCOMPARE(args.at(1).toString(), f2);

    // check the path cache
    QVERIFY(!kn.watchingPath(f1));
    QVERIFY(kn.watchingPath(f2));

    // test a subsequent rename
    const QString f3(QStringLiteral("%1/randomJunk3").arg(dir.path()));
    QFile::rename(f2, f3);

    // check the desired signal
    QVERIFY(spy.wait());
    QCOMPARE(spy.count(), 1);
    args = spy.takeFirst();
    QCOMPARE(args.at(0).toString(), f2);
    QCOMPARE(args.at(1).toString(), f3);

    // check the path cache
    QVERIFY(!kn.watchingPath(f1));
    QVERIFY(!kn.watchingPath(f2));
    QVERIFY(kn.watchingPath(f3));


    // KInotify claims it has updated its data structures, lets see if that is true
    // by creating a file in the new folder
    // listen to the desired signal
    const QString f4(QStringLiteral("%1/somefile").arg(f3));

    QSignalSpy createdSpy(&kn, SIGNAL(created(QString,bool)));

    // test creating a file
    touchFile(f4);

    QVERIFY(createdSpy.wait());
    QCOMPARE(createdSpy.count(), 1);
    QCOMPARE(createdSpy.takeFirst().at(0).toString(), f4);
}
コード例 #11
0
ファイル: ScenarioView.cpp プロジェクト: OSSIA/Score
void ScenarioView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
{
  if (event->buttons() & Qt::MiddleButton)
  {
    auto obj = copySelectedScenarioElements(m_scenario);
    if (!obj.empty())
    {
      QDrag d{this};
      auto m = new QMimeData;
      QJsonDocument doc{obj};
      ;
      m->setData(
          score::mime::scenariodata(), doc.toJson(QJsonDocument::Indented));
      d.setMimeData(m);
      d.exec();
    }
  }
  else
  {
    if (m_moving
        || (event->buttonDownScreenPos(Qt::LeftButton) - event->screenPos())
                   .manhattanLength()
               > QApplication::startDragDistance())
    {
      m_moving = true;
      moved(event->scenePos());
    }
  }
  event->accept();
}
コード例 #12
0
ファイル: node.cpp プロジェクト: zoltanp/ktechlab-0.3
Node::Node(ICNDocument *icnDocument, Node::node_type type, int dir, const QPoint &pos, QString *id)
		: QObject(), QCanvasPolygon(icnDocument ? icnDocument->canvas() : 0) {
	m_length = 8;
	p_nodeGroup = 0;
	p_parentItem = 0;
	b_deleted = false;
	m_dir = dir;
	m_type = type;
	p_icnDocument = icnDocument;
	m_level = 0;

	if(p_icnDocument) {
		if (id) {
			m_id = *id;

			if (!p_icnDocument->registerUID(*id))
				kdError() << k_funcinfo << "Could not register id " << *id << endl;
		} else m_id = p_icnDocument->generateUID("node" + QString::number(type));
	}

	initPoints();

	move(pos.x(), pos.y());
	setBrush(Qt::black);
	setPen(Qt::black);
	show();

	emit(moved(this));
}
コード例 #13
0
ファイル: node.cpp プロジェクト: zoltanp/ktechlab-0.3
void Node::moveBy(const double dx, const double dy) {
	if(dx == 0 && dy == 0) return;

	QCanvasPolygon::moveBy(dx, dy);

	emit moved(this);
}
コード例 #14
0
ファイル: samegame.c プロジェクト: z88dk/z88dk
int main()
{
  int   mode;
  void *param = &udgs;
  console_ioctl(IOCTL_GENCON_SET_UDGS, &param);

  putch(1);
  putch(32);

#ifdef SWITCH_MODE
   mode = SWITCH_MODE;
   console_ioctl(IOCTL_GENCON_SET_MODE, &mode);
#endif


    while ( 1 ) {
        initialise_level();
        playing = 1;
        score = 0;
        clrscr();
        moved();
        while ( playing ) {
            handle_keys();         
        }
    }
}
コード例 #15
0
ファイル: move.cpp プロジェクト: LocutusOfBorg/poedit
 void invariant() const {
     if(!moved()) { // Do not check (some) invariants for moved-from objects.
         BOOST_CONTRACT_ASSERT(index() < size());
     }
     // More invariants here that hold also for moved-from objects (e.g.,
     // all assertions necessary to successfully destroy moved-from objects).
 }
コード例 #16
0
ファイル: QmlWindowClass.cpp プロジェクト: AndrewMeadows/hifi
/**jsdoc
 * @typedef {object} OverlayWindow.Properties
 * @property {string} title
 * @property {string} source
 * @property {number} width
 * @property {number} height
 * @property {boolean} visible
 */
void QmlWindowClass::initQml(QVariantMap properties) {
#ifndef DISABLE_QML
    auto offscreenUi = DependencyManager::get<OffscreenUi>();
    _source = properties[SOURCE_PROPERTY].toString();

    auto objectInitLambda = [&](QQmlContext* context, QObject* object) {
        _qmlWindow = object;
        context->setContextProperty(EVENT_BRIDGE_PROPERTY, this);
        context->engine()->setObjectOwnership(this, QQmlEngine::CppOwnership);
        context->engine()->setObjectOwnership(object, QQmlEngine::CppOwnership);
        if (properties.contains(TITLE_PROPERTY)) {
            object->setProperty(TITLE_PROPERTY, properties[TITLE_PROPERTY].toString());
        }
        if (properties.contains(HEIGHT_PROPERTY) && properties.contains(WIDTH_PROPERTY)) {
            uvec2 requestedSize { properties[WIDTH_PROPERTY].toUInt(), properties[HEIGHT_PROPERTY].toUInt() };
            requestedSize = glm::clamp(requestedSize, MIN_QML_WINDOW_SIZE, MAX_QML_WINDOW_SIZE);
            asQuickItem()->setSize(QSize(requestedSize.x, requestedSize.y));
        }

        bool visible = !properties.contains(VISIBILE_PROPERTY) || properties[VISIBILE_PROPERTY].toBool();
        object->setProperty(OFFSCREEN_VISIBILITY_PROPERTY, visible);
        object->setProperty(SOURCE_PROPERTY, _source);

        const QMetaObject *metaObject = _qmlWindow->metaObject();
        // Forward messages received from QML on to the script
        connect(_qmlWindow, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)), Qt::QueuedConnection);
        connect(_qmlWindow, SIGNAL(visibleChanged()), this, SIGNAL(visibleChanged()), Qt::QueuedConnection);

        if (metaObject->indexOfSignal("resized") >= 0)
            connect(_qmlWindow, SIGNAL(resized(QSizeF)), this, SIGNAL(resized(QSizeF)), Qt::QueuedConnection);
        if (metaObject->indexOfSignal("moved") >= 0)
            connect(_qmlWindow, SIGNAL(moved(QVector2D)), this, SLOT(hasMoved(QVector2D)), Qt::QueuedConnection);
        connect(_qmlWindow, SIGNAL(windowClosed()), this, SLOT(hasClosed()), Qt::QueuedConnection);
    };
コード例 #17
0
ファイル: kinotifytest.cpp プロジェクト: stream009/baloo
void KInotifyTest::testMoveRootFolder()
{
    // create some test folders
    QTemporaryDir dir;
    const QString src(QStringLiteral("%1/randomJunk1").arg(dir.path()));
    const QString dest(QStringLiteral("%1/randomJunk2").arg(dir.path()));
    mkdir(src);

    // start watching the new subfolder only
    KInotify kn(nullptr /*no config*/);
    kn.addWatch(src, KInotify::EventAll);

    // listen for the moved signal
    QSignalSpy spy(&kn, SIGNAL(moved(QString,QString)));

    // actually move the file
    QFile::rename(src, dest);

    // check the desired signal
    QEXPECT_FAIL("", "KInotify cannot handle moving of top-level folders.", Abort);
    QVERIFY(spy.wait(500));
    QCOMPARE(spy.count(), 1);
    QList<QVariant> args = spy.takeFirst();
    QCOMPARE(args.at(0).toString(), src);
    QCOMPARE(args.at(1).toString(), dest);

    // check the path cache
    QVERIFY(!kn.watchingPath(src));
    QVERIFY(kn.watchingPath(dest));
}
コード例 #18
0
ファイル: joycontrolstick.cpp プロジェクト: Pater1/antimicro
void JoyControlStick::joyEvent(bool ignoresets)
{
    safezone = !inDeadZone();

    if (safezone && !isActive)
    {
        isActive = true;
        emit active(axisX->getCurrentRawValue(), axisY->getCurrentRawValue());
        createDeskEvent(ignoresets);
    }
    else if (!safezone && isActive)
    {
        isActive = false;
        currentDirection = StickCentered;
        emit released(axisX->getCurrentRawValue(), axisY->getCurrentRawValue());

        createDeskEvent(ignoresets);
    }
    else if (isActive)
    {
        createDeskEvent(ignoresets);
    }

    emit moved(axisX->getCurrentRawValue(), axisY->getCurrentRawValue());
}
コード例 #19
0
ファイル: tidy_example.cpp プロジェクト: choenig/qt-creator
void afterMove(Base &&base)
{
    Base moved(std::move(base));

    // misc-use-after-move
    base.value;
}
コード例 #20
0
 void LabelWidget::mouseMoveEvent(QMouseEvent* e)
 {
   if (dragMode)
     {
       emit moved(this, e->globalPos()-clickedPos);
     }
 }
コード例 #21
0
QVariant Container::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
    if (change == ItemPositionChange) {
            QPointF newPos = value.toPointF();
            QPointF rigthBottom = QPointF(newPos.x()+this->rect().width(),newPos.y()+this->rect().height());
            if (!margins.contains(newPos) || !margins.contains(rigthBottom)) {
                newPos.setX(qMin(margins.right(), qMax(newPos.x(), margins.left()+1)));
                newPos.setY(qMin(margins.bottom(), qMax(newPos.y(), margins.top()+1)));
                if(!margins.contains(rigthBottom))
                {
                    newPos.setX(qMax(margins.left(), qMin(newPos.x(),margins.right()-this->rect().width())));
                    newPos.setY(qMax(margins.top(), qMin(newPos.y(),margins.bottom()-this->rect().height())));                    
                }                
                return newPos;
            }
            emit moved(this);
     }
    else if(change == ItemSelectedChange)
    {
        bool b = value.toBool();
        if(b)
            this->grabKeyboard();
        else
            this->ungrabKeyboard();
    }
    return QGraphicsItem::itemChange(change, value);
}
コード例 #22
0
ファイル: OptionalTest.cpp プロジェクト: DrhF/folly
TEST(Optional, Shared) {
  shared_ptr<int> ptr;
  Optional<shared_ptr<int>> opt;
  EXPECT_FALSE(bool(opt));
  // empty->emplaced
  opt.emplace(new int(5));
  EXPECT_TRUE(bool(opt));
  ptr = opt.value();
  EXPECT_EQ(ptr.get(), opt->get());
  EXPECT_EQ(2, ptr.use_count());
  opt.clear();
  EXPECT_EQ(1, ptr.use_count());
  // full->copied
  opt = ptr;
  EXPECT_EQ(2, ptr.use_count());
  EXPECT_EQ(ptr.get(), opt->get());
  opt.clear();
  EXPECT_EQ(1, ptr.use_count());
  // full->moved
  opt = std::move(ptr);
  EXPECT_EQ(1, opt->use_count());
  EXPECT_EQ(nullptr, ptr.get());
  {
    Optional<shared_ptr<int>> copied(opt);
    EXPECT_EQ(2, opt->use_count());
    Optional<shared_ptr<int>> moved(std::move(opt));
    EXPECT_EQ(2, moved->use_count());
    moved.emplace(new int(6));
    EXPECT_EQ(1, moved->use_count());
    copied = moved;
    EXPECT_EQ(2, moved->use_count());
  }
}
コード例 #23
0
void QgsAnnotation::setFrameOffsetFromReferencePoint( QPointF offset )
{
  mOffsetFromReferencePoint = offset;
  updateBalloon();
  emit moved();
  emit appearanceChanged();
}
コード例 #24
0
ファイル: QmitkRenderWindow.cpp プロジェクト: GHfangxin/MITK
void QmitkRenderWindow::moveEvent(QMoveEvent* event)
{
  QVTKWidget::moveEvent(event);

  // after a move the overlays need to be positioned
  emit moved();
}
コード例 #25
0
ファイル: OptionalTest.cpp プロジェクト: DrhF/folly
TEST(Optional, Unique) {
  Optional<unique_ptr<int>> opt;

  opt.clear();
  EXPECT_FALSE(bool(opt));
  // empty->emplaced
  opt.emplace(new int(5));
  EXPECT_TRUE(bool(opt));
  EXPECT_EQ(5, **opt);

  opt.clear();
  // empty->moved
  opt = unique_ptr<int>(new int(6));
  EXPECT_EQ(6, **opt);
  // full->moved
  opt = unique_ptr<int>(new int(7));
  EXPECT_EQ(7, **opt);

  // move it out by move construct
  Optional<unique_ptr<int>> moved(std::move(opt));
  EXPECT_TRUE(bool(moved));
  EXPECT_FALSE(bool(opt));
  EXPECT_EQ(7, **moved);

  EXPECT_TRUE(bool(moved));
  opt = std::move(moved); // move it back by move assign
  EXPECT_FALSE(bool(moved));
  EXPECT_TRUE(bool(opt));
  EXPECT_EQ(7, **opt);
}
コード例 #26
0
int main( int argc, char** argv){
	Simplicial_complex complex;
	Cell s( {1,2,3,4} );
	auto pair = complex.insert_closed_cell( s);
	std::cout << pair.second << " cells inserted!" << std::endl;
	std::cout << "complex is " << 
		((complex.is_closed())? "closed":"not closed") << std::endl; 
	std::cout << complex << std::endl;

	Simplicial_complex_boundary b( complex);
	Simplicial_complex_boundary copyd( b);
	Simplicial_complex_boundary moved( std::move( copyd));
	for( auto i = complex.begin(); i != complex.end(); ++i){
	std::cout << "boundary test: " << ctl::delta << "("  
		  << i->first << ")" << std::endl;
	std::cout << "boundary length: " << b.length( i) << std::endl;
	for( simplicial_boundary_iterator j = b.begin( i); j != b.end( i); ++j){
		std::cout << j->cell()->first << " ";
	}
	std::cout << std::endl;
	}
	std::ofstream out( "test.asc");
	complex.write( out); 
	return 0;
}
コード例 #27
0
ファイル: dock_grid.cpp プロジェクト: mbasaglia/Knotter
void Dock_Grid::set_grid(Snapping_Grid *target_grid)
{

    target = target_grid;

    if ( target )
    {
        spin_size->setValue(target->size());
        connect(spin_size,SIGNAL(valueChanged(int)),target,SLOT(set_size(int)));


        combo_shape->setCurrentIndex(target->shape());

        check_enable->setChecked(target->is_enabled());
        connect(check_enable,SIGNAL(clicked(bool)),target,SLOT(enable(bool)));
        connect(target,SIGNAL(enabled(bool)),check_enable,SLOT(setChecked(bool)));

        spin_x->blockSignals(true);
        spin_x->setValue(target->origin().x());
        spin_x->blockSignals(false);
        spin_y->blockSignals(true);
        spin_y->setValue(target->origin().y());
        spin_y->blockSignals(false);

        connect(target,SIGNAL(moved(QPointF)),SLOT(grid_moved(QPointF)));


        setEnabled(true);
    }
    else
    {
        check_enable->setChecked(false);
        setEnabled(false);
    }
}
コード例 #28
0
ファイル: moc_qwt_picker.cpp プロジェクト: lolsborn/RovDash
int QwtPicker::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: activated((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: selected((*reinterpret_cast< const QPolygon(*)>(_a[1]))); break;
        case 2: appended((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 3: moved((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 4: removed((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 5: changed((*reinterpret_cast< const QPolygon(*)>(_a[1]))); break;
        case 6: setEnabled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 7;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isEnabled(); break;
        case 1: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 2: *reinterpret_cast< DisplayMode*>(_v) = trackerMode(); break;
        case 3: *reinterpret_cast< QPen*>(_v) = trackerPen(); break;
        case 4: *reinterpret_cast< QFont*>(_v) = trackerFont(); break;
        case 5: *reinterpret_cast< RubberBand*>(_v) = rubberBand(); break;
        case 6: *reinterpret_cast< QPen*>(_v) = rubberBandPen(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 1: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 2: setTrackerMode(*reinterpret_cast< DisplayMode*>(_v)); break;
        case 3: setTrackerPen(*reinterpret_cast< QPen*>(_v)); break;
        case 4: setTrackerFont(*reinterpret_cast< QFont*>(_v)); break;
        case 5: setRubberBand(*reinterpret_cast< RubberBand*>(_v)); break;
        case 6: setRubberBandPen(*reinterpret_cast< QPen*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
コード例 #29
0
ファイル: QmitkRenderWindow.cpp プロジェクト: GHfangxin/MITK
void QmitkRenderWindow::showEvent(QShowEvent* event)
{
  QVTKWidget::showEvent(event);

  // this singleshot is necessary to have the overlays positioned correctly after initial show
  // simple call of moved() is no use here!!
  QTimer::singleShot(0, this, SIGNAL( moved() ));
}
コード例 #30
0
ファイル: diveplanner.cpp プロジェクト: AresDice/subsurface
void DiveHandler::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
	ProfileWidget2 *view = qobject_cast<ProfileWidget2*>(scene()->views().first());
	if(view->isPointOutOfBoundaries(event->scenePos()))
		return;
	QGraphicsEllipseItem::mouseMoveEvent(event);
	emit moved();
}