Point Cloud Library (PCL) 1.12.0
Loading...
Searching...
No Matches
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_geometry_handlers.h> // for PointCloudGeometryHandler
41#include <pcl/visualization/point_cloud_color_handlers.h> // for PointCloudColorHandler
42#include <pcl/PCLPointCloud2.h>
43
44#include <vtkLODActor.h>
45#include <vtkSmartPointer.h>
46#include <vtkIdTypeArray.h>
47
48#include <unordered_map>
49#include <vector>
50
51template <typename T> class vtkSmartPointer;
52class vtkLODActor;
53class vtkProp;
54
55namespace pcl
56{
57 namespace visualization
58 {
59 class PCL_EXPORTS CloudActor
60 {
62 using GeometryHandlerPtr = GeometryHandler::Ptr;
63 using GeometryHandlerConstPtr = GeometryHandler::ConstPtr;
64
66 using ColorHandlerPtr = ColorHandler::Ptr;
67 using ColorHandlerConstPtr = ColorHandler::ConstPtr;
68
69 public:
70 CloudActor () : color_handler_index_ (0), geometry_handler_index_ (0) {}
71
72 virtual ~CloudActor ()
73 {
74 geometry_handlers.clear ();
75 color_handlers.clear ();
76 }
77
78 /** \brief The actor holding the data to render. */
80
81 /** \brief A vector of geometry handlers that can be used for rendering the data. */
82 std::vector<GeometryHandlerConstPtr> geometry_handlers;
83
84 /** \brief A vector of color handlers that can be used for rendering the data. */
85 std::vector<ColorHandlerConstPtr> color_handlers;
86
87 /** \brief The active color handler. */
89
90 /** \brief The active geometry handler. */
92
93 /** \brief The viewpoint transformation matrix. */
95
96 /** \brief Internal cell array. Used for optimizing updatePointCloud. */
98 };
99
100 using CloudActorMap = std::unordered_map<std::string, CloudActor>;
101 using CloudActorMapPtr = shared_ptr<CloudActorMap>;
102
103 using ShapeActorMap = std::unordered_map<std::string, vtkSmartPointer<vtkProp> >;
104 using ShapeActorMapPtr = shared_ptr<ShapeActorMap>;
105
106 using CoordinateActorMap = std::unordered_map<std::string, vtkSmartPointer<vtkProp> >;
107 using CoordinateActorMapPtr = shared_ptr<CoordinateActorMap>;
108 }
109}
vtkSmartPointer< vtkLODActor > actor
The actor holding the data to render.
Definition actor_map.h:79
vtkSmartPointer< vtkIdTypeArray > cells
Internal cell array.
Definition actor_map.h:97
std::vector< ColorHandlerConstPtr > color_handlers
A vector of color handlers that can be used for rendering the data.
Definition actor_map.h:85
int color_handler_index_
The active color handler.
Definition actor_map.h:88
vtkSmartPointer< vtkMatrix4x4 > viewpoint_transformation_
The viewpoint transformation matrix.
Definition actor_map.h:94
std::vector< GeometryHandlerConstPtr > geometry_handlers
A vector of geometry handlers that can be used for rendering the data.
Definition actor_map.h:82
int geometry_handler_index_
The active geometry handler.
Definition actor_map.h:91
shared_ptr< const PointCloudColorHandler< PointCloud > > ConstPtr
Base Handler class for PointCloud colors.
shared_ptr< const PointCloudGeometryHandler< PointCloud > > ConstPtr
Base handler class for PointCloud geometry.
std::unordered_map< std::string, CloudActor > CloudActorMap
Definition actor_map.h:100
std::unordered_map< std::string, vtkSmartPointer< vtkProp > > ShapeActorMap
Definition actor_map.h:103
shared_ptr< CloudActorMap > CloudActorMapPtr
Definition actor_map.h:101
std::unordered_map< std::string, vtkSmartPointer< vtkProp > > CoordinateActorMap
Definition actor_map.h:106
shared_ptr< ShapeActorMap > ShapeActorMapPtr
Definition actor_map.h:104
shared_ptr< CoordinateActorMap > CoordinateActorMapPtr
Definition actor_map.h:107