diff --git a/.gitattributes b/.gitattributes index 0269365de2f..98ee61e1e7d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4170,12 +4170,16 @@ Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.rc -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.reg -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_3.cpp -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_3.h -text +Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.cpp -text +Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.h -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizView_3.cpp -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizView_3.h -text +Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_border_points_dt2.h -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc71.sln -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc71.vcproj -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc80.sln -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc80.vcproj -text +Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vertex_segment_2.h -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/MainFrm.cpp -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/MainFrm.h -text Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/data/Isidor_50.pwc -text diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.cpp b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.cpp index 4de98d37a94..b0ee6a93bbf 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.cpp +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.cpp @@ -6,6 +6,8 @@ #include "MainFrm.h" #include "ChildFrm.h" +#include "GyrovizDoc_4.h" +#include "GyrovizView_4.h" #include "GyrovizDoc_3.h" #include "GyrovizView_3.h" #include "GyrovizDoc_2.h" @@ -64,15 +66,15 @@ BOOL CGyrovizApp::InitInstance() // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views - CMultiDocTemplate* pDocTemplate; - pDocTemplate = new CMultiDocTemplate(IDR_GyrovizTYPE_3, + CMultiDocTemplate* pDocTemplate3; + pDocTemplate3 = new CMultiDocTemplate(IDR_GyrovizTYPE_3, RUNTIME_CLASS(CGyrovizDoc_3), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CGyrovizView_3)); - if (!pDocTemplate) + if (!pDocTemplate3) return FALSE; - AddDocTemplate(pDocTemplate); - // + AddDocTemplate(pDocTemplate3); + // CMultiDocTemplate* pDocTemplate2; pDocTemplate2 = new CMultiDocTemplate(IDR_GyrovizTYPE_2, RUNTIME_CLASS(CGyrovizDoc_2), @@ -81,6 +83,15 @@ BOOL CGyrovizApp::InitInstance() if (!pDocTemplate2) return FALSE; AddDocTemplate(pDocTemplate2); + // + CMultiDocTemplate* pDocTemplate4; + pDocTemplate4 = new CMultiDocTemplate(IDR_GyrovizTYPE_4, + RUNTIME_CLASS(CGyrovizDoc_4), + RUNTIME_CLASS(CChildFrame), // custom MDI child frame + RUNTIME_CLASS(CGyrovizView_4)); + if (!pDocTemplate4) + return FALSE; + AddDocTemplate(pDocTemplate4); // create main MDI Frame window CMainFrame* pMainFrame = new CMainFrame; diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.rc b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.rc index 98485bf14b4..4a72a0fd2b2 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.rc +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz.rc @@ -205,6 +205,62 @@ BEGIN END END +IDR_GyrovizTYPE_4 MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN + MENUITEM "&Close", ID_FILE_CLOSE + MENUITEM "Save input point set &as...\tCtrl+S", ID_FILE_SAVE_AS + MENUITEM "Save reconstructed surface as...", ID_FILE_SAVE_SURFACE + MENUITEM SEPARATOR + MENUITEM "Recent File", ID_FILE_MRU_FILE1 + MENUITEM SEPARATOR + MENUITEM "E&xit", ID_APP_EXIT + END + POPUP "&Edit" + BEGIN + MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO + MENUITEM SEPARATOR + MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY + MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE + MENUITEM SEPARATOR + MENUITEM "Options...\tO", ID_EDIT_OPTIONS + END + MENUITEM "&Algorithms", ID_ALGORITHMS + POPUP "&Render" + BEGIN + MENUITEM "Vertices\tG", ID_RENDER_POINTS + MENUITEM "Border Vertices\tB", ID_RENDER_BORDERVERTICES32845 + MENUITEM "Edges\tD", ID_RENDER_DELAUNAYEDGES + MENUITEM "Triangles\tT", ID_RENDER_TRIANGLES + MENUITEM "Rays\tR", ID_RENDERCOFF_RAYS + MENUITEM "Inside Tetrahedrons\tI", ID_RENDERCOFF_INSIDE + MENUITEM SEPARATOR + POPUP "Arcball" + BEGIN + MENUITEM "Reset", ID_ARCBALL_RESET + MENUITEM "View sphere", ID_RENDER_ARCBALL + END + END + POPUP "&View" + BEGIN + MENUITEM "&Toolbar", ID_VIEW_TOOLBAR + MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR + END + POPUP "&Window" + BEGIN + MENUITEM "&New Window", ID_WINDOW_NEW + MENUITEM "&Cascade", ID_WINDOW_CASCADE + MENUITEM "&Tile", ID_WINDOW_TILE_HORZ + END + POPUP "&Help" + BEGIN + MENUITEM "&About Gyroviz...", ID_APP_ABOUT + END +END + ///////////////////////////////////////////////////////////////////////////// // @@ -217,7 +273,7 @@ BEGIN VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT "X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT - "O", ID_EDIT_OPTIONS, VIRTKEY, NOINVERT + "O", ID_EDIT_OPTIONS, VIRTKEY, ALT, NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT @@ -231,6 +287,7 @@ BEGIN "M", ID_RECONSTRUCTION_SURFACEMESHING, VIRTKEY, NOINVERT "A", ID_RENDER_ARCBALL, VIRTKEY, CONTROL, NOINVERT "B", ID_RENDER_BORDERVERTICES, VIRTKEY, NOINVERT + "C", ID_RENDER_CONSTRAINTS, VIRTKEY, ALT, NOINVERT "C", ID_RENDER_CONTOUR, VIRTKEY, NOINVERT "D", ID_RENDER_DELAUNAYEDGES, VIRTKEY, NOINVERT "F", ID_RENDER_FILTERED, VIRTKEY, NOINVERT @@ -246,7 +303,7 @@ BEGIN VK_OEM_MINUS, ID_RENDER_ZOOMOUT, VIRTKEY, NOINVERT "I", ID_RENDERCOFF_INSIDE, VIRTKEY, NOINVERT "R", ID_RENDERCOFF_RAYS, VIRTKEY, NOINVERT - "C", ID_RENDER_CONSTRAINTS, VIRTKEY, ALT, NOINVERT + "O", ID_RENDER_ORIGINALIMAGE, VIRTKEY, NOINVERT END @@ -339,6 +396,7 @@ BEGIN IDS_MESSAGE2 "------------------------" IDS_MESSAGE3 "---------------------" IDR_GyrovizTYPE_2 "\nGyroviz\nGyroviz\nImage Files (*.ppm)\n.ppm\nGyroviz.Document\nGyroviz.Document" + IDR_GyrovizTYPE_4 "\nGyroviz\nGyroviz\nImage Sequences (*.bmp)\n.bmp\nGyroviz.Document\nGyroviz.Document" END STRINGTABLE @@ -496,6 +554,17 @@ BEGIN EDITTEXT IDC_EDIT_POINT_SIZE,96,28,30,12,ES_AUTOHSCROLL END +IDD_DIALOG_OPTIONS_4 DIALOGEX 0, 0, 242, 110 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Options" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,171,77,50,14 + PUSHBUTTON "Annuler",IDCANCEL,117,77,50,14 + LTEXT "OpenGL Point Size",IDC_STATIC,24,29,52,8 + EDITTEXT IDC_EDIT_POINT_SIZE,96,28,30,12,ES_AUTOHSCROLL +END + ///////////////////////////////////////////////////////////////////////////// // @@ -520,6 +589,14 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 103 END + + IDD_DIALOG_OPTIONS_4, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 235 + TOPMARGIN, 7 + BOTTOMMARGIN, 103 + END END #endif // APSTUDIO_INVOKED diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_2.cpp b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_2.cpp index 84b3b97d162..003b982a131 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_2.cpp +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_2.cpp @@ -168,7 +168,7 @@ BOOL CGyrovizDoc_2::OnOpenDocument(LPCTSTR lpszPathName) m_cimg_filt_image = gauss3(m_cimg_gray_image); m_filtered_image = cimg_image_multiplexer_char(m_cimg_filt_image); - m_cimg_seg_image = grad_freiChen(m_cimg_filt_image,30); // Edge detection on filtered image + m_cimg_seg_image = grad_freiChen(m_cimg_filt_image,15); // Edge detection on filtered image def : 30 m_segmented_image = cimg_image_multiplexer_char(m_cimg_seg_image); } else @@ -214,7 +214,7 @@ BOOL CGyrovizDoc_2::OnOpenDocument(LPCTSTR lpszPathName) AfxMessageBox("Unable to open file"); return FALSE; } - m_gyroviz_dt.nw_add_constraints(m_cimg_seg_image, 1); + m_gyroviz_dt.nw_add_constraints(m_cimg_seg_image, 5); status_message("Constrained Delaunay triangulation (%lf s)",duration(init)); } diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_3.cpp b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_3.cpp index aaaa154aa9b..f00878f4e0e 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_3.cpp +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_3.cpp @@ -22,10 +22,10 @@ IMPLEMENT_DYNCREATE(CGyrovizDoc_3, CDocument) BEGIN_MESSAGE_MAP(CGyrovizDoc_3, CDocument) ON_COMMAND(ID_EDIT_OPTIONS, OnEditOptions) - ON_COMMAND(ID_FILE_SAVE_SURFACE, OnFileSaveSurface) - ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_SURFACE, OnUpdateFileSaveSurface) - ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs) - ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_AS, OnUpdateFileSaveAs) + ON_COMMAND(ID_FILE_SAVE_SURFACE, OnFileSaveSurface) + ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_SURFACE, OnUpdateFileSaveSurface) + ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs) + ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_AS, OnUpdateFileSaveAs) END_MESSAGE_MAP() @@ -67,13 +67,13 @@ BOOL CGyrovizDoc_3::OnOpenDocument(LPCTSTR lpszPathName) CString extension = lpszPathName; extension = extension.Right(4); extension.MakeLower(); - + // set current path CString path = lpszPathName; path = path.Left(path.ReverseFind('\\')); SetCurrentDirectory(path); - // if .pnt extension + // if .pnt extension if(extension.CompareNoCase(".pnt") == 0) { double init = clock(); @@ -82,13 +82,15 @@ BOOL CGyrovizDoc_3::OnOpenDocument(LPCTSTR lpszPathName) AfxMessageBox("Unable to open file"); return FALSE; } + + //m_gyroviz_dt.nw_add_constraints(m_cimg_seg_image, 1); // for cdt2 status_message("Delaunay triangulation (%lf s)",duration(init)); } - + // if .pwc extension else if (extension.CompareNoCase(".pwc") == 0) { - double init = clock(); + double init = clock(); if(!m_gyroviz_dt3.read_pwc((char *)lpszPathName)) { AfxMessageBox("Unable to open file"); @@ -96,16 +98,16 @@ BOOL CGyrovizDoc_3::OnOpenDocument(LPCTSTR lpszPathName) } status_message("3D Delaunay triangulation (%lf s)",duration(init)); } - - else + + else { AfxMessageBox("File format not supported"); return FALSE; } - update_status(); + update_status(); UpdateAllViews(NULL); - return TRUE; + return TRUE; } // Save input point set as... callback @@ -117,9 +119,9 @@ void CGyrovizDoc_3::OnFileSaveAs() // to avoid jeopardizing the input file. void CGyrovizDoc_3::OnUpdateFileSaveAs(CCmdUI *pCmdUI) { -/* + /* pCmdUI->Enable(!m_gyroviz_solved); -*/ + */ } // Save reconstructed surface as... callback @@ -130,9 +132,9 @@ void CGyrovizDoc_3::OnFileSaveSurface() // Enable "Save reconstructed surface as..." if surface is computed void CGyrovizDoc_3::OnUpdateFileSaveSurface(CCmdUI *pCmdUI) { -/* + /* pCmdUI->Enable(m_surface_mesher_dt.number_of_vertices() > 0); -*/ + */ } // Update the number of vertices and faces in the status bar @@ -144,7 +146,7 @@ void CGyrovizDoc_3::update_status() CStatusBar* pStatus = (CStatusBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow( AFX_IDW_STATUS_BAR); - + if(pStatus != NULL) { CString vertices; @@ -158,7 +160,7 @@ void CGyrovizDoc_3::update_status() pStatus->SetPaneText(2,faces); pStatus->UpdateWindow(); } - } + } } // Set user message in status bar @@ -171,19 +173,19 @@ void CGyrovizDoc_3::status_message(char* fmt,...) CStatusBar* pStatus = (CStatusBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow( AFX_IDW_STATUS_BAR); - + // fill buffer va_list argptr; va_start(argptr,fmt); vsprintf(buffer,fmt,argptr); va_end(argptr); - + if(pStatus != NULL) { pStatus->SetPaneText(0,buffer); pStatus->UpdateWindow(); } - } + } return; } @@ -201,5 +203,5 @@ void CGyrovizDoc_3::OnEditOptions() double CGyrovizDoc_3::duration(const double time_init) { - return (clock() - time_init)/CLOCKS_PER_SEC; + return (clock() - time_init)/CLOCKS_PER_SEC; } diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.cpp b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.cpp new file mode 100644 index 00000000000..c834d50bbd9 --- /dev/null +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.cpp @@ -0,0 +1,237 @@ +// GyrovizDoc_4.cpp : implementation of the CGyrovizDoc_4 class +// + +#include "stdafx.h" +#include "GyrovizDoc_4.h" +#include "MainFrm.h" +#include "DialogOptions_4.h" + +using namespace cimg_library; + +#include "Gyroviz_segmentation2.h" + + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CGyrovizDoc_4 + +IMPLEMENT_DYNCREATE(CGyrovizDoc_4, CDocument) + +BEGIN_MESSAGE_MAP(CGyrovizDoc_4, CDocument) +END_MESSAGE_MAP() + + +// CGyrovizDoc_4 construction/destruction + +CGyrovizDoc_4::CGyrovizDoc_4() +{ +} + +CGyrovizDoc_4::~CGyrovizDoc_4() +{ +} + +BOOL CGyrovizDoc_4::OnNewDocument() +{ + if (!CDocument::OnNewDocument()) + return FALSE; + // TODO: add reinitialization code here + // (SDI documents will reuse this document) + return TRUE; +} + +// CGyrovizDoc_4 serialization + +void CGyrovizDoc_4::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + // TODO: add storing code here + } + else + { + // TODO: add loading code here + } +} + + +// CGyrovizDoc_4 diagnostics + +#ifdef _DEBUG +void CGyrovizDoc_4::AssertValid() const +{ + CDocument::AssertValid(); +} + +void CGyrovizDoc_4::Dump(CDumpContext& dc) const +{ + CDocument::Dump(dc); +} +#endif //_DEBUG + +// CGyrovizDoc_4 commands + + +// Update the number of vertices and faces in the status bar +void CGyrovizDoc_4::update_status() +{ + CWinApp *pApp = AfxGetApp(); + if(pApp->m_pMainWnd != NULL) + { + CStatusBar* pStatus = + (CStatusBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow( + AFX_IDW_STATUS_BAR); + + if(pStatus != NULL) + { + //CString vertices; + //vertices.Format("%d vertices",m_gyroviz_dt.number_of_vertices()); + + //CString faces; + //faces.Format("%d faces",m_gyroviz_dt.number_of_faces()); + + //// Update status bar + //pStatus->SetPaneText(1,vertices); + //pStatus->SetPaneText(2,faces); + //pStatus->UpdateWindow(); + } + } +} + +// User message in status bar +void CGyrovizDoc_4::status_message(char* fmt,...) +{ + CWinApp *pApp = AfxGetApp(); + if(pApp->m_pMainWnd != NULL) + { + char buffer[256]; + CStatusBar* pStatus = + (CStatusBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow( + AFX_IDW_STATUS_BAR); + + // fill buffer + va_list argptr; + va_start(argptr,fmt); + vsprintf(buffer,fmt,argptr); + va_end(argptr); + + if(pStatus != NULL) + { + pStatus->SetPaneText(0,buffer); + pStatus->UpdateWindow(); + } + } + return; +} + + +BOOL CGyrovizDoc_4::OnSaveDocument(LPCTSTR lpszPathName) +{ + // save pslg to a file + //return m_pslg.save((char *)lpszPathName); + return CDocument::OnSaveDocument(lpszPathName); +} + + +BOOL CGyrovizDoc_4::OnOpenDocument(LPCTSTR lpszPathName) +{ + // + // Read bitmap image + // + + if (!CDocument::OnOpenDocument(lpszPathName)) + return FALSE; + + // get extension + CString file = lpszPathName; + CString extension = lpszPathName; + extension = extension.Right(4); + extension.MakeLower(); + + // set current path + // path "c:\path\file.wrl" -> c:\path + CString path = lpszPathName; + path = path.Left(path.ReverseFind('\\')); + SetCurrentDirectory(path); + + if(extension == ".bmp") + {// read bmp format image + m_cimg_interm_image = CImg((char *)lpszPathName); + m_original_image = cimg_image_multiplexer_char(m_cimg_interm_image); + + m_cimg_gray_image = to_grayscale(m_cimg_interm_image); + m_grayscaled_image = cimg_image_multiplexer_char(m_cimg_gray_image); + + m_cimg_filt_image = gauss3(m_cimg_gray_image); + m_filtered_image = cimg_image_multiplexer_char(m_cimg_filt_image); + + m_cimg_seg_image = grad_freiChen(m_cimg_filt_image,15); // Edge detection on filtered image def : 30 + m_segmented_image = cimg_image_multiplexer_char(m_cimg_seg_image); + } + else + { + AfxMessageBox("File format not supported"); + return FALSE; + } + + // + // Read corresponding Voodoo 2D feature file (.pnt) + // + + // file filters + static char szFilter[] = "Voodoo 2D Feature Files (*.pnt)|*.pnt|All Files (*.*)|*.*||"; + + // create the Open dialog + CFileDialog dlgOpen(true, "pnt", NULL, + OFN_DONTADDTORECENT | OFN_FILEMUSTEXIST, szFilter, AfxGetMainWnd()); + + // dialog title + dlgOpen.m_ofn.lpstrTitle = "Select corresponding Voodoo 2D feature file"; + + // show the dialog + if (dlgOpen.DoModal() == IDOK) + { + // get extension + CString file = dlgOpen.m_ofn.lpstrFile; + CString extension = dlgOpen.m_ofn.lpstrFile; + extension = extension.Right(4); + extension.MakeLower(); + + // set current path + CString path = dlgOpen.m_ofn.lpstrFile; + path = path.Left(path.ReverseFind('\\')); + SetCurrentDirectory(path); + + // if .pnt extension + if(extension.CompareNoCase(".pnt") == 0) + { + double init = clock(); + if(!m_gyroviz_dt.read_pnt((char *)dlgOpen.m_ofn.lpstrFile)) + { + AfxMessageBox("Unable to open file"); + return FALSE; + } + m_gyroviz_dt.nw_add_constraints(m_cimg_seg_image, 5); + status_message("Constrained Delaunay triangulation (%lf s)",duration(init)); + + } + else + { + AfxMessageBox("File format not supported"); + return FALSE; + } + } + + update_status(); + UpdateAllViews(NULL); + return TRUE; +} + +double CGyrovizDoc_4::duration(const double time_init) +{ + return (clock() - time_init)/CLOCKS_PER_SEC; +} + diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.h new file mode 100644 index 00000000000..f7900e3bc69 --- /dev/null +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizDoc_4.h @@ -0,0 +1,152 @@ +// GyrovizDoc_4.h : interface of the CGyrovizDoc_4 class +#pragma once + +// STL +#include +#include + +// CGAL +#include "GyrovizKernel.h" +#include + +// CImg +#include +using namespace cimg_library; + +// This demo +//#include "Gyroviz_dt2.h" +#include "Gyroviz_cdt2.h" + +// Gyroviz's Delaunay triangulation 2-3 +//typedef CGAL::Triangulation_vertex_base_with_info_2 Vb; +//typedef CGAL::Triangulation_face_base_2 Fb; +//typedef CGAL::Triangulation_data_structure_2 Tds; +//typedef Gyroviz_dt2 Dt2; +//typedef Dt2::Face_handle Face_handle; +//typedef Dt2::Finite_faces_iterator Finite_faces_iterator; +//typedef Dt2::Finite_edges_iterator Finite_edges_iterator; +//typedef Dt2::Finite_vertices_iterator Finite_vertices_iterator; +typedef CGAL::Triangulation_vertex_base_with_info_2 CVb; +typedef CGAL::Constrained_triangulation_face_base_2 CFb; +typedef CGAL::Triangulation_data_structure_2 CTds; +typedef CGAL::Exact_predicates_tag Itag; +typedef Gyroviz_cdt2 CDt2; + + + + +class CGyrovizDoc_4 : public CDocument +{ +protected: // create from serialization only + CGyrovizDoc_4(); + DECLARE_DYNCREATE(CGyrovizDoc_4) + + // Attributes +public: + + CImg m_cimg_interm_image; + CImg m_cimg_gray_image; + CImg m_cimg_filt_image; + CImg m_cimg_seg_image; + + unsigned char* m_original_image; + unsigned char* m_grayscaled_image; + unsigned char* m_filtered_image; + unsigned char* m_segmented_image; + + + // Triangulation + //Dt2 m_gyroviz_dt; // The Gyroviz equation is solved on the vertices of m_gyroviz_dt + CDt2 m_gyroviz_dt; // The Gyroviz equation is solved on the vertices of m_gyroviz_dt + +// Public methods +public: + + // Get triangulation. + //Dt2& get_dt2() + //{ + // return m_gyroviz_dt; + //} + //const Dt2& get_dt2() const + //{ + // return m_gyroviz_dt; + //} + + CDt2& get_cdt2() + { + return m_gyroviz_dt; + } + const CDt2& get_cdt2() const + { + return m_gyroviz_dt; + } + + // Private methods +private: + + // misc status stuff + void update_status(); + void status_message(char* fmt,...); + double duration(const double time_init); + + // Overrides +public: + virtual BOOL OnNewDocument(); + virtual void Serialize(CArchive& ar); + + // Implementation +public: + virtual ~CGyrovizDoc_4(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + + // Generated message map functions +protected: + DECLARE_MESSAGE_MAP() +public: + virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); + virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); + + + //unsigned char* cimg_image_multiplexer_char(const CImg & image) + //{ + // int ix,iy,i=0; + + // unsigned char* result = new unsigned char[image.dimx()*image.dimy()*3]; + + // for(iy=image.dimy() - 1; iy >= 0; --iy) + // { + // for(ix=0; ix < image.dimx(); ++ix) + // { + // result[i++] = *(image.ptr() + image.dimx()*iy + ix); + // result[i++] = *(image.ptr() + image.dimx()*iy + ix + image.dimx()*image.dimy()); + // result[i++] = *(image.ptr() + image.dimx()*iy + ix + image.dimx()*image.dimy()*2); + // } + // } + // return result; + //} + unsigned char* cimg_image_multiplexer_char(const CImg & image) + { + int ix,iy,i=0; + + unsigned char* result = new unsigned char[image.dimx()*image.dimy()*3]; + + for(iy=0; iy < image.dimy(); ++iy) + { + for(ix=0; ix < image.dimx(); ++ix) + { + result[i++] = *(image.ptr() + image.dimx()*iy + ix); + result[i++] = *(image.ptr() + image.dimx()*iy + ix + image.dimx()*image.dimy()); + result[i++] = *(image.ptr() + image.dimx()*iy + ix + image.dimx()*image.dimy()*2); + } + } + return result; + } + +}; + + diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizView_2.cpp b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizView_2.cpp index d4dbf39cca7..31389ac2e18 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizView_2.cpp +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/GyrovizView_2.cpp @@ -437,7 +437,7 @@ void CGyrovizView_2::OnPaint() { //::glColor3ub(255,0,0); /*pDoc->get_dt2().gl_draw_on_border_2D_vertices(255,0,0,4,pDoc->m_cimg_seg_image);*/ - pDoc->get_cdt2().gl_draw_on_border_2D_vertices(255,0,255,4,pDoc->m_cimg_seg_image); + pDoc->get_cdt2().gl_draw_on_border_2D_vertices(255,0,255,6/*TEST,pDoc->m_cimg_seg_image*/); } if(m_view_constraints) diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_border_points_dt2.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_border_points_dt2.h new file mode 100644 index 00000000000..90ff65503bd --- /dev/null +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_border_points_dt2.h @@ -0,0 +1,77 @@ +// Author : Nader Salman + +#ifndef _Gyroviz_border_points_dt2_ +#define _Gyroviz_border_points_dt2_ + +#include +#include +#include +#include + +#include + +template < class Gt, class Tds > +class Gyroviz_border_points_dt2 : public CGAL::Delaunay_triangulation_2 +{ + // Private types +private: + + typedef CGAL::Delaunay_triangulation_2 Base; + + // Public types +public: + + // Repeat Delaunay_triangulation_2 public types + typedef Tds Triangulation_data_structure; + typedef Gt Geom_traits; + typedef typename Geom_traits::FT FT; + typedef typename Geom_traits::Point_2 Point_2; + typedef typename Geom_traits::Segment_2 Segment_2; + typedef typename Base::Face_handle Face_handle; + typedef typename Base::Vertex_handle Vertex_handle; + typedef typename Base::Edge Edge; + typedef typename Base::Finite_edges_iterator Finite_edges_iterator; + typedef typename Base::Finite_faces_iterator Finite_faces_iterator; + typedef typename Base::Finite_vertices_iterator Finite_vertices_iterator; + + // Data members +private: + std::vector input; + + // Public methods +public: + + + // Constructors + Gyroviz_border_points_dt2(){} + Gyroviz_border_points_dt2(std::vector in) + { + for(int i=0; iinsert(in[i]->point()); + } + } + + + // Functions + + // this function will store as a vector of Gyroviz_vertex_segment_2 + // the entire 2D Delaunay triangulation + std::vector segments_out_of_dt2() + { + std::vector result; + + Finite_edges_iterator fe = this->finite_edges_begin(); + for(; fe != this->finite_edges_end(); ++fe) + { + Segment_2 curr_segment(fe->first->vertex(ccw(fe->second))->point(), + fe->first->vertex(cw(fe->second))->point()); + result.push_back(curr_segment); + } + + return result; + } + +}; + +#endif // _Gyroviz_border_points_dt2_ diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_cdt2.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_cdt2.h index 95749549d24..9f51538a45c 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_cdt2.h +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_cdt2.h @@ -19,6 +19,8 @@ #include #include "Gyroviz_info_for_cdt2.h" +#include "Gyroviz_vertex_segment_2.h" +#include "Gyroviz_border_points_dt2.h" #include #include @@ -60,6 +62,7 @@ public: typedef typename Base::Finite_edges_iterator Finite_edges_iterator; typedef typename Base::Finite_faces_iterator Finite_faces_iterator; typedef typename Base::Finite_vertices_iterator Finite_vertices_iterator; + typedef typename Gyroviz_vertex_segment_2 Gyroviz_vertex_segment_2; // Data members private: @@ -80,6 +83,11 @@ public: bool read_pnt(char *pFilename) { + + //DEBUG + int number_of_vertices_pnt = 0; + + //extract from pFilename the image number std::string temp ( pFilename ); std::string filename_without_path = temp.substr(temp.size()-15); std::string extract_number = filename_without_path.substr(7,filename_without_path.size()-4); @@ -113,6 +121,7 @@ public: Vertex_handle vh = this->insert(point_2); vh->info() = Gyroviz_info_for_cdt2(point_3,image_number,false); + number_of_vertices_pnt++; } } } @@ -122,21 +131,25 @@ public: } - // flag the vertices positionned on the border and return a vector of these - std::vector set_on_border_2D_vertices(const CImg & image) + // set flag to true for the vertices positionned on the border and return a vector of these + std::vector set_on_border_2D_vertices(const CImg & image) { - std::vector vector_of_border_points; + + //DEBUG + int number_of_border_vertices = 0; + + std::vector vector_of_border_points; + Finite_vertices_iterator fv = this->finite_vertices_begin(); for(; fv != this->finite_vertices_end(); ++fv) { // if pixel any of 3x3 surrounding pixels is on border // keep vertex(white color is used in frei-chen gradient operator) - if (image((unsigned int)fv->point().x(),(unsigned int)fv->point().y(),0,0)==255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } else if((unsigned int)fv->point().x() == 0 && (unsigned int)fv->point().y() == 0) //upper left pixel @@ -146,7 +159,7 @@ public: image((unsigned int)fv->point().x()+1,(unsigned int)fv->point().y()+1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -157,7 +170,7 @@ public: image((unsigned int)fv->point().x()-1,(unsigned int)fv->point().y()+1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -168,7 +181,7 @@ public: image((unsigned int)fv->point().x()+1,(unsigned int)fv->point().y()-1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -180,7 +193,7 @@ public: image((unsigned int)fv->point().x()-1,(unsigned int)fv->point().y()-1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -193,7 +206,7 @@ public: image((unsigned int)fv->point().x()+1,(unsigned int)fv->point().y()+1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -206,7 +219,7 @@ public: image((unsigned int)fv->point().x()+1,(unsigned int)fv->point().y(),0,0) == 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -219,7 +232,7 @@ public: image((unsigned int)fv->point().x(), (unsigned int)fv->point().y()+1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -232,7 +245,7 @@ public: image((unsigned int)fv->point().x(), (unsigned int)fv->point().y()+1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } @@ -248,10 +261,13 @@ public: image((unsigned int)fv->point().x()+1,(unsigned int)fv->point().y()+1,0,0)== 255) { fv->info().set_flag(true); - vector_of_border_points.push_back(fv->point()); + vector_of_border_points.push_back(fv); } } } + + number_of_border_vertices = vector_of_border_points.size(); + return vector_of_border_points; } @@ -273,21 +289,26 @@ public: } - // this function will draw segments between all border points - std::vector link_points_on_border(std::vector vector_of_border_points) + // (DEPRECATED)this function will draw segments between all border points + std::vector link_points_on_border(const std::vector& vector_of_border_points) { - std::vector vector_of_segments; + //DEBUG + int number_of_segments = 0; + + std::vector vector_of_vertex_segments; - for(int i = 0; i nw_add_constraints(const CImg & image, int gap_score) { - std::vector vector_of_border_points = set_on_border_2D_vertices(image); - std::vector vector_of_segments = link_points_on_border(vector_of_border_points); + std::vector vector_of_border_points = set_on_border_2D_vertices(image); + + Gyroviz_border_points_dt2 border_dt2(vector_of_border_points); + + std::vector vector_of_segments = border_dt2.segments_out_of_dt2(); + + //std::vector vector_of_vertex_segments = link_points_on_border(vector_of_border_points); + + //DEBUG + int vector_of_border_points_size = vector_of_border_points.size(); + int vector_of_segments_size = vector_of_segments.size(); + + int BEFORE_constraints_number_of_vertices=0; + + + for(Finite_vertices_iterator fv = this->finite_vertices_begin(); fv != this->finite_vertices_end(); ++fv) + { + BEFORE_constraints_number_of_vertices++; + } + Point_2 source_vertex; Point_2 end_vertex; @@ -314,44 +353,67 @@ public: std::vector vector_of_constraints; double length_curr_segment = 0; - int global_score = 0;// no constraint + int global_score = -1;// no constraint // the similarity matrix i will use is // S(Border/Segment) = +1 // S(Gap/Segment) = gap_score (default : -2) - for(int i = 0; ipoint(); + //end_vertex = vector_of_vertex_segments[i].get_target()->point(); + //Segment_2 s (source_vertex, end_vertex); + + source_vertex = vector_of_segments[i].source(); + end_vertex = vector_of_segments[i].target(); Segment_2 s = vector_of_segments[i]; - source_vertex = s.source(); - end_vertex = s.target(); v = end_vertex - source_vertex; + length_curr_segment = (int)ceil(sqrt(s.squared_length())); int current_gap_score = gap_score; for(int j = 0; j= 0) { - this->insert_constraint(source_vertex,end_vertex); + + this->insert_constraint(source_vertex,end_vertex/*vector_of_vertex_segments[i].get_source(),vector_of_vertex_segments[i].get_target()*/); vector_of_constraints.push_back(s); global_score = 0; } else global_score = 0; } + + + // DEBUG + int AFTER_constraints_number_of_vertices=0; + + + for(Finite_vertices_iterator fv = this->finite_vertices_begin(); fv != this->finite_vertices_end(); ++fv) + { + AFTER_constraints_number_of_vertices++; + } + return vector_of_constraints; } @@ -432,6 +494,9 @@ public: void gl_draw_2D_vertices(const unsigned char r, const unsigned char g, const unsigned char b, float size) { + //DEBUG + int number_of_vertices_2v = 0; + ::glPointSize(size); ::glColor3ub(r,g,b); ::glBegin(GL_POINTS); @@ -440,15 +505,22 @@ public: for(; fv != this->finite_vertices_end(); ++fv) { ::glVertex2d(fv->point().x(),fv->point().y()); + + + number_of_vertices_2v++; } + ::glEnd(); } // draw 2D only points near detected borders void gl_draw_on_border_2D_vertices(const unsigned char r, const unsigned char g, - const unsigned char b, float size, const CImg & image) + const unsigned char b, float size/* TEST, const CImg & image*/) { + /* + TEST + ::glPointSize(size); ::glColor3ub(r,g,b); ::glBegin(GL_POINTS); @@ -456,9 +528,30 @@ public: std::vector vector_of_border_points = set_on_border_2D_vertices(image); for(int i=0; ifinite_vertices_begin(); + for(; fv != this->finite_vertices_end(); ++fv) + { + if(fv->info().get_flag()){ + ::glVertex2d(fv->point().x(),fv->point().y()); + + number_of_vertices_b++; + + } + } + ::glEnd(); + } @@ -513,6 +606,7 @@ public: ::glLineWidth(line_width); ::glBegin(GL_LINES); + Finite_edges_iterator fe = this->finite_edges_begin(); for(; fe != this->finite_edges_end(); ++fe) { @@ -534,6 +628,9 @@ public: void gl_draw_soup_vertices(const unsigned char r, const unsigned char g, const unsigned char b, float size) { + //DEBUG + int number_of_vertices_sv = 0; + ::glPointSize(size); ::glColor3ub(r,g,b); ::glBegin(GL_POINTS); @@ -543,34 +640,67 @@ public: { const Point_3& p = fv->info().get_point3(); ::glVertex3d(p.x(),p.y(),p.z()); - } + + number_of_vertices_sv++; + } ::glEnd(); } + // draw 2D only points near detected borders + void gl_draw_on_border_3D_vertices(const unsigned char r, const unsigned char g, + const unsigned char b, float size) + { + //DEBUG + int number_of_vertices_bv = 0; + + ::glPointSize(size); + ::glColor3ub(r,g,b); + ::glBegin(GL_POINTS); + + Finite_vertices_iterator fv = this->finite_vertices_begin(); + for(; fv != this->finite_vertices_end(); ++fv) + { + if(fv->info().get_flag()) + { + ::glVertex3d(fv->info().get_point3().x(),fv->info().get_point3().y(),fv->info().get_point3().z()); + + number_of_vertices_bv++; + + } + } + ::glEnd(); + } + + + // 3D projection of the tracked 2D constrained edges void gl_draw_soup_constrained_edges(const unsigned char r, const unsigned char g, - const unsigned char b, const float width, const CImg & image) + const unsigned char b, const float width/*, const CImg & image*/) { ::glLineWidth(width); ::glColor3ub(r,g,b); ::glBegin(GL_LINES); - std::vector vector_of_constraints = nw_add_constraints(image); - for(int i=0; i vector_of_constraints = nw_add_constraints(image);*/ + Finite_edges_iterator fe = this->finite_edges_begin(); + for(; fe != this->finite_edges_end(); ++fe) { - ::glVertex3d(vector_of_constraints[i].source()->info().get_point3().x(), - vector_of_constraints[i].source()->info().get_point3().y(), - vector_of_constraints[i].source()->info().get_point3().z()); - ::glVertex3d(vector_of_constraints[i].target()->info().get_point3().x(), - vector_of_constraints[i].target()->info().get_point3().y(), - vector_of_constraints[i].target()->info().get_point3().z()); - } - ::glEnd(); + if(fe->first->is_constrained(fe->second)) + { + Point_3 p1 = fe->first->vertex(ccw(fe->second))->info().get_point3(); + Point_3 p2 = fe->first->vertex(cw(fe->second))->info().get_point3(); + ::glVertex3d(p1.x(), p1.y(), p1.z()); + ::glVertex3d(p2.x(), p2.y(), p2.z()); + } + } + + ::glEnd(); } + // 3D projection of the tracked 2D constrained triangulation void gl_draw_soup_constrained_triangles(const unsigned char r, const unsigned char g, const unsigned char b){ diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_info_for_cdt2.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_info_for_cdt2.h index f906cfcd800..4aef791e7a6 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_info_for_cdt2.h +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_info_for_cdt2.h @@ -10,12 +10,12 @@ protected: // 3D Point Point_3 point; - + // Camera number int camera_number; - - // Flag := on border or not - bool flag; + + // Flag := on border or not + bool flag; public: Gyroviz_info_for_cdt2(){} diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_segmentation2.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_segmentation2.h index 6969c7be29d..e8b569fb2ae 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_segmentation2.h +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_segmentation2.h @@ -11,6 +11,9 @@ #include using namespace std; + + +//#define cimg_convert_path "C:\Users\nsalman\Documents\ImageMagick\ImageMagick-6.4.0\VisualMagick\bin\convert" #include using namespace cimg_library; diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc80.vcproj b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc80.vcproj index bf43390d9dd..7533b9cece3 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc80.vcproj +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vc80.vcproj @@ -46,7 +46,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Zm900" Optimization="0" - AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\..\trunk\Principal_component_analysis\include;..\..\..\..\..\trunk\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)";"$(CIMGROOT)"" + AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\..\trunk\Principal_component_analysis\include;..\..\..\..\..\trunk\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)";"$(CIMGROOT)";"$(convert)"" PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_USE_TAUCS;_WIN32_WINNT= 0x0500;CGAL_PROFILE" MinimalRebuild="true" BasicRuntimeChecks="0" @@ -139,7 +139,7 @@ AdditionalOptions="/Zm900" Optimization="2" InlineFunctionExpansion="1" - AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\..\trunk\Principal_component_analysis\include;..\..\..\..\..\trunk\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)";"$(CIMGROOT)"" + AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\..\trunk\Principal_component_analysis\include;..\..\..\..\..\trunk\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)";"$(CIMGROOT)";"$(convert)"" PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_USE_TAUCS;_WIN32_WINNT= 0x0500;CGAL_PROFILE" MinimalRebuild="false" BasicRuntimeChecks="0" @@ -223,6 +223,10 @@ RelativePath=".\DialogOptions_3.cpp" > + + @@ -239,6 +243,10 @@ RelativePath=".\GyrovizDoc_3.cpp" > + + @@ -247,6 +255,10 @@ RelativePath=".\GyrovizView_3.cpp" > + + @@ -297,6 +309,10 @@ RelativePath=".\DialogOptions_3.h" > + + @@ -309,6 +325,10 @@ RelativePath=".\Gyroviz.h" > + + @@ -345,6 +365,10 @@ RelativePath=".\Gyroviz_segmented_dt3.h" > + + @@ -353,6 +377,10 @@ RelativePath=".\GyrovizDoc_3.h" > + + @@ -365,6 +393,10 @@ RelativePath=".\GyrovizView_3.h" > + + diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vertex_segment_2.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vertex_segment_2.h new file mode 100644 index 00000000000..b38e9b2779b --- /dev/null +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/Gyroviz_vertex_segment_2.h @@ -0,0 +1,37 @@ +// Author : Nader Salman + + +// an object used to store a segment_2 as a couple of vertices Source & Target +// will be used to insert constraints in the 2D Delaunay triangulation +// function: ct.insert_constraint ( Vertex_handle va, Vertex_handle vb) +// Inserts the line segment s whose endpoints are the vertices +// va and vb as a constrained edge e. The triangles intersected +// by s are removed and new ones are created. + +#include + +template < class Triangulation > +class Gyroviz_vertex_segment_2 +{ + +protected: + + typedef typename Triangulation::Vertex_handle Vertex_handle; + + // Vertex_handles + Vertex_handle source; + Vertex_handle target; + + +public: + Gyroviz_vertex_segment_2(){} + Gyroviz_vertex_segment_2(Vertex_handle va, Vertex_handle vb):source(va),target(vb){} + + // accessors + const Vertex_handle get_source() const { return source; } + const Vertex_handle get_target() const { return target; } + + // modificators + void set_source(Vertex_handle va) { source=va; } + void set_target(Vertex_handle vb) { target=vb; } +}; \ No newline at end of file diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/Gyroviz_dt2.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/Gyroviz_dt2.h index 31bbd389c98..54542febeaa 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/Gyroviz_dt2.h +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/Gyroviz_dt2.h @@ -119,8 +119,7 @@ public: Point_3 point_3(x,y,z); Vertex_handle vh = this->insert(point_2); - - vh->info() = Gyroviz_info_for_dt2(point_3,image_number); + vh->info() = Gyroviz_info_for_dt2(point_3,image_number); } } } diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/arcball.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/arcball.h index c336487ee1c..c4c727d2710 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/arcball.h +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/include/arcball.h @@ -1,3 +1,4 @@ +#pragma once #include "Director.h" class Arcball diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/resource.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/resource.h index b1e52e2522b..8a2c231f015 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/resource.h +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/gyroviz/resource.h @@ -12,6 +12,8 @@ #define IDD_DIALOG_OPTIONS_3 134 #define IDR_GyrovizTYPE_2 135 #define IDD_DIALOG_OPTIONS2 136 +#define IDR_GyrovizTYPE_4 137 +#define IDD_DIALOG_OPTIONS_4 138 #define IDC_EDIT_SM_ANGLE 1000 #define IDC_EDIT_SM_RADIUS 1001 #define IDC_EDIT_SM_DISTANCE 1002 @@ -60,13 +62,14 @@ #define ID_RENDERCOFF_INSIDE 32840 #define ID_RENDERCOFF_CAMERAS 32841 #define ID_RENDER_CONSTRAINTS 32842 +#define ID_RENDER_BORDERVERTICES32845 32845 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 137 -#define _APS_NEXT_COMMAND_VALUE 32843 +#define _APS_NEXT_RESOURCE_VALUE 139 +#define _APS_NEXT_COMMAND_VALUE 32847 #define _APS_NEXT_CONTROL_VALUE 1007 #define _APS_NEXT_SYMED_VALUE 101 #endif