MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / SetUp

Method SetUp

test/io/test_ply_io.cpp:137–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135struct PLYColorTest : public PLYTest
136{
137 void SetUp () override
138 {
139 // Test colors from ply_benchmark.ply
140 clr_1_.r = 255;
141 clr_1_.g = 0;
142 clr_1_.b = 0;
143 clr_1_.a = 255;
144
145 clr_2_.r = 0;
146 clr_2_.g = 255;
147 clr_2_.b = 0;
148 clr_2_.a = 0;
149
150 clr_3_.r = 0;
151 clr_3_.g = 0;
152 clr_3_.b = 255;
153 clr_3_.a = 128;
154
155 clr_4_.r = 255;
156 clr_4_.g = 255;
157 clr_4_.b = 255;
158 clr_4_.a = 128;
159
160 std::ofstream fs;
161 fs.open (mesh_file_ply_.c_str ());
162 fs << "ply\n"
163 "format ascii 1.0\n"
164 "element vertex 4\n"
165 "property float x\n"
166 "property float y\n"
167 "property float z\n"
168 "property uchar red\n"
169 "property uchar green\n"
170 "property uchar blue\n"
171 "property uchar alpha\n"
172 "element face 2\n"
173 "property list uchar int vertex_indices\n"
174 "end_header\n"
175 "4.23607 0 1.61803 "
176 << static_cast<unsigned>(clr_1_.r) << ' '
177 << static_cast<unsigned>(clr_1_.g) << ' '
178 << static_cast<unsigned>(clr_1_.b) << ' '
179 << static_cast<unsigned>(clr_1_.a) << "\n"
180 "2.61803 2.61803 2.61803 "
181 << static_cast<unsigned>(clr_2_.r) << ' '
182 << static_cast<unsigned>(clr_2_.g) << ' '
183 << static_cast<unsigned>(clr_2_.b) << ' '
184 << static_cast<unsigned>(clr_2_.a) << "\n"
185 "0 1.61803 4.23607 "
186 << static_cast<unsigned>(clr_3_.r) << ' '
187 << static_cast<unsigned>(clr_3_.g) << ' '
188 << static_cast<unsigned>(clr_3_.b) << ' '
189 << static_cast<unsigned>(clr_3_.a) << "\n"
190 "0 -1.61803 4.23607 "
191 << static_cast<unsigned>(clr_4_.r) << ' '
192 << static_cast<unsigned>(clr_4_.g) << ' '
193 << static_cast<unsigned>(clr_4_.b) << ' '
194 << static_cast<unsigned>(clr_4_.a) << "\n"

Callers

nothing calls this directly

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected