+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnSaveCollections(wxCommandEvent &event)
+{
+ //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+ #if wxMAJOR_VERSION <= 2
+ wxFileDialog* FD = new wxFileDialog( 0,
+ _T("Save groups of points .."),
+ _T(""),
+ _T(""),
+ _T("(*.xls)|*.xls"),
+ wxSAVE | wxOVERWRITE_PROMPT,
+ wxDefaultPosition);
+ #else
+ wxFileDialog* FD = new wxFileDialog( 0,
+ _T("Save groups of points .."),
+ _T(""),
+ _T(""),
+ _T("(*.xls)|*.xls"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
+ wxDefaultPosition);
+ #endif
+
+ int result_FD = FD->ShowModal();
+ // This line is need it by windows //EED
+ FD->SetReturnCode( result_FD );
+ if (FD->GetReturnCode()==wxID_OK)
+ {
+ std::string filename= (const char*) ( FD->GetPath().mb_str() );
+
+ FILE *ff;
+ ff = fopen( filename.c_str() , "w+" );
+ if (ff!=NULL)
+ {
+ int i,size=lstModelShowNPoints.size();
+ fprintf(ff,"NumberOfGroups %d \n",size);
+
+ for (i=0;i<size;i++)
+ {
+ lstModelShowNPoints[i]->SavePoints_(ff);
+ } // for i
+
+ fclose(ff);
+ } else { // else ff
+ printf("WidgetShowNPoints::Save Groups Points ...Error... creating file \n");
+ } //ff
+
+
+ } // dialog box
+
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnLoadCollections(wxCommandEvent &event)
+{
+ //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+ #if wxMAJOR_VERSION <= 2
+ wxFileDialog* FD = new wxFileDialog( 0,
+ _T("Load groups of points .."),
+ _T(""),
+ _T(""),
+ _T("(*.xls)|*.xls"),
+ wxOPEN | wxFILE_MUST_EXIST,
+ wxDefaultPosition);
+ #else
+ wxFileDialog* FD = new wxFileDialog( 0,
+ _T("Load groups of points .."),
+ _T(""),
+ _T(""),
+ _T("(*.xls)|*.xls"),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST,
+ wxDefaultPosition);
+ #endif
+ int i;
+ //EED
+ int result_FD = FD->ShowModal();
+ // This line is need it by windows //EED
+ FD->SetReturnCode( result_FD );
+ if (FD->GetReturnCode()==wxID_OK)
+ {
+
+ FILE *ff = fopen( filename.c_str() , "r+" );
+ if (ff!=NULL)
+ {
+ int iGroup,sizeGroups;
+ int iPoint,numberPointsRead
+ char chartmp[256];
+ fscanf(ff," %s %d",chartmp,&sizeGroups);
+
+ /// InsertCollection();
+
+ for (iGroup=0;i<sizeGroups;i++)
+ {
+ int numberPointsRead= lstModelShowNPoints?????????[i]->ReadPoints_(ff);
+ for (i=0;i<numberPointsRead;i++)
+ {
+ // EED 2022-05-19
+ //AddVtkPoint();
+ GetViewShowNPoints?????()->AddVtkPoint();
+ }// for
+ } // for i
+
+ fclose(ff);
+ } else { // else ff
+ printf("WidgetShowNPoints::Load Group of Points ...Error... reading file");
+ } //ff
+
+ RefreshCollectionText();
+ RefreshColourCollection();
+
+ } // dialog box
+
+///
+
+}