Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
b58979d0
Commit
b58979d0
authored
Jul 30, 2014
by
edgarriba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code tutorial
parent
38c2cc85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
+82
-0
Mesh.cpp
...orial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp
+82
-0
No files found.
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp
0 → 100644
View file @
b58979d0
/*
* Mesh.cpp
*
* Created on: Apr 9, 2014
* Author: edgar
*/
#include "Mesh.h"
#include "CsvReader.h"
// --------------------------------------------------- //
// TRIANGLE CLASS //
// --------------------------------------------------- //
/** The custom constructor of the Triangle Class */
Triangle
::
Triangle
(
int
id
,
cv
::
Point3f
V0
,
cv
::
Point3f
V1
,
cv
::
Point3f
V2
)
{
id_
=
id
;
v0_
=
V0
;
v1_
=
V1
;
v2_
=
V2
;
}
/** The default destructor of the Class */
Triangle
::~
Triangle
()
{
// TODO Auto-generated destructor stub
}
// --------------------------------------------------- //
// RAY CLASS //
// --------------------------------------------------- //
/** The custom constructor of the Ray Class */
Ray
::
Ray
(
cv
::
Point3f
P0
,
cv
::
Point3f
P1
)
{
p0_
=
P0
;
p1_
=
P1
;
}
/** The default destructor of the Class */
Ray
::~
Ray
()
{
// TODO Auto-generated destructor stub
}
// --------------------------------------------------- //
// OBJECT MESH CLASS //
// --------------------------------------------------- //
/** The default constructor of the ObjectMesh Class */
Mesh
::
Mesh
()
:
list_vertex_
(
0
)
,
list_triangles_
(
0
)
{
id_
=
0
;
num_vertexs_
=
0
;
num_triangles_
=
0
;
}
/** The default destructor of the ObjectMesh Class */
Mesh
::~
Mesh
()
{
// TODO Auto-generated destructor stub
}
/** Load a CSV with *.ply format **/
void
Mesh
::
load
(
const
std
::
string
path
)
{
// Create the reader
CsvReader
csvReader
(
path
);
// Clear previous data
list_vertex_
.
clear
();
list_triangles_
.
clear
();
// Read from .ply file
csvReader
.
readPLY
(
list_vertex_
,
list_triangles_
);
// Update mesh attributes
num_vertexs_
=
list_vertex_
.
size
();
num_triangles_
=
list_triangles_
.
size
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment