Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef CLOUD_H_
00043 #define CLOUD_H_
00044
00045 #include <QtGui/QColor>
00046 #include <pcl/apps/point_cloud_editor/localTypes.h>
00047 #include <pcl/apps/point_cloud_editor/statistics.h>
00048
00061
00062
00063
00064
00065 class Cloud : public Statistics
00066 {
00067 public:
00069 Cloud ();
00070
00075 Cloud (const Cloud& copy);
00076
00081 Cloud (const Cloud3D& cloud, bool register_stats=false);
00082
00084 ~Cloud ();
00085
00090 Cloud&
00091 operator= (const Cloud& cloud);
00092
00100 Point3D&
00101 operator[] (unsigned int index);
00102
00110 const Point3D&
00111 operator[] (unsigned int index) const;
00112
00117 inline
00118 void
00119 getCenter (float &x, float &y, float &z) const
00120 {
00121 x = center_xyz_[X]; y = center_xyz_[Y]; z = center_xyz_[Z];
00122 }
00123
00126 inline
00127 float
00128 getScalingFactor() const
00129 {
00130 return (display_scale_);
00131 }
00132
00138 inline
00139 const float*
00140 getMatrix () const
00141 {
00142 return (cloud_matrix_);
00143 }
00144
00152 void
00153 loadMatrix (const float* matrix);
00154
00163 void
00164 multMatrix (const float* matrix);
00165
00176 void
00177 setSelectionRotation (const float* matrix);
00178
00179 void
00180 setSelectionTranslation (float dx, float dy, float dz);
00181
00196 void
00197 setSelection (SelectionPtr selection_ptr);
00198
00203 void
00204 setRGB (float r, float g, float b);
00205
00210 void
00211 setHighlightColor (float r, float g, float b);
00212
00217 void
00218 draw (bool disable_highlight = false) const;
00219
00223 void
00224 drawWithTexture () const;
00225
00230 void
00231 drawWithRGB () const;
00232
00235 void
00236 drawWithPureColor () const;
00237
00240 void
00241 drawWithHighlightColor () const;
00242
00247 inline
00248 void
00249 setColorRampAxis(Axis a)
00250 {
00251 color_ramp_axis_ = a;
00252 }
00253
00259 inline
00260 void
00261 setColorRamp(bool on_off)
00262 {
00263 use_color_ramp_ = on_off;
00264 }
00265
00268 void
00269 append (const Point3D& point);
00270
00273 void
00274 append (const Cloud& cloud);
00275
00286 void
00287 remove (const Selection& selection);
00288
00290 inline
00291 unsigned int
00292 size () const
00293 {
00294 return (cloud_.size());
00295 }
00296
00303 void
00304 resize (unsigned int new_size);
00305
00307 void
00308 clear ();
00309
00312 void
00313 setPointSize (int size);
00314
00317 void
00318 setHighlightPointSize (int size);
00319
00327 Point3D
00328 getObjectSpacePoint (unsigned int index) const;
00329
00339 Point3D
00340 getDisplaySpacePoint (unsigned int index) const;
00341
00350 void
00351 getDisplaySpacePoints (std::vector<Point3D>& pts) const;
00352
00355 const Cloud3D&
00356 getInternalCloud () const;
00357
00360 void
00361 restore (const CopyBuffer& copy_buffer, const Selection& selection);
00362
00364 std::string
00365 getStat () const;
00366
00368 static const float DEFAULT_POINT_DISPLAY_SIZE_;
00370 static const float DEFAULT_POINT_HIGHLIGHT_SIZE_;
00372 static const float DEFAULT_POINT_DISPLAY_COLOR_RED_;
00374 static const float DEFAULT_POINT_DISPLAY_COLOR_GREEN_;
00376 static const float DEFAULT_POINT_DISPLAY_COLOR_BLUE_;
00378 static const float DEFAULT_POINT_HIGHLIGHT_COLOR_RED_;
00380 static const float DEFAULT_POINT_HIGHLIGHT_COLOR_GREEN_;
00382 static const float DEFAULT_POINT_HIGHLIGHT_COLOR_BLUE_;
00383
00384 private:
00391 void
00392 updateCloudMembers ();
00393
00395 void
00396 enableTexture () const;
00397
00399 void
00400 disableTexture() const;
00401
00403 Cloud3D cloud_;
00404
00408 boost::weak_ptr<Selection> selection_wk_ptr_;
00409
00412 bool use_color_ramp_;
00413
00416 bool use_native_color_;
00417
00419 Axis color_ramp_axis_;
00420
00423 float display_scale_;
00424
00427 float center_xyz_[XYZ_SIZE];
00428
00431 float min_xyz_[XYZ_SIZE];
00432
00435 float max_xyz_[XYZ_SIZE];
00436
00438 float cloud_matrix_[MATRIX_SIZE];
00439
00443 float select_matrix_[MATRIX_SIZE];
00444
00450 IndexVector partitioned_indices_;
00451
00453 float point_size_;
00454
00456 float selected_point_size_;
00457
00460 float color_[RGB];
00461
00463 float highlight_color_[RGB];
00464
00466 float select_translate_x_, select_translate_y_, select_translate_z_;
00467 };
00468 #endif // CLOUD_H_
00469
00470
00471
00472