void cElHJaArrangt::TestPolygoneSimple ( const std::vector<Pt2dr> & aPolyg, const std::vector<int> & aVSelect ) { ReInit(aPolyg); INT aNb = (int) aPolyg.size(); for (INT aK=0 ; aK<aNb ; aK++) { if (aVSelect[aK]) { SegComp aSeg(aPolyg[aK],aPolyg[(aK+1)%aNb]); cElHJaPlan3D * aPl = AddPlan ( cElPlan3D ( PFromSeg(aSeg,0,0), PFromSeg(aSeg,1,0), PFromSeg(aSeg,1,1) ) ); aPl->SetSegOblig(aSeg); } } }
Quick_Flux_Poly_Comp::Quick_Flux_Poly_Comp(const std::vector<Pt2di> & Pts,Box2di aBox) : RLE_Flux_Pts_Computed(2,aBox._p1.x-aBox._p0.x) { INT NbPts = (INT) Pts.size(); INT YMin = aBox._p0.y; INT YMax = aBox._p1.y; INT NbY = YMax-YMin; // On initialise LinesH std::vector<QFPC_LineH> LinesH; LinesH.reserve(NbY); QFPC_LineH aLine; for (INT anY=0 ; anY<NbY ; anY++) { LinesH.push_back(aLine); } for (INT k=0 ; k<NbPts ; k++) { Pt2di p0 = Pts[k]; Pt2di p1 = Pts[(k+1)%NbPts]; if(p0.y != p1.y) { Pt2dr aPR0 = Pt2dr(p0); Pt2dr aPR1 = Pt2dr(p1); Seg2d aSeg(aPR0,aPR1); INT y0 = ElMin(p0.y ,p1.y); INT y1 = ElMax(p0.y ,p1.y); for (INT y =y0 ; y<y1 ; y++) { INT x = round_ni(aSeg.AbsiceInterDroiteHoriz(y+0.5)); LinesH[y-YMin].AddAbscisse(x); } } } INT NbInterv = 0; for (INT y=0 ; y<NbY ; y++) { LinesH[y].Finish(); NbInterv += LinesH[y].NbInterv(); } mRLE.reserve(NbInterv); { for (INT y=0 ; y<NbY ; y++) { INT NbInt = LinesH[y].NbInterv(); for (INT k=0 ; k<NbInt ; k++) { QFPV_RLE aRLE = LinesH[y].KthInterv(k,y+YMin); if (! aRLE.IsEmpty()) mRLE.push_back(aRLE); } } } }
void GenCodeSurf() { if (1) { ElSeg3D aSeg(Pt3dr(0,0,0),Pt3dr(1,0,0)); cCylindreRevolution aCyl(true,aSeg,Pt3dr(0,1,0)); cSetEqFormelles aSet; aSet.AllocCylindre(aCyl,true); } if (1) { cSetEqFormelles aSet; Pt3dr aP(0,0,0); cSolBasculeRig aSBR(aP,aP,ElMatrix<double>::Rotation(0,0,0),1); aSet.NewEqObsBascult(aSBR,true); } }
void TestRandomSetOfMesureSegDr() { std::string aInput="/media/data1/ExempleDoc/Test-CompDrAnalogik/MesureLineImageOri.xml"; std::string aOut="/media/data1/ExempleDoc/Test-CompDrAnalogik/MesureLineImage.xml"; cSetOfMesureSegDr aSMS = StdGetFromPCP(aInput,SetOfMesureSegDr); for ( std::list<cMesureAppuiSegDr1Im>::iterator itIm=aSMS.MesureAppuiSegDr1Im().begin(); itIm!=aSMS.MesureAppuiSegDr1Im().end(); itIm++ ) { std::string aNameIm = itIm->NameIm(); { for ( std::list<cOneMesureSegDr>::iterator itMes=itIm->OneMesureSegDr().begin(); itMes!=itIm->OneMesureSegDr().end(); itMes++ ) { Pt2dr aP1 = itMes->Pt1Im(); Pt2dr aP2 = itMes->Pt2Im(); SegComp aSeg(aP1,aP2); itMes->Pt1Im() = aSeg.from_rep_loc(Pt2dr(0.6+NRrandC(),0)); itMes->Pt2Im() = aSeg.from_rep_loc(Pt2dr(0.4-NRrandC(),0)); } } } MakeFileXML(aSMS,aOut); exit(0); }