first commit

This commit is contained in:
William Cardoso Simas committed 2026-11-18 10:27:27 -03:00
commit e4be8d7943
257 files changed
+129570

No files matched your search

@@ -0,0 +1,85 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#include<time.h>
#include<stdio.h>
#pragma hdrstop
#include "UFrmEficienciaDeAlgoritmosDeOrdenacao.h"
#include "UVetor.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFrmEficienciaDeAlgoritmosDeOrdenacao *FrmEficienciaDeAlgoritmosDeOrdenacao;
int vVetorGerado = 0, vTamanhoDoVetor, vFaixaDeValores;
Vetor *oVetor;
//double *vVetor;
//---------------------------------------------------------------------------
__fastcall TFrmEficienciaDeAlgoritmosDeOrdenacao::TFrmEficienciaDeAlgoritmosDeOrdenacao(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFrmEficienciaDeAlgoritmosDeOrdenacao::EvCarregarAlgoritmosDeOrdenacaoOnCreate(TObject *Sender)
{
oVetor = new Vetor;
}
//---------------------------------------------------------------------------
void __fastcall TFrmEficienciaDeAlgoritmosDeOrdenacao::EvFecharFormularioOnClose(TObject *Sender,
TCloseAction &Action)
{
delete oVetor;
Action = caFree;
}
//---------------------------------------------------------------------------
void __fastcall TFrmEficienciaDeAlgoritmosDeOrdenacao::EvCarregarVetorOnClick(TObject *Sender)
{
int vTamanhoDoVetor;
int vFaixaDeValores;
int vContador;
vTamanhoDoVetor = edtTamanhoDoVetor -> Text.ToInt();
vFaixaDeValores = edtFaixaDeValores -> Text.ToInt();
oVetor -> setTamanhoDoVetor(vTamanhoDoVetor);
oVetor -> setFaixaDeValores(vFaixaDeValores);
oVetor -> dimensionarVetor();
oVetor -> carregarVetor();
carregarGrafico(oVetor ->getNumero() , oVetor ->getCor(), oVetor ->getTamanhoDoVetor());
}
//---------------------------------------------------------------------------
void __fastcall TFrmEficienciaDeAlgoritmosDeOrdenacao::EvResetarVetorOnClick(TObject *Sender)
{
carregarGrafico(oVetor ->getNumero() , oVetor ->getCor(), oVetor ->getTamanhoDoVetor());
}
//---------------------------------------------------------------------------
void __fastcall TFrmEficienciaDeAlgoritmosDeOrdenacao::EvOrdenarVetorOnClick(TObject *Sender)
{
if (chxSelecao->State == cbChecked) {
Caption = "Executando ordenação por seleção...";
ShowMessage("A seguir, será exibida a ordenação através do método de seleção");
//FnOrdenarPorSelecao();
}
Caption = "Ordenação terminada";
}
//---------------------------------------------------------------------------
void TFrmEficienciaDeAlgoritmosDeOrdenacao::carregarGrafico(double *pNumeros, int *pCores, int pTamanhoDoVetor){
int vContador;
Series1->Clear();
for (vContador = 0; vContador < pTamanhoDoVetor; vContador++) {
Series1->AddXY(vContador, pNumeros[vContador], "", pCores[vContador]);
}
}
//---------------------------------------------------------------------------