Point Cloud Library (PCL)  1.14.0-dev
pcl_cuda_base.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  */
35 
36 #pragma once
37 
38 #include <pcl/memory.h>
39 #include <pcl/cuda/point_cloud.h>
40 
41 
42 namespace pcl
43 {
44 namespace cuda
45 {
46  ///////////////////////////////////////////////////////////////////////////////////////////
47  /** \brief PCL base class. Implements methods that are used by all PCL objects.
48  */
49  template <typename CloudT>
51  {
52  public:
53  using PointCloud = CloudT;
54  using PointCloudPtr = typename PointCloud::Ptr;
56 
57  /** \brief Empty constructor. */
58  PCLCUDABase () : input_() {};
59 
60  /** \brief Provide a pointer to the input dataset
61  * \param cloud the const boost shared pointer to a PointCloud message
62  */
63  virtual inline void
65  {
66  input_ = cloud;
67  }
68 
69  /** \brief Get a pointer to the input host point cloud dataset. */
70  inline PointCloudConstPtr const
72  {
73  return (input_);
74  }
75 
76  protected:
77  /** \brief The input point cloud dataset. */
79 
80  /** \brief This method should get called before starting the actual computation. */
81  bool
83  {
84  // Check if input was set
85  if (!input_)
86  return (false);
87  return (true);
88  }
89 
90  /** \brief This method should get called after finishing the actual computation. */
91  bool
93  {
94  return (true);
95  }
96  };
97 } // namespace
98 } // namespace
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:413
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:414
PCL base class.
Definition: pcl_cuda_base.h:51
PointCloudConstPtr const getInputCloud()
Get a pointer to the input host point cloud dataset.
Definition: pcl_cuda_base.h:71
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
Definition: pcl_cuda_base.h:64
bool deinitCompute()
This method should get called after finishing the actual computation.
Definition: pcl_cuda_base.h:92
typename PointCloud::Ptr PointCloudPtr
Definition: pcl_cuda_base.h:54
typename PointCloud::ConstPtr PointCloudConstPtr
Definition: pcl_cuda_base.h:55
PCLCUDABase()
Empty constructor.
Definition: pcl_cuda_base.h:58
bool initCompute()
This method should get called before starting the actual computation.
Definition: pcl_cuda_base.h:82
PointCloudConstPtr input_
The input point cloud dataset.
Definition: pcl_cuda_base.h:78
Defines functions, macros and traits for allocating and using memory.