summaryrefslogtreecommitdiff
path: root/src/GudhUI/utils
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-01-12 16:07:10 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-01-12 16:07:10 +0000
commit11b195d4e26d48cdc56883957cbad16e298e43ca (patch)
tree0cbe94cf64b53ed9a84050689db0811795fdba51 /src/GudhUI/utils
parentf9b5b9b3306f3f00f5bfa2724cbfa087d5161fcb (diff)
Fix alpha complex remarks and bugs
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@957 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fa837fd1a4373c2322db16353d98767907f34c79
Diffstat (limited to 'src/GudhUI/utils')
-rw-r--r--src/GudhUI/utils/Bar_code_persistence.h3
-rw-r--r--src/GudhUI/utils/Persistence_compute.h15
2 files changed, 7 insertions, 11 deletions
diff --git a/src/GudhUI/utils/Bar_code_persistence.h b/src/GudhUI/utils/Bar_code_persistence.h
index a1a46ea8..a4cd8156 100644
--- a/src/GudhUI/utils/Bar_code_persistence.h
+++ b/src/GudhUI/utils/Bar_code_persistence.h
@@ -39,7 +39,7 @@ class Bar_code_persistence {
max_death = death;
}
- void show() {
+ void show(const std::string& window_title) {
// Create a view, put a scene in it
QGraphicsView * view = new QGraphicsView();
QGraphicsScene * scene = new QGraphicsScene();
@@ -78,6 +78,7 @@ class Bar_code_persistence {
QGraphicsTextItem* dimText = scene->addText(scale_value, QFont("Helvetica", 8));
dimText->setPos(scale - (3.0 * scale_value.size()), height + 9.0 * (modulo % 2));
}
+ view->setWindowTitle(window_title.c_str());
// Show the view
view->show();
}
diff --git a/src/GudhUI/utils/Persistence_compute.h b/src/GudhUI/utils/Persistence_compute.h
index 0b9961d3..1f04cc6b 100644
--- a/src/GudhUI/utils/Persistence_compute.h
+++ b/src/GudhUI/utils/Persistence_compute.h
@@ -46,10 +46,6 @@ struct Persistence_params {
* Show persistence into output stream
*/
template<typename SkBlComplex> class Persistence_compute {
- private:
- SkBlComplex& complex_;
- std::ostream& stream_;
-
public:
typedef typename SkBlComplex::Vertex_handle Vertex_handle;
typedef typename SkBlComplex::Edge_handle Edge_handle;
@@ -61,9 +57,7 @@ template<typename SkBlComplex> class Persistence_compute {
* double threshold
* int p for coefficient Z_p
*/
- Persistence_compute(SkBlComplex& complex, std::ostream& stream, const Persistence_params& params) :
- // double threshold = 0.5,unsigned dim_max = 8):
- complex_(complex), stream_(stream) {
+ Persistence_compute(SkBlComplex& complex, std::ostream& stream, const Persistence_params& params) {
// for now everything is copied, todo boost adapt iterators to points of SkBlComplex instead of copying to an
// initial vector
typedef std::vector<double> Point_t;
@@ -87,10 +81,11 @@ template<typename SkBlComplex> class Persistence_compute {
pcoh.init_coefficients(params.p);
// put params.min_pers
pcoh.compute_persistent_cohomology(params.min_pers);
- stream_ << "persistence: \n";
- stream_ << "p dimension birth death: \n";
+ stream << "persistence: \n";
+ stream << "p dimension birth death: \n";
- pcoh.output_diagram(stream_);
+ pcoh.output_diagram(stream);
+
}
};