-
-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to convex hull visualization * Use the newer viewer everywhere but in ROS related viewer
- Loading branch information
Showing
19 changed files
with
260 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
add_library(drawable SHARED | ||
drawable_cloud.cpp | ||
object_painter.cpp | ||
drawable_polygon3d.cpp | ||
drawable_cube.cpp) | ||
target_link_libraries(drawable | ||
${OpenCV_LIBS} | ||
${OPENGL_gl_LIBRARY} | ||
${OPENGL_glu_LIBRARY}) | ||
${OPENGL_glu_LIBRARY}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright Igor Bogoslavskyi, year 2017. | ||
// In case of any problems with the code please contact me. | ||
// Email: [email protected]. | ||
|
||
#include "./drawable_polygon3d.h" | ||
#include <GL/glut.h> | ||
|
||
namespace depth_clustering { | ||
|
||
void DrawablePolygon3d::Draw() const { | ||
if (polygon_.empty()) { | ||
return; | ||
} | ||
glPushMatrix(); | ||
const auto start = polygon_.front(); | ||
glColor3f(color_[0], color_[1], color_[2]); | ||
glLineWidth(4.0f); | ||
glBegin(GL_LINE_STRIP); | ||
|
||
// Bottom polygon | ||
for (const auto& point : polygon_) { | ||
glVertex3f(point.x(), point.y(), point.z()); | ||
} | ||
glVertex3f(start.x(), start.y(), start.z()); | ||
|
||
// Top polygon | ||
for (const auto& point : polygon_) { | ||
glVertex3f(point.x(), point.y(), point.z() + height_); | ||
} | ||
glVertex3f(start.x(), start.y(), start.z() + height_); | ||
|
||
glEnd(); | ||
|
||
glBegin(GL_LINES); | ||
// For the Sides of the polygon | ||
for (const auto& point : polygon_) { | ||
glVertex3f(point.x(), point.y(), point.z()); | ||
glVertex3f(point.x(), point.y(), point.z() + height_); | ||
} | ||
glEnd(); | ||
glPopMatrix(); | ||
} | ||
|
||
} // namespace depth_clustering |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright Igor Bogoslavskyi, year 2017. | ||
// In case of any problems with the code please contact me. | ||
// Email: [email protected]. | ||
|
||
#ifndef SRC_QT_DRAWABLES_DRAWABLE_POLYGON3D_H_ | ||
#define SRC_QT_DRAWABLES_DRAWABLE_POLYGON3D_H_ | ||
|
||
#include <Eigen/Core> | ||
#include <vector> | ||
|
||
#include "qt/drawables/drawable.h" | ||
#include "utils/mem_utils.h" | ||
|
||
namespace depth_clustering { | ||
|
||
class DrawablePolygon3d : public Drawable { | ||
public: | ||
using AlignedEigenVectors = | ||
std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f>>; | ||
DrawablePolygon3d(const AlignedEigenVectors& polygon, float height, | ||
const Eigen::Vector3f& color) | ||
: polygon_{polygon}, height_{height}, color_{color} {} | ||
|
||
void Draw() const override; | ||
static DrawablePolygon3d::UniquePtr Create( | ||
const AlignedEigenVectors& polygon, float height, | ||
const Eigen::Vector3f& color = Eigen::Vector3f(1.0f, 0.5f, 0.2f)) { | ||
return mem_utils::make_unique<DrawablePolygon3d>( | ||
DrawablePolygon3d(polygon, height, color)); | ||
} | ||
|
||
~DrawablePolygon3d() override {} | ||
|
||
private: | ||
AlignedEigenVectors polygon_; | ||
float height_; | ||
Eigen::Vector3f color_; | ||
}; | ||
|
||
} // namespace depth_clustering | ||
|
||
#endif // SRC_QT_DRAWABLES_DRAWABLE_POLYGON3D_H_ |
Oops, something went wrong.