Fix build and sloppy build errors
This commit is contained in:
parent
b574b9040b
commit
cc03214142
4 changed files with 55 additions and 32 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
exercise1/build/
|
||||
exercise2/build/
|
||||
exercise3/build/
|
||||
|
||||
.vscode/ipch
|
21
.vscode/tasks.json
vendored
21
.vscode/tasks.json
vendored
|
@ -36,6 +36,27 @@
|
|||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Run Exercise 3",
|
||||
"type": "shell",
|
||||
"command": "exercise3/build/cmake/./exercise3",
|
||||
"dependsOn": "Build Exercise 3",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Build Exercise 3",
|
||||
"type": "shell",
|
||||
"command": "cd exercise3/build/cmake && cmake . && make -j4",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "shared",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Run Exercise 2",
|
||||
"type": "shell",
|
||||
|
|
|
@ -21,7 +21,7 @@ set(HEADERS
|
|||
../../include/recursive_cubes.h
|
||||
../../dependencies/qdbmp/include/qdbmp.h
|
||||
)
|
||||
|
||||
|
||||
# Definition der Sourcedateien
|
||||
set(SOURCES
|
||||
../../src/abstract_scene.cpp
|
||||
|
@ -55,4 +55,4 @@ add_executable(exercise3
|
|||
)
|
||||
|
||||
# Bibliotheken linken
|
||||
target_link_libraries(exercise3 ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
|
||||
target_link_libraries(exercise3 ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} -lpthread)
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
//
|
||||
// This source code is property of the Computer Graphics and Visualization
|
||||
// chair of the TU Dresden. Do not distribute in modified or unmodified form!
|
||||
// This source code is property of the Computer Graphics and Visualization
|
||||
// chair of the TU Dresden. Do not distribute in modified or unmodified form!
|
||||
// Copyright (C) 2016 CGV TU Dresden - All Rights Reserved
|
||||
//
|
||||
/*************************************************************************
|
||||
Template class for vectors.
|
||||
This template class defines small vectors of a defined dimension with
|
||||
an arbitrary data type. Basic operations such as addition of vectors and
|
||||
multiplication of a vector and a scalar are supported via operator
|
||||
overloading. Also more advanced functions such as normalization and
|
||||
multiplication of a vector and a scalar are supported via operator
|
||||
overloading. Also more advanced functions such as normalization and
|
||||
iterating through the elements are implemented.
|
||||
At the end of this file the data types "point2d", "point3d" and
|
||||
At the end of this file the data types "point2d", "point3d" and
|
||||
"point4d" are specified as a tinyvec of doubles with the according dimension.
|
||||
*************************************************************************/
|
||||
|
||||
|
@ -22,9 +22,10 @@ At the end of this file the data types "point2d", "point3d" and
|
|||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <numeric>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
@ -64,7 +65,7 @@ public:
|
|||
|
||||
tiny_vec(const T&x,const T&y, const T&z);
|
||||
|
||||
tiny_vec(const T&x, const T&y, const T&z,const T& w);
|
||||
tiny_vec(const T&x, const T&y, const T&z,const T& w);
|
||||
|
||||
int size() const;
|
||||
|
||||
|
@ -87,7 +88,7 @@ public:
|
|||
tiny_vec& operator=(const tiny_vec & v);
|
||||
|
||||
void fill(const T& s);
|
||||
|
||||
|
||||
void zeros();
|
||||
|
||||
void ones();
|
||||
|
@ -106,14 +107,14 @@ public:
|
|||
|
||||
const_reverse_iterator rbegin() const;
|
||||
|
||||
const_reverse_iterator rend() const;
|
||||
const_reverse_iterator rend() const;
|
||||
|
||||
bool operator==(const tiny_vec& v) const;
|
||||
|
||||
bool operator!=(const tiny_vec& v) const;
|
||||
|
||||
tiny_vec operator-() const;
|
||||
|
||||
|
||||
|
||||
|
||||
tiny_vec& operator+=(int s);
|
||||
|
@ -123,45 +124,45 @@ public:
|
|||
tiny_vec& operator+=(double s);
|
||||
|
||||
|
||||
|
||||
|
||||
tiny_vec operator+(int s) const;
|
||||
|
||||
tiny_vec operator+(float s) const;
|
||||
|
||||
tiny_vec operator+(double s) const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tiny_vec& operator-=(int s);
|
||||
|
||||
tiny_vec& operator-=(float s);
|
||||
|
||||
tiny_vec& operator-=(double s);
|
||||
|
||||
|
||||
|
||||
tiny_vec& operator-=(double s);
|
||||
|
||||
|
||||
|
||||
tiny_vec operator-(int s) const;
|
||||
|
||||
tiny_vec operator-(float s) const;
|
||||
|
||||
tiny_vec operator-(double s) const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tiny_vec& operator*=(int s);
|
||||
|
||||
tiny_vec& operator*=(float s);
|
||||
|
||||
tiny_vec& operator*=(double s);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tiny_vec operator*(int s) const;
|
||||
|
||||
tiny_vec operator*(float s) const;
|
||||
|
||||
tiny_vec operator*(double s) const;
|
||||
|
||||
|
||||
|
||||
|
||||
tiny_vec& operator/=(int s);
|
||||
|
@ -171,11 +172,11 @@ public:
|
|||
tiny_vec& operator/=(double s);
|
||||
|
||||
|
||||
|
||||
|
||||
tiny_vec operator/(int s) const;
|
||||
|
||||
tiny_vec operator/(float s) const;
|
||||
|
||||
|
||||
tiny_vec operator/(double s) const;
|
||||
|
||||
tiny_vec& operator+=(const tiny_vec& v);
|
||||
|
@ -243,8 +244,8 @@ tiny_vec<T,N>::tiny_vec(){}
|
|||
|
||||
template <typename T, int N>
|
||||
tiny_vec<T,N>::tiny_vec(size_t n,const T* marray)
|
||||
{
|
||||
std::copy(marray,marray+N,begin());
|
||||
{
|
||||
std::copy(marray,marray+N,begin());
|
||||
}
|
||||
|
||||
template <typename T, int N>
|
||||
|
@ -363,7 +364,7 @@ void tiny_vec<T,N>::fill(const T& s)
|
|||
|
||||
template <typename T, int N>
|
||||
void tiny_vec<T,N>::zeros()
|
||||
{
|
||||
{
|
||||
T zero;
|
||||
zero=0;
|
||||
std::fill(begin(), end(), zero);
|
||||
|
@ -794,7 +795,7 @@ size_t tiny_vec<T,N>::min_index() const
|
|||
}
|
||||
|
||||
template <typename T, int N>
|
||||
T& tiny_vec<T,N>::max_elem()
|
||||
T& tiny_vec<T,N>::max_elem()
|
||||
{
|
||||
return *std::max_element(begin(),end());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue