Image Component Library (ICL)
|
00001 /******************************************************************** 00002 ** Image Component Library (ICL) ** 00003 ** ** 00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** 00005 ** Neuroinformatics Group ** 00006 ** Website: www.iclcv.org and ** 00007 ** http://opensource.cit-ec.de/projects/icl ** 00008 ** ** 00009 ** File : ICLGeom/src/ICLGeom/PointCloudObject.h ** 00010 ** Module : ICLGeom ** 00011 ** Authors: Christof Elbrechter, Patrick Nobou ** 00012 ** ** 00013 ** ** 00014 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00015 ** This file may be used under the terms of the GNU Lesser General ** 00016 ** Public License version 3.0 as published by the ** 00017 ** ** 00018 ** Free Software Foundation and appearing in the file LICENSE.GPL ** 00019 ** included in the packaging of this file. Please review the ** 00020 ** following information to ensure the license requirements will ** 00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00022 ** ** 00023 ** The development of this software was supported by the ** 00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00026 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00027 ** Excellence Initiative. ** 00028 ** ** 00029 ********************************************************************/ 00030 00031 #pragma once 00032 00033 #include <ICLGeom/PointCloudObjectBase.h> 00034 00035 namespace icl{ 00036 namespace geom{ 00037 00039 00051 class PointCloudObject : public PointCloudObjectBase{ 00052 protected: 00053 bool m_organized; 00054 utils::Size m_dim2D; 00055 bool m_hasNormals; 00056 bool m_hasColors; 00057 00058 public: 00059 00061 PointCloudObject(int numPoints, bool withNormals=false, bool withColors=true); 00062 00064 00069 PointCloudObject(int width, int height, bool organized=true, bool withNormals=false, bool withColors=true); 00070 00072 virtual bool supports(FeatureType t) const; 00073 00075 virtual bool isOrganized() const; 00076 00078 virtual utils::Size getSize() const throw (utils::ICLException); 00079 00081 virtual int getDim() const; 00082 00084 00085 virtual void setSize(const utils::Size &size); 00086 00088 virtual DataSegment<float,3> selectXYZ(); 00089 00091 virtual DataSegment<float,4> selectXYZH(); 00092 00094 virtual DataSegment<float,4> selectRGBA32f(); 00095 00097 00098 virtual DataSegment<float,4> selectNormal(); 00099 00101 virtual void customRender(); 00102 00104 virtual PointCloudObject *copy() const { 00105 return new PointCloudObject(*this); 00106 } 00107 00109 00112 void push_back(const Vec &point){ 00113 addVertex(point,GeomColor(0,100,255,255)); 00114 if(m_hasNormals) m_normals.push_back(Vec(0,0,0,1)); 00115 } 00116 00118 00119 void push_back(const Vec &point, const GeomColor &color){ 00120 addVertex(point,color); 00121 if(m_hasNormals) m_normals.push_back(Vec(0,0,0,1)); 00122 } 00123 00125 00126 void push_back(const Vec &point, const Vec &normal, const GeomColor &color){ 00127 addVertex(point,color); 00128 if(m_hasNormals) m_normals.push_back(Vec(0,0,0,1)); 00129 } 00130 00131 private: 00132 00134 using SceneObject::addVertex; 00135 using SceneObject::addNormal; 00136 00137 }; 00138 00139 00140 00141 } // namespace geom 00142 } 00143