############
Point Shapes
############


The point shape displays groups of points on screen. It behaves exactly as the :doc:`/book/subjects/bk_sgo/bk_sg_mesh_shapes` or :doc:`/book/subjects/bk_sgo/bk_sg_line_shapes`.

The point shape is created using the ``RED::Factory`` and the ``CID_REDPointShape``, as all other shapes: See :doc:`/tasks/ta_ca/ta_ca_scenegraph/tk_creating_and_destroying_shapes` for details. It implements the given set of interfaces:

+----------------------------+--------------------------------------------+
| Interface                  | Description                                |
+============================+============================================+
| ``RED::IPointShape``       | Point management API.                      |
+----------------------------+--------------------------------------------+
| ``RED::IShape``            | Global shape API. Controls shape tree      |
|                            | navigation and shape attributes.           |
+----------------------------+--------------------------------------------+
| ``RED::IUserData``         | User data API to store application custom  |
|                            | data associated to a shape.                |
+----------------------------+--------------------------------------------+
| ``RED::IChunkSaver``       | Shape serialization interface.             |
+----------------------------+--------------------------------------------+
| ``RED::IReferenceSolving`` | Shape serialization interface.             |
+----------------------------+--------------------------------------------+

The point shape works exactly as the mesh does: APIs are very similar for the management of data arrays: See in the section **Geometry Definition APIs** in the doc :doc:`/book/subjects/bk_sgo/bk_sg_mesh_shapes` for all the details. However, the registration of points to be displayed uses ``RED::IPointShape::AddPoints``.

Point shapes are using the same primitive indexing. While it could sound a bit redundant at a first look, we have kept an indexed rendering system for points to have points behave like the other geometry shapes. Therefore, to render points 0, 1, 2 you need to have data arrays with 3 points at least AND a point index that contain 0, 1, 2 to draw.

Point shapes can share their data as line shape or mesh shapes do. The mechanisms are identical and detailed in the :doc:`/book/subjects/bk_sgo/bk_sg_mesh_shapes` page.
