summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-29 21:13:22 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-29 21:13:22 (GMT)
commit1b31c32638faa0429ffb6af0751a2199b33c52a0 (patch)
tree02db39aa979996789565daa660a8780f98f216b2 /patches
parentc1fa2f9675225df448a1c1f162ae7d93573401fa (diff)
Cleaned up the OGL_helper patches a bit
Diffstat (limited to 'patches')
-rw-r--r--patches/CGAL-OGL_helper-colors.patch80
-rw-r--r--patches/CGAL-OGL_helper-tesscombine.patch (renamed from patches/CGAL-OGL-Tess-Combine-Fix.patch)21
2 files changed, 86 insertions, 15 deletions
diff --git a/patches/CGAL-OGL_helper-colors.patch b/patches/CGAL-OGL_helper-colors.patch
new file mode 100644
index 0000000..4c2f8c0
--- /dev/null
+++ b/patches/CGAL-OGL_helper-colors.patch
@@ -0,0 +1,80 @@
+--- OGL_helper.h 2011-09-29 23:02:04.000000000 +0200
++++ ../src/OGL_helper.h 2011-09-29 23:01:27.000000000 +0200
+@@ -263,7 +263,7 @@
+ enum { SNC_BOUNDARY, SNC_SKELETON };
+
+ class Polyhedron : public OGL_base_object {
+-
++ protected:
+ std::list<DPoint> vertices_;
+ std::list<DSegment> edges_;
+ std::list<DFacet> halffacets_;
+@@ -356,11 +356,17 @@
+ Bbox_3 bbox() const { return bbox_; }
+ Bbox_3& bbox() { return bbox_; }
+
++ virtual CGAL::Color getVertexColor(Vertex_iterator v) const
++ {
++ CGAL::Color cf(CGAL_NEF3_MARKED_VERTEX_COLOR),
++ ct(CGAL_NEF3_UNMARKED_VERTEX_COLOR); // more blue-ish
++ CGAL::Color c = v->mark() ? ct : cf;
++ return c;
++ }
++
+ void draw(Vertex_iterator v) const {
+ // CGAL_NEF_TRACEN("drawing vertex "<<*v);
+- CGAL::Color cf(CGAL_NEF3_MARKED_VERTEX_COLOR),
+- ct(CGAL_NEF3_UNMARKED_VERTEX_COLOR); // more blue-ish
+- CGAL::Color c = v->mark() ? ct : cf;
++ CGAL::Color c = getVertexColor(v);
+ glPointSize(10);
+ glColor3ub(c.red(), c.green(), c.blue());
+ glBegin(GL_POINTS);
+@@ -372,12 +378,18 @@
+ glEnd();
+ }
+
++ virtual CGAL::Color getEdgeColor(Edge_iterator e) const
++ {
++ CGAL::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR),
++ ct(CGAL_NEF3_UNMARKED_EDGE_COLOR); // more blue-ish
++ CGAL::Color c = e->mark() ? ct : cf;
++ return c;
++ }
++
+ void draw(Edge_iterator e) const {
+ // CGAL_NEF_TRACEN("drawing edge "<<*e);
+ Double_point p = e->source(), q = e->target();
+- CGAL::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR),
+- ct(CGAL_NEF3_UNMARKED_EDGE_COLOR); // more blue-ish
+- CGAL::Color c = e->mark() ? ct : cf;
++ CGAL::Color c = getEdgeColor(e);
+ glLineWidth(5);
+ glColor3ub(c.red(),c.green(),c.blue());
+ glBegin(GL_LINE_STRIP);
+@@ -386,6 +398,14 @@
+ glEnd();
+ }
+
++ virtual CGAL::Color getFacetColor(Halffacet_iterator f) const
++ {
++ CGAL::Color cf(CGAL_NEF3_MARKED_FACET_COLOR),
++ ct(CGAL_NEF3_UNMARKED_FACET_COLOR); // more blue-ish
++ CGAL::Color c = (f->mark() ? ct : cf);
++ return c;
++ }
++
+ void draw(Halffacet_iterator f) const {
+ // CGAL_NEF_TRACEN("drawing facet "<<(f->debug(),""));
+ GLUtesselator* tess_ = gluNewTess();
+@@ -403,9 +423,7 @@
+ GLU_TESS_WINDING_POSITIVE);
+
+ DFacet::Coord_const_iterator cit;
+- CGAL::Color cf(CGAL_NEF3_MARKED_FACET_COLOR),
+- ct(CGAL_NEF3_UNMARKED_FACET_COLOR); // more blue-ish
+- CGAL::Color c = (f->mark() ? ct : cf);
++ CGAL::Color c = getFacetColor(f);
+ glColor3ub(c.red(),c.green(),c.blue());
+ gluTessBeginPolygon(tess_,f->normal());
+ // CGAL_NEF_TRACEN(" ");
diff --git a/patches/CGAL-OGL-Tess-Combine-Fix.patch b/patches/CGAL-OGL_helper-tesscombine.patch
index 2a4ad1a..792e1da 100644
--- a/patches/CGAL-OGL-Tess-Combine-Fix.patch
+++ b/patches/CGAL-OGL_helper-tesscombine.patch
@@ -1,12 +1,11 @@
---- CGAL-3.4/include/CGAL/Nef_3/OGL_helper.h
-+++ CGAL-3.4/include/CGAL/Nef_3/OGL_helper.h
-@@ -243,6 +243,23 @@
+--- ../../libraries/install/include/CGAL/Nef_3/OGL_helper.h 2010-06-09 21:00:52.000000000 +0200
++++ OGL_helper.h 2011-09-29 23:09:47.000000000 +0200
+@@ -243,6 +243,22 @@
glVertex3dv(pc);
}
-+ inline void CGAL_GLU_TESS_CALLBACK combineCallback(GLdouble coords[3], GLvoid *d[4], GLfloat w[4], GLvoid **dataOut)
-+ {
-+ static std::list<GLdouble*> pcache;
++ inline void CGAL_GLU_TESS_CALLBACK combineCallback(GLdouble coords[3], GLvoid *[4], GLfloat [4], GLvoid **dataOut)
++ { static std::list<GLdouble*> pcache;
+ if (dataOut) {
+ GLdouble *n = new GLdouble[3];
+ n[0] = coords[0];
@@ -24,7 +23,7 @@
enum { SNC_AXES};
enum { SNC_BOUNDARY, SNC_SKELETON };
-@@ -376,6 +393,8 @@
+@@ -376,6 +392,8 @@
GLUtesselator* tess_ = gluNewTess();
gluTessCallback(tess_, GLenum(GLU_TESS_VERTEX_DATA),
(GLvoid (CGAL_GLU_TESS_CALLBACK *)(CGAL_GLU_TESS_DOTS)) &vertexCallback);
@@ -33,11 +32,3 @@
gluTessCallback(tess_, GLenum(GLU_TESS_BEGIN),
(GLvoid (CGAL_GLU_TESS_CALLBACK *)(CGAL_GLU_TESS_DOTS)) &beginCallback);
gluTessCallback(tess_, GLenum(GLU_TESS_END),
-@@ -410,6 +429,7 @@
- gluTessEndPolygon(tess_);
- // CGAL_NEF_TRACEN("End Polygon");
- gluDeleteTess(tess_);
-+ combineCallback(NULL, NULL, NULL, NULL);
- }
-
- void construct_axes() const
contact: Jan Huwald // Impressum