def register_points_draw_callback(
        self, draw_manager, object_anchor, positions, colors, point_size
    ):
        """Register a callback to draw a point cloud."""
        self.set_point_size(point_size)
        args = (draw_manager, object_anchor, positions, colors)
        self._draw_handler_handle = bpy.types.SpaceView3D.draw_handler_add(
            self._draw_points_callback, args, "WINDOW", "POST_VIEW"
        )
Register a callback to draw a point cloud.
photogrammetry_importer/opengl/draw_manager.py