Cleanup: use style for doxygen comment blocks

This commit is contained in:
Campbell Barton
2023-11-30 14:15:11 +11:00
parent b0746f4be2
commit 15db0cb446
32 changed files with 154 additions and 77 deletions

View File

@@ -194,7 +194,8 @@ int insert_key_action(Main *bmain,
eInsertKeyFlags insert_key_flag,
eBezTriple_KeyframeType key_type);
/** Insert keys to the ID of the given PointerRNA for the given RNA paths. Tries to create an
/**
* Insert keys to the ID of the given PointerRNA for the given RNA paths. Tries to create an
* action if none exists yet.
* \param scene_frame is expected to be not NLA mapped as that happens within the function.
*/

View File

@@ -309,9 +309,11 @@ class AssetCatalogCollection {
static OwningAssetCatalogMap copy_catalog_map(const OwningAssetCatalogMap &orig);
};
/** Keeps track of which catalogs are defined in a certain file on disk.
/**
* Keeps track of which catalogs are defined in a certain file on disk.
* Only contains non-owning pointers to the #AssetCatalog instances, so ensure the lifetime of this
* class is shorter than that of the #`AssetCatalog`s themselves. */
* class is shorter than that of the #`AssetCatalog`s themselves.
*/
class AssetCatalogDefinitionFile {
protected:
/* Catalogs stored in this file. They are mapped by ID to make it possible to query whether a

View File

@@ -42,8 +42,10 @@ void AS_asset_library_refresh_catalog_simplename(struct AssetLibrary *asset_libr
/** Return whether any loaded AssetLibrary has unsaved changes to its catalogs. */
bool AS_asset_library_has_any_unsaved_catalogs(void);
/** An asset library can include local IDs (IDs in the current file). Their pointers need to be
* remapped on change (or assets removed as IDs gets removed). */
/**
* An asset library can include local IDs (IDs in the current file). Their pointers need to be
* remapped on change (or assets removed as IDs gets removed).
*/
void AS_asset_library_remap_ids(const struct IDRemapper *mappings);
/**

View File

@@ -19,8 +19,10 @@
namespace blender::asset_system::tests {
/** Sets up asset library loading so we have a library to load asset representations into (required
* for some functionality to perform work). */
/**
* Sets up asset library loading so we have a library to load asset representations into (required
* for some functionality to perform work).
*/
class AssetRepresentationTest : public AssetLibraryTestBase {
public:
AssetLibrary *get_builtin_library_from_type(eAssetLibraryType type)

View File

@@ -220,8 +220,10 @@ struct ListBase BKE_collection_object_cache_get(struct Collection *collection);
ListBase BKE_collection_object_cache_instanced_get(struct Collection *collection);
/** Free the object cache of given `collection` and all of its ancestors (recursively). */
void BKE_collection_object_cache_free(struct Collection *collection);
/** Free the object cache of all collections in given `bmain`, including master collections of
* scenes. */
/**
* Free the object cache of all collections in given `bmain`, including master collections of
* scenes.
*/
void BKE_main_collections_object_cache_free(const struct Main *bmain);
struct Base *BKE_collection_or_layer_objects(const struct Scene *scene,
@@ -312,8 +314,10 @@ bool BKE_collection_validate(struct Collection *collection);
/* .blend file I/O */
/** Perform some pre-writing cleanup on the COllection data itself (_not_ in any sub-data
* referenced by pointers). To be called before writing the Collection struct itself. */
/**
* Perform some pre-writing cleanup on the COllection data itself (_not_ in any sub-data
* referenced by pointers). To be called before writing the Collection struct itself.
*/
void BKE_collection_blend_write_prepare_nolib(struct BlendWriter *writer,
struct Collection *collection);
void BKE_collection_blend_write_nolib(struct BlendWriter *writer, struct Collection *collection);
@@ -372,10 +376,11 @@ void BKE_scene_objects_iterator_begin(struct BLI_Iterator *iter, void *data_in);
void BKE_scene_objects_iterator_next(struct BLI_Iterator *iter);
void BKE_scene_objects_iterator_end(struct BLI_Iterator *iter);
/** Iterate over objects in the scene based on a flag.
/**
* Iterate over objects in the scene based on a flag.
*
* \note The object->flag is tested against flag.
* */
*/
typedef struct SceneObjectsIteratorExData {
struct Scene *scene;
int flag;

View File

@@ -18,16 +18,19 @@
extern "C" {
#endif
/** Reporting Information and Errors.
/**
* Reporting Information and Errors.
*
* These functions are thread-safe, unless otherwise specified.
*
* These functions also accept nullptr in case no error reporting is needed. The message are only
* printed to the console then. */
* printed to the console then.
*/
/* Report structures are stored in DNA. */
/** Initialize a #ReportList struct.
/**
* Initialize a #ReportList struct.
*
* \note: Not thread-safe, should only be called from the 'owner' thread of the report list.
*/

View File

@@ -306,14 +306,16 @@ static bool reuse_bmain_data_remapper_is_id_remapped(IDRemapper *remapper, ID *i
return false;
}
/** Does a complete replacement of data in `new_bmain` by data from `old_bmain. Original new data
/**
* Does a complete replacement of data in `new_bmain` by data from `old_bmain. Original new data
* are moved to the `old_bmain`, and will be freed together with it.
*
* WARNING: Currently only expects to work on local data, won't work properly if some of the IDs of
* given type are linked.
*
* NOTE: There is no support at all for potential dependencies of the IDs moved around. This is not
* expected to be necessary for the current use cases (UI-related IDs). */
* expected to be necessary for the current use cases (UI-related IDs).
*/
static void swap_old_bmain_data_for_blendfile(ReuseOldBMainData *reuse_data, const short id_code)
{
Main *new_bmain = reuse_data->new_bmain;
@@ -382,9 +384,11 @@ static void swap_old_bmain_data_for_blendfile(ReuseOldBMainData *reuse_data, con
FOREACH_MAIN_LISTBASE_ID_END;
}
/** Similar to #swap_old_bmain_data_for_blendfile, but with special handling for WM ID. Tightly
/**
* Similar to #swap_old_bmain_data_for_blendfile, but with special handling for WM ID. Tightly
* related to further WM post-processing from calling WM code (see #WM_file_read and
* #wm_homefile_read_ex). */
* #wm_homefile_read_ex).
*/
static void swap_wm_data_for_blendfile(ReuseOldBMainData *reuse_data, const bool load_ui)
{
Main *old_bmain = reuse_data->old_bmain;

View File

@@ -1047,8 +1047,10 @@ static void collection_gobject_hash_ensure(Collection *collection)
collection_gobject_assert_internal_consistency(collection, true);
}
/** Similar to #collection_gobject_hash_ensure/#collection_gobject_hash_create, but does fix
* inconsistencies in the collection objects list. */
/**
* Similar to #collection_gobject_hash_ensure/#collection_gobject_hash_create, but does fix
* inconsistencies in the collection objects list.
*/
static void collection_gobject_hash_ensure_fix(Collection *collection)
{
bool changed = false;

View File

@@ -94,9 +94,11 @@ BLI_INLINE IDOverrideLibraryRuntime *override_library_runtime_ensure(
return liboverride->runtime;
}
/** Helper to preserve Pose mode on override objects.
/**
* Helper to preserve Pose mode on override objects.
* A bit annoying to have this special case, but not much to be done here currently, since the
* matching RNA property is read-only. */
* matching RNA property is read-only.
*/
BLI_INLINE void lib_override_object_posemode_transfer(ID *id_dst, ID *id_src)
{
if (GS(id_src->name) == ID_OB && GS(id_dst->name) == ID_OB) {
@@ -3420,10 +3422,12 @@ static int lib_override_sort_libraries_func(LibraryIDLinkCallbackData *cb_data)
return IDWALK_RET_NOP;
}
/** Define the `temp_index` of libraries from their highest level of indirect usage.
/**
* Define the `temp_index` of libraries from their highest level of indirect usage.
*
* E.g. if lib_a uses lib_b, lib_c and lib_d, and lib_b also uses lib_d, then lib_a has an index of
* 1, lib_b and lib_c an index of 2, and lib_d an index of 3. */
* 1, lib_b and lib_c an index of 2, and lib_d an index of 3.
*/
static int lib_override_libraries_index_define(Main *bmain)
{
LISTBASE_FOREACH (Library *, library, &bmain->libraries) {

View File

@@ -197,8 +197,10 @@ BVHTreeOverlap *BLI_bvhtree_overlap(const BVHTree *tree1,
unsigned int *r_overlap_num,
BVHTree_OverlapCallback callback,
void *userdata);
/** Compute overlaps of the tree with itself. This is faster than BLI_bvhtree_overlap
* because it only tests and returns each symmetrical pair once. */
/**
* Compute overlaps of the tree with itself. This is faster than #BLI_bvhtree_overlap
* because it only tests and returns each symmetrical pair once.
*/
BVHTreeOverlap *BLI_bvhtree_overlap_self(const BVHTree *tree,
unsigned int *r_overlap_num,
BVHTree_OverlapCallback callback,

View File

@@ -327,8 +327,10 @@ struct LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh);
*/
void BLO_blendhandle_close(BlendHandle *bh);
/** Mark the given Main (and the 'root' local one in case of lib-split Mains) as invalid, and
* generate an error report containing given `message`. */
/**
* Mark the given Main (and the 'root' local one in case of lib-split Mains) as invalid, and
* generate an error report containing given `message`.
*/
void BLO_read_invalidate_message(BlendHandle *bh, struct Main *bmain, const char *message);
/**

View File

@@ -3544,8 +3544,10 @@ static void read_undo_remap_noundo_data(FileData *fd)
FOREACH_MAIN_ID_END;
}
/** Contains sanity/debug checks to be performed at the very end of the reading process (i.e. after
* data, liblink, linked data, etc. has been done). */
/**
* Contains sanity/debug checks to be performed at the very end of the reading process (i.e. after
* data, liblink, linked data, etc. has been done).
*/
static void blo_read_file_checks(Main *bmain)
{
#ifndef NDEBUG

View File

@@ -354,7 +354,9 @@ static GPUShader *get_subdiv_custom_data_shader(int comp_type, int dimensions)
}
/* -------------------------------------------------------------------- */
/** Vertex formats used for data transfer from OpenSubdiv, and for data processing on our side.
/** \name Vertex Formats
*
* Used for data transfer from OpenSubdiv, and for data processing on our side.
* \{ */
static GPUVertFormat *get_uvs_format()

View File

@@ -328,8 +328,10 @@ BLI_STATIC_ASSERT_ALIGN(DRWDebugPrintBuffer, 16)
/* Reuse first instance as row index as we don't use instancing. Equivalent to
* `DRWDebugPrintBuffer.command.i_first`. */
#define drw_debug_print_row_shared drw_debug_print_buf[3]
/** Offset to the first data. Equal to: `sizeof(DrawCommand) / sizeof(uint)`.
* This is needed because we bind the whole buffer as a `uint` array. */
/**
* Offset to the first data. Equal to: `sizeof(DrawCommand) / sizeof(uint)`.
* This is needed because we bind the whole buffer as a `uint` array.
*/
#define drw_debug_print_offset 8
/** \} */
@@ -372,8 +374,10 @@ BLI_STATIC_ASSERT_ALIGN(DRWDebugPrintBuffer, 16)
/* Equivalent to `DRWDebugDrawBuffer.command.v_count`. */
#define drw_debug_draw_v_count drw_debug_verts_buf[0].pos0
/** Offset to the first data. Equal to: `sizeof(DrawCommand) / sizeof(DRWDebugVert)`.
* This is needed because we bind the whole buffer as a `DRWDebugVert` array. */
/**
* Offset to the first data. Equal to: `sizeof(DrawCommand) / sizeof(DRWDebugVert)`.
* This is needed because we bind the whole buffer as a `DRWDebugVert` array.
*/
#define drw_debug_draw_offset 2
/** \} */

View File

@@ -21,8 +21,10 @@ struct Main;
void ED_asset_catalogs_save_from_main_path(struct AssetLibrary *library, const struct Main *bmain);
/** Saving catalog edits when the file is saved is a global option shared for each asset library,
* and as such ignores the per asset library #ED_asset_catalogs_read_only(). */
/**
* Saving catalog edits when the file is saved is a global option shared for each asset library,
* and as such ignores the per asset library #ED_asset_catalogs_read_only().
*/
void ED_asset_catalogs_set_save_catalogs_when_file_is_saved(bool should_save);
bool ED_asset_catalogs_get_save_catalogs_when_file_is_saved(void);

View File

@@ -146,7 +146,8 @@ int64_t ED_keylist_array_len(const AnimKeylist *keylist);
/* Key-data Generation --------------- */
/** Add the keyframes of the F-Curve to the keylist.
/**
* Add the keyframes of the F-Curve to the keylist.
* \param adt can be a nullptr.
* \param range only adds keys in the given range to the keylist.
*/

View File

@@ -564,8 +564,10 @@ using uiButHandleNFunc = void (*)(bContext *C, void *argN, void *arg2);
using uiButHandleHoldFunc = void (*)(bContext *C, ARegion *butregion, uiBut *but);
using uiButCompleteFunc = int (*)(bContext *C, char *str, void *arg);
/** Function to compare the identity of two buttons over redraws, to check if they represent the
* same data, and thus should be considered the same button over redraws. */
/**
* Function to compare the identity of two buttons over redraws, to check if they represent the
* same data, and thus should be considered the same button over redraws.
*/
using uiButIdentityCompareFunc = bool (*)(const uiBut *a, const uiBut *b);
/* Search types. */

View File

@@ -98,9 +98,11 @@ class TreeViewItemContainer {
ENUM_OPERATORS(TreeViewItemContainer::IterOptions,
TreeViewItemContainer::IterOptions::SkipCollapsed);
/** The container class is the base for both the tree-view and the items. This alias gives it a
/**
* The container class is the base for both the tree-view and the items. This alias gives it a
* clearer name for handles that accept both. Use whenever something wants to act on child-items,
* irrespective of if they are stored at root level or as children of some other item. */
* irrespective of if they are stored at root level or as children of some other item.
*/
using TreeViewOrItem = TreeViewItemContainer;
/** \} */

View File

@@ -80,8 +80,10 @@ static Array<float2> sample_curve_2d(Span<float2> positions, const int64_t resol
return points;
}
/** Morph \a src onto \a target such that the points have the same spacing as in \a src and
* write the result to \a dst. */
/**
* Morph \a src onto \a target such that the points have the same spacing as in \a src and
* write the result to \a dst.
*/
static void morph_points_to_curve(Span<float2> src, Span<float2> target, MutableSpan<float2> dst)
{
BLI_assert(src.size() == dst.size());

View File

@@ -934,8 +934,10 @@ void SCULPT_vertex_neighbors_get(SculptSession *ss,
neighbor_iterator.vertex = neighbor_iterator.neighbors[neighbor_iterator.i]; \
neighbor_iterator.index = neighbor_iterator.neighbor_indices[neighbor_iterator.i];
/** Iterate over neighboring and duplicate vertices (for PBVH_GRIDS). Duplicates come
* first since they are nearest for floodfill. */
/**
* Iterate over neighboring and duplicate vertices (for PBVH_GRIDS).
* Duplicates come first since they are nearest for flood-fill.
*/
#define SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \
SCULPT_vertex_neighbors_get(ss, v_index, true, &neighbor_iterator); \
for (neighbor_iterator.i = neighbor_iterator.size - 1; neighbor_iterator.i >= 0; \

View File

@@ -141,8 +141,10 @@ class AssetCatalogDropTarget : public ui::TreeViewItemDropTarget {
std::string drop_tooltip_asset_catalog(const wmDrag &drag) const;
};
/** Only reason this isn't just `BasicTreeViewItem` is to add a '+' icon for adding a root level
* catalog. */
/**
* Only reason this isn't just `BasicTreeViewItem` is to add a '+' icon for adding a root level
* catalog.
*/
class AssetCatalogTreeViewAllItem : public ui::BasicTreeViewItem {
using BasicTreeViewItem::BasicTreeViewItem;

View File

@@ -206,8 +206,10 @@ BlendHandle *filelist_lib(FileList *filelist);
bool filelist_islibrary(FileList *filelist, char *dir, char **r_group);
void filelist_freelib(FileList *filelist);
/** Return the total raw number of entries listed in the given `filelist`, whether they are
* filtered out or not. */
/**
* Return the total raw number of entries listed in the given `filelist`, whether they are
* filtered out or not.
*/
int filelist_files_num_entries(FileList *filelist);
void filelist_readjob_start(FileList *filelist, int space_notifier, const bContext *C);

View File

@@ -333,10 +333,12 @@ static void nlastrip_overlap_reorder(TransDataNla *tdn, NlaStrip *strip)
}
}
/** Flag overlaps with adjacent strips.
/**
* Flag overlaps with adjacent strips.
*
* Since the strips are re-ordered as they're transformed, we only have to check adjacent
* strips for overlap instead of all of them. */
* strips for overlap instead of all of them.
*/
static void nlastrip_flag_overlaps(NlaStrip *strip)
{

View File

@@ -46,7 +46,8 @@
#define MAX_COLOR_BAND 128
#define MAX_GPU_SKIES 8
/** Whether the optimized variant of the GPUPass should be created asynchronously.
/**
* Whether the optimized variant of the GPUPass should be created asynchronously.
* Usage of this depends on whether there are possible threading challenges of doing so.
* Currently, the overhead of GPU_generate_pass is relatively small in comparison to shader
* compilation, though this option exists in case any potential scenarios for material graph

View File

@@ -13,8 +13,10 @@
namespace blender::gpu {
/** Vertex attribute and buffer descriptor wrappers
* for use in PSO construction and caching. */
/**
* Vertex attribute and buffer descriptor wrappers
* for use in PSO construction and caching.
*/
struct MTLVertexAttributeDescriptorPSO {
MTLVertexFormat format;
int offset;

View File

@@ -96,10 +96,12 @@ struct SampleInterpolationSettings {
double weight;
};
/** Check whether the requested time from the \a selector falls between two sampling time from the
/**
* Check whether the requested time from the \a selector falls between two sampling time from the
* \a time_sampling. If so, returns a #SampleInterpolationSettings with the required data to
* interpolate. If not, returns nothing and we can assume that the requested time falls on a
* specific sampling time of \a time_sampling and no interpolation is necessary. */
* specific sampling time of \a time_sampling and no interpolation is necessary.
*/
std::optional<SampleInterpolationSettings> get_sample_interpolation_settings(
const Alembic::AbcGeom::ISampleSelector &selector,
const Alembic::AbcCoreAbstract::TimeSamplingPtr &time_sampling,

View File

@@ -12,8 +12,10 @@
namespace blender::io::usd {
/** A transformation matrix and a boolean indicating
* whether the matrix is constant over time. */
/**
* A transformation matrix and a boolean indicating
* whether the matrix is constant over time.
*/
using XformResult = std::tuple<pxr::GfMatrix4f, bool>;
class USDXformReader : public USDPrimReader {

View File

@@ -485,8 +485,10 @@ typedef enum ObjectType {
#define OB_TYPE_SUPPORT_MATERIAL(_type) \
(((_type) >= OB_MESH && (_type) <= OB_MBALL) || \
((_type) >= OB_GPENCIL_LEGACY && (_type) <= OB_GREASE_PENCIL))
/** Does the object have some render-able geometry (unlike empties, cameras, etc.). True for
* #OB_CURVES_LEGACY, since these often evaluate to objects with geometry. */
/**
* Does the object have some render-able geometry (unlike empties, cameras, etc.). True for
* #OB_CURVES_LEGACY, since these often evaluate to objects with geometry.
*/
#define OB_TYPE_IS_GEOMETRY(_type) \
(ELEM(_type, \
OB_MESH, \

View File

@@ -18,10 +18,12 @@ extern "C" {
struct ReportList;
/** Error reporting: convert BKE_report (#ReportList) reports into python errors.
/**
* Error reporting: convert BKE_report (#ReportList) reports into python errors.
*
* \param clear: When `true`, #BKE_reports_free is called on the given `reports`, which should
* then be considered as 'freed' data and not used anymore. */
* then be considered as 'freed' data and not used anymore.
*/
short BPy_reports_to_error(struct ReportList *reports, PyObject *exception, bool clear);
/**
* A version of #BKE_report_write_file_fp that uses Python's stdout.

View File

@@ -593,7 +593,8 @@ void WM_report_banner_show(wmWindowManager *wm, wmWindow *win) ATTR_NONNULL(1);
* Hide all currently displayed banners and abort their timer.
*/
void WM_report_banners_cancel(Main *bmain);
/** Move a whole list of reports to the WM ReportList, and show the banner.
/**
* Move a whole list of reports to the WM ReportList, and show the banner.
*
* \note In case the given \a reports is a `nullptr`, or has its #RPT_OP_HOLD flag set, this
* function does nothing.
@@ -604,7 +605,8 @@ void WM_report_banners_cancel(Main *bmain);
*
* \params reports The #ReportList from which to move reports to the WM one, may be `nullptr`.
* \params wm the WindowManager to add given \a reports to. If `nullptr`, the first WM of current
* #G_MAIN will be used. */
* #G_MAIN will be used.
*/
void WM_reports_from_reports_move(wmWindowManager *wm, ReportList *reports);
void WM_report(eReportType type, const char *message);
void WM_reportf(eReportType type, const char *format, ...) ATTR_PRINTF_FORMAT(2, 3);
@@ -632,8 +634,10 @@ void WM_event_timer_free_data(wmTimer *timer);
*/
void WM_event_timers_free_all(wmWindowManager *wm);
/** Mark the given `timer` to be removed, actual removal and deletion is deferred and handled
* internally by the window manager code. */
/**
* Mark the given `timer` to be removed, actual removal and deletion is deferred and handled
* internally by the window manager code.
*/
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *win, wmTimer *timer);
void WM_event_timer_remove_notifier(wmWindowManager *wm, wmWindow *win, wmTimer *timer);
/**

View File

@@ -918,7 +918,8 @@ struct wmTimer {
bool sleep;
};
/** Communication/status data owned by the wmJob, and passed to the worker code when calling
/**
* Communication/status data owned by the wmJob, and passed to the worker code when calling
* `startjob` callback.
*
* 'OUTPUT' members mean that they are defined by the worker thread, and read/used by the wmJob
@@ -932,21 +933,27 @@ struct wmTimer {
* controlling thread (i.e. wmJob management code) and the worker thread.
*/
struct wmJobWorkerStatus {
/** OUTPUT - Set to true by the worker to request update processing from the main thread (as part
* of the wmJob 'event loop', see #wm_jobs_timer). */
/**
* OUTPUT - Set to true by the worker to request update processing from the main thread (as part
* of the wmJob 'event loop', see #wm_jobs_timer).
*/
bool do_update;
/** INPUT - Set by the wmJob management code to request a worker to stop/abort its processing.
/**
* INPUT - Set by the wmJob management code to request a worker to stop/abort its processing.
*
* \note Some job types (rendering or baking ones e.g.) also use the #Global.is_break flag to
* cancel their processing. */
* cancel their processing.
*/
bool stop;
/** OUTPUT - Progress as reported by the worker, from `0.0f` to `1.0f`. */
float progress;
/** OUTPUT - Storage of reports generated during this job's run. Contains its own locking for
* thread-safety. */
/**
* OUTPUT - Storage of reports generated during this job's run. Contains its own locking for
* thread-safety.
*/
ReportList *reports;
};

View File

@@ -361,7 +361,8 @@ typedef struct wmGizmoType {
/** Gizmo-specific handler to update gizmo attributes based on the property value. */
wmGizmoFnPropertyUpdate property_update;
/** Returns the final transformation which may be different from the 'matrix',
/**
* Returns the final transformation which may be different from the 'matrix',
* depending on the gizmo.
* Notes:
* - Scale isn't applied (wmGizmo.scale/user_scale).