ГОСТ Р ИСО/ТС 10303-26—2015
/ /
// Exemplifies how the Point Compound type, defined by means of the
// define_compound_point function, is used to populate Points on
// an HDF5 dataset.
// Geometrically the Points make up corners of a square(0,0>,(100,0),
//
(
1
00
,
1
00
)
,
(
0
,
1
00
)
I t -
........................................................................................................................................................................................................................................................
herr_t create_ppoir.ts(hid_t group_id, hid t p_tid)
{
herr t rstat;
hid_tpoint_dataset;
hid tmyspace;
hid_tobj_group;
hsize_t mydimJ1J;
point_t ppoints(NO_OF_PPOINTSI;
/ /
// Populate the points in a memory buffer
/ /
ppoints(0J.set_unset_bitmap - 7;
ppoints(0).id - 0;
ppointsC0j.x - 0
ppoints(0J.y *■0.;
ppoints(1J.set_unset_bitmap - 7;
ppoints(1;.id - 1;
ppointsflj.x - 100.;
ppoint3(lJ.y - 0.;
ppoints[2].set_unset_bitmap - 7;
ppoints[2].id - 2;
ppoints[2].x - 100.;
ppoints(2j.у - 100.;
ppointe(3
)
.set_unset_bitmap - 7;
ppoints(3).id - 3;
ppointsf3).x - 0.;
ppoints[3J.y - 100.;
//
// Create the group that shall contain the dataset
/ /
objgroup - H5Gcreate(groupid, ”Point_objects", H5P_DEFAU1T,
H5P_DEbAUL7, H5P_DEFAULT);
/ /
// Create the dataset that shall contain the Points
/ /
mydimfO; - NO_OF_PPOINTS;
myspace - H5Screate_simple(1, mydim, NULL);
point_dataset - H5Dcreatel (obj_group, ,,Point_in3tances", p_tid,
myspace, H5P_DEFAULT);
/ /
// Write the Points to the dataset
/ /
rstat - H5Dwrite(point_dataset, p_tid, H5S_ALL, H5S_ALL,
H5P_DEFAULT, ppoints);
return(rstat);
)
29