cisst-saw
Loading...
Searching...
No Matches
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
50
51// Always include last!
52#include <cisstMesh/mshExport.h>
53
55{
56
57 private:
58
59#if CISST_MSH_HAS_RPLY
60 ply_io ply_obj;
61#endif
62
63 public:
64
67
71
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(vctDynamicVector< vct2 > &points)
Definition msh2PointCloud.h:68
int AppendPointCloudFromFile(std::string &filePath)
Definition msh2PointCloud.h:94
int ReadPointCloudFromFile(std::string &filePath)
Definition msh2PointCloud.h:89
static int WritePointCloudToFile(vctDynamicVector< vct2 > &points, std::string &filePath)
static int AppendPointCloudFromFile(vctDynamicVector< vct2 > &points, std::string &filePath)
vctDynamicVector< vct2 > pointOrientations
Definition msh2PointCloud.h:66
int WritePointCloudToFile(std::string &filePath)
Definition msh2PointCloud.h:84
void LoadPLY(const std::string &input_file)
void SavePLY(const std::string &output_file)
static int ReadPointCloudFromFile(vctDynamicVector< vct2 > &points, std::string &filePath)
msh2PointCloud(vctDynamicVector< vct2 > &points, vctDynamicVector< vct2 > &pointOrientations)
Definition msh2PointCloud.h:72
vctDynamicVector< vct2 > points
Definition msh2PointCloud.h:65
Definition vctForwardDeclarations.h:131
#define CISST_EXPORT
Definition cmnExportMacros.h:50
Macros to export the symbols of cisstMesh (in a Dll).
Typedef for dynamic vectors.
Typedef for fixed size vectors.