cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMesh
msh2PointCloud.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
// ****************************************************************************
4
//
5
// Copyright (c) 2014, Seth Billings, Russell Taylor, Johns Hopkins University
6
// All rights reserved.
7
//
8
// Redistribution and use in source and binary forms, with or without
9
// modification, are permitted provided that the following conditions are
10
// met:
11
//
12
// 1. Redistributions of source code must retain the above copyright
13
// notice, this list of conditions and the following disclaimer.
14
//
15
// 2. Redistributions in binary form must reproduce the above copyright
16
// notice, this list of conditions and the following disclaimer in the
17
// documentation and/or other materials provided with the distribution.
18
//
19
// 3. Neither the name of the copyright holder nor the names of its
20
// contributors may be used to endorse or promote products derived from
21
// this software without specific prior written permission.
22
//
23
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
//
35
// ****************************************************************************
36
37
#ifndef _msh2PointCloud_h
38
#define _msh2PointCloud_h
39
40
#include <stdio.h>
41
42
#include <
cisstMesh/mshConfig.h
>
43
44
#if CISST_MSH_HAS_RPLY
45
#include "ply_io.h"
46
#endif
47
48
#include <
cisstVector/vctFixedSizeVectorTypes.h
>
49
#include <
cisstVector/vctDynamicVectorTypes.h
>
50
51
// Always include last!
52
#include <
cisstMesh/mshExport.h
>
53
54
class
CISST_EXPORT
msh2PointCloud
55
{
56
57
private
:
58
59
#if CISST_MSH_HAS_RPLY
60
ply_io ply_obj;
61
#endif
62
63
public
:
64
65
vctDynamicVector<vct2>
points
;
66
vctDynamicVector<vct2>
pointOrientations
;
67
68
msh2PointCloud
(
vctDynamicVector<vct2>
&
points
) :
69
points
(
points
)
70
{};
71
72
msh2PointCloud
(
vctDynamicVector<vct2>
&
points
,
vctDynamicVector<vct2>
&
pointOrientations
) :
73
points
(
points
),
74
pointOrientations
(
pointOrientations
)
75
{};
76
77
// Point Set I/O
78
void
LoadPLY
(
const
std::string &input_file);
79
void
SavePLY
(
const
std::string &output_file);
80
static
int
WritePointCloudToFile
(
vctDynamicVector<vct2>
&
points
, std::string &filePath);
81
static
int
ReadPointCloudFromFile
(
vctDynamicVector<vct2>
&
points
, std::string &filePath);
82
static
int
AppendPointCloudFromFile
(
vctDynamicVector<vct2>
&
points
, std::string &filePath);
83
84
int
WritePointCloudToFile
(std::string &filePath)
85
{
86
return
WritePointCloudToFile
(
points
, filePath);
87
}
88
89
int
ReadPointCloudFromFile
(std::string &filePath)
90
{
91
return
ReadPointCloudFromFile
(
points
, filePath);
92
}
93
94
int
AppendPointCloudFromFile
(std::string &filePath)
95
{
96
return
AppendPointCloudFromFile
(
points
, filePath);
97
}
98
99
};
100
101
#endif
// _cisstPointCloud2D_h_
msh2PointCloud::msh2PointCloud
msh2PointCloud(vctDynamicVector< vct2 > &points)
Definition
msh2PointCloud.h:68
msh2PointCloud::AppendPointCloudFromFile
int AppendPointCloudFromFile(std::string &filePath)
Definition
msh2PointCloud.h:94
msh2PointCloud::ReadPointCloudFromFile
int ReadPointCloudFromFile(std::string &filePath)
Definition
msh2PointCloud.h:89
msh2PointCloud::WritePointCloudToFile
static int WritePointCloudToFile(vctDynamicVector< vct2 > &points, std::string &filePath)
msh2PointCloud::AppendPointCloudFromFile
static int AppendPointCloudFromFile(vctDynamicVector< vct2 > &points, std::string &filePath)
msh2PointCloud::pointOrientations
vctDynamicVector< vct2 > pointOrientations
Definition
msh2PointCloud.h:66
msh2PointCloud::WritePointCloudToFile
int WritePointCloudToFile(std::string &filePath)
Definition
msh2PointCloud.h:84
msh2PointCloud::LoadPLY
void LoadPLY(const std::string &input_file)
msh2PointCloud::SavePLY
void SavePLY(const std::string &output_file)
msh2PointCloud::ReadPointCloudFromFile
static int ReadPointCloudFromFile(vctDynamicVector< vct2 > &points, std::string &filePath)
msh2PointCloud::msh2PointCloud
msh2PointCloud(vctDynamicVector< vct2 > &points, vctDynamicVector< vct2 > &pointOrientations)
Definition
msh2PointCloud.h:72
msh2PointCloud::points
vctDynamicVector< vct2 > points
Definition
msh2PointCloud.h:65
vctDynamicVector
Definition
vctForwardDeclarations.h:131
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
mshConfig.h
mshExport.h
Macros to export the symbols of cisstMesh (in a Dll).
vctDynamicVectorTypes.h
Typedef for dynamic vectors.
vctFixedSizeVectorTypes.h
Typedef for fixed size vectors.
Generated by
1.18.0