示例#1
0
kinematicConstraint::kinematicConstraint(modeler* _md, QString& _nm, tKinematicConstraint kt, VEC3D _loc, 
										 mass* ip, VEC3D _fi, VEC3D _gi, 
										 mass* jp, VEC3D _fj, VEC3D _gj)
										 : md(_md)
										 , i(ip)
										 , j(jp)
										 , lm(NULL)
										 , type(kt)
										 , nm(_nm)
										 //, reactionForce(NULL)
										 , srow(0)
										 , icol(0)
										 , jcol(0)
										 , nconst(0)
										 , maxnnz(0)
										 , fi(_fi)
										 , fj(_fj)
										 , gi(_gi)
										 , gj(_gj)
										 , loc(_loc)
										 //, principal_axis(0)
{
	hi = fi.cross(gi);
	hj = fj.cross(gj);
	setCoordinates();
}
示例#2
0
void LineDialog::apply()
{
    if (tw->currentPage()==dynamic_cast<QWidget *>(options)){
        lm->setStyle(Graph::getPenStyle(styleBox->currentItem()));
        lm->setColor(colorBox->color());
        lm->setWidth(widthBox->value());
        lm->drawEndArrow(endBox->isChecked());
        lm->drawStartArrow(startBox->isChecked());
  } else if (tw->currentPage()==dynamic_cast<QWidget *>(head)){
        if (lm->headLength() != boxHeadLength->value())
            lm->setHeadLength( boxHeadLength->value() );

        if (lm->headAngle() != boxHeadAngle->value())
            lm->setHeadAngle( boxHeadAngle->value() );

        if (lm->filledArrowHead() != filledBox->isChecked())
            lm->fillArrowHead( filledBox->isChecked() );
  } else if (tw->currentPage()==dynamic_cast<QWidget *>(geometry))
        setCoordinates(unitBox->currentItem());

	QwtPlot *plot = lm->plot();
  Graph *g = dynamic_cast<Graph *>(plot->parent());
	plot->replot();
	g->notifyChanges();

	enableHeadTab();
}
示例#3
0
void waypoint::setCoordinates(screenshot myMap)
{
    setCoordinates(myMap.calculateCoords(latitude, longitude));

    coordinates = coordinates - offset;

    if (coordinates.x < 0)
    {
//	std::cout << "X: " << coordinates.x << ", Y: " << coordinates.y << std::endl;
	coordinates.x = 0;
    }
    if (coordinates.x >= myMap.image.cols)
    {
//	std::cout << "X: " << coordinates.x << ", Y: " << coordinates.y << std::endl;
	coordinates.x = myMap.image.cols - 1;
    }
    if (coordinates.y < 0)
    {
//	std::cout << "X: " << coordinates.x << ", Y: " << coordinates.y << std::endl;
	coordinates.y = 0;
    }
    if (coordinates.y >= myMap.image.rows)
    {
//	std::cout << "X: " << coordinates.x << ", Y: " << coordinates.y << std::endl;
	coordinates.y = myMap.image.rows - 1;
    }
}
示例#4
0
void EnrichmentDialog::apply()
{
	if (tabWidget->currentPage() == editPage)
		fetchImage();
	else if (tabWidget->currentPage() == framePage)
		frameApplyTo();
	else if (imagePage && tabWidget->currentPage() == imagePage)
		chooseImageFile(imagePathBox->text());
	else if (tabWidget->currentPage() == geometryPage){
		setCoordinates(unitBox->currentIndex());
		FrameWidget *fw = qobject_cast<FrameWidget *>(d_widget);
        if (fw)
            fw->setAttachPolicy((FrameWidget::AttachPolicy)attachToBox->currentIndex());

		if (d_app)
			d_app->d_keep_aspect_ration = keepAspectBox->isChecked();
	} else if (patternPage && tabWidget->currentPage() == patternPage)
		patternApplyTo();
	else if (textPage && tabWidget->currentPage() == textPage){
		LegendWidget *l = qobject_cast<LegendWidget *>(d_widget);
		if (l)
			l->setText(textEditBox->text());

		textFormatApplyTo();
		if (d_app)
			d_app->setFormatBarFont(textFont);
	}
}
void LineDialog::apply()
{
    if (tw->currentPage()==(QWidget *)options){
        lm->setStyle(styleBox->style());
        lm->setColor(colorBox->color());
        lm->setWidth(widthBox->value());
        lm->drawEndArrow(endBox->isChecked());
        lm->drawStartArrow(startBox->isChecked());
	} else if (tw->currentPage()==(QWidget *)head){
        if (lm->headLength() != boxHeadLength->value())
            lm->setHeadLength( boxHeadLength->value() );

        if (lm->headAngle() != boxHeadAngle->value())
            lm->setHeadAngle( boxHeadAngle->value() );

        if (lm->filledArrowHead() != filledBox->isChecked())
            lm->fillArrowHead( filledBox->isChecked() );
	} else if (tw->currentPage()==(QWidget *)geometry)
        setCoordinates(unitBox->currentItem());

	Graph *g = (Graph *)lm->plot();
	g->replot();
	g->multiLayer()->notifyChanges();

	enableHeadTab();
}
示例#6
0
文件: Menu.cpp 项目: Taranyan/TTToe
void Menu::recalculate(){
	if(this->xShift != this->openedUpperLeft.x - this->upperLeft.x){
		this->upperLeft.x = this->openedUpperLeft.x - xShift;
	}

	setCoordinates();
	displayedAfterMove = false;
}
示例#7
0
void MenuView::setShowSettings(int x, int y){
    int x_c = x, y_c = y;
    if(x + 100 > 1024) x_c = x - (x + 100 - 1024);
    if(y + 310 > 768) y_c = y - (y + 310 - 768);
    setCoordinates(x_c, y_c);
    setItemLoc(x, y);
    setShowMenu(true);
}
void EllipseWidget::clone(EllipseWidget* r)
{
	d_frame = r->frameStyle();
	setFramePen(r->framePen());
	setBackgroundColor(r->backgroundColor());
	setBrush(r->brush());
	setCoordinates(r->xValue(), r->yValue(), r->right(), r->bottom());
}
void ImageWidget::clone(ImageWidget* t)
{
	d_frame = t->frameStyle();
	setFramePen(t->framePen());
	d_file_name = t->fileName();
	d_save_xpm = t->saveInternally();
	setPixmap(t->pixmap());
	setCoordinates(t->xValue(), t->yValue(), t->right(), t->bottom());
}
 void RectangleExpositor::setup(const StringMap & settings)
 {
     Expositor::setup(settings);
     int x1 = std::atoi(settings.at("expositors.Rectangle.region.x1").c_str());
     int y1 = std::atoi(settings.at("expositors.Rectangle.region.y1").c_str());
     int x2 = std::atoi(settings.at("expositors.Rectangle.region.x2").c_str());
     int y2 = std::atoi(settings.at("expositors.Rectangle.region.y2").c_str());
     setCoordinates(x1, y1, x2, y2);
 }
示例#11
0
文件: Button.cpp 项目: j4qfrost/Pyman
void Button::setParams(int x, int y, int w, int h, bool& f, const string& file)
{
	if (bounds == NULL)
		bounds = new SDL_Rect;

    setCoordinates(x,y);
    setBounds(w,h);
    setFlag(f);
    setSource(file);
}
示例#12
0
    PrimitiveBox::PrimitiveBox(Coordinate upleft, Coordinate downright, Color c) {

        vector<Coordinate> coords;
        coords.push_back(upleft);
        coords.push_back(downright);
        setCoordinates(coords);

        setColor(c);

    }
示例#13
0
void GWindow::setCoordinates(
    const R2Point& leftBottom, const R2Point& rightTop
) {
    setCoordinates(
        R2Rectangle(
            leftBottom, 
            rightTop.x - leftBottom.x,
            rightTop.y - leftBottom.y
        )
    );
}
void bottomUp(stList *flowers, stKVDatabase *sequenceDatabase, Name referenceEventName,
              bool isTop, stMatrix *(*generateSubstitutionMatrix)(double)) {
    /*
     * A reference thread between the two caps
     * in each flower f may be broken into two in the children of f.
     * Therefore, for each flower f first identify attached stub ends present in the children of f that are
     * not present in f and copy them into f, reattaching the reference caps as needed.
     */
    stList *caps = getCaps(flowers, referenceEventName);
    for (int64_t i = stList_length(caps) - 1; i >= 0; i--) { //Start from end, as we add to this list.
        setAdjacencyLengthsAndRecoverNewCapsAndBrokenAdjacencies(stList_get(caps, i), caps);
    }
    for(int64_t i=0; i<stList_length(flowers); i++) {
        recoverBrokenAdjacencies(stList_get(flowers, i), caps, referenceEventName);
    }

    //Build the phylogenetic event trees for base calling.
    segmentWriteFn_flowerToPhylogeneticTreeHash = stHash_construct2(NULL, (void (*)(void *))cleanupPhylogeneticTree);
    for(int64_t i=0; i<stList_length(flowers); i++) {
        Flower *flower = stList_get(flowers, i);
        Event *refEvent = eventTree_getEvent(flower_getEventTree(flower), referenceEventName);
        assert(refEvent != NULL);
        stHash_insert(segmentWriteFn_flowerToPhylogeneticTreeHash, flower, getPhylogeneticTreeRootedAtGivenEvent(refEvent, generateSubstitutionMatrix));
    }

    if (isTop) {
        stList *threadStrings = buildRecursiveThreadsInList(sequenceDatabase, caps, segmentWriteFn,
                terminalAdjacencyWriteFn);
        assert(stList_length(threadStrings) == stList_length(caps));

        int64_t nonTrivialSeqIndex = 0, trivialSeqIndex = stList_length(threadStrings); //These are used as indices for the names of trivial and non-trivial sequences.
        for (int64_t i = 0; i < stList_length(threadStrings); i++) {
            Cap *cap = stList_get(caps, i);
            assert(cap_getStrand(cap));
            assert(!cap_getSide(cap));
            Flower *flower = end_getFlower(cap_getEnd(cap));
            char *threadString = stList_get(threadStrings, i);
            bool trivialString = isTrivialString(&threadString); //This alters the original string
            MetaSequence *metaSequence = addMetaSequence(flower, cap, trivialString ? trivialSeqIndex++ : nonTrivialSeqIndex++,
                    threadString, trivialString);
            free(threadString);
            int64_t endCoordinate = setCoordinates(flower, metaSequence, cap, metaSequence_getStart(metaSequence) - 1);
            (void) endCoordinate;
            assert(endCoordinate == metaSequence_getLength(metaSequence) + metaSequence_getStart(metaSequence));
        }
        stList_setDestructor(threadStrings, NULL); //The strings are already cleaned up by the above loop
        stList_destruct(threadStrings);
    } else {
        buildRecursiveThreads(sequenceDatabase, caps, segmentWriteFn, terminalAdjacencyWriteFn);
    }
    stHash_destruct(segmentWriteFn_flowerToPhylogeneticTreeHash);
    stList_destruct(caps);
}
示例#15
0
/// Reload the whole UI based on the model. Everything is first removed,
/// and then re-created in the same coordinates, so that the user notice
/// anything.
void MainWindow::reloadModel() {
  qDebug() << "Reloading model";
  reloading = true;

  int selectedVertexValue = -1;

  if (scene->selectedItems().size() == 1) {
    VertexGraphicsItem* selection =
        dynamic_cast<VertexGraphicsItem*>(scene->selectedItems().at(0));

    if (selection) {
      selectedVertexValue = selection->value();
    }
  }

  vertices_.clear();
  scene->clear();

  std::unordered_map<Vertex*, VertexGraphicsItem*> vgi_map;

  int i = 0;
  for (auto& v : *graph_) {
    auto vgi = new VertexGraphicsItem(&v);

    if (!vgi->hasCoordinates()) {
      vgi->setCoordinates(115 * (i / 5 + 1) * std::cos(i),
                          115 * (i / 5 + 1) * std::sin(i));
    }

    vertices_.push_back(vgi);
    scene->addItem(vgi);

    if (v.value == selectedVertexValue) {
      vgi->setSelected(true);
    }

    vgi_map[&v] = vgi;

    i++;
  }

  for (auto& v : *graph_) {
    Vertex* vertex = &v;

    VertexGraphicsItem* vgi = vgi_map[vertex];
    for (Edge& e : vertex->edges) {
      graphConnect(vgi, vgi_map[e.to], &e);
      vgi->repaintEdges();
    }
  }

  reloading = false;
}
/**
 * Überprüft auf eine Kollision
 * Return: diff = neues Struct direkt zum Ziel
 * return: 0 wenn keine Kollision, 1 sonst
 */
uint8_t calc_Offroad(gps_reducedData_t* diff, gps_reducedData_t* own, gps_reducedData_t* target){
	int16_t xCollision, yCollision;

	tree_init(CoordinatesToMap(own->x), CoordinatesToMap(own->y));
	if (calc_reachability(&xCollision, &yCollision,CoordinatesToMap(own->x), CoordinatesToMap(own->y),CoordinatesToMap(target->x), CoordinatesToMap(target->y)) == 0){
		setCoordinates(diff, target->cam_id, target->tag_id, target->x, target->y, target->angle, target->isWorld);
		return 0;
	}
	else{
		scan_Obstacles(xCollision, yCollision, own, target, CoordinatesToMap(own->x), CoordinatesToMap(own->y)); //übergibt hier die Kollisionskoordinaten
	}
	return 1;
}
示例#17
0
GoogleMapChart::GoogleMapChart(QWidget *parent) : QWebView(parent), pendingRequests(0)
{
    this->setWindowState(Qt::WindowFullScreen);

    manager = new QNetworkAccessManager(this);
    connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
    connect(this,SIGNAL(reloadMap()), this,SLOT(loadCoordinates()));
    timer = new QTimer(this);
    timer->setInterval(400);
    connect(timer, SIGNAL(timeout()), this, SLOT(moveBoat()));
    connect(timer, SIGNAL(timeout()), this, SLOT(loadCoordinates()));
    setCoordinates(65.019442,25.402193 );
}
示例#18
0
文件: nmeagps.cpp 项目: UpWind/devel
void NMEAGPS::CreateGUI(){
    ui->setupUi(this->getWidget());

    ui->gemap->setUrl(QUrl("file:///" +
                       QApplication::applicationDirPath() +
                       "/plugins/index.html"));

    nsbutts = new QButtonGroup();
    nsbutts->addButton(ui->northButton);
    nsbutts->addButton(ui->southButton);

    webutts = new QButtonGroup();
    webutts->addButton(ui->westButton);
    webutts->addButton(ui->eastButton);

    QWebPage *page = ui->gemap->page();
    frame = page->mainFrame();

    connect(ui->simulatorButton, SIGNAL(clicked()), this, SLOT(toggleSimulation()));
    connect(ui->selectXMLFileButton,SIGNAL(clicked()),this, SLOT(setXMLFile()));
    connect(ui->latLineEdit,SIGNAL(textEdited(const QString &)),this, SLOT(setCoordinates()));
    connect(ui->longLineEdit,SIGNAL(textEdited(const QString &)),this, SLOT(setCoordinates()));
    connect(ui->northButton,SIGNAL(clicked()),this, SLOT(setCoordinates()));
    connect(ui->southButton,SIGNAL(clicked()),this, SLOT(setCoordinates()));
    connect(ui->westButton,SIGNAL(clicked()),this, SLOT(setCoordinates()));
    connect(ui->eastButton,SIGNAL(clicked()),this, SLOT(setCoordinates()));

    //ui->setupUi(this);
    connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(attachGPSPluginToPage()) );

    //take away the spinnaker check box
    connect(ui->spinnaker,SIGNAL(stateChanged(int)),this,SLOT(spinnakerChanged(int)));

    ui->latLineEdit->setInputMask("9999.999");
    ui->longLineEdit->setInputMask("99999.999");

}
示例#19
0
//! Takes a the text from between the $molecule-$end tags and parses it.
void MoleculeSection::read(QString const& input) {
   QStringList lines( input.trimmed().split(QRegExp("\\n")) );
   bool okay(false);

   if (lines.count() > 0) {
      QString first(lines[0].replace(QChar(','),QChar(' ')));
      QStringList tokens(first.split(QRegExp("\\s+"), QString::SkipEmptyParts));
      lines.removeFirst();

      if (tokens.count() == 1) {
         if (tokens[0].toLower() == "read") {
            setCoordinates("read");
            okay = true;
         }
      }else if (tokens.count() == 2) {
         // line 1 is charge + multiplicity
         // everything else is the molecule
         bool c,m;
         m_charge = tokens[0].toInt(&c);
         m_multiplicity = tokens[1].toInt(&m);
         okay = c && m;
         setCoordinates(lines.join("\n"));
        // m_molecule = new Molecule();
        // m_molecule->setCoordinates(input);
      }
      
   }

   // TODO: This should really load a molecule object so that the coordinate
   // conversion can be done.
   if (!okay) {
      QString msg("Problem reading $molecule section: \n");
      msg += input;
      QMessageBox::warning(0, "Parse Error", msg);
   }
}
示例#20
0
void ElementGeometryClipper::visitWay(const Way& way)
{
    ClipperLib::Path wayShape;
    PointLocation pointLocation = setPath(quadKeyBbox_, way, wayShape);
    // 1. all geometry inside current quadkey: no need to truncate.
    if (pointLocation == PointLocation::AllInside) {
        callback_(way, quadKey_);
        return;
    }

    // 2. all geometry outside : way should be skipped
    if (pointLocation == PointLocation::AllOutside) {
        return;
    }

    ClipperLib::PolyTree solution;
    clipper_.AddPath(wayShape, ClipperLib::ptSubject, false);
    clipper_.AddPath(createPathFromBoundingBox(), ClipperLib::ptClip, true);
    clipper_.Execute(ClipperLib::ctIntersection, solution);
    clipper_.Clear();
    std::size_t count = static_cast<std::size_t>(solution.Total());

    // 3. way intersects border only once: store a copy with clipped geometry
    if (count == 1) {
        Way clippedWay;
        setData(clippedWay, way, solution.GetFirst()->Contour);
        callback_(clippedWay, quadKey_);
    }
        // 4. in this case, result should be stored as relation (collection of ways)
    else {
        Relation relation;
        relation.id = way.id;
        relation.tags = way.tags;
        relation.elements.reserve(count);
        ClipperLib::PolyNode* polyNode = solution.GetFirst();
        while (polyNode) {
            auto clippedWay = std::make_shared<Way>();
            clippedWay->id = way.id;
            setCoordinates(*clippedWay, polyNode->Contour);
            relation.elements.push_back(clippedWay);
            polyNode = polyNode->GetNext();
        }
        callback_(relation, quadKey_);
    }
}
示例#21
0
MainWindow::MainWindow()
    : dcStream_(0)
    , desktopSelectionWindow_(new DesktopSelectionWindow())
    , x_(0)
    , y_(0)
    , width_(0)
    , height_(0)
    , deviceScale_(1.f)
{
    generateCursorImage();
    setupUI();

    // Receive changes from the selection rectangle
    connect(desktopSelectionWindow_->getDesktopSelectionView()->getDesktopSelectionRectangle(),
            SIGNAL(coordinatesChanged(QRect)), this, SLOT(setCoordinates(QRect)));

    connect(desktopSelectionWindow_, SIGNAL(windowVisible(bool)), showDesktopSelectionWindowAction_, SLOT(setChecked(bool)));
}
示例#22
0
void ElementGeometryClipper::visitArea(const Area& area)
{
    ClipperLib::Path areaShape;
    PointLocation pointLocation = setPath(quadKeyBbox_, area, areaShape);
    // 1. all geometry inside current quadkey: no need to truncate.
    if (pointLocation == PointLocation::AllInside) {
        callback_(area, quadKey_);
        return;
    }

    // 2. all geometry outside: skip
    if (pointLocation == PointLocation::AllOutside) {
        return;
    }

    ClipperLib::Paths solution;
    clipper_.AddPath(areaShape, ClipperLib::ptSubject, true);
    clipper_.AddPath(createPathFromBoundingBox(), ClipperLib::ptClip, true);
    clipper_.Execute(ClipperLib::ctIntersection, solution);
    clipper_.Clear();

    // 3. way intersects border only once: store a copy with clipped geometry
    if (solution.size() == 1) {
        Area clippedArea;
        setData(clippedArea, area, solution[0]);
        callback_(clippedArea, quadKey_);
    }
        // 4. in this case, result should be stored as relation (collection of areas)
    else {
        Relation relation;
        relation.id = area.id;
        relation.tags = area.tags;
        relation.elements.reserve(solution.size());
        for (auto it = solution.begin(); it != solution.end(); ++it) {
            auto clippedArea = std::make_shared<Area> ();
            clippedArea->id = area.id;
            setCoordinates(*clippedArea, *it);
            relation.elements.push_back(clippedArea);
        }
        callback_(relation, quadKey_);
    }
}
示例#23
0
BackgroundRenderer::BackgroundRenderer(const Background& background,
                                       const WallRenderContext& context,
                                       QQuickItem& parentItem)
{
    auto content = background.getContent()->clone();
    const auto& uuid = background.getContentUUID();
    auto window = std::make_shared<Window>(std::move(content), uuid);

    const auto wallRect = QRect{QPoint(), context.wallSize};
    window->setCoordinates(geometry::adjustAndCenter(*window, wallRect));
    auto sync = context.provider.createSynchronizer(*window, context.view);

    _renderer.reset(new WindowRenderer(std::move(sync), window, parentItem,
                                       context.engine.rootContext(), true));

    auto emptyGroup = DisplayGroup::create(context.screenRect.size());
    const auto helper = VisibilityHelper{*emptyGroup, context.screenRect,
                                         context.isAlphaBlendingEnabled()};
    _renderer->update(window, helper.getVisibleArea(*window));
}
示例#24
0
文件: Menu.cpp 项目: Taranyan/TTToe
Menu::Menu(int openBCEvID, int navBLCEvID, int navBRCEvID, Point openedUpperLeft, Point closedUpperLeft, Point currentUpperLeft, int status, 
	       int height, int width, int openButtonWidth, int navButtonHeight, int navButtonWidth, string lbl, MenuStyle* style){
	
	this->openedUpperLeft = openedUpperLeft;
	this->closedUpperLeft = closedUpperLeft;
	this->upperLeft = currentUpperLeft;

	this->xShift = openedUpperLeft.x - upperLeft.x;

	menuIndex = 0;

	this->status = status;
	this->height = height;
	this->width = width;
	this->label = lbl;
	this->style = style;

	this->navigationButton.setStyle(style->navigationButtonStyle);
	this->navigationButton.setHeightSmpl(navButtonHeight);
	this->navigationButton.setWidthSmpl(navButtonWidth);
	this->navigationButton.setLeftButtonClickedEventID(navBLCEvID);
	this->navigationButton.setRightButtonClickedEventID(navBRCEvID);
	this->navigationButton.setLeftLabel("<--");
	this->navigationButton.setRightLabel("-->");

	this->openButton.setWidth(openButtonWidth);
	this->openButton.setButtonClickedEventID(openBCEvID);
	this->openButton.setStyle(style->openButtonStyle);
	this->openButton.setLabel(this->status == (this->MENU_CLOSED | this->MENU_OPENING) ? string("<") : string(">")); 

	setCoordinates();

	this->velocity = 0;

	font = new CFont();
	font->CreateFont(0, 10, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,  DEFAULT_PITCH | FF_SWISS, L"Courier");

	oldUpperLeft.setIsValid(false);
	displayedAfterMove = true;
}
void topDown(Flower *flower, Name referenceEventName) {
    /*
     * Run on each flower, top down. Sets the coordinates of each reference cap to the correct
     * sequence, and sets the bases of the reference sequence to be consensus bases.
     */
    Flower_EndIterator *endIt = flower_getEndIterator(flower);
    End *end;
    while ((end = flower_getNextEnd(endIt)) != NULL) {
        Cap *cap = getCapForReferenceEvent(end, referenceEventName); //The cap in the reference
        if (cap != NULL) {
            cap = cap_getStrand(cap) ? cap : cap_getReverse(cap);
            if (!cap_getSide(cap)) {
                assert(cap_getCoordinate(cap) != INT64_MAX);
                Sequence *sequence = cap_getSequence(cap);
                assert(sequence != NULL);
                Group *group = end_getGroup(end);
                if (!group_isLeaf(group)) {
                    Flower *nestedFlower = group_getNestedFlower(group);
                    Cap *nestedCap = flower_getCap(nestedFlower, cap_getName(cap));
                    assert(nestedCap != NULL);
                    nestedCap = cap_getStrand(nestedCap) ? nestedCap : cap_getReverse(nestedCap);
                    assert(cap_getStrand(nestedCap));
                    assert(!cap_getSide(nestedCap));
                    int64_t endCoordinate = setCoordinates(nestedFlower, sequence_getMetaSequence(sequence),
                                                           nestedCap, cap_getCoordinate(cap));
                    (void) endCoordinate;
                    assert(endCoordinate == cap_getCoordinate(cap_getAdjacency(cap)));
                    assert(endCoordinate
                           == cap_getCoordinate(
                               flower_getCap(nestedFlower, cap_getName(cap_getAdjacency(cap)))));
                }
            }
        }
    }
    flower_destructEndIterator(endIt);
}
示例#26
0
void QG_CoordinateWidget::setCoordinates(const RS_Vector& abs,
                                         const RS_Vector& rel, bool updateFormat) {
    setCoordinates(abs.x, abs.y, rel.x, rel.y, updateFormat);
}
示例#27
0
void QG_CoordinateWidget::setGraphic(RS_Graphic* graphic) {
    this->graphic = graphic;

    setCoordinates(RS_Vector(0.0,0.0), RS_Vector(0.0,0.0), true);
}
示例#28
0
void LineSegment::setCoordinates(const LineSegment ls) {
	setCoordinates(ls.p0,ls.p1);
}
示例#29
0
文件: Menu.cpp 项目: Taranyan/TTToe
bool Menu::animate(){
	this->oldUpperLeft = this->upperLeft;
	if(this->status == this->MENU_CLOSED || this->status == this->MENU_OPENED){
		return false;
	}
	else{
		if(this->status == this->MENU_CLOSING && this->upperLeft == this->closedUpperLeft ||
		   this->status == this->MENU_OPENING && this->upperLeft == this->openedUpperLeft){

		   if(this->status == this->MENU_CLOSING){
		      this->status = this->MENU_CLOSED;
		   }
		   else if(this->status == this->MENU_OPENING){
		      this->status = this->MENU_OPENED;
		   }	   

		     return false;
		}
		else{
			if(this->status == this->MENU_CLOSING){
				if(this->upperLeft == this->openedUpperLeft && this->velocity == 0){
					this->velocity = style->closeVo;
				}
				if(upperLeft.x + velocity <= closedUpperLeft.x){
					upperLeft.x += velocity;
					velocity += style->closeA;
					xShift = openedUpperLeft.x - upperLeft.x;
					setCoordinates();				
				}
				else{
					upperLeft.x = closedUpperLeft.x;
					velocity = 0;
					status = this->MENU_CLOSED;
					xShift = openedUpperLeft.x - upperLeft.x;
					setCoordinates();
					//return true;
				}
			}
			else{
				if(this->upperLeft == this->closedUpperLeft && this->velocity == 0){
					this->velocity = style->openVo;
				}

				if(upperLeft.x + velocity >= openedUpperLeft.x){
					upperLeft.x += velocity;
					velocity += style->openA;
					xShift = openedUpperLeft.x - upperLeft.x;
					setCoordinates();
				}
				else{

				    int acc1 = (int)((openedUpperLeft.x - upperLeft.x)*(style->openA)/(velocity));
					int acc2 = style->openA - acc1;

					if( (velocity + acc1)*(style->reflectionCoef) - acc2 > - style->maxStickSpeed){
						upperLeft.x = openedUpperLeft.x;
						velocity = 0;
						status = this->MENU_OPENED;
						xShift = openedUpperLeft.x - upperLeft.x;
						setCoordinates();
					//	return true;
					}
					else{
						upperLeft.x += -(int)(style->reflectionCoef * (upperLeft.x + velocity - openedUpperLeft.x - acc1));
						velocity = (int)(( -velocity - acc1) * style->reflectionCoef + acc2);
						xShift = openedUpperLeft.x - upperLeft.x;
						setCoordinates();
						//return true;
					}
				}
			}		
		}
	}

	return true;
}
示例#30
0
文件: Menu.cpp 项目: Taranyan/TTToe
void Menu::insertList(vector<ControlElement*> list){
	elements.push_back(list);
	setCoordinates();
}