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

cppcheck fixes

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17358 383ad7c9-94d9-4d36-a494-682f7c89f535
parent be69df34
......@@ -120,7 +120,7 @@ compute_edge_weights()
typename Mesh::EdgeIter e_it, e_end(mesh_.edges_end());
typename Mesh::HalfedgeHandle heh0, heh1, heh2;
const typename Mesh::Point *p0, *p1, *p2;
const typename Mesh::Point *p2;
typename Mesh::Point d0, d1;
typename Mesh::Scalar weight;
......@@ -128,21 +128,21 @@ compute_edge_weights()
for (e_it=mesh_.edges_begin(); e_it!=e_end; ++e_it)
{
heh0 = mesh_.halfedge_handle(*e_it, 0);
p0 = &mesh_.point(mesh_.to_vertex_handle(heh0));
const typename Mesh::Point& p0 = mesh_.point(mesh_.to_vertex_handle(heh0));
heh1 = mesh_.halfedge_handle(*e_it, 1);
p1 = &mesh_.point(mesh_.to_vertex_handle(heh1));
const typename Mesh::Point& p1 = mesh_.point(mesh_.to_vertex_handle(heh1));
heh2 = mesh_.next_halfedge_handle(heh0);
p2 = &mesh_.point(mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2).normalize();
d1 = (*p1 - *p2).normalize();
d0 = (p0 - *p2).normalize();
d1 = (p1 - *p2).normalize();
weight = 1.0 / tan(acos(d0|d1));
heh2 = mesh_.next_halfedge_handle(heh1);
p2 = &mesh_.point(mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2).normalize();
d1 = (*p1 - *p2).normalize();
d0 = (p0 - *p2).normalize();
d1 = (p1 - *p2).normalize();
weight += 1.0 / tan(acos(d0|d1));
mesh_.property(edge_weight_, *e_it) = weight;
......
......@@ -579,7 +579,6 @@ bool FileOFFPlugin::parseASCII(std::istream& _in, OFFImporter& _importer, DataTy
OpenMesh::Vec4i c4;
OpenMesh::Vec4f c4f;
std::vector<VertexHandle> vhandles;
VertexHandle vh;
FaceHandle fh;
int objectId = -1;
......@@ -632,7 +631,7 @@ bool FileOFFPlugin::parseASCII(std::istream& _in, OFFImporter& _importer, DataTy
// Always read VERTEX
_in >> v[0] >> v[1] >> v[2];
vh = _importer.addVertex(v);
const VertexHandle vh = _importer.addVertex(v);
// perhaps read NORMAL
if ( _importer.hasVertexNormals() ){
......@@ -888,7 +887,6 @@ bool FileOFFPlugin::parseBinary(std::istream& _in, OFFImporter& _importer, DataT
float alpha = 1.0f;
OpenMesh::Vec2f t;
std::vector<VertexHandle> vhandles;
VertexHandle vh;
FaceHandle fh;
int objectId = -1;
......@@ -927,7 +925,7 @@ bool FileOFFPlugin::parseBinary(std::istream& _in, OFFImporter& _importer, DataT
readValue(_in, v[1]);
readValue(_in, v[2]);
vh = _importer.addVertex(v);
const VertexHandle vh = _importer.addVertex(v);
if ( _importer.hasVertexNormals() ) {
readValue(_in, n[0]);
......
......@@ -80,8 +80,6 @@ DataType FileViewPlugin::supportedType() {
int FileViewPlugin::loadObject(QString _filename) {
// Declare variables
int width = 1;
int height = 1;
ACG::Vec3d eye(1.0,1.0,1.0);
ACG::Vec3d center(0.0,0.0,0.0);
ACG::Vec3d up(1.0,0.0,0.0);
......@@ -99,8 +97,8 @@ int FileViewPlugin::loadObject(QString _filename) {
settings.beginGroup("VIEW");
if(settings.contains("Width") && settings.contains("Height")) {
width = settings.value("Width").toInt();
height = settings.value("Height").toInt();
const int width = settings.value("Width").toInt();
const int height = settings.value("Height").toInt();
std::cerr << "Setting new viewport to " << width << "x" << height << std::endl;
//e_widthAndHeight = true;
}
......
......@@ -110,8 +110,6 @@ void MeshObjectSelectionPlugin::update_regions(MeshType* _mesh) {
typename MeshType::FaceVertexIter fv_it;
typename MeshType::VertexHandle v0, v1, v2;
bool h;
for(f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it) {
fv_it = _mesh->fv_iter(*f_it);
v0 = *( fv_it);
......@@ -119,7 +117,7 @@ void MeshObjectSelectionPlugin::update_regions(MeshType* _mesh) {
v2 = *(++fv_it);
const bool a =(_mesh->status(v0).is_bit_set(AREA)|| _mesh->status(v1).is_bit_set(AREA)|| _mesh->status(v2).is_bit_set(AREA));
h =(_mesh->status(v0).is_bit_set(HANDLEAREA)&&
bool h =(_mesh->status(v0).is_bit_set(HANDLEAREA)&&
_mesh->status(v1).is_bit_set(HANDLEAREA)&&
_mesh->status(v2).is_bit_set(HANDLEAREA));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment