Commit 59fb6ef8 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'master' into bsp-fix-attempt

parents 40e2dda8 564202f9
Pipeline #3336 failed with stage
in 90 minutes and 46 seconds
......@@ -626,7 +626,7 @@ DrawMeshT<Mesh>::rebuild()
if (baseProp)
{
int numAttribs = baseProp->n_elements();
size_t numAttribs = baseProp->n_elements();
const void* attribData = propDesc->propDataPtr_;
meshComp_->setAttribVec( propDesc->declElementID_, numAttribs, attribData );
......
......@@ -193,7 +193,7 @@ public:
void set(GLint _size, GLenum _type, GLsizei _stride, const GLvoid* _ptr)
{
size = _size; type = _type; stride = _stride, pointer = _ptr;
size = _size; type = _type; stride = _stride; pointer = _ptr;
}
};
......
......@@ -1461,8 +1461,8 @@ void IRenderer::renderLineThicknessGL42()
Texture2D* lineColorImg2D = 0;
TextureBuffer* lineColorImgBuf = 0;
GLsizei w = prevViewport_[2], h = prevViewport_[3];
GLsizei lineBPP = useIntegerTexture ? 4 : 16; // bytes per pixel
size_t w = static_cast<size_t>(prevViewport_[2]), h = static_cast<size_t>(prevViewport_[3]);
size_t lineBPP = static_cast<size_t>(useIntegerTexture ? 4 : 16); // bytes per pixel
if (useBufferTexture)
......@@ -1491,7 +1491,7 @@ void IRenderer::renderLineThicknessGL42()
}
// resize
if (lineColorImg2D->getWidth() != w || lineColorImg2D->getHeight() != h)
if (lineColorImg2D->getWidth() != static_cast<int>(w) || lineColorImg2D->getHeight() != static_cast<int>(h))
lineColorImg2D->setData(0,
useIntegerTexture ? GL_R32UI : GL_RGBA32F,
w, h,
......
......@@ -256,23 +256,23 @@ void MeshCompiler::computeAdjacency(bool _forceRecompute)
}
void MeshCompiler::setVertices( int _num, const void* _data, int _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize )
void MeshCompiler::setVertices( size_t _num, const void* _data, size_t _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize )
{
setAttribVec(inputIDPos_, _num, _data, _stride, _internalCopy, _fmt, _elementSize);
}
void MeshCompiler::setNormals( int _num, const void* _data, int _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize )
void MeshCompiler::setNormals( size_t _num, const void* _data, size_t _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize )
{
setAttribVec(inputIDNorm_, _num, _data, _stride, _internalCopy, _fmt, _elementSize);
}
void MeshCompiler::setTexCoords( int _num, const void* _data, int _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize )
void MeshCompiler::setTexCoords( size_t _num, const void* _data, size_t _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize )
{
setAttribVec(inputIDTexC_, _num, _data, _stride, _internalCopy, _fmt, _elementSize);
}
void MeshCompiler::setAttribVec(int _attrIdx, int _num, const void* _data, int _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize)
void MeshCompiler::setAttribVec(int _attrIdx, size_t _num, const void* _data, size_t _stride, bool _internalCopy /*= false*/, GLuint _fmt, int _elementSize)
{
// sets vertex data for each attribute individually
// Example:
......@@ -307,7 +307,7 @@ void MeshCompiler::setAttribVec(int _attrIdx, int _num, const void* _data, int _
if (_data)
{
// copy elementwise because of striding
for (int i = 0; i < _num; ++i)
for (size_t i = 0; i < _num; ++i)
{
memcpy(inbuf->internalBuf + (size_t)(size * i),
(const char*)_data + (size_t)(_stride * i),
......
......@@ -265,7 +265,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void setVertices(int _num, const void* _data, int _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
void setVertices(size_t _num, const void* _data, size_t _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
/** set input normals
*
......@@ -276,7 +276,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void setNormals(int _num, const void* _data, int _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
void setNormals(size_t _num, const void* _data, size_t _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
/** set input texture coords
*
......@@ -287,7 +287,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void setTexCoords(int _num, const void* _data, int _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
void setTexCoords(size_t _num, const void* _data, size_t _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
/** Set custom input attribute.
*
......@@ -300,7 +300,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void setAttribVec(int _attrIdx, int _num, const void* _data, int _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
void setAttribVec(int _attrIdx, size_t _num, const void* _data, size_t _stride = 0, bool _internalCopy = false, GLuint _fmt = 0, int _elementSize = -1);
/** Set single custom input attributes.
*
......@@ -971,10 +971,10 @@ private:
// final buffers used for drawing
/// # vertices in vbo
int numDrawVerts_;
size_t numDrawVerts_;
/// # isolated vertices
int numIsolatedVerts_;
size_t numIsolatedVerts_;
/// index buffer
std::vector<int> indices_;
......
......@@ -213,7 +213,7 @@ const QtPrincipalAxisDialog::ColorScheme &QtPrincipalAxisDialog::getSelectedColo
void QtPrincipalAxisDialog::setColorScheme(ColorScheme cs) {
float best_match = std::numeric_limits<float>::infinity();
int best_match_i = -1;
size_t best_match_i = std::numeric_limits<size_t>::max();
for (size_t i = 0; i < N_COLOR_SCHEMES; ++i) {
float match = colorSchemeDistance(cs, color_schemes_[i]);
......
......@@ -102,9 +102,9 @@ PrincipalAxisNode::PrincipalAxisNode( BaseNode* _parent,
updateVBO_(true) {
static const Vec4f default_cols[3] = {
Vec4f(0.91, 0.11, 0.09, 1.0),
Vec4f(0.0, .43, 1.0, 1.0),
Vec4f(0.0, 0.70, 0.0, 1.0)
Vec4f(0.91f, 0.11f, 0.09f, 1.0f),
Vec4f(0.0f, .43f, 1.0f , 1.0f),
Vec4f(0.0f, 0.70f, 0.0f , 1.0f)
};
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 4; ++j) {
......@@ -172,15 +172,15 @@ show_tensor_component(unsigned int _i, unsigned char _show)
void
PrincipalAxisNode::
resize(unsigned int _n)
resize(size_t _n)
{
unsigned int old_n = pc_.size();
size_t old_n = pc_.size();
pc_.resize(_n);
draw_pc_.resize(_n);
// initialize new draw_pc_ values
for(unsigned int i=old_n; i<_n; ++i)
for(size_t i=old_n; i<_n; ++i)
draw_pc_[i] = false;
auto_update_range();
......@@ -192,7 +192,7 @@ resize(unsigned int _n)
void
PrincipalAxisNode::
enable ( unsigned int _i)
enable ( size_t _i)
{
if(_i < draw_pc_.size())
{
......@@ -211,7 +211,7 @@ enable ( unsigned int _i)
void
PrincipalAxisNode::
disable ( unsigned int _i)
disable ( size_t _i)
{
if(_i < draw_pc_.size())
{
......@@ -232,7 +232,7 @@ void
PrincipalAxisNode::
disable_all()
{
for(unsigned int i=0; i<pc_.size(); ++i)
for(size_t i=0; i<pc_.size(); ++i)
disable(i);
}
......@@ -242,7 +242,7 @@ disable_all()
void
PrincipalAxisNode::
set(unsigned int _i, const PrincipalComponent& _pc)
set(size_t _i, const PrincipalComponent& _pc)
{
if( _i < pc_.size())
{
......@@ -269,7 +269,7 @@ set(unsigned int _i, const PrincipalComponent& _pc)
void
PrincipalAxisNode::
get(unsigned int _i, PrincipalComponent& _pc)
get(size_t _i, PrincipalComponent& _pc)
{
if( _i < pc_.size())
{
......@@ -379,9 +379,9 @@ auto_update_range()
min_abs_value_ = std::numeric_limits<double>::max();
max_abs_value_ = 0.0;
for(unsigned int i=0; i<pc_.size(); ++i)
for(size_t i=0; i<pc_.size(); ++i)
if(draw_pc_[i])
for(unsigned j=0; j<3; ++j)
for(size_t j=0; j<3; ++j)
if(show_tensor_component_[j])
{
max_abs_value_ = std::max( max_abs_value_, pc_[i].a[j].norm() );
......@@ -404,7 +404,7 @@ update_bounding_box()
bbMin_ = Vec3d( FLT_MAX, FLT_MAX, FLT_MAX);
bbMax_ = Vec3d(-FLT_MAX,-FLT_MAX,-FLT_MAX);
for(unsigned int i=0; i<pc_.size(); ++i)
for(size_t i=0; i<pc_.size(); ++i)
{
Vec3d lmin = (pc_[i].p) - Vec3d(1,1,1)*max_draw_radius_;
Vec3d lmax = (pc_[i].p) + Vec3d(1,1,1)*max_draw_radius_;
......@@ -413,14 +413,14 @@ update_bounding_box()
{
if(uninitialized)
{
bbMin_ = lmin;
bbMax_ = lmax;
uninitialized = false;
bbMin_ = lmin;
bbMax_ = lmax;
uninitialized = false;
}
else
{
bbMin_.minimize(lmin);
bbMax_.maximize(lmax);
bbMin_.minimize(lmin);
bbMax_.maximize(lmax);
}
}
......@@ -494,7 +494,7 @@ draw_principal_component(const PrincipalComponent& _pc)
glTranslated( _pc.p[0], _pc.p[1], _pc.p[2]);
// for(unsigned int i=0; i<1; ++i)
for(unsigned int i=0; i<3; ++i)
for(size_t i=0; i<3; ++i)
{
if( ! show_tensor_component_[i]) continue;
......@@ -586,15 +586,12 @@ void
PrincipalAxisNode::
draw_arrow( const Vec3d& _axis, double _r)
{
double base_radius = _r;
double top_radius = _r;
double size = _axis.norm();
if( size > 1e-10)
{
glPushMatrix();
unsigned int slices(8);
Vec3d direction = _axis;
Vec3d z_axis(0,0,1);
......@@ -640,7 +637,7 @@ draw_line( const Vec3d& _axis, double _w)
glLineWidth(_w);
glBegin(GL_LINES);
glVertex3f(0,0,0);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(_axis[0], _axis[1], _axis[2]);
glEnd();
}
......@@ -676,8 +673,8 @@ pick(GLState& /*_state*/, PickTarget _target)
void PrincipalAxisNode::set_axes_colors(const Vec4f colors[3]) {
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 4; ++j) {
for (size_t i = 0; i < 3; ++i) {
for (size_t j = 0; j < 4; ++j) {
axes_colors[i][j] = colors[i][j];
}
}
......@@ -687,8 +684,8 @@ void PrincipalAxisNode::set_axes_colors(const Vec4f colors[3]) {
}
void PrincipalAxisNode::get_axes_colors(Vec4f out_colors[3]) const {
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 4; ++j) {
for (size_t i = 0; i < 3; ++i) {
for (size_t j = 0; j < 4; ++j) {
out_colors[i][j] = axes_colors[i][j];
}
}
......@@ -854,7 +851,7 @@ void PrincipalAxisNode::getRenderObjects(IRenderer* _renderer, GLState& _state,
int numInstances = 0;
int visibleTensors = 0;
for (unsigned int k = 0; k < 3; ++k)
for (size_t k = 0; k < 3; ++k)
{
if (show_tensor_component_[k])
++visibleTensors;
......@@ -1120,7 +1117,7 @@ void PrincipalAxisNode::emitIndividualRenderobjects(IRenderer* _renderer, GLStat
}
for (unsigned int i = 0; i < pc_.size(); ++i)
for (size_t i = 0; i < pc_.size(); ++i)
{
if (draw_pc_[i])
{
......
......@@ -166,15 +166,15 @@ public:
void show_tensor_component(unsigned int _i, unsigned char _show);
// number of tensors to display
unsigned int size() {return pc_.size();}
size_t size() {return pc_.size();}
void resize( unsigned int _n);
void resize( size_t _n);
void clear() { pc_.clear(); invalidateInstanceData_ = true; }
// enable/disable drawing the _i'th PC
void enable ( unsigned int _i);
void disable( unsigned int _i);
void enable ( size_t _i);
void disable( size_t _i);
void disable_all();
// set properties of Principal component
......@@ -182,8 +182,8 @@ public:
void set_vector( unsigned int _i, const Vec3d _p, const VectorT& _v);
template<class MatrixT>
void set_matrix( unsigned int _i, const Vec3d _p, const MatrixT& _m);
void set( unsigned int _i, const PrincipalComponent& _pc);
void get( unsigned int _i, PrincipalComponent& _pc);
void set( size_t _i, const PrincipalComponent& _pc);
void get( size_t _i, PrincipalComponent& _pc);
void add( const PrincipalComponent& _pc, bool _enable = true);
// enable automatic range clamping
void set_auto_range( bool _b);
......
......@@ -59,7 +59,7 @@ echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
if [ $COUNT -gt 54 ]; then
if [ $COUNT -gt 45 ]; then
echo -e ${WARNING}
echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed";
echo -e "${NC}"
......
......@@ -127,7 +127,7 @@ void QtPlaneSelect::slotMouseEvent(QMouseEvent* event)
return;
unsigned int node_idx, target_idx;
size_t node_idx, target_idx;
if (PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_FACE,
event->pos(),
......
......@@ -69,7 +69,7 @@ public:
std::vector<InterpolatePoint> points_;
std::vector<ACG::Vec3d> handles_;
/// Index of the corresponding mesh
unsigned int meshIndex_;
size_t meshIndex_;
public:
......
......@@ -64,7 +64,7 @@ public:
ACG::Vec3d circleSideAxis_;
double circleMainRadius_;
double circleSideRadius_;
unsigned int circleMeshIndex_;
size_t circleMeshIndex_;
public:
PolyLineCircleData(ACG::Vec3d center, ACG::Vec3d normal, ACG::Vec3d mainAxis, ACG::Vec3d sideAxis, double mainR, double sideR, unsigned int mesh);
......
......@@ -260,7 +260,7 @@ void setSceneGraphRootNodeGlobal( SeparatorNode* _root_node ) {
PluginFunctions::sceneGraphRootNodeGlobal_ = _root_node;
}