ongoing. TODO fix the update of impostors after commit

This commit is contained in:
Fabio Ganovelli ganovelli 2010-08-22 19:21:53 +00:00
parent 2c247ba083
commit 2f2cb6cabb
8 changed files with 27 additions and 101 deletions

View File

@ -29,7 +29,7 @@ $Log: meshedit.cpp,v $
#include <math.h>
#include <stdlib.h>
#include <meshlab/glarea.h>
#include <meshlab/mainwindow.h>
//#include <meshlab/mainwindow.h>
#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;

View File

@ -33,7 +33,7 @@
/* OCME include */
#include <ocme/ocme.h>
#include <vcglib/wrap/gui/trackball.h>
#include <wrap/gui/trackball.h>
class OcmeEditPlugin : public QObject, public MeshEditInterface
{

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -101,7 +101,7 @@ void OCME::FillSamples(std::vector<CellKey> & 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();

View File

@ -225,8 +225,7 @@ void OCME::Render(){
RAssert(MemDbg::CheckHeap(1));
vcg::Color4b c;
vcg::GlTrimesh<vcgMesh> glw;
std::list<Cell*>::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<vcg::GLW::DMPoints,vcg::GLW::CMPerVert,vcg::GLW::TMNone>();
if(vcg::tri::HasPerVertexColor(cells_to_render[i]->rd->Mesh()))
default_renderer.Draw<vcg::GLW::DMPoints,vcg::GLW::CMPerVert,vcg::GLW::TMNone>();
else
default_renderer.Draw<vcg::GLW::DMPoints,vcg::GLW::CMLast,vcg::GLW::TMNone>();
default_renderer.Draw<vcg::GLW::DMPoints,vcg::GLW::CMLast,vcg::GLW::TMNone>();
cells_to_render[i]->rd->renderCacheToken->unlock();
}

View File

@ -4,7 +4,6 @@
#include <vector>
#include "std_util.h"
#ifdef WIN32
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>