Commit 7dbc432b authored by Sylvain Thery's avatar Sylvain Thery

histogram are back

parent 4b50f19b
cmake_minimum_required(VERSION 2.6)
project(testing_algo_booleanOperator)
add_executable( test_algo_booleanOperator
algo_booleanOperator.cpp
mergeVertices.cpp
)
target_link_libraries( test_algo_booleanOperator
${CGoGN_LIBS} ${CGoGN_EXT_LIBS})
#include <iostream>
extern int test_mergeVertices();
int main()
{
test_mergeVertices();
return 0;
}
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __ALGO_BOOLEANOPERATOR_VERTICES_H__
#define __ALGO_BOOLEANOPERATOR_VERTICES_H__
#include "Geometry/basic.h"
#include "Geometry/inclusion.h"
#include "Geometry/orientation.h"
namespace CGoGN
{
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
namespace Algo
{
namespace Surface
{
#include "Algo/BooleanOperator/mergeVertices.h"
using namespace CGoGN;
namespace BooleanOperator
struct PFP1 : public PFP_STANDARD
{
typedef EmbeddedMap2 MAP;
};
template <typename PFP>
bool isBetween(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& positions, Dart d, Dart e, Dart f) ;
template bool Algo::Surface::BooleanOperator::isBetween<PFP1>(PFP1::MAP& map, const VertexAttribute<PFP1::VEC3, PFP1::MAP>& positions, Dart d, Dart e, Dart f);
template void Algo::Surface::BooleanOperator::mergeVertex<PFP1>(PFP1::MAP& map, VertexAttribute<PFP1::VEC3, PFP1::MAP>& positions, Dart d, Dart e);
template void Algo::Surface::BooleanOperator::mergeVertices<PFP1>(PFP1::MAP& map, VertexAttribute<PFP1::VEC3, PFP1::MAP>& positions);
template <typename PFP>
void mergeVertex(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& positions, Dart d, Dart e);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PFP>
void mergeVertices(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& positions);
struct PFP2 : public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
template bool Algo::Surface::BooleanOperator::isBetween<PFP2>(PFP2::MAP& map, const VertexAttribute<PFP2::VEC3, PFP2::MAP>& positions, Dart d, Dart e, Dart f);
template void Algo::Surface::BooleanOperator::mergeVertex<PFP2>(PFP2::MAP& map, VertexAttribute<PFP2::VEC3, PFP2::MAP>& positions, Dart d, Dart e);
template void Algo::Surface::BooleanOperator::mergeVertices<PFP2>(PFP2::MAP& map, VertexAttribute<PFP2::VEC3, PFP2::MAP>& positions);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
struct PFP3 : public PFP_STANDARD
{
typedef EmbeddedGMap2 MAP;
};
}
template bool Algo::Surface::BooleanOperator::isBetween<PFP3>(PFP3::MAP& map, const VertexAttribute<PFP3::VEC3, PFP3::MAP>& positions, Dart d, Dart e, Dart f);
template void Algo::Surface::BooleanOperator::mergeVertex<PFP3>(PFP3::MAP& map, VertexAttribute<PFP3::VEC3, PFP3::MAP>& positions, Dart d, Dart e);
template void Algo::Surface::BooleanOperator::mergeVertices<PFP3>(PFP3::MAP& map, VertexAttribute<PFP3::VEC3, PFP3::MAP>& positions);
}
#include "mergeVertices.hpp"
int test_mergeVertices()
{
#endif
return 0;
}
\ No newline at end of file
......@@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 2.6)
project(testing_algo)
#add_subdirectory(BooleanOperator)
add_subdirectory(BooleanOperator)
add_subdirectory(Decimation)
add_subdirectory(Export)
add_subdirectory(Filtering)
add_subdirectory(Geometry)
#add_subdirectory(Histogram)
add_subdirectory(Histogram)
#add_subdirectory(ImplicitHierarchicalMesh)
add_subdirectory(Import)
add_subdirectory(LinearSolving)
......
cmake_minimum_required(VERSION 2.6)
project(testing_algo_histogram)
add_executable( test_algo_histogram
algo_histogram.cpp
histogram.cpp
)
target_link_libraries( test_algo_histogram
${CGoGN_LIBS} ${CGoGN_EXT_LIBS})
#include <iostream>
extern int test_histogram();
int main()
{
test_histogram();
return 0;
}
This diff is collapsed.
///*******************************************************************************
//* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
//* version 0.1 *
//* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
//* *
//* This library is free software; you can redistribute it and/or modify it *
//* under the terms of the GNU Lesser General Public License as published by the *
//* Free Software Foundation; either version 2.1 of the License, or (at your *
//* option) any later version. *
//* *
//* This library is distributed in the hope that it will be useful, but WITHOUT *
//* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
//* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
//* for more details. *
//* *
//* You should have received a copy of the GNU Lesser General Public License *
//* along with this library; if not, write to the Free Software Foundation, *
//* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
//* *
//* Web site: http://cgogn.unistra.fr/ *
//* Contact information: cgogn@unistra.fr *
//* *
//*******************************************************************************/
//
//#ifndef __QT_HISTO_DRAW__
//#define __QT_HISTO_DRAW__
//
//
//#include <QWidget>
//#include <QPainter>
//#include <QMouseEvent>
//
//#include "Utils/Qt/qtpopup.h"
//#include "Algo/Histogram/histogram.h"
//
//#ifdef WIN32
//#if defined CGoGN_QT_DLL_EXPORT
//#define CGoGN_UTILS_API __declspec(dllexport)
//#else
//#define CGoGN_UTILS_API __declspec(dllimport)
//#endif
//#endif
//
//namespace CGoGN
//{
//
//namespace Utils
//{
//
//namespace QT
//{
//
//
//class CGoGN_UTILS_API RenderHistogram : public QWidget
//{
// Q_OBJECT
//
// static const int m_frameWidth = 10;
//
//
// const Algo::Histogram::Histogram& m_histo;
// std::vector<Geom::Vec3f> m_qcolors;
//
// unsigned int m_max;
// int m_h;
// int m_w;
// unsigned int m_l;
//
// std::vector<int> m_vals_ax_left;
//
// int m_axl_nbd;
// bool m_drawHisto;
// bool m_drawQuantiles;
// bool m_histoFront;
// float m_opacity;
// bool m_drawAxis;
//
// /// draw all in painter
// void draw(QPainter& painter);
//
// /// compute left axis value
// void axeVals();
//
//public:
//
// static const unsigned int NONE = 0xffffffff;
//
// /**
// * constructor
// * @param parent parent widget
// * @param histo histogram to draw
// */
// RenderHistogram(QWidget* parent, Algo::Histogram::Histogram& histo, bool drawAxis=true );
//
// /// minimum size
// virtual QSize minimumSizeHint() const;
//
// /// size at launch
// virtual QSize sizeHint() const;
//
// /**
// * set color table for quantiles drawing
// * @param colors vector of colors
// */
// void setQuantilesColors(const std::vector<Geom::Vec3f>& colors);
//
// /***
// * svg export
// * @param filename file name of svg file
// */
// void svgExport(const std::string& filename);
//
// /**
// * set histo position (front or back)
// * @param hf if true histo is in front of the quantille
// */
// void setHistoPosition(bool hf);
//
// /**
// * define if histogram is drawn
// */
// void setHistoDraw(bool d);
//
// /**
// * define if quantille is drawn
// */
// void setQuantilesDraw(bool d);
//
// /**
// * get bool value that indicate drawing of histogram
// */
// bool getHistoDraw();
//
// /**
// * get bool value that indicate drawing of quantille
// */
// bool getQuantilesDraw();
//
// /**
// * get opacity value
// */
// float getOpacity();
//
// /**
// * define the opacity if the two graphs are drawn
// */
// void setOpacity(float op);
//
// /**
// * update drawing
// */
// void update();
//
// signals:
// /**
// * emitted signal when a column of histogram is clicked
// * @param i column of histo (NONE if none)
// * @param j column of quantileq (NONE if none)
// */
// void clicked(unsigned int, unsigned int);
//
//
//
//protected:
//
// /// draw the histogram in painter widget
// void drawHisto(QPainter& painter);
//
// /// draw the quatilles in painter widget
// void drawQuantiles(QPainter& painter);
//
// /// functinn calles when widget need to be redraw
// void paintEvent(QPaintEvent *event);
//
// /// draw the histogram in painter widget
// void mousePressEvent(QMouseEvent* event);
//
//};
//
//}
//}
//}
//
//
//#endif
......@@ -42,10 +42,10 @@ IF (CGoGN_WITH_QT)
target_link_libraries( tuto_orbits
${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
# qt_wrap_cpp(tuto_histo_moc tuto_histo.h)
# add_executable( tuto_histo tuto_histo.cpp tuto_histo.h ${tuto_histo_ui} ${tuto_histo_moc})
# target_link_libraries( tuto_histo
# ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
qt_wrap_cpp(tuto_histo_moc tuto_histo.h)
add_executable( tuto_histo tuto_histo.cpp tuto_histo.h ${tuto_histo_ui} ${tuto_histo_moc})
target_link_libraries( tuto_histo
${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
# qt_wrap_cpp(tp_master_moc tp_master.h)
......
......@@ -118,7 +118,7 @@ void MyQT::createMap(const std::string& filename)
l_popup = new Utils::QT::QtPopUp(this);
// create the widget to view histogram
l_histodraw = new Utils::QT::RenderHistogram(l_popup, *l_histo);
l_histodraw = new Algo::Histogram::RenderHistogram(l_popup, *l_histo);
// some simple parameters
l_histodraw->setQuantilesDraw(true);
......@@ -274,7 +274,7 @@ void MyQT::clickHisto(unsigned int i,unsigned int j)
{
std::cout << "CLICK on column Histo: " << i << " / Quantiles: " << j <<std::endl;
if (i != Utils::QT::RenderHistogram::NONE)
if (i != Algo::Histogram::RenderHistogram::NONE)
{
std::vector<unsigned int > vc;
l_histo->cellsOfHistogramColumn(i,vc);
......@@ -287,7 +287,7 @@ void MyQT::clickHisto(unsigned int i,unsigned int j)
std::cout << l_histo->markCellsOfHistogramColumn(i,cm) << " marked cells" << std::endl;
}
if (j != Utils::QT::RenderHistogram::NONE)
if (j != Algo::Histogram::RenderHistogram::NONE)
{
std::vector<unsigned int > vc;
l_histo->cellsOfHistogramColumn(j,vc);
......
......@@ -38,7 +38,8 @@
#include "Utils/vbo.h"
#include "Algo/Histogram/histogram.h"
#include "Utils/Qt/qthistodraw.h"
#include "Algo/Histogram/qthistodraw.h"
#include "Utils/Qt/qtpopup.h"
using namespace CGoGN ;
......@@ -120,7 +121,7 @@ protected:
ColMap* l_cm;
Algo::Histogram::Histogram* l_histo;
Utils::QT::QtPopUp* l_popup;
Utils::QT::RenderHistogram* l_histodraw;
Algo::Histogram::RenderHistogram* l_histodraw;
unsigned int l_nbc;
unsigned int l_nbq;
......
......@@ -32,6 +32,11 @@ file(
${CGoGN_SRC_DIR}/include/Algo/*.h
)
IF(CGoGN_WITH_QT)
qt_wrap_cpp(ALGO_QT_HEADERS_MOC ${CGoGN_SRC_DIR}/include/Algo/Histogram/qthistodraw.h)
SET (files_algo_withQt ${files_algo} ${ALGO_QT_HEADERS_MOC})
ENDIF()
file(
GLOB
shaders_src
......@@ -108,7 +113,7 @@ file( GLOB_RECURSE
IF (CGoGN_ONELIB)
IF(CGoGN_WITH_QT)
add_definitions(-DCGoGN_QT_DLL_EXPORT)
add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils_withQt})
add_library( cgogn ${files_topology} ${files_container} ${files_algo_withQt} ${files_utils_withQt})
qt_use_modules(cgogn Gui OpenGL Xml Svg)
ELSE()
add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils} )
......@@ -132,7 +137,13 @@ ELSE()
add_library( topology ${files_topology})
target_link_libraries(topology container)
add_library( algo ${files_algo})
IF (CGoGN_WITH_QT)
add_definitions(-DCGoGN_QT_DLL_EXPORT)
add_library( algo ${files_algo_withQt} )
qt_use_modules(algo Gui OpenGL Xml Svg)
ELSE()
add_library( algo ${files_algo} )
ENDIF()
target_link_libraries(algo utils topology)
......
......@@ -157,7 +157,7 @@ inline unsigned int Histogram::whichQuantille(double val) const
template<typename ATTC>
void Histogram::histoColorize(ATTC& colors)
{
unsigned int nb = m_dataIdx.size();
unsigned int nb = uint32(m_dataIdx.size());
for (unsigned int i = 0; i<nb; ++i)
{
unsigned int j = idx(i);
......@@ -171,8 +171,8 @@ template<typename ATTC>
void Histogram::quantilesColorize(ATTC& colors, const std::vector<Geom::Vec3f>& tc)
{
unsigned int nb = m_dataIdx.size();
unsigned int nbi = m_interv.size()-1;
unsigned int nb = uint32(m_dataIdx.size());
unsigned int nbi = uint32(m_interv.size() - 1);
assert(tc.size() >= nbi);
......@@ -239,7 +239,7 @@ unsigned int Histogram::markCellsOfQuantilesColumn(unsigned int c, CELLMARKER& c
double bi = m_interv[c];
double bs = m_interv[c+1];
unsigned int nb=m_dataIdx.size();
unsigned int nb = uint32(m_dataIdx.size());
unsigned int i=0;
while ((i<nb) && (data(i)< bi))
......
This diff is collapsed.
......@@ -59,7 +59,7 @@ class CGoGN_UTILS_API QtPopUp : public QDialog
{
Q_OBJECT
Utils::QT::SimpleQT * m_cbs;
//Utils::QT::SimpleQT * m_cbs;
QGridLayout* m_layout;
......@@ -69,7 +69,7 @@ public:
* create an empty popup
* @param withButtons add OK/CANCEL to the popup (exec launch blocking popup & return 1/0)
*/
QtPopUp(Utils::QT::SimpleQT* sqt=NULL, bool withButtons=false);
QtPopUp(/*Utils::QT::SimpleQT* sqt=NULL,*/ bool withButtons=false);
/**
*
......
This diff is collapsed.
......@@ -36,7 +36,7 @@ namespace QT
ColorsChooser::ColorsChooser(SimpleQT *interf):
QtPopUp(NULL,false),m_interf(interf),m_current(0)
QtPopUp(false),m_interf(interf),m_current(0)
{
m_list = new QListWidget();
m_diag = new QColorDialog();
......
......@@ -35,8 +35,8 @@ namespace QT
{
QtPopUp::QtPopUp(SimpleQT* sqt, bool withButtons):
m_cbs(sqt)
QtPopUp::QtPopUp(/*SimpleQT* sqt,*/ bool withButtons)/*:
m_cbs(sqt)*/
{
if (withButtons)
{
......@@ -82,8 +82,8 @@ void QtPopUp::keyPressEvent ( QKeyEvent * event )
if ( (k >= 65) && (k <= 91) && !(event->modifiers() & Qt::ShiftModifier) )
k += 32;
if (m_cbs)
m_cbs->cb_keyPress(k);
//if (m_cbs)
// m_cbs->cb_keyPress(k);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment