From ee666541d5122b5334cb30aabb2ca65089b01d01 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Mon, 7 Jan 2019 21:50:55 +0100 Subject: [PATCH] Wire up volume calculation --- exercise3/src/SurfaceArea.cpp | 4 +--- exercise3/src/Volume.cpp | 12 +++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/exercise3/src/SurfaceArea.cpp b/exercise3/src/SurfaceArea.cpp index 7b2d8b3..2f538d5 100644 --- a/exercise3/src/SurfaceArea.cpp +++ b/exercise3/src/SurfaceArea.cpp @@ -11,9 +11,7 @@ float ComputeSurfaceArea(const HEMesh& m) { Triangles triangles(m); - float area = 0.0f; - - area = triangles.surface_area(); + float area = triangles.surface_area(); return area; } \ No newline at end of file diff --git a/exercise3/src/Volume.cpp b/exercise3/src/Volume.cpp index 39516c2..0e13988 100644 --- a/exercise3/src/Volume.cpp +++ b/exercise3/src/Volume.cpp @@ -1,15 +1,17 @@ -// This source code is property of the Computer Graphics and Visualization -// chair of the TU Dresden. Do not distribute! +// This source code is property of the Computer Graphics and Visualization +// chair of the TU Dresden. Do not distribute! // Copyright (C) CGV TU Dresden - All Rights Reserved #include "Volume.h" +#include "triangles.h" #include float ComputeVolume(const HEMesh& m) { - float vol = 0; - /*Task 2.2.2*/ - std::cout << "Volume calculation is not implemented." << std::endl; + Triangles triangles(m); + + float vol = triangles.volume(); + return vol; } \ No newline at end of file