Point Cloud Library (PCL)  1.11.1-dev
actor_map.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, 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  * $Id$
35  *
36  */
37 
38 #pragma once
39 
40 #include <pcl/visualization/point_cloud_handlers.h>
41 #include <pcl/PCLPointCloud2.h>
42 
43 #include <vtkLODActor.h>
44 #include <vtkSmartPointer.h>
45 
46 #include <unordered_map>
47 #include <vector>
48 
49 template <typename T> class vtkSmartPointer;
50 class vtkLODActor;
51 class vtkProp;
52 
53 namespace pcl
54 {
55  namespace visualization
56  {
58  {
60  using GeometryHandlerPtr = GeometryHandler::Ptr;
61  using GeometryHandlerConstPtr = GeometryHandler::ConstPtr;
62 
64  using ColorHandlerPtr = ColorHandler::Ptr;
65  using ColorHandlerConstPtr = ColorHandler::ConstPtr;
66 
67  public:
68  CloudActor () : color_handler_index_ (0), geometry_handler_index_ (0) {}
69 
70  virtual ~CloudActor ()
71  {
72  geometry_handlers.clear ();
73  color_handlers.clear ();
74  }
75 
76  /** \brief The actor holding the data to render. */
78 
79  /** \brief A vector of geometry handlers that can be used for rendering the data. */
80  std::vector<GeometryHandlerConstPtr> geometry_handlers;
81 
82  /** \brief A vector of color handlers that can be used for rendering the data. */
83  std::vector<ColorHandlerConstPtr> color_handlers;
84 
85  /** \brief The active color handler. */
87 
88  /** \brief The active geometry handler. */
90 
91  /** \brief The viewpoint transformation matrix. */
93 
94  /** \brief Internal cell array. Used for optimizing updatePointCloud. */
96  };
97 
98  using CloudActorMap = std::unordered_map<std::string, CloudActor>;
99  using CloudActorMapPtr = shared_ptr<CloudActorMap>;
100 
101  using ShapeActorMap = std::unordered_map<std::string, vtkSmartPointer<vtkProp> >;
102  using ShapeActorMapPtr = shared_ptr<ShapeActorMap>;
103 
104  using CoordinateActorMap = std::unordered_map<std::string, vtkSmartPointer<vtkProp> >;
105  using CoordinateActorMapPtr = shared_ptr<CoordinateActorMap>;
106  }
107 }
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >
Base Handler class for PointCloud colors.
Definition: point_cloud_color_handlers.h:543
pcl::visualization::ShapeActorMapPtr
shared_ptr< ShapeActorMap > ShapeActorMapPtr
Definition: actor_map.h:102
pcl
Definition: convolution.h:46
pcl::visualization::CloudActor::CloudActor
CloudActor()
Definition: actor_map.h:68
pcl::visualization::CloudActor::cells
vtkSmartPointer< vtkIdTypeArray > cells
Internal cell array.
Definition: actor_map.h:95
pcl::visualization::CloudActor::color_handler_index_
int color_handler_index_
The active color handler.
Definition: actor_map.h:86
pcl::visualization::CloudActorMap
std::unordered_map< std::string, CloudActor > CloudActorMap
Definition: actor_map.h:98
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::Ptr
shared_ptr< PointCloudColorHandler< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:550
pcl::visualization::CloudActor::geometry_handler_index_
int geometry_handler_index_
The active geometry handler.
Definition: actor_map.h:89
pcl::visualization::CloudActorMapPtr
shared_ptr< CloudActorMap > CloudActorMapPtr
Definition: actor_map.h:99
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::ConstPtr
shared_ptr< const PointCloudColorHandler< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:551
pcl::visualization::PointCloudGeometryHandler< pcl::PCLPointCloud2 >
Base handler class for PointCloud geometry.
Definition: point_cloud_geometry_handlers.h:324
pcl::visualization::CoordinateActorMap
std::unordered_map< std::string, vtkSmartPointer< vtkProp > > CoordinateActorMap
Definition: actor_map.h:104
pcl::visualization::CloudActor::~CloudActor
virtual ~CloudActor()
Definition: actor_map.h:70
pcl::visualization::CloudActor::viewpoint_transformation_
vtkSmartPointer< vtkMatrix4x4 > viewpoint_transformation_
The viewpoint transformation matrix.
Definition: actor_map.h:92
pcl::visualization::PointCloudGeometryHandler< pcl::PCLPointCloud2 >::Ptr
shared_ptr< PointCloudGeometryHandler< PointCloud > > Ptr
Definition: point_cloud_geometry_handlers.h:331
pcl::visualization::ShapeActorMap
std::unordered_map< std::string, vtkSmartPointer< vtkProp > > ShapeActorMap
Definition: actor_map.h:101
pcl::visualization::PointCloudGeometryHandler< pcl::PCLPointCloud2 >::ConstPtr
shared_ptr< const PointCloudGeometryHandler< PointCloud > > ConstPtr
Definition: point_cloud_geometry_handlers.h:332
pcl::visualization::CloudActor::geometry_handlers
std::vector< GeometryHandlerConstPtr > geometry_handlers
A vector of geometry handlers that can be used for rendering the data.
Definition: actor_map.h:80
pcl::visualization::CloudActor::color_handlers
std::vector< ColorHandlerConstPtr > color_handlers
A vector of color handlers that can be used for rendering the data.
Definition: actor_map.h:83
pcl::visualization::CloudActor
Definition: actor_map.h:57
pcl::visualization::CoordinateActorMapPtr
shared_ptr< CoordinateActorMap > CoordinateActorMapPtr
Definition: actor_map.h:105
pcl::visualization::CloudActor::actor
vtkSmartPointer< vtkLODActor > actor
The actor holding the data to render.
Definition: actor_map.h:77
PCL_EXPORTS
#define PCL_EXPORTS
Definition: pcl_macros.h:323
vtkSmartPointer
Definition: actor_map.h:49