Skip to content

Commit

Permalink
Refactors, mostly to remove warnings under qmake and set the stage fo…
Browse files Browse the repository at this point in the history
…r resurfacing
  • Loading branch information
Hugomatic committed May 15, 2012
1 parent 3f76331 commit 5e99bb2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 27 deletions.
3 changes: 2 additions & 1 deletion arcball.cpp
Expand Up @@ -147,7 +147,8 @@ void Arcball::mouse_up()

/********************************** Arcball::mouse_motion() **********/

void Arcball::mouse_motion(int x, int y, int shift, int ctrl, int alt)
void Arcball::mouse_motion(int x, int y, int , //shift,
int ctrl, int alt)
{
/* Set the X constraint if CONTROL key is pressed, Y if ALT key */
set_constraints( ctrl != 0, alt != 0 );
Expand Down
14 changes: 8 additions & 6 deletions gcode.cpp
Expand Up @@ -286,8 +286,14 @@ void gcodeModel::loadGcodeLine(const char* lineStr)



void addPointsFromPolygon(const Polygon &poly, float xOff, float yOff, float z, PointKind kind, int nb, float feedrate, float flowrate, vector<point> &points, layerMap& map)
void addPointsFromPolygon(const Polygon &poly,
float xOff,
float yOff,
float z,
PointKind kind, int nb, float feedrate, float flowrate, vector<point> &points,
layerMap& )
{

for(unsigned int i=0; i < poly.size(); i++)
{
Vector2 p = poly[i];
Expand Down Expand Up @@ -317,8 +323,6 @@ void addPointsFromSurface(const GridRanges& gridRanges, const Grid & grid, float
{
float feedrate = 10;
float flowrate = 5;
int nb =0;



map.recordHeight(z);
Expand Down Expand Up @@ -399,7 +403,6 @@ void gcodeModel::loadSliceData(const Tomograph& tomograph,
feedrateBounds.evaluate(feedrate);
flowrateBounds.evaluate(flowrate);

float xOff = -1.1 * tomograph.grid.readXvalues()[0] + tomograph.grid.readXvalues().back();
for (unsigned int i = 0; i < slices.size(); i++)
{
const SliceData &sliceData = slices[i];
Expand Down Expand Up @@ -466,9 +469,8 @@ void gcodeModel::loadGCode(QString q)
string extension = filename.substr(filename.find_last_of('.'), filename.size());
std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
cout << "extension "<< extension << endl;
int r = extension.find("stl");

if(extension.find("gcode") >= 0)
if(extension.find("gcode") != string::npos)
{
cout << "loading gcode: " << filename << endl;
ifstream file;
Expand Down
4 changes: 2 additions & 2 deletions gcodeview.cpp
Expand Up @@ -290,7 +290,7 @@ void GcodeView::mouseMoveEvent(QMouseEvent *event)

}

void GcodeView::mouseReleaseEvent(QMouseEvent *event) {
void GcodeView::mouseReleaseEvent(QMouseEvent *) {
arcball.mouse_up();

// Start an animation timer if the arcball is still spinning
Expand Down Expand Up @@ -353,7 +353,7 @@ void GcodeView::toggleSurfs(bool v)
updateGL();
}

void GcodeView::mouseDoubleClickEvent(QMouseEvent event) {
void GcodeView::mouseDoubleClickEvent(QMouseEvent ) {
// TODO: We never get here.
resetView();
updateGL();
Expand Down
14 changes: 0 additions & 14 deletions mainwindow.cpp
Expand Up @@ -377,15 +377,6 @@ void MainWindow::loadFile(const QString &fileName) {

}

void MainWindow::on_LayerMin_destroyed(QObject *arg1)
{

}

void MainWindow::on_actionSaveGcode_triggered()
{
cout << "hello save menu!" << endl;
}


void MainWindow::on_pushButtonSaveGcode_clicked()
Expand All @@ -406,11 +397,6 @@ void MainWindow::on_actionSave_gcode_triggered()
ui->graphicsView->exportModel(filename, &progress);
}

void MainWindow::on_radioButtonSurfs_toggled(bool checked)
{
cout << "Toggle surfs" << endl;
}

void MainWindow::on_checkBoxSurfs_toggled(bool checked)
{
cout << "Toggle surfs" << endl;
Expand Down
6 changes: 3 additions & 3 deletions mainwindow.h
Expand Up @@ -50,17 +50,17 @@ private slots:

void on_buttonSlice_clicked();

void on_LayerMin_destroyed(QObject *arg1);
// void on_LayerMin_destroyed(QObject *arg1);

void on_LayerMin_valueChanged(int value);

void on_actionSaveGcode_triggered();
// void on_actionSaveGcode_triggered();

void on_pushButtonSaveGcode_clicked();

void on_actionSave_gcode_triggered();

void on_radioButtonSurfs_toggled(bool checked);


void on_checkBoxSurfs_toggled(bool checked);

Expand Down
3 changes: 2 additions & 1 deletion quaternion.cpp
Expand Up @@ -112,7 +112,8 @@ quat operator - (const quat &a )

quat operator * ( const quat &a, const quat &b)
{
return quat( a.s*b.s - a.v*b.v, a.s*b.v + b.s*a.v + a.v^b.v );
//return quat( a.s*b.s - a.v*b.v, a.s*b.v + b.s*a.v + a.v^b.v );
return quat( a.s*b.s - a.v*b.v, a.s*b.v + b.s*a.v + (a.v^b.v) );
}

quat operator * ( const quat &a, const float t)
Expand Down

0 comments on commit 5e99bb2

Please sign in to comment.