nom.push_back("Redo ctrl + y");
funct.push_back((wxObjectEventFunction) &interfEditMenu:: onRedo);
+//CMRU 17-08-09 ------------------------------------------------------------------
+ path.push_back(datadir + "/Letter.PNG");
+ nom.push_back("Insert a Label");
+ funct.push_back((wxObjectEventFunction)&interfEditMenu::onPrintLabel);
+//-------------------------------------------------------------------------------
+
this->addButtons(path, nom);
this->setVectorFunction(funct);
void interfEditMenu::onRedo(wxCommandEvent& event){
interfMainPanel::getInstance()->onRedo();
}
+void interfEditMenu::onPrintLabel(wxCommandEvent& event){
+ interfMainPanel::getInstance()->onPrintLabel();
+}
interfEditMenu::~interfEditMenu()
{
void onPaste(wxCommandEvent& event);
void onUndo(wxCommandEvent& event);
void onRedo(wxCommandEvent& event);
+ void onPrintLabel(wxCommandEvent& event);
};
mirrorPanel = NULL;
thresholdPanel = NULL;
currentWindow = NULL;
-
+
+//CMRU 17-08-09 ------------------------------------------------------------------
+ infoPanelCalibration = NULL;
+ panelAux = NULL;
+//--------------------------------------------------------------------------------
splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
splitterwindow->SetMinimumPaneSize( 10 );
wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2);
infoPanel->SetSizer(infosizer, true);
infoPanel->SetAutoLayout( true );
-
+
splitterwindow->Initialize(toolpanel);
splitterwindow->SetSashGravity(1);
splitterwindow->SplitHorizontally(toolpanel, infoPanel);
-
+
Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourLine();
}
+
+// RaC 09-09 ---------------------
+void interfMainPanel::onCreateContourPoints( ){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourPoints();
+}
+// RaC 09-09 ---------------------
+
void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull){
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
//wxPanel* panel = contourevent->getSegmentationPanelITK(segmentPanelITK);
wxPanel* panel = new interfSegmentationPanelITK(segmentPanelITK);
-
wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T(" Automatic ITK Segmentation ")), wxDefaultPosition,
wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
//contourevent->FillGridWithContoursInformation();
infoWin->Show(true);
}
+ }
+
+//CMRU 29-08-09-----------------------------------------------------------------------------------------------
+ if(panelAux == NULL)
+ {
+ panelAux = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
}
-
+//------------------------------------------------------------------------------------------------------------
+
// mask view control panel
if(infoPanelMask == NULL){
- infoPanelMask = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
+ infoPanelMask = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
infoPanelMask->SetSizer(flexsizer, true);
infoPanelMask->SetAutoLayout( true );
infoPanelMask->Layout();
}
- showPanel(infoPanelMask);
+
+//CMRU 29-08-09-----------------------------------------------------------------------------------------------
+ //Calibration panel
+ if(infoPanelCalibration == NULL)
+ {
+ infoPanelCalibration = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER , wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ infoPanelCalibration->SetSizer(flexsizer, true);
+ infoPanelCalibration->SetAutoLayout( true );
+
+ wxPanel *panel = new interfCalibrationPanel(infoPanelCalibration);
+ wxStaticText* stattext = new wxStaticText(infoPanelCalibration, -1, wxString(_T(" Calibration ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+
+ flexsizer->Add(panel, wxEXPAND);
+ infoPanelCalibration->Layout();
+ }
+
+ wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
+ panelAux->SetSizer(sizer, true);
+ panelAux->SetAutoLayout( true );
+ sizer->Add(infoPanelMask);
+ sizer->Add(infoPanelCalibration);
+
+ showPanel(panelAux);
+
+//------------------------------------------------------------------
+
wxContourMainFrame::getInstance()->changeInstant();
}
{
wxContourMainFrame::getInstance()->SetContourGroup( contourGroup);
}
+
+//CMRU 17-08-09 ---------------------------------------------
+void interfMainPanel::onPrintLabel ()
+{
+ wxString label;
+ manualBaseModel* manualModel = wxContourMainFrame::getInstance()->getContour();
+
+ if(manualModel==NULL)
+ {
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please select a Contour"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ return;
+ }
+
+ wxTextEntryDialog* dialog = new wxTextEntryDialog(this,"Enter a tag name: ") ;
+
+ if (dialog->ShowModal() == wxID_OK)
+ {
+ label = dialog->GetValue();
+
+ if(label.Len()!=0)
+ {
+ wxContourMainFrame::getInstance()->onPrintLabel(label,manualModel);
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("The tag name was updated"), wxT("Information"), wxOK | wxICON_INFORMATION);
+ dial->ShowModal();
+ }
+ else
+ {
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please enter a valid tag"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ }
+ }
+}
+void interfMainPanel::onCalibration(wxString size, int unit)
+{
+ int type = 0;
+ double contourSize = 0.0;
+ double realSizeDouble = 0.0;
+
+ type = wxContourMainFrame::getInstance()->getType();
+ contourSize = wxContourMainFrame::getInstance()->getContourSizeInPixels();
+
+ std::cout<<"Cata->TamaƱo del contorno en pixeles:"<<contourSize<<endl;
+
+ if ( type == 6 )
+ {
+ if (size.ToDouble(&realSizeDouble))
+ {
+ if(unit==1)
+ {
+ realSizeDouble = realSizeDouble * 10;
+ }
+ if(unit==2)
+ {
+ realSizeDouble = realSizeDouble * 25.4;
+ }
+ std::cout<< "Valor del usuario" << realSizeDouble<< endl ;
+ onePixelSize (realSizeDouble,contourSize);
+ }
+ else
+ {
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please enter a numeric value"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ }
+ }
+ else
+ {
+
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please select a line contour"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ }
+
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("The calibration was made"), wxT("Information"), wxOK | wxICON_INFORMATION);
+ dial->ShowModal();
+ std::cout<< "Cata-> Se ha realizado la calibracion" << endl ;
+}
+
+double interfMainPanel::onePixelSize (double realSize,double sizePixel)
+{
+ _pixelValue = realSize/sizePixel;
+ std::cout<< "Valor del un pixel = " << _pixelValue<< endl ;
+ wxContourMainFrame::getInstance()->onePixelSize (_pixelValue);
+ return _pixelValue ;
+}
+double interfMainPanel::GetPixelValue()
+{
+ return _pixelValue;
+}
+//------------------------------------------------------------------------------------------------------------
\ No newline at end of file
void onCreateContourRectangle( );
void onCreateContourCircle( );
void onCreateContourLine( );
+
+ // RaC 09-09 ---------------------
+ void onCreateContourPoints( );
+ // RaC 09-09 ---------------------
+
void onCreateContoursBullEye(wxPanel* panBull);
/////////////////////////////////
void onDeleteContour();
void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ);
void SetContourGroup(int contourGroup);
+//CMRU 29-08-09-----------------------------------------------------------------------------------------------
+
+ /**
+ * Associates the current selected contour with a label
+ */
+ void onPrintLabel();
+
+
+ /**
+ * Calculates the pixel value in milimeters according to the current contour if the selected contour is a Line Contour
+ * @param size Size in milimeters of the selected contour
+ * @param unit Measurement unit
+ */
+ void onCalibration(wxString size, int unit);
+
+ /**
+ * Calculate the pixel value in milimeters
+ * @param realSize Size of the contour in milimeters
+ * @param sizePixel Size of the contour in pixels
+ */
+ double onePixelSize (double realSize,double sizePixel);
+
+ /**
+ * Returns the value of a pixel in milimeters
+ */
+ double GetPixelValue();
+//------------------------------------------------------------------------------------------------------------
+
private:
wxPanel* infoPanel;
wxPanel* infoPanelMask;
+//CMRU 17-08-09 ------------------------------------------------------------------
+
+ /**
+ * Panel with the calibration options
+ */
+ wxPanel* infoPanelCalibration;
+
+ /**
+ * Panel who contains the calibration panel and the information panel mask
+ */
+ wxPanel* panelAux;
+
+ /**
+ * Value of a pixel in milimeters
+ */
+ double _pixelValue;
+//--------------------------------------------------------------------------------
+
wxStaticText* statictext;
wxStaticText* statictext1;
wxStaticText* statictext2;
nom.push_back("Create a Line");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
hand.push_back(this);
-/*
- path.push_back(datadir + "/Line.png");
+
+ // RaC 09-09 ---------------------
+ path.push_back(datadir + "/Points.png");
nom.push_back("Create Points");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
hand.push_back(this);
-*/
+ // RaC 09-09 ---------------------
+
this->addButtons(path, nom);
this->setVectorFunction(funct);
void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
interfMainPanel::getInstance()->onCreateContourLine();
}
-/*
+
+// RaC 09-09 ---------------------
void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){
- interfMainPanel::getInstance()->onCreateContourLine();
+ interfMainPanel::getInstance()->onCreateContourPoints();
}
-*/
+// RaC 09-09 ---------------------
**/
void onCreateContourLine( wxCommandEvent& event );
- //void onCreateContourPoints( wxCommandEvent& event );
+ /**
+ ** This method is in charge of capturing the event when the button is clicked
+ **/
+ void onCreateContourPoints( wxCommandEvent& event );
};
interfMainPanel::getInstance()->SetContourGroup( _radiolstboxContourGroup->GetSelection() );
}
+//CMRU 29-08-09-----------------------------------------------------------------------------------------------
+interfCalibrationPanel:: interfCalibrationPanel(wxWindow * parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+ double range[2];
+ interfMainPanel::getInstance()->getImageRange(range);
+
+ //Radio buttons
+ wxString options[3];
+ options[0]=_T("mm");
+ options[1]=_T("cm");
+ options[2]=_T("inch");
+
+ _unitsRadiobox = new wxRadioBox(this, -1, _T("Unit of measurement"), wxPoint(2, 25), wxSize(145,45), 3 , options, 3, wxRA_SPECIFY_COLS);
+ _unitsRadiobox->SetSelection(0);
+
+ //The label
+ new wxStaticText(this, wxID_ANY, wxT("Real Size: "), wxPoint(2, 5));
+
+ //Text Control
+ _size = new wxTextCtrl(this, wxID_ANY, wxT(""), wxPoint(78,3), wxSize(70, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
+
+ //The button
+ new wxButton(this, 1, wxT("Calibrate"), wxPoint(78, 70), wxSize(70, 25), 0, wxDefaultValidator, wxT("button"));
+
+ //Conexion del boton con su respectivo manejador
+ Connect(1, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &interfCalibrationPanel::onCalibrate);
+
+}
+
+interfCalibrationPanel:: ~interfCalibrationPanel()
+{
+}
+
+void interfCalibrationPanel::onCalibrate(wxCommandEvent& event)
+{
+ wxString size =_size->GetValue();
+ int unit = _unitsRadiobox->GetSelection();
+ interfMainPanel::getInstance()->onCalibration(size, unit);
+}
+//------------------------------------------------------------------------------------------------------------
\ No newline at end of file
};
+//CMRU 29-08-09-----------------------------------------------------------------------------------------------
+/**
+* This class represents the calibration panel in the interface icons
+*/
+class interfCalibrationPanel
+ : public wxPanel
+{
+public:
+
+ /**
+ * Initialized the panel
+ * @param parent Window who contains the panel
+ */
+ interfCalibrationPanel(wxWindow * parent);
+
+ ~interfCalibrationPanel();
+ /**
+ * Manages the event associated with the button of calibration
+ */
+ void onCalibrate(wxCommandEvent& event);
+
+private:
+
+ /**
+ * Text field of the calibration measure
+ */
+ wxTextCtrl * _size;
+
+ /**
+ * Radio Box with the measurement units
+ */
+ wxRadioBox * _unitsRadiobox;
+};
+//------------------------------------------------------------------------------------------------------------
#endif
#include "ConceptDataWrap.h"
#include <creaWx.h>
-
+#include <string>
+using namespace std;
//----------------------------------------------------------------------------------------------------------------
// Class implementation
createContour( 6 );
}
+// RaC 09-09 --------------------------------------
+void wxContourMainFrame::onCreateContourPoints( ){
+ //JCP 20-10-08 Undo redo implementation
+ saveState();
+ //JCP 20-10-08 Undo redo implementation
+ createContour( 7 );
+}
+// RaC 09-09 --------------------------------------
+
//------------------------------------------------------------------------------------------------------------
void wxContourMainFrame :: onCreateContourBullEye(wxPanel* panel )
{
- //Creating the manualContourModel and including in the model
- manualContourModel * manModelContour = factoryManualContourModel(panel );
+ //Creating the manualBaseModel and including in the model
+ manualBaseModel * manModelContour = factoryManualContourModel(panel );
std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
void wxContourMainFrame :: createContour( int typeContour )
{
//Creating the manualContourModel and including in the model
- manualContourModel * manModelContour = kernelManager->factoryManualContourModel(typeContour);
-
+ manualBaseModel * manModelContour = kernelManager->factoryManualContourModel(typeContour);
std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
}
}
-manualContourModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel){
+manualBaseModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel){
manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
- manualContourModel *manModelContour=NULL;
+ manualBaseModel *manModelContour=NULL;
manModelContour = manModelContourBullEye;
if (panel!=NULL){
int iCrown,sizeCrowns,iSector,sizeSectors;
void wxContourMainFrame :: createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append )
{
std::string cloneName = kernelManager->createCopyContourOf( anExistingKName, instantNoTouchData );
- manualContourModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);//_modelManager->getOutlineByKeyName( cloneName )->getModel();
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);//_modelManager->getOutlineByKeyName( cloneName )->getModel();
_theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
}
void wxContourMainFrame :: createMirrorContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append )
{
std::string cloneName = kernelManager->createCopyContourOf( anExistingKName, instantNoTouchData );
- manualContourModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);
manualPoint * refPoint1 = _refLineModel->GetManualPoint(0);
manualPoint * refPoint2 = _refLineModel->GetManualPoint(1);
std::vector<int> instantVector;
int typeContourModel;
- manualContourModel *manModelContour;
+ manualBaseModel *manModelContour;
int typeView;
int i;
void wxContourMainFrame::onLoad()
{
char tmp[255];
- wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxOPEN );
- if (dialog.ShowModal() == wxID_OK)
+ char tmpD[255];
+ std::string fileNameContourROI = GetFileLocation();
+
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ if(GetFileLocation().empty())
+ {
+//------------------------------------------------------------------------------------------------------------
+ wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxOPEN );
+ if (dialog.ShowModal() == wxID_OK)
+ {
+ fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
+ }
+ }
+
+ FILE *pFile =fopen(fileNameContourROI.c_str(),"r+");
+
+
+//CMRU 03-09-09- ----------------------------------------------------------------------------------------------
+ if(pFile != NULL)
{
- std::string fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
- FILE *pFile=fopen(fileNameContourROI.c_str(),"r+");
+//------------------------------------------------------------------------------------------------------------
+ fileNameContourROI.append("data");
+ FILE *pFileData=fopen(fileNameContourROI.c_str(),"r+");
+ if(pFileData != NULL)
+ {
+ fscanf(pFileData,"%s",tmpD); // --CreaContour--
+ fscanf(pFileData,"%s",tmpD); // Version
+ fscanf(pFileData,"%s",tmpD); // 1.0.2 || 1.0.1 || 1.0.0
+
+ fscanf(pFileData,"%s",tmpD); // onePixelSize
+ fscanf(pFileData,"%s",tmpD); // #
+ _onePixelSize = atof(tmpD);
+ fscanf(pFileData,"%s",tmpD); // NumberOfContours
+ fscanf(pFileData,"%s",tmpD); // #
+ }
fscanf(pFile,"%s",tmp); // --CreaContour--
//AD:02-06-09
if (version=="1.0.2")
{
- openContours(pFile,2,false);
- openContours(pFile,2,true); //Load StaticContours
+ openContours(pFile,pFileData,2,false);
+ openContours(pFile,pFileData,2,true); //Load StaticContours
}
//AD:02-06-09
else if (version=="1.0.1")
{
- openContours(pFile,1,false); //Skips ImageDimensions and ImageSpacing
- openContours(pFile,1,true); //Load StaticContours, skips ImageDimensions and ImageSpacing
+ openContours(pFile,pFileData,1,false); //Skips ImageDimensions and ImageSpacing
+ openContours(pFile,pFileData,1,true); //Load StaticContours, skips ImageDimensions and ImageSpacing
}
//AD:02-06-09
else if (version=="1.0.0")
{
- openContours(pFile,1,false); //Skips ImageDimensions and ImageSpacing
+ openContours(pFile,pFileData,1,false); //Skips ImageDimensions and ImageSpacing
}
fclose(pFile);
+
+ if(pFileData != NULL)
+ {
+ fclose(pFileData);
+ }
}
_theViewPanel->getSceneManager()->removeSceneContours();
changeInstant();
//AD: 29-05-09
void wxContourMainFrame::onSave(){
- wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxSAVE );
- if (dialog.ShowModal() == wxID_OK)
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ if(GetFileLocation().empty())
{
- std::string fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
+//------------------------------------------------------------------------------------------------------------
+ wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxSAVE );
+ if (dialog.ShowModal() == wxID_OK)
+ {
+ std::string fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
+ kernelManager->setCurrentFileName(fileNameContourROI);
+ saveFileWithContours( fileNameContourROI );
+ }
+ }
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ else
+ {
+ std::cout<<"Nombre del archivo: "<<GetFileLocation()<<std::endl;
+ std::string fileNameContourROI = GetFileLocation();
+ std::cout<<"Nombre del archivo: "<<fileNameContourROI<<std::endl;
kernelManager->setCurrentFileName(fileNameContourROI);
- saveFileWithContours( fileNameContourROI );
+ saveFileWithContours( fileNameContourROI);
}
+//------------------------------------------------------------------------------------------------------------
}
//AD: 29-05-09
{
FILE *pFile=fopen(filename.c_str(),"w+");
+
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ filename.append("data");
+ std::cout<<"Nombre del archivo: "<<filename<<std::endl;
+ FILE *pFileData=fopen(filename.c_str(),"w+");
+//------------------------------------------------------------------------------------------------------------
+
std::vector< std::string > lstNameThings;
int i,sizeLstNameThings;
fprintf(pFile,"--CreaContour--\n");
fprintf(pFile,"Version %s\n", "1.0.2" );
+
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ fprintf(pFileData,"--CreaContour--\n");
+ fprintf(pFileData,"Version %s\n", "1.0.2" );
+ fprintf(pFileData,"OnePixelSize %f\n", _onePixelSize);
+ std::cout<<"Valor de un pixel: "<<_onePixelSize<<std::endl;
+
+//------------------------------------------------------------------------------------------------------------
vtkImageData *image = _images[0];
sizeLstNameThings = lstNameThings.size();
fprintf(pFile,"NumberOfContours %d\n", sizeLstNameThings );
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ fprintf(pFileData,"NumberOfContours %d\n", sizeLstNameThings );
+//------------------------------------------------------------------------------------------------------------
+
for (i=0 ; i<sizeLstNameThings ; i++)
{
- kernelManager->SaveThingName( pFile, lstNameThings[i] );
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(lstNameThings[i]);
+ double sizeInPixel = manualModel ->GetPathSize();
+ double realContourSize = sizeInPixel*_onePixelSize;
+ manualModel ->SetRealSize(realContourSize);
+//------------------------------------------------------------------------------------------------------------
+
+ //int size= kernelManager->GetLstNameThings().size();
+
+ kernelManager->SaveThingName( pFile, pFileData, lstNameThings[i] );
_theViewPanel->getSceneManager()->SaveThingName( pFile, lstNameThings[i] );
}// for i
lstNameThings = kernelManager->GetLstNameThingsStatic();
sizeLstNameThings = lstNameThings.size();
fprintf(pFile,"NumberOfContoursStatic %d\n", sizeLstNameThings );
+
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+ fprintf(pFileData,"NumberOfContoursStatic %d\n", sizeLstNameThings );
+//------------------------------------------------------------------------------------------------------------
+
for (i=0 ; i<sizeLstNameThings ; i++)
{
- kernelManager->SaveThingName( pFile, lstNameThings[i] );
+ kernelManager->SaveThingName( pFile, pFileData, lstNameThings[i] );
_theViewPanel->getSceneManager()->SaveThingName( pFile, lstNameThings[i] );
}// for i
fclose(pFile);
+ fclose(pFileData);
}
//AD:04-06-09
-void wxContourMainFrame::openContours( FILE *pFile, int version, bool staticContour )
+void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, int version, bool staticContour )
{
char tmp[255];
std::vector<int> instantVector;
int typeContourModel;
- manualContourModel *manModelContour;
+ manualBaseModel *manModelContour;
int typeView;
if (compatible==true)
manModelContour = kernelManager->factoryManualContourModel(typeContourModel);
manModelContour->Open(pFile);
+ if(pFileData != NULL)
+ {
+ manModelContour->OpenData(pFileData);
+ }
fscanf(pFile,"%s",tmp); // TypeView
fscanf(pFile,"%s",tmp); // ##
manModelContour = kernelManager->factoryManualContourModel(typeContourModel);
manModelContour->Open(pFile);
-
+ if(pFileData != NULL)
+ {
+ manModelContour->OpenData(pFileData);
+ }
if (transform==true)
{
if (typeOfTransformation==0)
int j,sizeCtrPt = vecCtrlPointX.size();
- manualContourModel *manModelContour = kernelManager->factoryManualContourModel( typeofcontour );
+ manualBaseModel *manModelContour = kernelManager->factoryManualContourModel( typeofcontour );
manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 );
if (sizeCtrPt>=3){
for (j=0 ; j<sizeCtrPt ; j++)
actualInstantVector[1]=z;
int j,sizeCtrPt = vecCtrlPointX.size();
- manualContourModel *manModelContour = kernelManager->factoryManualContourModel( typeofcontour );
+ manualBaseModel *manModelContour = kernelManager->factoryManualContourModel( typeofcontour );
manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 );
if (sizeCtrPt>=3){
for (j=0 ; j<sizeCtrPt ; j++)
int typeofcontour = 1;
std::string theName;
- manualContourModel* manModelContour = kernelManager->GetPoints(z, type, &vecCtrlPointX,&vecCtrlPointY,&vecCtrlPointZ, theName,typeofcontour, tempVector);
+ manualBaseModel* manModelContour = kernelManager->GetPoints(z, type, &vecCtrlPointX,&vecCtrlPointY,&vecCtrlPointZ, theName,typeofcontour, tempVector);
if( manModelContour!=NULL ){
double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
_contourextractdata ->SetTypeOperation( typeContourGroup % 3 );
- std::vector<manualContourModel*> lstManConMod;
- std::vector<manualContourModel*> lstManConModTmp;
- std::vector<manualContourModel*> lstManConModExp;
+ std::vector<manualBaseModel*> lstManConMod;
+ std::vector<manualBaseModel*> lstManConModTmp;
+ std::vector<manualBaseModel*> lstManConModExp;
std::vector<double> pLstValue;
std::vector<double> pLstValuePosX;
std::vector<double> pLstValuePosY;
ContourThing **contourthing = lstContourThings[ii];
lstManConMod.push_back( (*contourthing)->getModel() );
}
- lstManConModExp = kernelManager->ExploseEachModel( lstManConMod );
+ lstManConModExp = kernelManager->ExploseEachModel( lstManConMod );
tempString.Printf(_T("%d - %d"),z, sizeLstContourThings);
interfMainPanel::getInstance()->setRowLabelInfoPanel(z, tempString);
int tmpIntA;
-
-
for( iContourGroup=0 ; iContourGroup<sizeContourGroup ; iContourGroup++ ){
lstManConModTmp.clear();
+
+
+
if (typeContourGroup==3) // contour separete
{
lstManConModTmp.push_back( lstManConModExp[iContourGroup]);
&pLstValuePosX,
&pLstValuePosY,
&pLstValuePosZ);
+
// Statistics of each slice.
_contourextractdata->Statistics( &pLstValue,
grayRangeMin,
//int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
_contourextractdata ->SetTypeOperation( typeContourGroup % 3 );
- std::vector<manualContourModel*> lstManConMod;
- std::vector<manualContourModel*> lstManConModTmp;
- std::vector<manualContourModel*> lstManConModExp;
+ std::vector<manualBaseModel*> lstManConMod;
+ std::vector<manualBaseModel*> lstManConModTmp;
+ std::vector<manualBaseModel*> lstManConModExp;
std::vector<double> pLstValue;
std::vector<double> pLstValuePosX;
std::vector<double> pLstValuePosY;
}
_contourextractdata ->SetTypeOperation( typeContourGroup % 3 );
- std::vector<manualContourModel*> lstManConMod;
- std::vector<manualContourModel*> lstManConModTmp;
- std::vector<manualContourModel*> lstManConModExp;
+ std::vector<manualBaseModel*> lstManConMod;
+ std::vector<manualBaseModel*> lstManConModTmp;
+ std::vector<manualBaseModel*> lstManConModExp;
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
return _viewThresholdImagePanel;
}
+//CMRU 17-08-09-----------------------------------------------------------------------------------------------
+int wxContourMainFrame::getType ()
+{
+ int tipo = 0;
+ std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
+
+ if(!currentSelection.empty())
+ {
+ std::string cloneName = currentSelection [0];
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);
+ tipo = manualModel-> GetTypeModel();
+ return tipo;
+ }
+}
+double wxContourMainFrame::getContourSizeInPixels()
+{
+ double contourSize = 0;
+
+ std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects(); if(!currentSelection.empty())
+ if(!currentSelection.empty())
+ {
+ std::string cloneName = currentSelection [0];
+
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);//_modelManager->getOutlineByKeyName( cloneName )->getModel();
+ contourSize = manualModel-> GetPathSize();
+ }
+ return contourSize;
+}
+manualBaseModel * wxContourMainFrame::getContour ()
+{
+ std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
+
+ if(!currentSelection.empty())
+ {
+ std::string cloneName = currentSelection [0];
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);//_modelManager->getOutlineByKeyName( cloneName )->getModel();
+ return manualModel;
+ }
+ return NULL;
+}
+void wxContourMainFrame::onPrintLabel (wxString label, manualBaseModel* manualModel)
+{
+ std::string labelAscii(label.ToAscii());
+ int pos = labelAscii.find(" ");
+ int j;
+
+ for (j=0 ; pos != string::npos;j++)
+ {
+ labelAscii.replace( pos, 1, "_" );
+ pos= labelAscii.find(" ");
+ }
+ manualModel -> SetLabel(labelAscii);
+}
+void wxContourMainFrame::onInsertCalculation(manualBaseModel* manualModel)
+{
+ double sizeInPixel = manualModel ->GetPathSize();
+ double onePixelRealSize = interfMainPanel::getInstance()->GetPixelValue();;
+ double realContourSize = sizeInPixel*onePixelRealSize;
+ manualModel ->SetRealSize(realContourSize);
+}
+double wxContourMainFrame::onePixelSize( double value)
+{
+ return _onePixelSize = value;
+}
+std::string wxContourMainFrame::GetFileLocation()
+{
+ return _fileLocation;
+}
+void wxContourMainFrame::SetFileLocation(std::string newFileLocation)
+{
+ _fileLocation = newFileLocation;
+ std::cout<<"GETFILELOCATION:"<<_fileLocation<<std::endl;
+}
+//------------------------------------------------------------------------------------------------------------
\ No newline at end of file
static wxContourMainFrame* getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, std::string datadir="C:/Creatis/creaContoursBin/RelWithDebInfo/");
static wxContourMainFrame* getInstance();
static void resetInstance();
+
//------------------------------------------------------------------------------------------------------------
// Other functional methods
//------------------------------------------------------------------------------------------------------------
void onCreateContourRectangle( );
void onCreateContourCircle( );
void onCreateContourLine( );
+ void onCreateContourPoints( );
void onCreateContourBullEye(wxPanel* pan);
/////////////////////////////////
void onDeleteContour();
void onLoad();
void onSave();
- void openContours( FILE *pFile, int version, bool staticContour );
+ void openContours( FILE *pFile, FILE *pFileData, int version, bool staticContour );
void RefreshInterface();
std::vector<std::string> getOutlinesName(int slide);
+ //
+ //
+ // @param typeContourGroup - int The operation id (AND,OR,XOR,ALL=3)
+ //
void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax);
void onSaveResults(std::string directory,std::string namefile, std::string filename,
void SetContourGroup(int contourGroup);
wxPanel *getThresholdImageViewPanel(wxWindow *parent);
+
+//CMRU 17-08-09-----------------------------------------------------------------------------------------------
+
+ /**
+ * Associates the String parameter with the contour
+ * @param label Label entered by the user
+ * @param manualBaseModel Currently selected contour
+ */
+ void onPrintLabel (wxString label, manualBaseModel* manualModel);
+
+ /**
+ * Calculates the size of the contour received as a parameter. Uses the measure of a pixel in millimeters.
+ * @param manualBaseModel Currently selected contour
+ */
+ void onInsertCalculation(manualBaseModel* manualModel);
+
+ /**
+ * Assigns and returns the value of a pixel in millimeters
+ @ param value Measure of the pixel in millimeters
+ */
+ double onePixelSize(double value);
+
+ /**
+ * Returns the type of the currently selected contour
+ */
+ int getType();
+
+ /**
+ * Returns the size in pixels of the currently selected contour
+ */
+ double getContourSizeInPixels();
+
+ /**
+ * Returns the currently selected contour. If no contour is selected returns NULL
+ */
+ manualBaseModel* getContour();
+
+ /**
+ * Returns the Path of the data persistence file
+ */
+ std::string GetFileLocation();
+
+ /**
+ * Assign a new path to the data persistence file
+ @ param newFileLocation New path of the file
+ */
+ void SetFileLocation(std::string newFileLocation);
+//------------------------------------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------------------------------------
private:
//------------------------------------------------------------------------------------------------------------
//manualContourModel * factoryManualContourModel(int typeContour);
- manualContourModel * factoryManualContourModel(wxPanel* panel);
+ manualBaseModel * factoryManualContourModel(wxPanel* panel);
ContourExtractData *_contourextractdata;
static char COPY;
+//CMRU 17-08-09-----------------------------------------------------------------------------------------------
+ wxWindow *infoWin2;
+ wxPanel *calibrationPanel;
+ wxPanel *calibrationPanelError;
+ double _onePixelSize;
+ std::string _imageLocation;
+ std::string _fileLocation;
+//------------------------------------------------------------------------------------------------------------
+
};
#endif
return _sceneManager->GetImageData();
}
- void wxContourViewPanel::configureViewControlTo(std::string theName,manualContourModel* manModelContour,double* spc,int typeofcontour){
+ void wxContourViewPanel::configureViewControlTo(std::string theName,manualBaseModel* manModelContour,double* spc,int typeofcontour){
_sceneManager->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
}
void wxContourViewPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)getWxVtkBaseView();
vtkImageViewer2 *imageviewer = wxvtk2dbaseview->_imageViewer2XYZ->GetVtkImageViewer2();
- imageviewer->SetColorWindow(colorwindow);
- imageviewer->SetColorLevel(windowlevel);
+ //AMP//imageviewer->SetColorWindow(colorwindow);
+ //AMP//imageviewer->SetColorLevel(windowlevel);
}
void wxContourViewPanel::onInterpolation(bool interpolate){
vtkImageData* getImageData();
- void configureViewControlTo(std::string theName,manualContourModel* manModelContour,double* spc,int typeofcontour);
+ void configureViewControlTo(std::string theName,manualBaseModel* manModelContour,double* spc,int typeofcontour);
int GetImageDataSizeZ();
int value = _lastConceptUpdated->getActualValue();
int min = _lastConceptUpdated->getMinValue();
int max = _lastConceptUpdated->getMaxValue();
- int delta = (int) (pow((double) 2,(double) _resolutionSlider->GetValue() ));
-
+ int delta = (int) (pow( 2, _resolutionSlider->GetValue() ));
int minTmp = value - delta/2;
int maxTmp = value + delta/2;
if (minTmp<min)
int value = theConceptToUpdate->getActualValue();
int min = theConceptToUpdate->getMinValue();
int max = theConceptToUpdate->getMaxValue();
- int delta = (int) (pow( (double)2, (double)_resolutionSlider->GetValue() ));
+ int delta = (int) (pow( 2, _resolutionSlider->GetValue() ));
int minTmp = value - delta/2;
int maxTmp = value + delta/2;
if (minTmp<min)
return _wxVtk_BaseView;
}
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: configureViewControlTo( std::string theKeyName, manualContourModel * manModelContour, double * spc,int typeContour)
+ void wxVtkBaseView_SceneManager :: configureViewControlTo( std::string theKeyName, manualBaseModel * manModelContour, double * spc,int typeContour)
{
//setControlActiveStateOfALL( false );
_creatingROI = true;
manualViewBaseContour *manViewerContour;
// Creating the view manualViewContour and the manualContourControler
+ // NOTE: The model is created in the KernelManagerContour class, factoryManualContourModel method
if (typeContour==1)
{
manContourControl = new manualContourControler();
manContourControl = new manualLineControler();
manViewerContour = new manualViewLine();
}
+ if (typeContour==7)
+ {
+ manContourControl = new manualContourControler();
+ manViewerContour = new manualViewPoints();
+ }
// Other functional methods
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: createCopyContourOf( std::string anExistingKName, std::string cloneName, manualContourModel * manualModel, bool append )
+ void wxVtkBaseView_SceneManager :: createCopyContourOf( std::string anExistingKName, std::string cloneName, manualBaseModel * manualModel, bool append )
{
if ( !append )
{
iter = _contours_ViewControl->find( anExistingKName );
- manualContourModel *cModule = manualModel;
+ manualBaseModel *cModule = manualModel;
manualViewBaseContour *cViewer = iter->second->getViewer()->Clone();
manualContourBaseControler *cControl = iter->second->getControler()->Clone( );
if (currentSelection.size()>=1){
manualContourBaseControler *cControler = this->getControlerOf( currentSelection[0] );
- manualContourModel *cModel = cControler->GetManualContourModel();
+ manualBaseModel *cModel = cControler->GetManualContourModel();
int i,size = cModel->GetNumberOfPointsSpline();
double x,y,z;
for (i=0; i<size; i++)
#include "manualViewBullEye.h"
#include "manualViewCircle.h"
#include "manualViewLine.h"
+#include "manualViewPoints.h"
#include "manualViewRoi.h"
#include <wx/event.h>
void setWxVtkViewBase( wxVtkBaseView * theBaseView );
void setWxEventHandler( wxEvtHandler * theEventHandler );
wxVtkBaseView * getWxVtkViewBase();
- void configureViewControlTo( std::string theKeyName, manualContourModel * manContourControl, double * spc ,int typeContour);
+
+ //
+ // Method which creates and associates view and controller to the contour model type pointed in parameter.
+ // The possible contour types are:
+ // 0-spline
+ // 1-spline
+ // 2-rectangle
+ // 3-circle
+ // 4-BullEye
+ // 5-BullEyeSector
+ // 6-Line
+ // 7-Points
+ // NOTE: The model is created in the KernelManagerContour class, factoryManualContourModel method
+ // @param typeContour - int
+ // @param theKeyName - string
+ // @param manContourControl - manualBaseModel
+ // @param spc - double* 3-pos Array
+ void configureViewControlTo( std::string theKeyName, manualBaseModel * manContourControl, double * spc ,int typeContour);
+
void configureSelectionROI( double * spc );
ContourWrap_ViewControl * insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour * manViewerContour );
void desconfigureViewControlOf( std::string theKeyName );
// Other functional methods
//------------------------------------------------------------------------------------------------------------
- void createCopyContourOf( std::string anExistingKName, std::string cloneName, manualContourModel * manualModel, bool append = false );
+ void createCopyContourOf( std::string anExistingKName, std::string cloneName, manualBaseModel * manualModel, bool append = false );
void removeFromScene( ContourWrap_ViewControl * contourWRP, bool visualization = true, bool control = true );
void removeFromScene( std::string theKeyName, bool visualization = true, bool control = true );
void removeSceneContours( );
bool _drawingSelectionROI;
manualRoiControler *_controlerSelectionROI;
manualViewRoi *_viewerSelectionROI;
- manualContourModel *_modelSelectionROI;
+ manualBaseModel *_modelSelectionROI;
double _widthOfContour;
bool _ctrlKey;
/*
* Creates a ContourThing
*/
- ContourThing :: ContourThing(manualContourModel * model)
+ ContourThing :: ContourThing(manualBaseModel * model)
{
setModel( model );
}
outlineName = aName;
}
- manualContourModel * ContourThing ::getModel()
+ manualBaseModel * ContourThing ::getModel()
{
return theModel;
}
- void ContourThing :: setModel(manualContourModel * model)
+ void ContourThing :: setModel(manualBaseModel * model)
{
theModel = model;
}
/*
* Creates a ContourThing
*/
- ContourThing(manualContourModel * model);
+ ContourThing(manualBaseModel * model);
/*
* Destroys a ContourThing
void setName(std::string aName);
- manualContourModel * getModel();
+ manualBaseModel * getModel();
- void setModel(manualContourModel * model);
+ void setModel(manualBaseModel * model);
/*
* Executes the given command if posible and returns is posible or not
std::string outlineName;
- manualContourModel * theModel;
+ manualBaseModel * theModel;
};
#endif
return modelManager;
}
-std::string KernelManagerContour::createOutline(manualContourModel * manModelContour,std::vector<int> instantVector){
+std::string KernelManagerContour::createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector){
return modelManager->createOutline( manModelContour, instantVector );
}
return modelManager->GetLstNameThingsStatic();
}
-void KernelManagerContour::SaveThingName(FILE* pFile, std::string name ){
- modelManager->SaveThingName(pFile, name);
+void KernelManagerContour::SaveThingName(FILE* pFile, FILE *pFileData, std::string name ){
+ modelManager->SaveThingName(pFile, pFileData, name);
}
std::vector<std::string> KernelManagerContour::GetLstNameThings(){
return modelManager->GetLstNameThings();
}
void KernelManagerContour::deleteCModel(std::string theKeyName){
- manualContourModel* cModel = modelManager->getOutlineByKeyName(theKeyName)->getModel();
+ manualBaseModel* cModel = modelManager->getOutlineByKeyName(theKeyName)->getModel();
modelManager->removeOutline( theKeyName );
delete cModel;
{
return modelManager->createCopyContourOf(anExistingKName, instantNoTouchData);
}
-manualContourModel* KernelManagerContour::getOutlineByKeyName(std::string cloneName){
+manualBaseModel* KernelManagerContour::getOutlineByKeyName(std::string cloneName){
return modelManager->getOutlineByKeyName (cloneName )->getModel();
}
_contourPropagation->CalculeSplinePropagation();
}
-manualContourModel* KernelManagerContour::GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector){
+manualBaseModel* KernelManagerContour::GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector){
bool addedModel = false;
- manualContourModel* manModelContour=NULL;
+ manualBaseModel* manModelContour=NULL;
if (_contourPropagation->ifSliceKeyContourExist(z)==false){
return manModelContour;
}
-manualContourModel * KernelManagerContour::factoryManualContourModel(int typeContour)
+manualBaseModel * KernelManagerContour::factoryManualContourModel(int typeContour)
{
- manualContourModel *manModelContour=NULL;
+ manualBaseModel *manModelContour=NULL;
+
+ // Creating the model
+ // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
// spline
if (typeContour==0)
{
manModelContour = new manualContourModelLine();
}
+
+ // points
+ if (typeContour==7)
+ {
+ manModelContour = new manualBaseModel();
+ }
return manModelContour;
}
return modelManager->getOutlinesAtInstant(instant);
}
-std::vector<manualContourModel*> KernelManagerContour::ExploseEachModel( std::vector<manualContourModel*> lstManConMod ){
- std::vector<manualContourModel*> lstTmp;
- std::vector<manualContourModel*> lstResult;
+std::vector<manualBaseModel*> KernelManagerContour::ExploseEachModel( std::vector<manualBaseModel*> lstManConMod ){
+ std::vector<manualBaseModel*> lstTmp;
+ std::vector<manualBaseModel*> lstResult;
int j,jSize;
int i,iSize=lstManConMod.size();
for (i=0;i<iSize;i++)
** This methods connect the event in the class interfNewContourMenu with the world of the appli
**/
- std::string createOutline(manualContourModel * manModelContour,std::vector<int> instantVector);
+ std::string createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector);
/////////////////////////////////
std::string intToString(int num);
std::vector<std::string> GetLstNameThingsStatic();
- void SaveThingName(FILE* pFile, std::string name );
+ void SaveThingName(FILE* pFile, FILE *pFileData, std::string name );
std::vector<std::string> GetLstNameThings();
Instant * getCurrentInstant();
- manualContourModel* getOutlineByKeyName(std::string cloneName);
+ manualBaseModel* getOutlineByKeyName(std::string cloneName);
bool onRedo(std::string& filename);
void getMaxMinZ(double *minZ,double *maxZ);
- manualContourModel* GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector);
-
- manualContourModel* factoryManualContourModel(int typeContour);
+ manualBaseModel* GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector);
+
+ //
+ // Method which creates the model associated with the type in parameter. The possible contour types are:
+ // 0-spline
+ // 1-spline
+ // 2-rectangle
+ // 3-circle
+ // 4-BullEye
+ // 5-BullEyeSector
+ // 6-Line
+ // 7-Points
+ // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
+ // @param typeContour - int
+ // @return manualBaseModel - Model created based on the type
+ manualBaseModel* factoryManualContourModel(int typeContour);
void CalculeSplinePropagation();
std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
- std::vector<manualContourModel*> ExploseEachModel( std::vector<manualContourModel*> lstManConMod );
+ std::vector<manualBaseModel*> ExploseEachModel( std::vector<manualBaseModel*> lstManConMod );
void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
* @return Returns the key name of the created outline, or ""if it wasn't created
*/
// bool OutlineModelManager :: createOutline(std::string aName, ContourThing * &theOutline)
- std::string OutlineModelManager :: createOutline(manualContourModel * model, std::vector<int> theInstantData, std::string aName)
+ std::string OutlineModelManager :: createOutline(manualBaseModel * model, std::vector<int> theInstantData, std::string aName)
{
ContourThing * theOutline = new ContourThing ( model );
theOutline->setName(aName);
std::string OutlineModelManager :: createCopyContourOf( std::string anExistingKName, std::vector<int> &instantNoTouchData )
{
- manualContourModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
+ manualBaseModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
return createOutline( manModelContour, instantNoTouchData );
}
- void OutlineModelManager::SaveThingName( FILE *pFile, std::string nameThing )
+ void OutlineModelManager::SaveThingName( FILE *pFile, FILE *pFileData, std::string nameThing )
{
std::vector< Instant * > *lstInstants;
lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
fprintf(pFile,"\n");
ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
contourthing->getModel()->Save(pFile);
+ contourthing->getModel()->SaveData(pFileData);
}
* @return Returns the key name of the created outline, or ""if it wasn't created
*/
//bool createOutline(std::string aName, ContourThing * &theOutline);
- std::string createOutline(manualContourModel * model, std::vector<int> theInstantData, std::string aName = "" );
+ std::string createOutline(manualBaseModel * model, std::vector<int> theInstantData, std::string aName = "" );
/*
* Creates an axeThing with a given name
void removeAllOutlines();
std::string createCopyContourOf( std::string anExistingKName, std::vector<int> &instantNoTouchData );
- void SaveThingName( FILE *pFile, std::string nameThing );
+ void SaveThingName( FILE *pFile, FILE *pFileData, std::string nameThing );
void ChangeContourOfList(std::string keyName, Instant *instant);
int IsPartOfStaticList(std::string ss);