Group Object


Introduction

A Group object is used as a container to combine related objects. All objects in a Group act as a single object. For example, when one object in a group is selected all other objects in the group are also selected. Similarly, when an attribute of an object in a group is modified, all other objects are also modified.

Use function XintView3dCreateGroup to create a group object. Objects can be added to a Group object using XintView3DAddObjectToGroup. Use function XintView3DRemoveObjectFromGroup to remove an object from a Group.


Example

Unlike other 3D objects, you should not assign a Material to a Group object. Objects inside a Group, however, should have a material assigned to them individually. The following code segment illustrates how to combine a line and a mesh object inside a Group.

    Widget             view3d;
    XintView3DObject   *mesh, *line, *group;
    XintView3DMaterial *mesh_material, *line_material;

    ...

    /* Create mesh surface object */
    mesh = XintCreateMeshSurface(...);

    /* Create material for mesh */
    mesh_material = XintView3DCreateMaterial(...);

    /* Assign material to mesh for viewer view3d */
    XintView3DSetMaterial(view3d, mesh, mesh_material, NULL);

    /* Create line object */
    line = XintView3DCreateLine(...);

    /* Create material for line */
    line_material = XintView3DCreateMaterial(...);

    /* Assign line_material to line for viewer view3d */
    XintView3DSetMaterial(view3d, line, line_material, NULL);

    /* Create a group object */
    group = XintView3DCreateGroup("group1", NULL);

    /* Add objects to group */
    XintView3DAddObjectToGroup(group, mesh);
    XintView3DAddObjectToGroup(group, line);

    /* Add group object to display list of viewer */
    XintView3DAddObject(view3d, group);

    ...