PointCloudEngine An implementation for a file-based point cloud. The file format is based upon XML. A sample XML looks like: The scale value applies to the entire point cloud. One or more cell values should be supplied, with the coordinates of the opposing corners, a color, and an option whether or not to randomize the generated points. Constructs a new XML-based point cloud access. The full path to the file. Sets up the file-based point cloud. The implementation of IPointCloudAccess.GetName(). The name (the file name). The implementation of IPointCloudAccess.GetColorEncoding() The color encoding. The implementation of IPointCloudAccess.CreatePointSetIterator(). The filter. The view id (unused). The new iterator. The implementation of IPointCloudAccess.CreatePointSetIterator(). The filter. The density. The view id (unused). The new iterator. The implementation of IPointCloudAccess.GetExtent(). The extents of the point cloud. The implementation of IPointCloudAccess.GetOffset(). This method is not used by Revit and will be removed in a later pre-release build. Zero. The implementation of IPointCloudAccess.GetUnitsToFeetConversionFactor(). The scale. The implementation of IPointCloudAccess.ReadPoints(). The filter. The view id (unused). The point cloud buffer. The maximum number of points. The number of points read. The implementation of IPointCloudAccess.Free(). The base class for all IPointCloudAccess implementations in this sample. Constructs a new instance of the base class. Adds a new cell to the point cloud. The lower left point. The upper right point. The color. True to randomize point number and location, false for a regular arrangement of points. Adds a new cell to the point cloud. The lower left point. The upper right point. The color. Adds a cell to the stored outline of the point cloud. If the cell boundaries extend beyond the current outline, the outline is adjusted. Gets the outline calculated from all cells in the point cloud. Gets the scale stored for this point cloud. Saves the contents of the point cloud into an XML element. The XML element in which to save the point cloud properties. The internal implementation for point cloud read requests from Revit. Both IPointCloudAccess.ReadPoints() and IPointSetIterator.ReadPoints() are served by this method. The point cloud filter. The point cloud buffer. The maximum number of points in the buffer. The start index for points. Pass 0 if called from IPointCloudAccess.ReadPoints() or if this is the first call to IPointSetIterator.ReadPoints(). Pass the previous cumulative number of read points for second and successive calls to IPointSetIterator.ReadPoints(). The number of points read. Sets up a point cloud from an XML root element. The root element. The implementation for an IPointSetIterator for a file-based or predefined point cloud. Constructs a new instance of the point cloud iterator. The access. The filter used for this iteration. Implementation of IPointSetIterator.ReadPoints() The point buffer. The buffer size. The number of points read. Implementation of IPointSetIterator.Free() This class is used to calculate and store points for a given cell. The number of points in the cell. The lower left point of the cell. The upper right point of the cell. The points in the cell. Creates a new instance of a rectangular cell. The lower left point of the cell. The upper right point of the cell. The color used for points in the cell. True to apply randomization to the number and location of points, false for a regular arrangement of points. Invokes the calculation for all points in the cell. Serializes the properties of the cell to an XML element. The element to which the properties are added as subelements. Constructs a new instance of a rectangular cell from an XML element. The XML element representing the cell. ExternalApplication used to register the point cloud engines managed by this sample. The implementation of IExternalApplication.OnStartup() The Revit application. Result.Succeeded The implementation of IExternalApplication.OnShutdown() The Revit application. Result.Succeeded. ExternalCommand to add a predefined point cloud. The implementation for IExternalCommand.Execute() The Revit command data. The error message (ignored). The elements to display in the failure dialog (ignored). Result.Succeeded ExternalCommand to a predefined point cloud with randomized points. The implementation for IExternalCommand.Execute() The Revit command data. The error message (ignored). The elements to display in the failure dialog (ignored). Result.Succeeded ExternalCommand to add a predefined point cloud at a non-default transform. The implementation for IExternalCommand.Execute() The Revit command data. The error message (ignored). The elements to display in the failure dialog (ignored). Result.Succeeded Base class for ExternalCommands used to add point cloud instances programmatically. Adds a point cloud instance programmatically. The document. The engine identifier string. The identifier for the particular point cloud. The transform to apply to the new point cloud instance. Utility ExternalCommand to take a predefined point cloud and write the corresponding XML for it to disk. The implementation for IExternalCommand.Execute() The Revit command data. The error message (ignored). The elements to display in the failure dialog (ignored). Result.Succeeded An implementation for a non file-based point cloud. In this implementaiton, the location of the cells, including their colors and options, are hardcoded. Constructs a new predefined point cloud access instance. The identifier of the point cloud. Constructs a new predefined point cloud access instance. The identifier of the point cloud. True to use randomization for the point location and number, false otherwise. Sets up the predefined point cloud. True to use randomization for the point location and number, false otherwise. The implementation of IPointCloudAccess.GetName(). The name (the file name). The implementation of IPointCloudAccess.GetColorEncoding() The color encoding. The implementation of IPointCloudAccess.CreatePointSetIterator(). The filter. The view id (unused). The new iterator. The implementation of IPointCloudAccess.CreatePointSetIterator(). The filter. The density. The view id (unused). The new iterator. The implementation of IPointCloudAccess.GetExtent(). The extents of the point cloud. The implementation of IPointCloudAccess.GetOffset(). This method is not used by Revit and will be removed in a later pre-release build. Zero. The implementation of IPointCloudAccess.GetUnitsToFeetConversionFactor(). The scale. The implementation of IPointCloudAccess.ReadPoints(). The filter. The view id (unused). The point cloud buffer. The maximum number of points. The number of points read. The implementation of IPointCloudAccess.Free(). The type of engine. Because the same engine implementation is used for all types of engines in this sample, a member of this enumerated type is used to determine the logic necessary to create the IPointCloudAccess instance. A predefined point cloud engine (non-randomized). A predefined point cloud engine (randomized). A file based point cloud engine. An implementation of IPointCloudEngine used by all the custom engines in this sample. Constructs a new instance of the engine. The type of point cloud served by this engine instance. Implementation of IPointCloudEngine.CreatePointCloudAccess(). The identifier (or file name) for the desired point cloud. The IPointCloudAccess implementation serving this point cloud. Implementation of IPointCloudEngine.Free(). Utilities used by the sample to process XML entries in file-based point clouds. Gets an XYZ point from an XML element. The element. The XYZ. Gets a boolean value from an XML element. The element. The value. Gets a double value from an XML element. The element. The value. Gets an integer value from an XML element. The element. The value. Gets a color value (in the form needed for inclusion in a CloudPoint) from an XML element. The element. The value. Gets the XML element representing a point. The point. The name of the XML element. The element. Gets the XML element representing a CloudPoint color. The color. The name. The element. Gets the XML element representing an object. The object. The name. The element.