summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-29 18:03:23 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-29 18:03:23 (GMT)
commita15c89922e347f6b92e7ddc20e6d5fcd35b207ce (patch)
treebea7a380291bf5758b0b8dc106d917578a6b9a41 /src
parente541df8bb50df403afded7dfe73d9df5b542d2e4 (diff)
parentfcd0629a12123b15cfce6ee3d444ef938e556ad6 (diff)
Merge branch 'master' of github.com:openscad/openscad
Diffstat (limited to 'src')
-rw-r--r--src/CGALEvaluator.cc14
-rw-r--r--src/glview.cc3
2 files changed, 8 insertions, 9 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index cd8cd55..15fa746 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -442,7 +442,7 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
void add_edges(int pn)
{
- for (int j = 1; j <= this->polygons[pn].size(); j++) {
+ for (unsigned int j = 1; j <= this->polygons[pn].size(); j++) {
int a = this->polygons[pn][j-1];
int b = this->polygons[pn][j % this->polygons[pn].size()];
if (a > b) { a = a^b; b = a^b; a = a^b; }
@@ -457,7 +457,7 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
void del_poly(int pn)
{
- for (int j = 1; j <= this->polygons[pn].size(); j++) {
+ for (unsigned int j = 1; j <= this->polygons[pn].size(); j++) {
int a = this->polygons[pn][j-1];
int b = this->polygons[pn][j % this->polygons[pn].size()];
if (a > b) { a = a^b; b = a^b; a = a^b; }
@@ -504,11 +504,11 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
int merge(int p1, int p1e, int p2, int p2e)
{
- for (int i = 1; i < this->polygons[p1].size(); i++) {
+ for (unsigned int i = 1; i < this->polygons[p1].size(); i++) {
int j = (p1e + i) % this->polygons[p1].size();
this->polygons[this->poly_n].push_back(this->polygons[p1][j]);
}
- for (int i = 1; i < this->polygons[p2].size(); i++) {
+ for (unsigned int i = 1; i < this->polygons[p2].size(); i++) {
int j = (p2e + i) % this->polygons[p2].size();
this->polygons[this->poly_n].push_back(this->polygons[p2][j]);
}
@@ -528,7 +528,7 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
int poly1_n = work_queue.front();
work_queue.pop_front();
if (this->polygons.find(poly1_n) == this->polygons.end()) continue;
- for (int j = 1; j <= this->polygons[poly1_n].size(); j++) {
+ for (unsigned int j = 1; j <= this->polygons[poly1_n].size(); j++) {
int a = this->polygons[poly1_n][j-1];
int b = this->polygons[poly1_n][j % this->polygons[poly1_n].size()];
if (a > b) { a = a^b; b = a^b; a = a^b; }
@@ -537,7 +537,7 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
int poly2_n = this->edge_to_poly[std::pair<int,int>(a, b)].first +
this->edge_to_poly[std::pair<int,int>(a, b)].second - poly1_n;
int poly2_edge = -1;
- for (int k = 1; k <= this->polygons[poly2_n].size(); k++) {
+ for (unsigned int k = 1; k <= this->polygons[poly2_n].size(); k++) {
int c = this->polygons[poly2_n][k-1];
int d = this->polygons[poly2_n][k % this->polygons[poly2_n].size()];
if (c > d) { c = c^d; d = c^d; c = c^d; }
@@ -567,7 +567,7 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
BOOST_FOREACH(const PolygonMap::value_type &i, polygons) {
std::list<CGAL_Nef_polyhedron2::Point> plist;
- for (int j = 0; j < i.second.size(); j++) {
+ for (unsigned int j = 0; j < i.second.size(); j++) {
int p = i.second[j];
plist.push_back(points[p]);
}
diff --git a/src/glview.cc b/src/glview.cc
index 499e555..0f9ec5b 100644
--- a/src/glview.cc
+++ b/src/glview.cc
@@ -371,6 +371,7 @@ void GLView::setupOrtho(double distance, bool offset)
glOrtho(-w_h_ratio*l, +w_h_ratio*l,
-(1/w_h_ratio)*l, +(1/w_h_ratio)*l,
-FAR_FAR_AWAY, +FAR_FAR_AWAY);
+ gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
}
void GLView::paintGL()
@@ -450,8 +451,6 @@ void GLView::paintGL()
setupOrtho(1000,true);
- gluLookAt(0.0, -1000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
-
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotated(object_rot_x, 1.0, 0.0, 0.0);
contact: Jan Huwald // Impressum