Example #1
0
int main(int argc, const char * argv[])
{
    Point pos1 = {2, 4};
    Point pos2 = {5, 7};
    
    ShowPoint (&pos1);
    ShowPoint (&pos2);
    SwapPoints (&pos1, &pos2);
    ShowPoint (&pos1);
    ShowPoint (&pos2);
    
    
    return 0;
}
Example #2
0
void cAppliMICMAC::CTPAddCell(const cMasqueAutoByTieP & aMATP,int anX,int anY,int aZ,bool Final)
{
   static int aCptR[5] ={0,0,0,0,0};
   if (0)
   {
       for (int aK=0 ; aK<5 ; aK++ )
           std::cout <<  " K"<<aK << "=" << aCptR[aK];
       std::cout << "\n";
   }

    aCptR[0] ++;

   if (!mMMTP->Inside(anX,anY,aZ))
     return;
   aCptR[1] ++;

   aCptR[2] ++;

   cCelTiep & aCel =  mMMTP->Cel(anX,anY);


   // std::cout << "NBCCCEL " << aCel.NbCel() << " " << aZ << "\n";

   if (aCel.ZIsExplored(aZ)) 
      return;
   aCptR[3] ++;
   aCel.SetZExplored(aZ);

   cResCorTP aCost = CorrelMasqTP(aMATP,anX,anY,aZ) ;
   // std::cout << "Cots " << aCost.CSom() << " " << aCost.CMax() << " " << aCost.CMed()  << "\n";
   double aCSom = aCost.CSom();
   if (
         (     (aCSom > aMATP.SeuilSomCostCorrel()) 
            || (aCost.CMax() > aMATP.SeuilMaxCostCorrel()) 
            || (aCost.CMed() > aMATP.SeuilMedCostCorrel()) 
         )
      )
   {
      return ;
   }
   aCptR[4] ++;
   if (aCSom < aCel.CostCorel())
   {
        aCel.SetCostCorel(aCSom);
        aCel.SetZ(aZ);
        ShowPoint(Pt2dr(anX,anY),aZ*10,1);
        mMMTP->MajOrAdd(aCel);
   }

#if (ELISE_X11)
  int aPer =  100000;
  static int aCpt=0; aCpt++;
  if ((aCpt%aPer)==0)
  {
     std::cout << "CPT= " << aCpt << "\n";
     if (0)
        TheWTiePCor->DumpImage("DumpMMTieP_"+ToString(aCpt/aPer)+".tif");
  }
#endif
}
Example #3
0
	//[11] 레벨 스코어 계산
	void CountScore(void)
	{
		score += 10;
		if (score % 30 == 0)
		{
			level += 1;
			speed -= 20; // 레벨 1증가할때 마다 스피드는 20 밀리 초 빨라짐
		}
		ShowPoint();
	}
Example #4
0
template <class TCont,class TIm1,class TIm2>  void ShowComp(const TCont & aCont,bool V8,int aCoul,TIm1 anImValue,TIm2 anImMarq)
{
   for (int aK=0 ; aK<int(aCont.size()) ;  aK++)
   {
       std::vector<Pt2di> aVPts;
       CompCnxCste(aVPts,V8,aCont[aK]->attr().P0(),anImValue,anImMarq);
       ELISE_ASSERT(int(aVPts.size())==aCont[aK]->attr().Sz(),"ShowComp");
       ShowPoint(aVPts,aCoul,2);
   }
}
Example #5
0
void ShowPoint(const std::vector<Pt2di> & aV,int aCoul,int aModeCoul)
{
#ifdef ELISE_X11
   if (TheWTiePCor)
   {
        for (int aK=0 ; aK<int(aV.size()) ; aK++)
        {
            ShowPoint(Pt2dr(aV[aK]),aCoul,aModeCoul);
        }
   }
#endif 
}
Example #6
0
	//[!] 메인 함수
	void Tetris()
	{
		ConsoleInit(); // 시작 화면 

		DrawField(); // 게임 영역 출력

		ShowPoint(); // 점수판 출력

		StartGame(); // 게임 시작

		EndGame(); // 게임 종료화 면
	}
Example #7
0
/**
 * @brief DialogHistory create dialog
 * @param data container with data
 * @param doc dom document container
 * @param parent parent widget
 */
DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
    :DialogTool(data, 0, parent), ui(new Ui::DialogHistory), doc(doc), cursorRow(0),
    cursorToolRecordRow(0)
{
    ui->setupUi(this);
    bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
    connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted);
    FillTable();
    InitialTable();
    connect(ui->tableWidget, &QTableWidget::cellClicked, this, &DialogHistory::cellClicked);
    connect(this, &DialogHistory::ShowHistoryTool, doc, &VPattern::ShowHistoryTool);
    connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
    connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
    ShowPoint();
}
void cAppliOptimTriplet::ShowPointSel(cImOfTriplet * aIm,Pt2df aP,int aCoul)
{
    ShowPoint(aIm,aP,aCoul,4);
    ShowPoint(aIm,aP,aCoul,6);
    ShowPoint(aIm,aP,aCoul,8);
}
void cAppliOptimTriplet::ShowPoints(cImOfTriplet * aIm,const std::vector<Pt2df> & aVPts,int aCoul,int aRay)
{
   for (int aK=0 ; aK<int(aVPts.size()) ; aK++)
       ShowPoint(aIm,aVPts[aK],aCoul,aRay);
}
Example #10
0
		void ShowCircle( )
		{
				ShowPoint( );                   // F
				cout<<" Radius: "<<r<<'\t';
				cout<<"Area: "<<Area( )<<endl;    //G
		}
Example #11
0
void  cAppliMICMAC::DoMasqueAutoByTieP(const Box2di& aBoxLoc,const cMasqueAutoByTieP & aMATP)
{

   std::cout << "cAppliMICMAC::DoMasqueAutoByTieP " << aBoxLoc << "\n";

   // std::cout <<  "*-*-*-*-*-*- cAppliMICMAC::DoMasqueAutoByTieP    "<< mImSzWCor.sz() << " " << aBox.sz() << mCurEtUseWAdapt << "\n";


   ElTimer aChrono;
   mMMTP = new cMMTP(aBoxLoc,mBoxIn,mBoxOut,*this);

    // Si il faut repartir d'un masque initial calcule a un de zool anterieur
    if (aMATP.TiePMasqIm().IsInit())
    {
       int aDZ = aMATP.TiePMasqIm().Val().DeZoomRel();
       int aDil = aMATP.TiePMasqIm().Val().Dilate();

       std::string aNameMasq = NameImageMasqOfResol(mCurEtape->DeZoomTer()*aDZ);
       Tiff_Im aTM(aNameMasq.c_str());
       Pt2di aSZM = aTM.sz();
       Im2D_Bits<1> aM(aSZM.x,aSZM.y);
       ELISE_COPY(aM.all_pts(),aTM.in(),aM.out());

       Im2D_Bits<1> aNewM = mMMTP->ImMasquageInput();
       ELISE_COPY
       (
             aNewM.all_pts(),
             dilat_32(aM.in(0)[Virgule(FX,FY)/double(aDZ)],aDil*3),
              aNewM.out()
       );
    }

    if (aMATP.mmtpFilterSky().IsInit())
    {
         Im2D_REAL4 * anIm = mPDV1->LoadedIm().FirstFloatIm();
         ELISE_ASSERT(anIm!=0,"Incohe in mmtpFilterSky");
         // Pt2di aSz = anIm->sz();
         Pt2di aSz = mMMTP->ImMasquageInput().sz();

         const cmmtpFilterSky & aFS = aMATP.mmtpFilterSky().Val();
         int aSeuilNbPts = round_ni(aSz.x*aSz.y*aFS.PropZonec().Val());

         Im2D_U_INT1 aImLabel(aSz.x,aSz.y);
         TIm2D<U_INT1,INT> aTLab(aImLabel);

         Fonc_Num FHGlob = FoncHomog(*anIm,aFS.SzKernelHom().Val(),aFS.PertPerPix().Val());
         ELISE_COPY(aImLabel.all_pts(),FHGlob,aImLabel.out());
         FiltrageCardCC(true,aTLab,1,2,aSeuilNbPts);

         Im2D_Bits<1> aNewM = mMMTP->ImMasquageInput();
         ELISE_COPY(select(aImLabel.all_pts(),aImLabel.in()==1),0,aNewM.out());
/*
         Video_Win * aW = Video_Win::PtrWStd(anIm->sz());
         ELISE_COPY(anIm->all_pts(),aImLabel.in(), aW->odisc());
         std::cout << "AAAAAAAAAAAAAAAAAaaaSkkkkkkYYyyyyy\n"; getchar();
*/
          
    }

 #ifdef ELISE_X11
   if (aMATP.Visu().Val())
   {
       Pt2dr aSzW = Pt2dr(aBoxLoc.sz());
       TheScaleW = ElMin(1000.0,ElMin(TheMaxSzW.x/aSzW.x,TheMaxSzW.y/aSzW.y));  // Pour l'instant on accepts Zoom>1 , donc => 1000

       // TheScaleW = 0.635;
       aSzW = aSzW * TheScaleW;

       TheWTiePCor= Video_Win::PtrWStd(round_ni(aSzW));
       TheWTiePCor=  TheWTiePCor->PtrChc(Pt2dr(0,0),Pt2dr(TheScaleW,TheScaleW),true);
       for (int aKS=0 ; aKS<mVLI[0]->NbScale() ; aKS++)
       {
           Im2D_REAL4 * anI = mVLI[0]->FloatIm(aKS);
           ELISE_COPY(anI->all_pts(),Max(0,Min(255,anI->in()/50)),TheWTiePCor->ogray());
       }
/*
       {
           ELISE_COPY(TheWTiePCor->all_pts(),mMMTP->ImMasquageInput().in(),TheWTiePCor->odisc());
           std::cout << "HERISE THE MAKSE \n"; getchar();
       }
*/
   }
#endif 
   std::string  aNamePts = mICNM->Assoc1To1
                           (
                              aMATP.KeyImFilePt3D(),
                              PDV1()->Name(),
                              true
                           );
   mTP3d = StdNuage3DFromFile(WorkDir()+aNamePts);

   cMasqBin3D * aMasq3D = 0;
//#if (ELISE_QT_VERSION >= 4)
   if (aMATP.Masq3D().IsInit())
   {
         aMasq3D  = cMasqBin3D::FromSaisieMasq3d(WorkDir()+aMATP.Masq3D().Val());
         std::vector<Pt3dr> aNewVec;
         for (int aK=0 ; aK<int(mTP3d->size()) ; aK++)
         {
              Pt3dr aP = (*mTP3d)[aK];
              if (aMasq3D->IsInMasq(aP))
                aNewVec.push_back(aP);
         }
         *mTP3d = aNewVec;
   }
// #endif

   std::cout << "== cAppliMICMAC::DoMasqueAutoByTieP " << aBoxLoc._p0 << " " << aBoxLoc._p1 << " Nb=" << mTP3d->size() << "\n"; 
   std::cout << " =NB Im " << mVLI.size() << "\n";


   cXML_ParamNuage3DMaille aXmlN =  mCurEtape->DoRemplitXML_MTD_Nuage();


   {
       cElNuage3DMaille *  aNuage = cElNuage3DMaille::FromParam(mPDV1->Name(),aXmlN,FullDirMEC());
       if (aMasq3D)
       {
           mMMTP->SetMasq3D(aMasq3D,aNuage,Pt2dr(mBoxIn._p0));
           mGLOBMasq3D = aMasq3D;
           mGLOBNuage = aNuage;
       }

       for (int aK=0 ; aK<int(mTP3d->size()) ; aK++)
       {
           Pt3dr aPE = (*mTP3d)[aK];
           Pt3dr aPL2 = aNuage->Euclid2ProfPixelAndIndex(aPE);


           int aXIm = round_ni(aPL2.x) - mBoxIn._p0.x;
           int aYIm = round_ni(aPL2.y) - mBoxIn._p0.y;
           int aZIm = round_ni(aPL2.z) ;


           MakeDerivAllGLI(aXIm,aYIm,aZIm);
           CTPAddCell(aMATP,aXIm,aYIm,aZIm,false);

           ShowPoint(Pt2dr(aXIm,aYIm),P8COL::red,0);
       }
   }



   OneIterFinaleMATP(aMATP,false);
   mMMTP->ExportResultInit();
   mMMTP->FreeCel();
 #ifdef ELISE_X11
   if (TheWTiePCor)
   {
       std::cout << "End croissance \n";
       TheWTiePCor->clik_in();
   }
 #endif
   const cComputeAndExportEnveloppe * aCAEE = aMATP.ComputeAndExportEnveloppe().PtrVal();


   if (aMATP.ParamFiltreRegProf().IsInit())
      mMMTP->MaskRegulMaj(aMATP.ParamFiltreRegProf().Val());
   mMMTP->ContAndBoucheTrou();
   if (aMATP.FilterPrgDyn().IsInit())
      mMMTP->MaskProgDyn(aMATP.FilterPrgDyn().Val());


   if (aCAEE)
   {
       mMMTP->ConputeEnveloppe(*aCAEE,aXmlN);
       if (aCAEE->EndAfter().Val()) return;
   }


/*
   if (aMATP.ParamFiltreRegProf().IsInit())
      mMMTP->MaskRegulMaj(aMATP.ParamFiltreRegProf().Val());
   mMMTP->ContAndBoucheTrou();
   if (aMATP.FilterPrgDyn().IsInit())
      mMMTP->MaskProgDyn(aMATP.FilterPrgDyn().Val());
*/



   // A CONSERVER , SAUV FINAL ...:

   std::string aNameMasq =  NameImageMasqOfResol(mCurEtape->DeZoomTer());

   Im2D_Bits<1> aImMasq0 = mMMTP->ImMasqFinal();
   ELISE_COPY(aImMasq0.all_pts(), aImMasq0.in(), Tiff_Im(aNameMasq.c_str()).out());
   
   std::string aNameImage = FullDirMEC() +aXmlN.Image_Profondeur().Val().Image();
   // Pour forcer le resultat flotant 
   Tiff_Im::CreateFromIm(mMMTP->ImProfFinal(),aNameImage.c_str());
/*
   ELISE_COPY(aImProf.all_pts(), aImProf.in(), Tiff_Im(aNameImage.c_str()).out());

       Im2D_REAL4   ImProfFinal() {return  mContBT;}   // image dequant et trous bouches
*/


}