Add an Attribute to an EPointCloud without Initial Data¶
The code shows how to add an attribute to a cloud when you don’t have the data.
C++¶
#include <eVision/Easy3D/EPointCloud.h>
using namespace eVision;
using namespace eVision::Easy3D;
EPointCloud cloud;
EC24A defaultValue;
// case 1: data is Color, Normal, Intensity, Texture, Index, Confidence or Distance
cloud.AllocateAttributeBufferEC24A(E3DAttribute_Color, defaultValue);
// case 2: data is something else
int attributeOffset = cloud.AllocateCustomAttributeBufferEC24A(defaultValue);
C#¶
using eVision;
using eVision.Easy3D;
EPointCloud cloud = new EPointCloud();
EC24A defaultValue = new EC24A(17, 17, 17);
// case 1: data is Color, Normal, Intensity, Texture, Index, Confidence or Distance
cloud.AllocateAttributeBufferEC24A((int)E3DAttribute.Color, defaultValue);
// case 2: data is something else
int attributeOffset = cloud.AllocateCustomAttributeBufferEC24A(defaultValue);
Python¶
import eVision
from eVision import Easy3D
cloud = Easy3D.EPointCloud()
defaultValue = eVision.EC24A(17, 17, 17)
# case 1: data is Color, Normal, Intensity, Texture, Index, Confidence or Distance
cloud.AllocateAttributeBufferEC24A(Easy3D.E3DAttribute.Color, defaultValue)
# case 2: data is something else
attribute_offset = cloud.AllocateCustomAttributeBufferEC24A(defaultValue)