ClassesClasses | | Operators

set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttrib (Operator)

Name

set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttrib — Set attributes of a 3D object model.

Signature

set_object_model_3d_attrib( : : ObjectModel3D, AttribName, AttachExtAttribTo, AttribValues : ObjectModel3DOut)

Herror set_object_model_3d_attrib(const Hlong ObjectModel3D, const char* AttribName, const char* AttachExtAttribTo, double AttribValues, Hlong* ObjectModel3DOut)

Herror T_set_object_model_3d_attrib(const Htuple ObjectModel3D, const Htuple AttribName, const Htuple AttachExtAttribTo, const Htuple AttribValues, Htuple* ObjectModel3DOut)

void SetObjectModel3dAttrib(const HTuple& ObjectModel3D, const HTuple& AttribName, const HTuple& AttachExtAttribTo, const HTuple& AttribValues, HTuple* ObjectModel3DOut)

HObjectModel3D HObjectModel3D::SetObjectModel3dAttrib(const HTuple& AttribName, const HString& AttachExtAttribTo, const HTuple& AttribValues) const

HObjectModel3D HObjectModel3D::SetObjectModel3dAttrib(const HString& AttribName, const HString& AttachExtAttribTo, double AttribValues) const

HObjectModel3D HObjectModel3D::SetObjectModel3dAttrib(const char* AttribName, const char* AttachExtAttribTo, double AttribValues) const

static void HOperatorSet.SetObjectModel3dAttrib(HTuple objectModel3D, HTuple attribName, HTuple attachExtAttribTo, HTuple attribValues, out HTuple objectModel3DOut)

HObjectModel3D HObjectModel3D.SetObjectModel3dAttrib(HTuple attribName, string attachExtAttribTo, HTuple attribValues)

HObjectModel3D HObjectModel3D.SetObjectModel3dAttrib(string attribName, string attachExtAttribTo, double attribValues)

Description

set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttribSetObjectModel3dAttrib sets the standard attributes or the extended attributes given in AttribNameAttribNameAttribNameAttribNameattribName of a 3D object model ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3D to the values in AttribValuesAttribValuesAttribValuesAttribValuesattribValues and returns a 3D object model with the new attribute values in ObjectModel3DOutObjectModel3DOutObjectModel3DOutObjectModel3DOutobjectModel3DOut. set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttribSetObjectModel3dAttrib is identical to set_object_model_3d_attrib_modset_object_model_3d_attrib_modSetObjectModel3dAttribModSetObjectModel3dAttribModSetObjectModel3dAttribMod with the exception that it creates a new 3D object model and leaves the original 3D object model unchanged. It is possible to attach the values of extended attributes to already existing standard attributes of the 3D object model by setting the parameter AttachExtAttribToAttachExtAttribToAttachExtAttribToAttachExtAttribToattachExtAttribTo. For standard attributes, AttachExtAttribToAttachExtAttribToAttachExtAttribToAttachExtAttribToattachExtAttribTo is ignored.

If the attributes in AttribNameAttribNameAttribNameAttribNameattribName do not exist, they are created if possible. If already existing attributes are set, the length of AttribValuesAttribValuesAttribValuesAttribValuesattribValues must match the existing attribute values. In this case the existing attribute values are replaced. If extended attributes are attached to already existing standard attributes with AttachExtAttribToAttachExtAttribToAttachExtAttribToAttachExtAttribToattachExtAttribTo, the length of AttribValuesAttribValuesAttribValuesAttribValuesattribValues must match the existing attribute values.

Standard attributes

The following standard attributes can be set:

'point_coord_x'"point_coord_x""point_coord_x""point_coord_x""point_coord_x":

The x-coordinates of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. If the attribute does not exist, the x-, y- and z-coordinates must be set with 'point_coord_x'"point_coord_x""point_coord_x""point_coord_x""point_coord_x", 'point_coord_y'"point_coord_y""point_coord_y""point_coord_y""point_coord_y", and 'point_coord_z'"point_coord_z""point_coord_z""point_coord_z""point_coord_z" at once. The number of x-, y-, and z-coordinates must be identical.

'point_coord_y'"point_coord_y""point_coord_y""point_coord_y""point_coord_y":

The y-coordinates of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. If the attribute does not exist, the x-, y- and z-coordinates must be set with 'point_coord_x'"point_coord_x""point_coord_x""point_coord_x""point_coord_x", 'point_coord_y'"point_coord_y""point_coord_y""point_coord_y""point_coord_y", and 'point_coord_z'"point_coord_z""point_coord_z""point_coord_z""point_coord_z" at once. The number of x-, y-, and z-coordinates must be identical.

'point_coord_z'"point_coord_z""point_coord_z""point_coord_z""point_coord_z":

The z-coordinates of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. If the attribute does not exist, the x-, y- and z-coordinates must be set with 'point_coord_x'"point_coord_x""point_coord_x""point_coord_x""point_coord_x", 'point_coord_y'"point_coord_y""point_coord_y""point_coord_y""point_coord_y", and 'point_coord_z'"point_coord_z""point_coord_z""point_coord_z""point_coord_z" at once. The number of x-, y-, and z-coordinates must be identical.

'point_normal_x'"point_normal_x""point_normal_x""point_normal_x""point_normal_x":

The x-components of the 3D point normals of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. If the attribute does not exist, the x-, y- and z-components of 3D point normals must be set with 'point_normal_x'"point_normal_x""point_normal_x""point_normal_x""point_normal_x", 'point_normal_y'"point_normal_y""point_normal_y""point_normal_y""point_normal_y", and 'point_normal_z'"point_normal_z""point_normal_z""point_normal_z""point_normal_z" at once. The number of x-, y-, and z-components must be identical to the number of 3D points. Note that the given 3D point normals will not be normalized to a length of 1.

'point_normal_y'"point_normal_y""point_normal_y""point_normal_y""point_normal_y":

The y-components of the 3D point normals of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. If the attribute does not exist, the x-, y- and z-components of 3D point normals must be set with 'point_normal_x'"point_normal_x""point_normal_x""point_normal_x""point_normal_x", 'point_normal_y'"point_normal_y""point_normal_y""point_normal_y""point_normal_y", and 'point_normal_z'"point_normal_z""point_normal_z""point_normal_z""point_normal_z" at once. The number of x-, y-, and z-components must be identical to the number of 3D points. Note that the given 3D point normals will not be normalized to a length of 1.

'point_normal_z'"point_normal_z""point_normal_z""point_normal_z""point_normal_z":

The z-components of the 3D point normals of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. If the attribute does not exist, the x-, y- and z-components of 3D point normals must be set with 'point_normal_x'"point_normal_x""point_normal_x""point_normal_x""point_normal_x", 'point_normal_y'"point_normal_y""point_normal_y""point_normal_y""point_normal_y", and 'point_normal_z'"point_normal_z""point_normal_z""point_normal_z""point_normal_z" at once. The number of x-, y-, and z-components must be identical to the number of 3D points. Note that the given 3D point normals will not be normalized to a length of 1.

'score'"score""score""score""score":

The score of a 3D reconstruction of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. Since the score is evaluated separately for each 3D point, the number of the score-components must be identical to the number of 3D points.

'red'"red""red""red""red":

The red channel of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. The number of the score-components must be identical to the number of 3D points.

'green'"green""green""green""green":

The green channel of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. The number of the score-components must be identical to the number of 3D points.

'blue'"blue""blue""blue""blue":

The blue channel of the 3D points are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues. The number of the score-components must be identical to the number of 3D points.

'triangles'"triangles""triangles""triangles""triangles":

The indices of the 3D points that represent triangles are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues in the following order: The first three values of AttribValuesAttribValuesAttribValuesAttribValuesattribValues (input values 0,1,2) represent the first triangle and contain the indices of the corresponding 3D points of the triangle corners. The second three values (input values 3,4,5) represent the second triangle etc. The direction of the triangles results from the order of the point indices.

'polygons'"polygons""polygons""polygons""polygons":

The indices of the 3D points that represent polygons are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues in the following order: The first value of AttribValuesAttribValuesAttribValuesAttribValuesattribValues contains the number n of points of the first polygon. The following values (input values 1,2,..,n) contains the indices of the points of the first polygon. The next value (input value n+1) contains the number m of the points of the second polygon. The following m values (input values n+2,n+3,..,n+1+m) contain the indices of the points of the second polygon etc.

'lines'"lines""lines""lines""lines":

The indices of the 3D points that represent polylines are set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues in the following order: The first value of AttribValuesAttribValuesAttribValuesAttribValuesattribValues contains the number n of points of the first polyline. The following values (input values 1,2,..,n) represent the indices of the points of the first polyline. The next value (input value n+1) contains the number m of points of the second polyline. The following m values (input values n+2,n+3,..,n+1+m) represent the indices of the points of the second polyline etc. All indices correspond to already existing 3D points.

'xyz_mapping'"xyz_mapping""xyz_mapping""xyz_mapping""xyz_mapping":

The mapping of 3D points to image coordinates is set with AttribValuesAttribValuesAttribValuesAttribValuesattribValues in the following order: The first two values of AttribValuesAttribValuesAttribValuesAttribValuesattribValues (input value 0 and 1) contain the width and height of the respective image. The following n values (input values 2,3,..,n+1, with n being the number of 3D points) represent the row coordinates of the n points given in image coordinates. The next n input values (input values n+2,n+3,..,n*2+1) represent the column coordinates of the n points in image coordinates. Hence, the total number of input values is n*2+2.

Extended attributes

Extended attributes are attributes, that can be derived from standard attributes by special operators (e.g. distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3d), or user-defined attributes. The names of extended attributes are arbitrary, but must start with the prefix '&'"&""&""&""&", e.g., '&my_attrib'"&my_attrib""&my_attrib""&my_attrib""&my_attrib". Extended attributes can have an arbitrary number of floating point values.

Extended attributes can be attached to already existing standard attributes of the 3D object model by setting the parameter AttachExtAttribToAttachExtAttribToAttachExtAttribToAttachExtAttribToattachExtAttribTo. The following values of AttachExtAttribToAttachExtAttribToAttachExtAttribToAttachExtAttribToattachExtAttribTo are possible:

'object'"object""object""object""object" or []:

If this value is set, the extended attribute specified in AttribNameAttribNameAttribNameAttribNameattribName is associated to the 3D object model as a whole. The number of values specified in AttribValuesAttribValuesAttribValuesAttribValuesattribValues is not restricted.

'points'"points""points""points""points":

If this value is set, the extended attribute specified in AttribNameAttribNameAttribNameAttribNameattribName is associated to the 3D points of the object model. The number of values specified in AttribValuesAttribValuesAttribValuesAttribValuesattribValues must be the same as the number of already existing 3D points.

'triangles'"triangles""triangles""triangles""triangles":

If this value is set, the extended attribute specified in AttribNameAttribNameAttribNameAttribNameattribName is associated to the triangles of the object model. The number of values specified in AttribValuesAttribValuesAttribValuesAttribValuesattribValues must be the same as the number of already existing triangles.

'polygons'"polygons""polygons""polygons""polygons":

If this value is set, the extended attribute specified in AttribNameAttribNameAttribNameAttribNameattribName is associated to the polygons of the object model. The number of values specified in AttribValuesAttribValuesAttribValuesAttribValuesattribValues must be the same as the number of already existing polygons.

'lines'"lines""lines""lines""lines":

If this value is set, the extended attribute specified in AttribNameAttribNameAttribNameAttribNameattribName is associated to the lines of the object model. The number of values specified in AttribValuesAttribValuesAttribValuesAttribValuesattribValues must be the same as the number of already existing lines.

Note that if a 3D object model is no longer needed or should be overwritten, the memory has to be freed first by calling the operator clear_object_model_3dclear_object_model_3dClearObjectModel3dClearObjectModel3dClearObjectModel3d.

Attention

If multiple attributes are given in AttribNameAttribNameAttribNameAttribNameattribName, AttribValuesAttribValuesAttribValuesAttribValuesattribValues is divided into sub-tuples of equal length. Each sub-tuple is then assigned to one attribute. E.g., if AttribNameAttribNameAttribNameAttribNameattribName and AttribValuesAttribValuesAttribValuesAttribValuesattribValues are set to

AttribNameAttribNameAttribNameAttribNameattribName := ['&attrib1','&attrib2','&attrib3']["&attrib1","&attrib2","&attrib3"]["&attrib1","&attrib2","&attrib3"]["&attrib1","&attrib2","&attrib3"]["&attrib1","&attrib2","&attrib3"],

AttribValuesAttribValuesAttribValuesAttribValuesattribValues := [0.0,1.0,2.0,3.0,4.0,5.0],

the following values are assigned to the individual attributes:

'&attrib1'"&attrib1""&attrib1""&attrib1""&attrib1" = [0.0,1.0], '&attrib2'"&attrib2""&attrib2""&attrib2""&attrib2" = [2.0,3.0], '&attrib3'"&attrib3""&attrib3""&attrib3""&attrib3" = [4.0,5.0].

Consequently, it is not possible to set multiple attributes of different lengths in one call.

set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttribSetObjectModel3dAttrib stores the input AttribValuesAttribValuesAttribValuesAttribValuesattribValues unmodified in the 3D object model. Therefore, special attention must be paid to the consistency of the input data, as most of the operators expect consistent 3D object models.

Execution Information

Parameters

ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3D (input_control)  object_model_3d HObjectModel3D, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Handle of the input 3D object model.

AttribNameAttribNameAttribNameAttribNameattribName (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Name of the attributes.

List of values: 'blue'"blue""blue""blue""blue", 'green'"green""green""green""green", 'lines'"lines""lines""lines""lines", 'point_coord_x'"point_coord_x""point_coord_x""point_coord_x""point_coord_x", 'point_coord_y'"point_coord_y""point_coord_y""point_coord_y""point_coord_y", 'point_coord_z'"point_coord_z""point_coord_z""point_coord_z""point_coord_z", 'point_normal_x'"point_normal_x""point_normal_x""point_normal_x""point_normal_x", 'point_normal_y'"point_normal_y""point_normal_y""point_normal_y""point_normal_y", 'point_normal_z'"point_normal_z""point_normal_z""point_normal_z""point_normal_z", 'polygons'"polygons""polygons""polygons""polygons", 'red'"red""red""red""red", 'score'"score""score""score""score", 'triangles'"triangles""triangles""triangles""triangles", 'xyz_mapping'"xyz_mapping""xyz_mapping""xyz_mapping""xyz_mapping"

AttachExtAttribToAttachExtAttribToAttachExtAttribToAttachExtAttribToattachExtAttribTo (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Defines where extended attributes are attached to.

Default value: []

List of values: [], 'lines'"lines""lines""lines""lines", 'object'"object""object""object""object", 'points'"points""points""points""points", 'polygons'"polygons""polygons""polygons""polygons", 'triangles'"triangles""triangles""triangles""triangles"

AttribValuesAttribValuesAttribValuesAttribValuesattribValues (input_control)  real(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Attribute values.

ObjectModel3DOutObjectModel3DOutObjectModel3DOutObjectModel3DOutobjectModel3DOut (output_control)  object_model_3d HObjectModel3D, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Handle of the resulting 3D object model.

Result

If the parameters are valid, the operator set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttribSetObjectModel3dAttrib returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

gen_empty_object_model_3dgen_empty_object_model_3dGenEmptyObjectModel3dGenEmptyObjectModel3dGenEmptyObjectModel3d

Possible Successors

get_object_model_3d_paramsget_object_model_3d_paramsGetObjectModel3dParamsGetObjectModel3dParamsGetObjectModel3dParams

Alternatives

set_object_model_3d_attrib_modset_object_model_3d_attrib_modSetObjectModel3dAttribModSetObjectModel3dAttribModSetObjectModel3dAttribMod

Module

3D Metrology


ClassesClasses | | Operators