void trend::TrendBase::wiret(const PointVector& pdata, WireWidth width) { // first check whether to draw only the center line DBbox wsquare = DBbox(TP(0,0),TP(width,width)); bool center_line_only = !wsquare.visible(topCTM() * scrCTM(), visualLimit()); _clayer->wire(pdata, width, center_line_only, *_rmm); }
void trend::TrendBase::grcwire (int4b* pdata, unsigned psize, WireWidth width) { // first check whether to draw only the center line DBbox wsquare = DBbox(TP(0,0),TP(width,width)); bool center_line_only = !wsquare.visible(topCTM() * scrCTM(), visualLimit()); _grcLayer->wire(pdata, psize, width, center_line_only); }
void trend::TrendBase::wirem(int4b* pdata, unsigned psize, WireWidth width, const SGBitSet* psel) { // first check whether to draw only the center line DBbox wsquare = DBbox(TP(0,0),TP(width,width)); bool center_line_only = !wsquare.visible(topCTM() * scrCTM(), visualLimit()); _clayer->wire(pdata, psize, width, center_line_only,psel,*_rmm); }
int tellstdfunc::stdDISTANCE::execute() { // get the data from the stack telldata::ttlist *pl = static_cast<telldata::ttlist*>(OPstack.top());OPstack.pop(); telldata::ttpnt* p1 = NULL; telldata::ttpnt* p2 = NULL; for (unsigned i = 0; i < pl->size(); i++) { p1 = p2; p2 = static_cast<telldata::ttpnt*>((pl->mlist())[i]); if (NULL != p1) { TP ap1 = TP(p1->x(),p1->y(), DATC->DBscale()); TP ap2 = TP(p2->x(),p2->y(), DATC->DBscale()); DATC->addRuler(ap1,ap2); /* std::ostringstream info; info << "Distance {" << p1->x() << " , " << p1->y() <<"} - {" << p2->x() << " , " << p2->y() <<"} is "; tell_log(console::MT_WARNING,info.str());*/ } } delete pl; RefreshGL(); return EXEC_NEXT; }
/* * Print a warning if a definition/declaration does not match another * definition/declaration of the same name. For functions, only the * types of return values are tested. */ static void chkvtdi(hte_t *hte, sym_t *def, sym_t *decl) { sym_t *sym; type_t *tp1, *tp2; /* LINTED (automatic hides external declaration: warn) */ int eq, warn; char *pos1; if (def == NULL) def = decl; if (def == NULL) return; tp1 = TP(def->s_type); for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { if (sym == def) continue; tp2 = TP(sym->s_type); warn = 0; if (tp1->t_tspec == FUNC && tp2->t_tspec == FUNC) { eq = eqtype(tp1->t_subt, tp2->t_subt, 1, 0, 0, &warn); } else { eq = eqtype(tp1, tp2, 0, 0, 0, &warn); } if (!eq || (sflag && warn)) { pos1 = xstrdup(mkpos(&def->s_pos)); /* %s value declared inconsistently\t%s :: %s */ msg(5, hte->h_name, pos1, mkpos(&sym->s_pos)); free(pos1); } } }
laydata::tdtdata* laydata::tdtdesign::addpoly(word la, const pointlist* pl) { laydata::valid_poly check(*pl); if (!check.valid()) { std::ostringstream ost; ost << "Polygon check fails - " << check.failtype(); tell_log(console::MT_ERROR, ost.str()); return NULL; } laydata::tdtdata* newshape; DBbox old_overlap = _target.edit()->overlap(); tdtlayer *actlay = static_cast<tdtlayer*>(targetlayer(la)); modified = true; pointlist vpl = check.get_validated(); if (check.box()) { TP* p1= DEBUG_NEW TP(vpl[0] *_target.rARTM()); TP* p2= DEBUG_NEW TP(vpl[2] *_target.rARTM()); newshape = actlay->addbox(p1,p2); } for(pointlist::iterator PL = vpl.begin(); PL != vpl.end(); PL++) (*PL) *= _target.rARTM(); newshape = actlay->addpoly(vpl); if (_target.edit()->overlapChanged(old_overlap, this)) do {} while(validate_cells()); return newshape; }
void tui::LayoutCanvas::update_viewport() { int W, H; GetClientSize(&W,&H); lp_BL = TP(0,0) * _LayCTM; lp_TR = TP(W, H) * _LayCTM; Properties->setClipRegion(DBbox(lp_BL.x(),lp_TR.y(), lp_TR.x(), lp_BL.y())); glClearColor(0,0,0,0); }
void tui::LayoutCanvas::update_viewport() { int W, H; GetClientSize(&W,&H); lp_BL = TP(0,0) * _LayCTM; lp_TR = TP(W, H) * _LayCTM; // _status_line.update(W, _LayCTM); DATC->setClipRegion(DBbox(lp_BL.x(),lp_TR.y(), lp_TR.x(), lp_BL.y())); glClearColor(0,0,0,0); }
/*!The method uses #_shape1 and #_shape2 structure as an input data and produces one or more polygons representing the result of the logical OR between the input polygons. Method returns false if no output shapes are generated, and true otherwise*/ bool logicop::logic::OR(pcollection& plycol) { bool result = false; VPoint* centinel = NULL; if (0 == _crossp) { // If there are no crossing points found, this still does not mean // that the operation will fail. Polygons might be fully overlapping... // Check that a random point from poly1 is inside poly2 ... if (_shape1->inside(_poly2)) centinel = _shape2; // ... if not, check that a random point from poly2 is inside poly1 ... else if (_shape2->inside(_poly1)) centinel = _shape1; // ... if not - polygons does not have any common area else return false; // If we've got here means that one of the polygons is completely // overlapped by the other one. So we need to return the outer one pointlist *shgen = new pointlist(); VPoint* vpnt = centinel; do { shgen->push_back(TP(vpnt->cp()->x(), vpnt->cp()->y())); vpnt = vpnt->next(); }while (centinel != vpnt); plycol.push_back(shgen); return true; } pcollection lclcol; // local collection of the resulting shapes // get first external and non crossing point centinel = getFirstOutside(_poly2, _shape1); if (NULL == centinel) centinel = getFirstOutside(_poly1, _shape2); assert(centinel); VPoint* collector = centinel; bool direction = true; /*next*/ do { if (0 == collector->visited()) { pointlist *shgen = new pointlist(); VPoint* pickup = collector; direction = (0 == lclcol.size()); do { pickup = pickup->follower(direction); shgen->push_back(TP(pickup->cp()->x(), pickup->cp()->y())); } while (pickup != collector); direction = true; lclcol.push_back(shgen); result = true; } collector = collector->next(); } while (collector != centinel); if (!result) return result; // Convert all collected shapes to a single normalized polygon pointlist* respoly = lclcol.front();lclcol.pop_front(); while (0 < lclcol.size()) { respoly = hole2simple(*respoly, *(lclcol.front())); lclcol.pop_front(); } plycol.push_back(respoly); return result; }
/* * Print a warning if the return value assumed for a function call * differs from the return value of the function definition or * function declaration. * * If no definition/declaration can be found, the assumed return values * are always int. So there is no need to compare with another function * call as it's done for function arguments. */ static void chkvtui(hte_t *hte, sym_t *def, sym_t *decl) { fcall_t *call; char *pos1; type_t *tp1, *tp2; /* LINTED (automatic hides external declaration: warn) */ int warn, eq; tspec_t t1; if (hte->h_calls == NULL) return; if (def == NULL) def = decl; if (def == NULL) return; t1 = (tp1 = TP(def->s_type)->t_subt)->t_tspec; for (call = hte->h_calls; call != NULL; call = call->f_nxt) { tp2 = TP(call->f_type)->t_subt; eq = eqtype(tp1, tp2, 1, 0, 0, (warn = 0, &warn)); if (!call->f_rused) { /* no return value used */ if ((t1 == STRUCT || t1 == UNION) && !eq) { /* * If a function returns a struct or union it * must be declared to return a struct or * union, also if the return value is ignored. * This is necessary because the caller must * allocate stack space for the return value. * If it does not, the return value would over- * write other data. * XXX Following massage may be confusing * because it appears also if the return value * was declared inconsistently. But this * behaviour matches pcc based lint, so it is * accepted for now. */ pos1 = xstrdup(mkpos(&def->s_pos)); /* %s value must be decl. before use %s :: %s */ msg(17, hte->h_name, pos1, mkpos(&call->f_pos)); free(pos1); } continue; } if (!eq || (sflag && warn)) { pos1 = xstrdup(mkpos(&def->s_pos)); /* %s value used inconsistenty\t%s :: %s */ msg(4, hte->h_name, pos1, mkpos(&call->f_pos)); free(pos1); } } }
//----------------------------------------------------------------------------- // class SSegment (Stretch Segment) //----------------------------------------------------------------------------- logicop::SSegment::SSegment(const TP& p1, const TP& p2, int distance) : PSegment(p1,p2) { assert(0 != distance); DBline sample(TP(0,0), TP(distance, 0)); CTM mtrx; real rotation = laydata::xangle(p1,p2) + 270.0; mtrx.Rotate(rotation); mtrx.Translate(p1); sample = sample * mtrx; _moved = parallel(sample.p2()); }
int tellstdfunc::stdZOOMWINb::execute() { telldata::ttwnd *w = static_cast<telldata::ttwnd*>(OPstack.top());OPstack.pop(); real DBscale = DATC->DBscale(); DBbox* box = DEBUG_NEW DBbox(TP(w->p1().x(), w->p1().y(), DBscale), TP(w->p2().x(), w->p2().y(), DBscale)); wxCommandEvent eventZOOM(wxEVT_CANVAS_ZOOM); eventZOOM.SetInt(tui::ZOOM_WINDOW); eventZOOM.SetClientData(static_cast<void*>(box)); wxPostEvent(TopedCanvasW, eventZOOM); return EXEC_NEXT; }
void tellstdfunc::stdSELECT::undo() { TEUNDO_DEBUG("select(box) UNDO"); telldata::ttwnd *w = static_cast<telldata::ttwnd*>(UNDOPstack.front());UNDOPstack.pop_front(); real DBscale = DATC->DBscale(); TP* p1DB = DEBUG_NEW TP(w->p1().x(), w->p1().y(), DBscale); TP* p2DB = DEBUG_NEW TP(w->p2().x(), w->p2().y(), DBscale); laydata::tdtdesign* ATDB = DATC->lockDB(); ATDB->unselect_inBox(p1DB, p2DB); DATC->unlockDB(); delete w;delete p1DB; delete p2DB; UpdateLV(); }
Month parseSingleReply(QNetworkReply* reply, QString& error) { QTextStream page(reply); QString str = page.readAll(); Month ret; if(str.indexOf("Ошибка") != -1) { error = "Ошибка в запросе"; return ret; } int start = str.indexOf("<tbody>"); int end = str.indexOf("</tbody>"); str = str.mid(start, end - start); auto list = str.split("<tr align=\"center\">", QString::SkipEmptyParts); for(int i = 1; i < list.size(); i++) { QString line = list[i]; auto day = line.split("<td", QString::SkipEmptyParts); Half first; Half second; first.t = TP(day[2]); second.t = TP(day[7]); first.p = TP(day[3]); second.p = TP(day[8]); first.cl = cloudness(day[4]); second.cl = cloudness(day[9]); first.ph = precipitations(day[5]); second.ph = precipitations(day[10]); auto windAM = wind(day[6]); auto windPM = wind(day[11]); first.wd = windLable(windAM.first); second.wd = windLable(windPM.first); first.ws = windAM.second; second.ws = windPM.second; ret.append( qMakePair(first, second) ); } return ret; }
int tellstdfunc::stdCELLAREF::execute() { UNDOcmdQ.push_front(this); // get the parameters from the operand stack //cellaref("boza",getpoint(),0,false,1,3,2,30,70); real stepY = getOpValue(); real stepX = getOpValue(); word row = getWordValue(); word col = getWordValue(); real magn = getOpValue(); bool flip = getBoolValue(); real angle = getOpValue(); telldata::ttpnt *rpnt = static_cast<telldata::ttpnt*>(OPstack.top());OPstack.pop(); std::string name = getStringValue(); real DBscale = DATC->DBscale(); int4b istepX = (int4b)rint(stepX * DBscale); int4b istepY = (int4b)rint(stepY * DBscale); CTM ori(TP(rpnt->x(), rpnt->y(), DBscale), magn,angle,flip); laydata::ArrayProperties arrprops(istepX,istepY,col,row); laydata::tdtdesign* ATDB = DATC->lockDB(); telldata::ttlayout* cl = DEBUG_NEW telldata::ttlayout( ATDB->addcellaref(name,ori,arrprops),REF_LAY); DATC->unlockDB(); OPstack.push(cl); UNDOPstack.push_front(cl->selfcopy()); LogFile << LogFile.getFN() << "(\""<< name << "\"," << *rpnt << "," << angle << "," << LogFile._2bool(flip) << "," << magn << "," << col << "," << row << "," << stepX << "," << stepY << ");"; LogFile.flush(); delete rpnt; RefreshGL(); return EXEC_NEXT; }
void CreateSingleWayInteraction::paintEvent(QPaintEvent* anEvent, QPainter& thePainter) { if (theRoad && (!theRoad->layer() || theRoad->isDeleted())) { // The road was begon and then undoed. Restarting.... HaveFirst = false; theRoad = NULL; Creating = false; view()->setInteracting(false); } if (HaveFirst) { QPointF PreviousPoint; if (theRoad && theRoad->size() && !Prepend) PreviousPoint = COORD_TO_XY(CAST_NODE(theRoad->get(theRoad->size()-1))->position()); else PreviousPoint = COORD_TO_XY(FirstPoint); QBrush SomeBrush(QColor(0xff,0x77,0x11,128)); QPen TP(SomeBrush,qBound(3, int(view()->pixelPerM()*4+2), 10)); ::draw(thePainter,TP,Feature::UnknownDirection, PreviousPoint,LastCursor ,4 ,view()->projection()); Coord NewPoint = XY_TO_COORD(LastCursor); const qreal distance = FirstPoint.distanceFrom(NewPoint); QString distanceTag; if (distance < 1.0) distanceTag = QString("%1 m").arg(int(distance * 1000)); else distanceTag = QString("%1 km").arg(distance, 0, 'f', 3); thePainter.drawText(LastCursor + QPointF(10,-10), distanceTag); } FeatureSnapInteraction::paintEvent(anEvent,thePainter); }
void testDummyRandomExceptionPackages() { try { libmaus2::parallel::SimpleThreadPool TP(8); uint64_t const dispid = 0; libmaus2::parallel::DummyThreadWorkPackageRandomExceptionDispatcher dummydisp; TP.registerDispatcher(dispid,&dummydisp); libmaus2::parallel::DummyThreadWorkPackageMeta meta; libmaus2::parallel::PosixMutex printmutex; libmaus2::parallel::DummyThreadWorkPackage * pack = meta.freelist.getPackage(); //(0,dispid,&printmutex,&meta); *pack = libmaus2::parallel::DummyThreadWorkPackage(0 /* priority */, dispid, &printmutex, &meta); TP.enque(pack); TP.join(); } catch(std::exception const & ex) { std::cerr << ex.what() << std::endl; } }
Value* Vector_dot(const Vector* vector1, const Vector* vector2, const Context* ctx) { unsigned count = vector1->vals->count; if(count != vector2->vals->count && vector2->vals->count != 1) { /* Both vectors must have the same number of values */ return ValErr(mathError("Vectors must have the same dimensions for dot product.")); } /* Store the total value of the dot product */ Value* accum = ValInt(0); unsigned i; for(i = 0; i < count; i++) { Value* val2; if(vector2->vals->count == 1) { val2 = vector2->vals->args[0]; } else { val2 = vector2->vals->args[i]; } /* accum += v1[i] * val2 */ TP(tp); accum = TP_EVAL(tp, ctx, "@@+@@*@@", accum, Value_copy(vector1->vals->args[i]), Value_copy(val2)); } return accum; }
int tellstdfunc::stdROTATESEL::execute() { UNDOcmdQ.push_front(this); UNDOPstack.push_front(OPstack.top()); telldata::ttpnt *p1 = static_cast<telldata::ttpnt*>(OPstack.top());OPstack.pop(); real angle = getOpValue(); UNDOPstack.push_front(DEBUG_NEW telldata::ttreal(angle)); real DBscale = DATC->DBscale(); // rotate_selected returns 3 select lists : Failed/Deleted/Added // This is because of the box rotation in which case box has to be converted to polygon // Failed shapes here should not exist but no explicit check for this laydata::selectList* fadead[3]; byte i; for (i = 0; i < 3; fadead[i++] = DEBUG_NEW laydata::selectList()); laydata::tdtdesign* ATDB = DATC->lockDB(); ATDB->rotate_selected(TP(p1->x(), p1->y(), DBscale), angle, fadead); telldata::ttlist* added = make_ttlaylist(fadead[2]); ATDB->select_fromList(get_ttlaylist(added)); // save for undo operations ... UNDOPstack.push_front(make_ttlaylist(fadead[0])); // first failed UNDOPstack.push_front(make_ttlaylist(fadead[1])); // then deleted UNDOPstack.push_front(added); // and added for (i = 0; i < 3; delete fadead[i++]); DATC->unlockDB(); LogFile << LogFile.getFN() << "("<< angle << "," << *p1 << ");"; LogFile.flush(); //delete p1; undo will delete them RefreshGL(); return EXEC_NEXT; }
int tellstdfunc::stdADDTEXT::execute() { // get the parameters from the operand stack real magn = getOpValue(); bool flip = getBoolValue(); real angle = getOpValue(); telldata::ttpnt *rpnt = static_cast<telldata::ttpnt*>(OPstack.top());OPstack.pop(); word la = getWordValue(); std::string text = getStringValue(); if ("" == text) { tell_log(console::MT_ERROR,"Empty string. Operation ignored"); return EXEC_ABORT; } if (0.0 == magn) { tell_log(console::MT_ERROR,"Text with size 0. Operation ignored"); return EXEC_ABORT; } UNDOcmdQ.push_front(this); UNDOPstack.push_front(DEBUG_NEW telldata::ttint(la)); real DBscale = DATC->DBscale(); CTM ori(TP(rpnt->x(), rpnt->y(), DBscale), magn*DBscale/OPENGL_FONT_UNIT,angle,flip); laydata::tdtdesign* ATDB = DATC->lockDB(); telldata::ttlayout* tx = DEBUG_NEW telldata::ttlayout(ATDB->addtext(la, text, ori), la); DATC->unlockDB(); OPstack.push(tx);UNDOPstack.push_front(tx->selfcopy()); LogFile << LogFile.getFN() << "(\"" << text << "\"," << la << "," << *rpnt << "," << angle << "," << LogFile._2bool(flip) << "," << magn << ");"; LogFile.flush(); delete rpnt; RefreshGL(); return EXEC_NEXT; }
int tellstdfunc::stdCOPYSEL::execute() { UNDOcmdQ.push_front(this); telldata::ttpnt *p2 = static_cast<telldata::ttpnt*>(OPstack.top());OPstack.pop(); telldata::ttpnt *p1 = static_cast<telldata::ttpnt*>(OPstack.top());OPstack.pop(); real DBscale = DATC->DBscale(); laydata::tdtdesign* ATDB = DATC->lockDB(); UNDOPstack.push_front(make_ttlaylist(ATDB->shapesel())); ATDB->copy_selected(TP(p1->x(), p1->y(), DBscale), TP(p2->x(), p2->y(), DBscale)); OPstack.push(make_ttlaylist(ATDB->shapesel())); DATC->unlockDB(); LogFile << LogFile.getFN() << "("<< *p1 << "," << *p2 << ");"; LogFile.flush(); delete p1; delete p2; RefreshGL(); return EXEC_NEXT; }
/* * Write a definition. */ static void outdef(hte_t *hte, sym_t *sym) { /* reset output buffer */ outclr(); /* line number in C source file */ outint(0); /* this is a definition */ outchar('d'); /* index of file where symbol was defined and line number of def. */ outint(0); outchar('.'); outint(0); /* flags */ if (sym->s_va) { outchar('v'); /* varargs */ outint(sym->s_nva); } if (sym->s_scfl) { outchar('S'); /* scanflike */ outint(sym->s_nscfl); } if (sym->s_prfl) { outchar('P'); /* printflike */ outint(sym->s_nprfl); } /* definition or tentative definition */ outchar(sym->s_def == DEF ? 'd' : 't'); if (TP(sym->s_type)->t_tspec == FUNC) { if (sym->s_rval) outchar('r'); /* fkt. has return value */ if (sym->s_osdef) outchar('o'); /* old style definition */ } outchar('u'); /* used (no warning if not used) */ /* name */ outname(hte->h_name); /* type */ outtype(TP(sym->s_type)); }
void tui::LayoutCanvas::OnMouseMotion(wxMouseEvent& event) { ScrMARKold = ScrMARK; // get a current position ScrMARK = TP(event.GetX(),event.GetY()) * _LayCTM ; int4b stepDB = Properties->stepDB(); ScrMARK.roundTO(stepDB); if (Properties->autopan() && mouse_input && !invalid_window) { CTM LayCTMR(_LayCTM.Reversed()); TP sp_BL = lp_BL * LayCTMR; TP sp_TR = lp_TR * LayCTMR; TP s_ScrMARK = n_ScrMARK * LayCTMR; TP nsp; if (abs(s_ScrMARK.x() - sp_BL.x()) < ap_trigger) { wxCommandEvent eventZOOM(wxEVT_CANVAS_ZOOM); eventZOOM.SetInt(ZOOM_LEFT); OnZoom(eventZOOM); nsp = ScrMARK * _LayCTM.Reversed(); WarpPointer(nsp.x(),nsp.y());return; } else if(abs(sp_TR.x() - s_ScrMARK.x()) < ap_trigger) { wxCommandEvent eventZOOM(wxEVT_CANVAS_ZOOM); eventZOOM.SetInt(ZOOM_RIGHT); OnZoom(eventZOOM); nsp = ScrMARK * _LayCTM.Reversed(); WarpPointer(nsp.x(),nsp.y());return; } else if(abs(sp_BL.y() - s_ScrMARK.y()) < ap_trigger) { wxCommandEvent eventZOOM(wxEVT_CANVAS_ZOOM); eventZOOM.SetInt(ZOOM_UP); OnZoom(eventZOOM); nsp = ScrMARK * _LayCTM.Reversed(); WarpPointer(nsp.x(),nsp.y());return; } else if(abs(s_ScrMARK.y() - sp_TR.y()) < ap_trigger) { wxCommandEvent eventZOOM(wxEVT_CANVAS_ZOOM); eventZOOM.SetInt(ZOOM_DOWN); OnZoom(eventZOOM); nsp = ScrMARK * _LayCTM.Reversed(); WarpPointer(nsp.x(),nsp.y());return; } } // update movement indicators static int deltaX = abs(ScrMARKold.x() - ScrMARK.x()); static int deltaY = abs(ScrMARKold.y() - ScrMARK.y()); if (!(deltaX || deltaY)) return; // // if (event.LeftIsDown() && !mouse_input) { // presspoint = ScrMARKold; // mouseIN(true);rubber_band = true; // } // if (mouse_input && event.LeftIsDown() && !rubber_band) rubber_band = true; // CursorControl(event.ShiftDown(), event.ControlDown()); if (deltaX > 0) UpdateCoordWin(ScrMARK.x(), POS_X, (n_ScrMARK.x() - releasepoint.x()), DEL_X); if (deltaY > 0) UpdateCoordWin(ScrMARK.y(), POS_Y, (n_ScrMARK.y() - releasepoint.y()), DEL_Y); if ((tmp_wnd || mouse_input)) Refresh();//updateGL(); }
bool auxdata::DrcPoly::pointInside(const TP pnt)const { TP p0, p1; byte cc = 0; for (unsigned i = 0; i < _psize ; i++) { p0 = TP(_pdata[2 * i ], _pdata[2 * i + 1]); p1 = TP(_pdata[2 * ((i+1) % _psize)], _pdata[2 * ((i+1) % _psize) + 1]); if (((p0.y() <= pnt.y()) && (p1.y() > pnt.y())) ||((p0.y() > pnt.y()) && (p1.y() <= pnt.y())) ) { float tngns = (float) (pnt.y() - p0.y())/(p1.y() - p0.y()); if (pnt.x() < p0.x() + tngns * (p1.x() - p0.x())) cc++; } } return (cc & 0x01) ? true : false; }
void tui::LayoutCanvas::OnresizeGL(wxSizeEvent& event) { // this is also necessary to update the context on some platforms wxGLCanvas::OnSize(event); // set GL viewport (not called by wxGLCanvas::OnSize on all platforms...) int w, h; GetClientSize(&w, &h); #ifndef __WXMOTIF__ if (GetContext()) #endif { SetCurrent(); glViewport( 0, 0, (GLint)w, (GLint)h ); } lp_BL = TP(0,0) * _LayCTM; lp_TR = TP(w, h) * _LayCTM; invalid_window = true; }
void GDSin::gds2ted::polygon(GDSin::GDSpolygon* wd, laydata::tdtcell* dst) { laydata::tdtlayer* wl = static_cast<laydata::tdtlayer*> (dst->securelayer(wd->GetLayer())); pointlist &pl = wd->GetPlist(); laydata::valid_poly check(pl); if (!check.valid()) { std::ostringstream ost; ost << "Layer " << wd->GetLayer(); ost << ": Polygon check fails - " << check.failtype(); tell_log(console::MT_ERROR, ost.str()); } else pl = check.get_validated() ; if (check.box()) { wl->addbox(DEBUG_NEW TP(pl[0]), DEBUG_NEW TP(pl[2]),false); } else wl->addpoly(pl,false); }
static Value* eval_exp(const Context* ctx, const ArgList* arglist, bool internal) { if(arglist->count != 1) { return ValErr(builtinArgs("exp", 1, arglist->count)); } TP(tp); return TP_EVAL(tp, ctx, "e^@@", Value_copy(arglist->args[0])); }
int tellstdfunc::stdADDBOX::execute() { UNDOcmdQ.push_front(this); word la = getWordValue(); UNDOPstack.push_front(DEBUG_NEW telldata::ttint(la)); telldata::ttwnd *w = static_cast<telldata::ttwnd*>(OPstack.top());OPstack.pop(); real DBscale = DATC->DBscale(); TP* p1DB = DEBUG_NEW TP(w->p1().x(), w->p1().y(), DBscale); TP* p2DB = DEBUG_NEW TP(w->p2().x(), w->p2().y(), DBscale); laydata::tdtdesign* ATDB = DATC->lockDB(); telldata::ttlayout* bx = DEBUG_NEW telldata::ttlayout(ATDB->addbox(la, p1DB, p2DB),la); DATC->unlockDB(); OPstack.push(bx); UNDOPstack.push_front(bx->selfcopy()); LogFile << LogFile.getFN() << "("<< *w << "," << la << ");";LogFile.flush(); delete w; RefreshGL(); return EXEC_NEXT; }
int tellstdfunc::stdSELECT::execute() { UNDOcmdQ.push_front(this); UNDOPstack.push_front(OPstack.top()); // get the data from the stack telldata::ttwnd *w = static_cast<telldata::ttwnd*>(OPstack.top());OPstack.pop(); real DBscale = DATC->DBscale(); TP* p1DB = DEBUG_NEW TP(w->p1().x(), w->p1().y(), DBscale); TP* p2DB = DEBUG_NEW TP(w->p2().x(), w->p2().y(), DBscale); laydata::tdtdesign* ATDB = DATC->lockDB(); ATDB->select_inBox(p1DB, p2DB); OPstack.push(make_ttlaylist(ATDB->shapesel())); DATC->unlockDB(); LogFile << LogFile.getFN() << "("<< *w << ");"; LogFile.flush(); //DONT delete w; - undo will delete it delete p1DB; delete p2DB; UpdateLV(); return EXEC_NEXT; }
void logicop::CrossFix::traverseOne(polycross::VPoint* const centinel, pcollection& plycol) { bool direction = true; /*next*/ pointlist *shgen = DEBUG_NEW pointlist(); // always push the entry point shgen->push_back(TP(centinel->cp()->x(), centinel->cp()->y())); polycross::VPoint* collector = centinel->next(); while ( *(collector->cp()) != *(centinel->cp()) ) { shgen->push_back(TP(collector->cp()->x(), collector->cp()->y())); if (0 == collector->visited()) { traverseOne(collector, plycol); } collector = collector->follower(direction, false); } plycol.push_back(shgen); }