Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion evertims/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads)

find_package(evert REQUIRED)
find_package(OpenGL REQUIRED)

target_include_directories(${PROJECT}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
Expand Down
8 changes: 0 additions & 8 deletions evertims/src/solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@
#include <iostream>
#include <time.h>

#ifdef __Darwin
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#else
#include <GL/gl.h>
#include <GL/glut.h>
#endif

#include "solver.h"
#include "material.h"
#include "utils.h"
Expand Down
1 change: 0 additions & 1 deletion libevert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ set (EVERT_SOURCES
src/elBSP.cc
src/elOrientedPoint.cc
src/elVector.cc
src/elRay.cc
src/elListener.cc
src/elPathSolution.cc
src/elRoom.cc
Expand Down
41 changes: 0 additions & 41 deletions libevert/src/elBeam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,44 +82,3 @@ void Beam::calculatePleqs(void)
}
m_pleqs[0] = sign * m_polygon.getPleq();
}

/*
void Beam::render(const Vector3& color) const
{
static const float extrudeDist = 100000.f; // 100 m

if (m_polygon.numPoints() == 0)
return;

glColor3fv(&color.x);
glBegin(GL_LINE_LOOP);
for (int i=0; i < m_polygon.numPoints(); i++)
glVertex3fv(&m_polygon[i].x);
glEnd();

glBegin(GL_LINES);
for (int i=0; i < m_polygon.numPoints(); i++)
{
Vector3 p = m_polygon[i];
glVertex3fv(&p.x);
p += extrudeDist * normalize(p-m_top);
glVertex3fv(&p.x);
}
glEnd();

glBegin(GL_POLYGON);
for (int i=0; i < m_polygon.numPoints(); i++)
glVertex3fv(&m_polygon[i].x);
glEnd();

glBegin(GL_QUAD_STRIP);
for (int i=0; i <= m_polygon.numPoints(); i++)
{
Vector3 p = m_polygon[i % m_polygon.numPoints()];
Vector3 e = p + extrudeDist * normalize(p-m_top);
glVertex3fv(&p.x);
glVertex3fv(&e.x);
}
glEnd();
}
*/
120 changes: 0 additions & 120 deletions libevert/src/elOrientedPoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@

#include "elOrientedPoint.h"

#ifdef __Darwin
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/glu.h>
#include <GL/glut.h>
#endif

using namespace EL;

//------------------------------------------------------------------------
Expand Down Expand Up @@ -63,115 +55,3 @@ const OrientedPoint& OrientedPoint::operator=(const OrientedPoint& s)
m_name = s.m_name;
return *this;
}

//------------------------------------------------------------------------

void multMatrix(const Matrix3x4& m)
{
float mtx[16];
*((Matrix3x4*)mtx) = m;
mtx[12] = mtx[3];
mtx[13] = mtx[7];
mtx[14] = mtx[11];
mtx[15] = 1.0f;
mtx[3] = mtx[7] = mtx[11] = 0.0f;
swap(mtx[1], mtx[4]);
swap(mtx[2], mtx[8]);
swap(mtx[6], mtx[9]);

glMultMatrixf(mtx);
}
/*
void OrientedPoint::render(const Vector3& color) const
{
const Vector3& pos = getPosition();
Vector3 posd = pos + getDirection() * 1000.f;

glPushAttrib(GL_ALL_ATTRIB_BITS);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.f);
glPointSize(13.f);
glBegin(GL_POINTS);
glColor3fv(&color.x);
glVertex3fv(&pos.x);
glEnd();
glDisable(GL_ALPHA_TEST);

glBegin(GL_LINES);
glVertex3fv(&pos.x);
glVertex3fv(&posd.x);
glEnd();

const char* string = getName().c_str();

glPushMatrix();

// determine string width
glLoadIdentity();
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_FALSE);
for (const char* p = string; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
float m[16];
glGetFloatv(GL_MODELVIEW_MATRIX, m);
float width = m[12];

glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);

glPopMatrix();
glPushMatrix();

glTranslatef(pos.x, pos.y, pos.z);
Matrix3x4 orient;
orient.setRotation(getOrientation());
multMatrix(orient);
glScalef(4.f, 4.f, 4.f);
glTranslatef(-width/2, -40.f, 200.f);

static const float miny = -30.f;
static const float maxy = 110.f;
static const float pad = 20.f;

Vector3 cv[5] =
{
Vector3(-pad, miny-pad, 0.f),
Vector3(width+pad, miny-pad, 0.f),
Vector3(width+pad, maxy+pad, 0.f),
Vector3(-pad, maxy+pad, 0.f),
Vector3(width/2, 40.f, -200.f)
};

glColor4f(.5f, .5f, .5f, .5f);
glDepthMask(GL_FALSE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
for (int j=0; j < 4; j++)
glVertex3fv(&cv[j].x);
glEnd();
glDisable(GL_BLEND);
glDepthMask(GL_TRUE);

glLineWidth(1.f);
glColor3f(1.f, 1.f, 1.f);
glBegin(GL_LINES);
for (int j=0; j < 4; j++)
{
glVertex3fv(&cv[j].x);
glVertex3fv(&cv[(j+1)%4].x);
glVertex3fv(&cv[j].x);
glVertex3fv(&cv[4].x);
}
glEnd();

glColor3f(1,1,1);
glLineWidth(2.f);
for (const char* p = string; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);

glPopMatrix();
glPopAttrib();
}
*/
41 changes: 0 additions & 41 deletions libevert/src/elPathSolution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
#include "elRoom.h"
#include "elSource.h"

#ifdef __Darwin
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif

#include <cstdio>
#define printf // Comment to add debug logs

Expand Down Expand Up @@ -64,41 +58,6 @@ struct PathSolution::SolutionNode
const Polygon* m_polygon;
};

//------------------------------------------------------------------------
void PathSolution::renderPath(const Path& path) const
{
glPushAttrib(GL_ALL_ATTRIB_BITS);

float width = 2.f*(m_maximumOrder-path.m_order+1.f);
float alpha = ((float)m_maximumOrder-path.m_order+4)/(m_maximumOrder+4);

// std::cerr << "Drawing path: width = " << width << ", alpha = " << alpha << std::endl;

glLineWidth(width);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1.f, 1.f, 0.f, alpha);

glBegin(GL_LINE_STRIP);
for( int i=0; i < (int)path.m_points.size(); i++ )
{
glVertex3fv(&path.m_points[i].x);
}
glEnd();

glPointSize(width*2.f);
glColor4f(1.f, 1.f, 1.f, alpha*2);
glEnable(GL_POINT_SMOOTH);
glDepthMask(GL_FALSE);
glBegin(GL_POINTS);
for( int i=0; i < (int)path.m_points.size(); i++ )
{
glVertex3fv(&path.m_points[i].x);
}
glEnd();

glPopAttrib();
}
//------------------------------------------------------------------------

PathSolution::PathSolution(const Room& room, const Source& source, const Listener& listener, int maximumOrder, bool changed):
Expand Down
1 change: 0 additions & 1 deletion libevert/src/elPathSolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class PathSolution
const Source & getSource (void) { return m_source; }

int getOrder (void) { return m_maximumOrder; }
void renderPath (const Path& path) const;
bool save (char *filename, char *modelname);

void print (int minOrder, int maxOrder, int maxAmount);
Expand Down
14 changes: 0 additions & 14 deletions libevert/src/elPolygon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,17 +681,3 @@ void Polygon::expand (float eps)
}

}


//------------------------------------------------------------------------
/*
void Polygon::render(const Vector3& color) const
{
glBegin(GL_POLYGON);
glColor3fv(&color.x);
for (int i=0; i < numPoints(); i++)
glVertex3fv(&m_points[i].x);
glEnd();
}
*/

18 changes: 0 additions & 18 deletions libevert/src/elRay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,4 @@

#include "elRay.h"

#ifdef __Darwin
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif

using namespace EL;

//------------------------------------------------------------------------
/*
void Ray::render(const Vector3& color) const
{
glBegin(GL_LINES);
glColor3fv(&color.x);
glVertex3fv(&m_a.x);
glVertex3fv(&m_b.x);
glEnd();
}
*/
54 changes: 0 additions & 54 deletions libevert/src/elRoom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@
#include "elRoom.h"
#include <cstdio>

#ifdef __Darwin
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif

using namespace EL;


Expand Down Expand Up @@ -264,49 +256,3 @@ Vector3 Room::getCenter(void) const
getBoundingBox(mn, mx);
return .5f*(mn+mx);
}

//------------------------------------------------------------------------

void Room::render(void) const
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1, 1);

for( int i=0; i < numConvexElements(); i++ )
{
const Room::Element& e = getConvexElement(i);
Vector3 color = e.m_color;

float ldot = dot(e.m_polygon.getNormal(), normalize(Vector3(3,2,4)));
ldot = .25f + .75f*fabsf(ldot);
color *= ldot;
glColor3fv(&color.x);

/*
glBegin(GL_POLYGON);
for (int j=0; j < e.m_polygon.numPoints(); j++)
glVertex3fv(&e.m_polygon[j].x);

glEnd();
*/
}
glDisable(GL_POLYGON_OFFSET_FILL);

glLineWidth(1.f);
for( int i=0; i < numElements(); i++ )
{
const Room::Element& e = getElement(i);
glColor3f(1.f, 1.f, 1.f);
Vector3 color = e.m_color;
glColor3fv(&color.x);
glBegin(GL_LINE_LOOP);
for( int j=0; j < e.m_polygon.numPoints(); j++ )
{
glVertex3fv(&e.m_polygon[j].x);
}
glEnd();
}
glPopAttrib();
}