diff options
author | YimingWu <xp8110@outlook.com> | 2019-09-05 06:54:02 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2019-09-05 06:54:02 +0300 |
commit | 4f1928c2ae8d35983a3e6f721cedee30ae918c2b (patch) | |
tree | 70e4fd3ca04c1ab483f784238d74aa2f31521eb7 /source/blender | |
parent | 7fb8ff3b2723a07ee1be79f27362548f8cf371ac (diff) |
LANPR: Use private header in editor module.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/lanpr/lanpr_cpu.c | 20 | ||||
-rw-r--r-- | source/blender/editors/include/ED_lanpr.h | 39 | ||||
-rw-r--r-- | source/blender/editors/lanpr/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/editors/lanpr/lanpr_chain.c | 2 | ||||
-rw-r--r-- | source/blender/editors/lanpr/lanpr_cpu.c | 6 | ||||
-rw-r--r-- | source/blender/editors/lanpr/lanpr_intern.h | 64 | ||||
-rw-r--r-- | source/blender/editors/lanpr/lanpr_util.c | 2 |
7 files changed, 93 insertions, 42 deletions
diff --git a/source/blender/draw/engines/lanpr/lanpr_cpu.c b/source/blender/draw/engines/lanpr/lanpr_cpu.c index 6a9151f497b..7db25fb80f7 100644 --- a/source/blender/draw/engines/lanpr/lanpr_cpu.c +++ b/source/blender/draw/engines/lanpr/lanpr_cpu.c @@ -98,19 +98,19 @@ static void lanpr_rebuild_render_draw_command(LANPR_RenderBuffer *rb, LANPR_Line GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); if (ll->contour.use) { - Count += lanpr_count_leveled_edge_segment_count(&rb->contours, ll); + Count += ED_lanpr_count_leveled_edge_segment_count(&rb->contours, ll); } if (ll->crease.use) { - Count += lanpr_count_leveled_edge_segment_count(&rb->crease_lines, ll); + Count += ED_lanpr_count_leveled_edge_segment_count(&rb->crease_lines, ll); } if (ll->intersection.use) { - Count += lanpr_count_leveled_edge_segment_count(&rb->intersection_lines, ll); + Count += ED_lanpr_count_leveled_edge_segment_count(&rb->intersection_lines, ll); } if (ll->edge_mark.use) { - Count += lanpr_count_leveled_edge_segment_count(&rb->edge_marks, ll); + Count += ED_lanpr_count_leveled_edge_segment_count(&rb->edge_marks, ll); } if (ll->material_separate.use) { - Count += lanpr_count_leveled_edge_segment_count(&rb->material_lines, ll); + Count += ED_lanpr_count_leveled_edge_segment_count(&rb->material_lines, ll); } vertCount = Count * 2; @@ -125,19 +125,19 @@ static void lanpr_rebuild_render_draw_command(LANPR_RenderBuffer *rb, LANPR_Line tn = N = MEM_callocN(sizeof(float) * 6 * Count, "temp n data"); if (ll->contour.use) { - tv = lanpr_make_leveled_edge_vertex_array(rb, &rb->contours, tv, tn, &tn, ll, 1.0f); + tv = ED_lanpr_make_leveled_edge_vertex_array(rb, &rb->contours, tv, tn, &tn, ll, 1.0f); } if (ll->crease.use) { - tv = lanpr_make_leveled_edge_vertex_array(rb, &rb->crease_lines, tv, tn, &tn, ll, 2.0f); + tv = ED_lanpr_make_leveled_edge_vertex_array(rb, &rb->crease_lines, tv, tn, &tn, ll, 2.0f); } if (ll->material_separate.use) { - tv = lanpr_make_leveled_edge_vertex_array(rb, &rb->material_lines, tv, tn, &tn, ll, 3.0f); + tv = ED_lanpr_make_leveled_edge_vertex_array(rb, &rb->material_lines, tv, tn, &tn, ll, 3.0f); } if (ll->edge_mark.use) { - tv = lanpr_make_leveled_edge_vertex_array(rb, &rb->edge_marks, tv, tn, &tn, ll, 4.0f); + tv = ED_lanpr_make_leveled_edge_vertex_array(rb, &rb->edge_marks, tv, tn, &tn, ll, 4.0f); } if (ll->intersection.use) { - tv = lanpr_make_leveled_edge_vertex_array(rb, &rb->intersection_lines, tv, tn, &tn, ll, 5.0f); + tv = ED_lanpr_make_leveled_edge_vertex_array(rb, &rb->intersection_lines, tv, tn, &tn, ll, 5.0f); } for (i = 0; i < vertCount; i++) { diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h index 7555e85ac8c..857b22fe07d 100644 --- a/source/blender/editors/include/ED_lanpr.h +++ b/source/blender/editors/include/ED_lanpr.h @@ -544,36 +544,6 @@ BLI_INLINE double tMatGetLinearRatio(real l, real r, real FromL) int ED_lanpr_point_inside_triangled(tnsVector2d v, tnsVector2d v0, tnsVector2d v1, tnsVector2d v2); -void *list_append_pointer_static(ListBase *h, LANPR_StaticMemPool *smp, void *p); -void *list_append_pointer_static_sized(ListBase *h, LANPR_StaticMemPool *smp, void *p, int size); -void *list_push_pointer_static(ListBase *h, LANPR_StaticMemPool *smp, void *p); -void *list_push_pointer_static_sized(ListBase *h, LANPR_StaticMemPool *smp, void *p, int size); - -void *list_append_pointer_static_pool(LANPR_StaticMemPool *mph, ListBase *h, void *p); -void *list_pop_pointer_no_free(ListBase *h); -void list_remove_pointer_item_no_free(ListBase *h, LinkData *lip); - -LANPR_StaticMemPoolNode *mem_new_static_pool(LANPR_StaticMemPool *smp); -void *mem_static_aquire(LANPR_StaticMemPool *smp, int size); -void *mem_static_aquire_thread(LANPR_StaticMemPool *smp, int size); -void *mem_static_destroy(LANPR_StaticMemPool *smp); - -void tmat_make_ortho_matrix_44d( - double (*mProjection)[4], real xMin, real xMax, real yMin, real yMax, real zMin, real zMax); -void tmat_make_perspective_matrix_44d( - double (*mProjection)[4], real fFov_rad, real fAspect, real zMin, real zMax); - -int lanpr_count_this_line(LANPR_RenderLine *rl, LANPR_LineLayer *ll); -int lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll); -int lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb); -void *lanpr_make_leveled_edge_vertex_array(LANPR_RenderBuffer *rb, - ListBase *LineList, - float *vertexArray, - float *NormalArray, - float **NextNormal, - LANPR_LineLayer *ll, - float componet_id); - struct Depsgraph; struct SceneLANPR; @@ -586,6 +556,15 @@ void ED_lanpr_discard_short_chains(LANPR_RenderBuffer *rb, float threshold); int ED_lanpr_count_chain(LANPR_RenderLineChain *rlc); void ED_lanpr_chain_clear_picked_flag(struct LANPR_RenderBuffer *rb); +int ED_lanpr_count_leveled_edge_segment_count(ListBase *LineList, struct LANPR_LineLayer *ll); +void *ED_lanpr_make_leveled_edge_vertex_array(struct LANPR_RenderBuffer *rb, + ListBase *LineList, + float *vertexArray, + float *NormalArray, + float **NextNormal, + LANPR_LineLayer *ll, + float componet_id); + void ED_lanpr_calculation_set_flag(LANPR_RenderStatus flag); bool ED_lanpr_calculation_flag_check(LANPR_RenderStatus flag); diff --git a/source/blender/editors/lanpr/CMakeLists.txt b/source/blender/editors/lanpr/CMakeLists.txt index 9319ed94ad0..3c1b0b389f6 100644 --- a/source/blender/editors/lanpr/CMakeLists.txt +++ b/source/blender/editors/lanpr/CMakeLists.txt @@ -36,6 +36,8 @@ set(SRC lanpr_cpu.c lanpr_chain.c lanpr_util.c + + lanpr_intern.h ) set(LIB diff --git a/source/blender/editors/lanpr/lanpr_chain.c b/source/blender/editors/lanpr/lanpr_chain.c index 05397f60ade..8c090e6046d 100644 --- a/source/blender/editors/lanpr/lanpr_chain.c +++ b/source/blender/editors/lanpr/lanpr_chain.c @@ -40,6 +40,8 @@ #include "bmesh.h" +#include "lanpr_intern.h" + #include <math.h> #define LANPR_OTHER_RV(rl, rv) ((rv) == (rl)->l ? (rl)->r : (rl)->l) diff --git a/source/blender/editors/lanpr/lanpr_cpu.c b/source/blender/editors/lanpr/lanpr_cpu.c index ef1b511a91e..1563bbf29d2 100644 --- a/source/blender/editors/lanpr/lanpr_cpu.c +++ b/source/blender/editors/lanpr/lanpr_cpu.c @@ -67,6 +67,8 @@ #include "BKE_text.h" +#include "lanpr_intern.h" + extern LANPR_SharedResource lanpr_share; extern const char *RE_engine_id_BLENDER_LANPR; struct Object; @@ -2789,7 +2791,7 @@ int lanpr_count_this_line(LANPR_RenderLine *rl, LANPR_LineLayer *ll) return AndResult; } } -int lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll) +int ED_lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll) { LinkData *lip; LANPR_RenderLine *rl; @@ -2826,7 +2828,7 @@ int lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb) } return Count; } -void *lanpr_make_leveled_edge_vertex_array(LANPR_RenderBuffer *UNUSED(rb), +void *ED_lanpr_make_leveled_edge_vertex_array(LANPR_RenderBuffer *UNUSED(rb), ListBase *LineList, float *vertexArray, float *NormalArray, diff --git a/source/blender/editors/lanpr/lanpr_intern.h b/source/blender/editors/lanpr/lanpr_intern.h new file mode 100644 index 00000000000..1b34b9d889d --- /dev/null +++ b/source/blender/editors/lanpr/lanpr_intern.h @@ -0,0 +1,64 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2019 Blender Foundation. + * All rights reserved. + */ + +/** \file + * \ingroup editors + */ + +#ifndef __LANPR_INTERN_H__ +#define __LANPR_INTERN_H__ + +#include "BLI_listbase.h" +#include "BLI_linklist.h" +#include "BLI_math.h" +#include "BLI_threads.h" + +#include "DNA_lanpr_types.h" + +#include <math.h> +#include <string.h> + +struct LANPR_StaticMemPoolNode; +struct LANPR_RenderLine; +struct LANPR_RenderBuffer; + +void *list_append_pointer_static(ListBase *h, struct LANPR_StaticMemPool *smp, void *p); +void *list_append_pointer_static_sized(ListBase *h, struct LANPR_StaticMemPool *smp, void *p, int size); +void *list_push_pointer_static(ListBase *h, struct LANPR_StaticMemPool *smp, void *p); +void *list_push_pointer_static_sized(ListBase *h, struct LANPR_StaticMemPool *smp, void *p, int size); + +void *list_append_pointer_static_pool(struct LANPR_StaticMemPool *mph, ListBase *h, void *p); +void *list_pop_pointer_no_free(ListBase *h); +void list_remove_pointer_item_no_free(ListBase *h, LinkData *lip); + +LANPR_StaticMemPoolNode *mem_new_static_pool(struct LANPR_StaticMemPool *smp); +void *mem_static_aquire(struct LANPR_StaticMemPool *smp, int size); +void *mem_static_aquire_thread(struct LANPR_StaticMemPool *smp, int size); +void *mem_static_destroy(LANPR_StaticMemPool *smp); + +void tmat_make_ortho_matrix_44d( + double (*mProjection)[4], double xMin, double xMax, double yMin, double yMax, double zMin, double zMax); +void tmat_make_perspective_matrix_44d( + double (*mProjection)[4], double fFov_rad, double fAspect, double zMin, double zMax); + +int lanpr_count_this_line(struct LANPR_RenderLine *rl, struct LANPR_LineLayer *ll); +int lanpr_count_intersection_segment_count(struct LANPR_RenderBuffer *rb); + + +#endif diff --git a/source/blender/editors/lanpr/lanpr_util.c b/source/blender/editors/lanpr/lanpr_util.c index ac1735c2491..6f9934087fd 100644 --- a/source/blender/editors/lanpr/lanpr_util.c +++ b/source/blender/editors/lanpr/lanpr_util.c @@ -28,6 +28,8 @@ #include "MEM_guardedalloc.h" #include <math.h> +#include "lanpr_intern.h" + /* ===================================================================[slt] */ void *list_append_pointer_static(ListBase *h, LANPR_StaticMemPool *smp, void *data) |