diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenkernel/BKE_subdiv_foreach.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenkernel/BKE_subdiv_foreach.h')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv_foreach.h | 249 |
1 files changed, 123 insertions, 126 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv_foreach.h b/source/blender/blenkernel/BKE_subdiv_foreach.h index 31c40767253..5de4edf40df 100644 --- a/source/blender/blenkernel/BKE_subdiv_foreach.h +++ b/source/blender/blenkernel/BKE_subdiv_foreach.h @@ -31,128 +31,126 @@ struct Subdiv; struct SubdivForeachContext; struct SubdivToMeshSettings; -typedef bool (*SubdivForeachTopologyInformationCb)( - const struct SubdivForeachContext *context, - const int num_vertices, - const int num_edges, - const int num_loops, - const int num_polygons); - -typedef void (*SubdivForeachVertexFromCornerCb)( - const struct SubdivForeachContext *context, - void *tls, - const int ptex_face_index, - const float u, const float v, - const int coarse_vertex_index, - const int coarse_poly_index, - const int coarse_corner, - const int subdiv_vertex_index); - -typedef void (*SubdivForeachVertexFromEdgeCb)( - const struct SubdivForeachContext *context, - void *tls, - const int ptex_face_index, - const float u, const float v, - const int coarse_edge_index, - const int coarse_poly_index, - const int coarse_corner, - const int subdiv_vertex_index); - -typedef void (*SubdivForeachVertexInnerCb)( - const struct SubdivForeachContext *context, - void *tls, - const int ptex_face_index, - const float u, const float v, - const int coarse_poly_index, - const int coarse_corner, - const int subdiv_vertex_index); - -typedef void (*SubdivForeachEdgeCb)( - const struct SubdivForeachContext *context, - void *tls, - const int coarse_edge_index, - const int subdiv_edge_index, - const int subdiv_v1, const int subdiv_v2); - -typedef void (*SubdivForeachLoopCb)( - const struct SubdivForeachContext *context, - void *tls, - const int ptex_face_index, - const float u, const float v, - const int coarse_loop_index, - const int coarse_poly_index, - const int coarse_corner, - const int subdiv_loop_index, - const int subdiv_vertex_index, const int subdiv_edge_index); - -typedef void (*SubdivForeachPolygonCb)( - const struct SubdivForeachContext *context, - void *tls, - const int coarse_poly_index, - const int subdiv_poly_index, - const int start_loop_index, const int num_loops); - -typedef void (*SubdivForeachLooseCb)( - const struct SubdivForeachContext *context, - void *tls, - const int coarse_vertex_index, - const int subdiv_vertex_index); - -typedef void (*SubdivForeachVertexOfLooseEdgeCb)( - const struct SubdivForeachContext *context, - void *tls, - const int coarse_edge_index, - const float u, - const int subdiv_vertex_index); +typedef bool (*SubdivForeachTopologyInformationCb)(const struct SubdivForeachContext *context, + const int num_vertices, + const int num_edges, + const int num_loops, + const int num_polygons); + +typedef void (*SubdivForeachVertexFromCornerCb)(const struct SubdivForeachContext *context, + void *tls, + const int ptex_face_index, + const float u, + const float v, + const int coarse_vertex_index, + const int coarse_poly_index, + const int coarse_corner, + const int subdiv_vertex_index); + +typedef void (*SubdivForeachVertexFromEdgeCb)(const struct SubdivForeachContext *context, + void *tls, + const int ptex_face_index, + const float u, + const float v, + const int coarse_edge_index, + const int coarse_poly_index, + const int coarse_corner, + const int subdiv_vertex_index); + +typedef void (*SubdivForeachVertexInnerCb)(const struct SubdivForeachContext *context, + void *tls, + const int ptex_face_index, + const float u, + const float v, + const int coarse_poly_index, + const int coarse_corner, + const int subdiv_vertex_index); + +typedef void (*SubdivForeachEdgeCb)(const struct SubdivForeachContext *context, + void *tls, + const int coarse_edge_index, + const int subdiv_edge_index, + const int subdiv_v1, + const int subdiv_v2); + +typedef void (*SubdivForeachLoopCb)(const struct SubdivForeachContext *context, + void *tls, + const int ptex_face_index, + const float u, + const float v, + const int coarse_loop_index, + const int coarse_poly_index, + const int coarse_corner, + const int subdiv_loop_index, + const int subdiv_vertex_index, + const int subdiv_edge_index); + +typedef void (*SubdivForeachPolygonCb)(const struct SubdivForeachContext *context, + void *tls, + const int coarse_poly_index, + const int subdiv_poly_index, + const int start_loop_index, + const int num_loops); + +typedef void (*SubdivForeachLooseCb)(const struct SubdivForeachContext *context, + void *tls, + const int coarse_vertex_index, + const int subdiv_vertex_index); + +typedef void (*SubdivForeachVertexOfLooseEdgeCb)(const struct SubdivForeachContext *context, + void *tls, + const int coarse_edge_index, + const float u, + const int subdiv_vertex_index); typedef struct SubdivForeachContext { - /* Is called when topology information becomes available. - * Is only called once. - * - * NOTE: If this callback returns false, the foreach loop is aborted. - */ - SubdivForeachTopologyInformationCb topology_info; - /* These callbacks are called from every ptex which shares "emitting" - * vertex or edge. - */ - SubdivForeachVertexFromCornerCb vertex_every_corner; - SubdivForeachVertexFromEdgeCb vertex_every_edge; - /* Those callbacks are run once per subdivision vertex, ptex is undefined - * as in it will be whatever first ptex face happened to be tarversed in - * the multi-threaded environment ahd which shares "emitting" vertex or - * edge. - */ - SubdivForeachVertexFromCornerCb vertex_corner; - SubdivForeachVertexFromEdgeCb vertex_edge; - /* Called exactly once, always corresponds to a single ptex face. */ - SubdivForeachVertexInnerCb vertex_inner; - /* Called once for each loose vertex. One loose coarse vertexcorresponds - * to a single subdivision vertex. - */ - SubdivForeachLooseCb vertex_loose; - /* Called once per vertex created for loose edge. */ - SubdivForeachVertexOfLooseEdgeCb vertex_of_loose_edge; - /* NOTE: If subdivided edge does not come from coarse edge, ORIGINDEX_NONE - * will be passed as coarse_edge_index. - */ - SubdivForeachEdgeCb edge; - /* NOTE: If subdivided loop does not come from coarse loop, ORIGINDEX_NONE - * will be passed as coarse_loop_index. - */ - SubdivForeachLoopCb loop; - SubdivForeachPolygonCb poly; - - /* User-defined pointer, to allow callbacks know something about context the - * traversal is happening for, - */ - void *user_data; - - /* Initial value of TLS data. */ - void *user_data_tls; - /* Size of TLS data. */ - size_t user_data_tls_size; - /* Function to free TLS storage. */ - void (*user_data_tls_free)(void *tls); + /* Is called when topology information becomes available. + * Is only called once. + * + * NOTE: If this callback returns false, the foreach loop is aborted. + */ + SubdivForeachTopologyInformationCb topology_info; + /* These callbacks are called from every ptex which shares "emitting" + * vertex or edge. + */ + SubdivForeachVertexFromCornerCb vertex_every_corner; + SubdivForeachVertexFromEdgeCb vertex_every_edge; + /* Those callbacks are run once per subdivision vertex, ptex is undefined + * as in it will be whatever first ptex face happened to be tarversed in + * the multi-threaded environment ahd which shares "emitting" vertex or + * edge. + */ + SubdivForeachVertexFromCornerCb vertex_corner; + SubdivForeachVertexFromEdgeCb vertex_edge; + /* Called exactly once, always corresponds to a single ptex face. */ + SubdivForeachVertexInnerCb vertex_inner; + /* Called once for each loose vertex. One loose coarse vertexcorresponds + * to a single subdivision vertex. + */ + SubdivForeachLooseCb vertex_loose; + /* Called once per vertex created for loose edge. */ + SubdivForeachVertexOfLooseEdgeCb vertex_of_loose_edge; + /* NOTE: If subdivided edge does not come from coarse edge, ORIGINDEX_NONE + * will be passed as coarse_edge_index. + */ + SubdivForeachEdgeCb edge; + /* NOTE: If subdivided loop does not come from coarse loop, ORIGINDEX_NONE + * will be passed as coarse_loop_index. + */ + SubdivForeachLoopCb loop; + SubdivForeachPolygonCb poly; + + /* User-defined pointer, to allow callbacks know something about context the + * traversal is happening for, + */ + void *user_data; + + /* Initial value of TLS data. */ + void *user_data_tls; + /* Size of TLS data. */ + size_t user_data_tls_size; + /* Function to free TLS storage. */ + void (*user_data_tls_free)(void *tls); } SubdivForeachContext; /* Invokes callbacks in the order and with values which corresponds to creation @@ -164,10 +162,9 @@ typedef struct SubdivForeachContext { * The main point here is th be abel to get base level topology, which can be * done with either of those. Having both of them is kind of redundant. */ -bool BKE_subdiv_foreach_subdiv_geometry( - struct Subdiv *subdiv, - const struct SubdivForeachContext *context, - const struct SubdivToMeshSettings *mesh_settings, - const struct Mesh *coarse_mesh); +bool BKE_subdiv_foreach_subdiv_geometry(struct Subdiv *subdiv, + const struct SubdivForeachContext *context, + const struct SubdivToMeshSettings *mesh_settings, + const struct Mesh *coarse_mesh); -#endif /* __BKE_SUBDIV_FOREACH_H__ */ +#endif /* __BKE_SUBDIV_FOREACH_H__ */ |