diff --git a/src/meshlabplugins/edit_ocme/edit_ocme.cpp b/src/meshlabplugins/edit_ocme/edit_ocme.cpp index 1509c9cd4..cc63fe7cc 100755 --- a/src/meshlabplugins/edit_ocme/edit_ocme.cpp +++ b/src/meshlabplugins/edit_ocme/edit_ocme.cpp @@ -29,7 +29,7 @@ $Log: meshedit.cpp,v $ #include #include #include -#include +//#include #include "edit_ocme.h" #include "ui_ocme.h" @@ -40,7 +40,7 @@ using namespace std; using namespace vcg; -#define _RELEASED_ +//#define _RELEASED_ OcmeEditPlugin::OcmeEditPlugin() { showTouched = false; @@ -304,9 +304,9 @@ bool OcmeEditPlugin::StartEdit(MeshModel &/*m*/, GLArea *_gla ) QObject::connect(odw->addFromDiskPushButton ,SIGNAL(clicked() ),this,SLOT( addFromDisk() )); - QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), gla, SLOT(updateGL())); - timer->start(300); +// QTimer *timer = new QTimer(this); +// connect(timer, SIGNAL(timeout()), gla, SLOT(updateGL())); +// timer->start(300); // store current trackball curr_track.track.sca = gla->trackball.track.sca; diff --git a/src/meshlabplugins/edit_ocme/edit_ocme.h b/src/meshlabplugins/edit_ocme/edit_ocme.h index 1e13377c3..0f7656710 100755 --- a/src/meshlabplugins/edit_ocme/edit_ocme.h +++ b/src/meshlabplugins/edit_ocme/edit_ocme.h @@ -33,7 +33,7 @@ /* OCME include */ #include -#include +#include class OcmeEditPlugin : public QObject, public MeshEditInterface { diff --git a/src/meshlabplugins/edit_ocme/edit_ocme.pro b/src/meshlabplugins/edit_ocme/edit_ocme.pro index 0b79982bb..776c95f2b 100755 --- a/src/meshlabplugins/edit_ocme/edit_ocme.pro +++ b/src/meshlabplugins/edit_ocme/edit_ocme.pro @@ -1,70 +1,13 @@ # this is the common include for all the plugins -TEMPLATE = lib -CONFIG += plugin -CONFIG += debug +include (../../shared.pri) + + QT += opengl QT += xml -VCGDIR = ../../../../vcglib -GLEWDIR = ../../../../meshlab/src/external/glew-1.5.1 -mac:LIBS += ../../../../meshlab/src/common/libcommon.dylib -# correct qmake syntax requires CONFIG(option, list of options) -win32-msvc2005:LIBS += ../../../../meshlab/src/distrib/common.lib -win32-msvc2008:LIBS += ../../../../meshlab/src/distrib/common.lib -win32-g++:LIBS += -L../../../../meshlab/src/distrib \ - -lcommon - -# CONFIG(debug, debug|release) { -# win32-msvc2005: LIBS += ../../common/debug/common.lib -# win32-msvc2008: LIBS += ../../common/debug/common.lib -# win32-g++: LIBS += -L../../common/debug -lcommon -# } -win32-msvc2005:DEFINES += GLEW_STATIC -win32-msvc2008:DEFINES += GLEW_STATIC - -# uncomment to try Eigen -# DEFINES += VCG_USE_EIGEN -# CONFIG += warn_off -INCLUDEPATH *= ../../../../ \ - $$VCGDIR \ - $$GLEWDIR/include \ - ../../../../meshlab/src \ - ../ \ -win32:INCLUDEPATH += ../../../../code/lib/Berkeleydb_4.8.26/include -DEPENDPATH += $$VCGDIR - -# Uncomment these if you want to experiment with newer gcc compilers -# (here using the one provided with macports) -# macx-g++:QMAKE_CXX=g++-mp-4.3 -# macx-g++:QMAKE_CXXFLAGS_RELEASE -= -Os -# macx-g++:QMAKE_CXXFLAGS_RELEASE += -O3 -macx:QMAKE_CXX = g++-4.2 - -# #macx:QMAKE_POST_LINK ="install_name_tool -change libcommon.1.dylib @executable_path/libcommon.1.dylib ../../meshlab/plugins/lib$${TARGET}.dylib" -# the following line is needed to avoid mismatch between -# the awful min/max macros of windows and the limits max -win32:DEFINES += NOMINMAX - -# the following line is to hide the hundred of warnings about the deprecated -# old printf are all around the code -win32-msvc2005:DEFINES += _CRT_SECURE_NO_DEPRECATE -win32-msvc2008:DEFINES += _CRT_SECURE_NO_DEPRECATE -# CONFIG(release,debug | release): - -# Uncomment the following line to disable assert in mingw -# DEFINES += NDEBUG -DESTDIR = ../../../../meshlab/src/distrib/plugins - -# uncomment in you local copy only in emergency cases. -# We should never be too permissive -# win32-g++:QMAKE_CXXFLAGS += -fpermissive -contains(TEMPLATE,lib):CONFIG(debug, debug|release) { - unix:TARGET = $$member(TARGET, 0)_DEBUG - else:TARGET = $$member(TARGET, 0)d -} -HEADERS = edit_ocme_factory.h \ - ui_ocme.h \ - edit_ocme.h \ +HEADERS = edit_ocme_factory.h \ + ui_ocme.h \ + edit_ocme.h \ ./src/ocme/vcg_mesh.h \ ./src/ocme/type_traits.h \ ./src/ocme/stdmatrix3.h \ @@ -88,13 +31,12 @@ HEADERS = edit_ocme_factory.h \ ./src/ocme/cell.h \ ./src/ocme/boolvector.h \ ../src/utils/name_access_function_bounds.h + SOURCES = edit_ocme_factory.cpp \ edit_ocme.cpp \ # ../../../../meshlab/src/meshlab/glarea.cpp \ ../../../../vcglib/wrap/gui/trackmode.cpp \ ../../../../vcglib/wrap/gui/trackball.cpp # ../../../../vcglib/wrap/gui/rubberband.cpp \ -# ../../../../vcglib/wrap/gui/coordinateframe.cpp \ -# ../../../../vcglib/wrap/gui/activecoordinateframe.cpp TARGET = edit_ocme QT += opengl RESOURCES = edit_ocme.qrc \ @@ -105,18 +47,11 @@ FORMS += ocme.ui # Lib headers INCLUDEPATH += ./src/ocme/ INCLUDEPATH += . -INCLUDEPATH += ./berkeleydb \ - . \ - ../utils/ \ - ./src/ \ - ./src/ooc_vector/ \ - ./src/ooc_vector/berkeleydb \ - /usr/local/BerkeleyDB.4.7/include \ - ../../../../vcglib/ \ - /usr/include/qt4/Qt -win32:INCLUDEPATH += ../../../../code/lib +INCLUDEPATH += . \ + ../utils/ \ + ./src/ \ + ./src/ooc_vector/ \ -# Lib sources SOURCES += ./src/ocme/ocme.cpp \ ./src/ocme/ocme_render.cpp \ ./src/ocme/ocme_impostor.cpp \ @@ -140,15 +75,9 @@ HEADERS += ./src/ocme/ocme_definition.h \ ./src/ocme/ocme_add.h \ ./src/ocme/ocme.h \ ./src/ocme/ocme_commit.h \ - ../utils/release_assert.h \ + ../utils/release_assert.h \ ./src/ocme/FBool.h \ ./src/ocme/berkeleydb/ooc_chunks_berkeleydb.hpp -#LIBS += -L/usr/local/BerkeleyDB.4.7/lib \ -# -ldb \ -# -ldb_cxx-4.7 - -# #DEFINES += GLEW_STATIC -# DEFINES += _RELEASE_ASSERT_ DEFINES += NO_BERKELEY -DEFINES += _DEBUG + diff --git a/src/meshlabplugins/edit_ocme/src/ocme/ocme_add.h b/src/meshlabplugins/edit_ocme/src/ocme/ocme_add.h index df29dc19d..17d49cd7e 100755 --- a/src/meshlabplugins/edit_ocme/src/ocme/ocme_add.h +++ b/src/meshlabplugins/edit_ocme/src/ocme/ocme_add.h @@ -181,6 +181,7 @@ void OCME::AddMesh( MeshType & m, AttributeMapper attr_map){ if(!c->generic_bool()) { // if it is the first occurrence of the cell UpdateCellsAttributes(c,attr_map); // make sure it contains all the attributes c->generic_bool = FBool(&generic_bool); + c->generic_bool = true; } unsigned int f_pos = c->AddFace(OFace(vIndex[0],vIndex[1],vIndex[2])); // assing the face to the cell diff --git a/src/meshlabplugins/edit_ocme/src/ocme/ocme_extract.h b/src/meshlabplugins/edit_ocme/src/ocme/ocme_extract.h index f384804ee..aaf4c1ca5 100755 --- a/src/meshlabplugins/edit_ocme/src/ocme/ocme_extract.h +++ b/src/meshlabplugins/edit_ocme/src/ocme/ocme_extract.h @@ -34,8 +34,6 @@ void OCME::ExtractContainedFacesFromASingleCell( CellKey ck , MeshType & m, bool Cell* c = GetCell(ck,false); sprintf(lgn->Buf(),"start adding vertices clock(): %d ", clock()); - if(ck==CellKey(-2,-4,15,1)) - ck =CellKey(-2,-4,15,1); if(loadall){ c->face->LoadAll(); c->vert->LoadAll(); diff --git a/src/meshlabplugins/edit_ocme/src/ocme/ocme_impostor.cpp b/src/meshlabplugins/edit_ocme/src/ocme/ocme_impostor.cpp index c30e0e832..e2f656a59 100755 --- a/src/meshlabplugins/edit_ocme/src/ocme/ocme_impostor.cpp +++ b/src/meshlabplugins/edit_ocme/src/ocme/ocme_impostor.cpp @@ -101,7 +101,7 @@ void OCME::FillSamples(std::vector & cs){ // *** we should have an ad hoc function FillSamplesFromASingleCell // *** TO DO. - this->ExtractContainedFacesFromASingleCell(cs[i],tmp,true,false); + this->ExtractContainedFacesFromASingleCell(cs[i],tmp,true,true); /* clear the data that will be recomputed */ c->impostor->ClearDataCumulate(); diff --git a/src/meshlabplugins/edit_ocme/src/ocme/ocme_render.cpp b/src/meshlabplugins/edit_ocme/src/ocme/ocme_render.cpp index 9f60eac7a..f8905f720 100755 --- a/src/meshlabplugins/edit_ocme/src/ocme/ocme_render.cpp +++ b/src/meshlabplugins/edit_ocme/src/ocme/ocme_render.cpp @@ -225,8 +225,7 @@ void OCME::Render(){ RAssert(MemDbg::CheckHeap(1)); vcg::Color4b c; - vcg::GlTrimesh glw; - std::list::iterator ori; + /* increase mark */ ++to_render_fbool; @@ -261,8 +260,8 @@ void OCME::Render(){ RAssert(MemDbg::CheckHeap(1)); ::RemoveDuplicates(cells_to_render); for(unsigned int i = 0; i < cells_to_render.size(); ++i) - if(!cells_to_render[i]->generic_bool()) { // generic_bool() == the cell is taken in editing - if(cells_to_render[i]->rd->renderCacheToken && cells_to_render[i]->rd->renderCacheToken->lock() ) + if(!cells_to_render[i]->generic_bool()) { // generic_bool() == the cell is taken in editing + if(cells_to_render[i]->rd->renderCacheToken && cells_to_render[i]->rd->renderCacheToken->lock() ) { //c = c.Scatter ( 32,COff(cells_to_render[i]->key.h) ); c = vcg::Color4b::Gray; @@ -271,10 +270,10 @@ void OCME::Render(){ default_renderer.m = &cells_to_render[i]->rd->Mesh(); - if(vcg::tri::HasPerVertexColor(cells_to_render[i]->rd->Mesh())) - default_renderer.Draw(); + if(vcg::tri::HasPerVertexColor(cells_to_render[i]->rd->Mesh())) + default_renderer.Draw(); else - default_renderer.Draw(); + default_renderer.Draw(); cells_to_render[i]->rd->renderCacheToken->unlock(); } diff --git a/src/meshlabplugins/edit_ocme/src/utils/memory_debug.h b/src/meshlabplugins/edit_ocme/src/utils/memory_debug.h index 479d7f842..d9475a64f 100755 --- a/src/meshlabplugins/edit_ocme/src/utils/memory_debug.h +++ b/src/meshlabplugins/edit_ocme/src/utils/memory_debug.h @@ -4,7 +4,6 @@ #include #include "std_util.h" - #ifdef WIN32 #define _CRTDBG_MAP_ALLOC #include