[Bf-blender-cvs] [cd4a7be5b2e] master: Cleanup: move public doc-strings into headers for 'io/gpencil'

Campbell Barton noreply at git.blender.org
Thu Dec 9 10:36:05 CET 2021


Commit: cd4a7be5b2ec458712bd9e0a028913dcb03512d9
Author: Campbell Barton
Date:   Thu Dec 9 20:31:05 2021 +1100
Branches: master
https://developer.blender.org/rBcd4a7be5b2ec458712bd9e0a028913dcb03512d9

Cleanup: move public doc-strings into headers for 'io/gpencil'

Ref T92709

===================================================================

M	source/blender/io/gpencil/gpencil_io.h
M	source/blender/io/gpencil/intern/gpencil_io_base.cc
M	source/blender/io/gpencil/intern/gpencil_io_base.hh
M	source/blender/io/gpencil/intern/gpencil_io_capi.cc
M	source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
M	source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh
M	source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
M	source/blender/io/gpencil/intern/gpencil_io_export_svg.hh

===================================================================

diff --git a/source/blender/io/gpencil/gpencil_io.h b/source/blender/io/gpencil/gpencil_io.h
index cb004910c1e..ea328a531c6 100644
--- a/source/blender/io/gpencil/gpencil_io.h
+++ b/source/blender/io/gpencil/gpencil_io.h
@@ -85,7 +85,13 @@ typedef enum eGpencilExportFrame {
   GP_EXPORT_FRAME_SCENE = 2,
 } eGpencilExportFrame;
 
+/**
+ * Main export entry point function.
+ */
 bool gpencil_io_export(const char *filename, struct GpencilIOParams *iparams);
+/**
+ * Main import entry point function.
+ */
 bool gpencil_io_import(const char *filename, struct GpencilIOParams *iparams);
 
 #ifdef __cplusplus
diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc
index 294f6bfccb7..f031648d2ed 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_base.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc
@@ -145,7 +145,6 @@ void GpencilIO::prepare_camera_params(Scene *scene, const GpencilIOParams *ipara
   }
 }
 
-/** Create a list of selected objects sorted from back to front */
 void GpencilIO::create_object_list()
 {
   ViewLayer *view_layer = CTX_data_view_layer(params_.C);
@@ -194,17 +193,12 @@ void GpencilIO::create_object_list()
   });
 }
 
-/**
- * Set file input_text full path.
- * \param filename: Path of the file provided by save dialog.
- */
 void GpencilIO::filename_set(const char *filename)
 {
   BLI_strncpy(filename_, filename, FILE_MAX);
   BLI_path_abs(filename_, BKE_main_blendfile_path(bmain_));
 }
 
-/** Convert to screenspace. */
 bool GpencilIO::gpencil_3D_point_to_screen_space(const float3 co, float2 &r_co)
 {
   float3 parent_co = diff_mat_ * co;
@@ -244,7 +238,6 @@ bool GpencilIO::gpencil_3D_point_to_screen_space(const float3 co, float2 &r_co)
   return false;
 }
 
-/** Convert to render space. */
 float2 GpencilIO::gpencil_3D_point_to_render_space(const float3 co)
 {
   float3 parent_co = diff_mat_ * co;
@@ -266,7 +259,6 @@ float2 GpencilIO::gpencil_3D_point_to_render_space(const float3 co)
   return r_co;
 }
 
-/** Convert to 2D. */
 float2 GpencilIO::gpencil_3D_point_to_2D(const float3 co)
 {
   const bool is_camera = (bool)(rv3d_->persp == RV3D_CAMOB);
@@ -278,7 +270,6 @@ float2 GpencilIO::gpencil_3D_point_to_2D(const float3 co)
   return result;
 }
 
-/** Get radius of point. */
 float GpencilIO::stroke_point_radius_get(bGPDlayer *gpl, bGPDstroke *gps)
 {
   bGPDspoint *pt = &gps->points[0];
@@ -338,7 +329,6 @@ bool GpencilIO::is_camera_mode()
   return is_camera_;
 }
 
-/* Calculate selected strokes boundbox. */
 void GpencilIO::selected_objects_boundbox_calc()
 {
   const float gap = 10.0f;
diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.hh b/source/blender/io/gpencil/intern/gpencil_io_base.hh
index 02758883f19..6437796648d 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_base.hh
+++ b/source/blender/io/gpencil/intern/gpencil_io_base.hh
@@ -87,11 +87,16 @@ class GpencilIO {
   float stroke_color_[4], fill_color_[4];
 
   /* Geometry functions. */
+  /** Convert to screenspace. */
   bool gpencil_3D_point_to_screen_space(const float3 co, float2 &r_co);
+  /** Convert to render space. */
   float2 gpencil_3D_point_to_render_space(const float3 co);
+  /** Convert to 2D. */
   float2 gpencil_3D_point_to_2D(const float3 co);
 
+  /** Get radius of point. */
   float stroke_point_radius_get(struct bGPDlayer *gpl, struct bGPDstroke *gps);
+  /** Create a list of selected objects sorted from back to front */
   void create_object_list();
 
   bool is_camera_mode();
@@ -101,8 +106,13 @@ class GpencilIO {
   void prepare_layer_export_matrix(struct Object *ob, struct bGPDlayer *gpl);
   void prepare_stroke_export_colors(struct Object *ob, struct bGPDstroke *gps);
 
+  /* Calculate selected strokes boundbox. */
   void selected_objects_boundbox_calc();
   void selected_objects_boundbox_get(rctf *boundbox);
+  /**
+   * Set file input_text full path.
+   * \param filename: Path of the file provided by save dialog.
+   */
   void filename_set(const char *filename);
 
  private:
diff --git a/source/blender/io/gpencil/intern/gpencil_io_capi.cc b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
index 95f5839682f..92ce165e059 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_capi.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
@@ -177,7 +177,6 @@ static bool gpencil_io_export_frame_svg(GpencilExporterSVG *exporter,
 }
 #endif
 
-/* Main import entry point function. */
 bool gpencil_io_import(const char *filename, GpencilIOParams *iparams)
 {
   GpencilImporterSVG importer = GpencilImporterSVG(filename, iparams);
@@ -185,7 +184,6 @@ bool gpencil_io_import(const char *filename, GpencilIOParams *iparams)
   return gpencil_io_import_frame(&importer, *iparams);
 }
 
-/* Main export entry point function. */
 bool gpencil_io_export(const char *filename, GpencilIOParams *iparams)
 {
   Depsgraph *depsgraph_ = CTX_data_depsgraph_pointer(iparams->C);
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
index 82f8444d43e..7539fba1343 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
@@ -109,7 +109,6 @@ bool GpencilExporterPDF::write()
   return (res == 0) ? true : false;
 }
 
-/* Create pdf document. */
 bool GpencilExporterPDF::create_document()
 {
   pdf_ = HPDF_New(error_handler, nullptr);
@@ -120,7 +119,6 @@ bool GpencilExporterPDF::create_document()
   return true;
 }
 
-/* Add page. */
 bool GpencilExporterPDF::add_page()
 {
   /* Add a new page object. */
@@ -136,7 +134,6 @@ bool GpencilExporterPDF::add_page()
   return true;
 }
 
-/* Main layer loop. */
 void GpencilExporterPDF::export_gpencil_layers()
 {
   /* If is doing a set of frames, the list of objects can change for each frame. */
@@ -229,10 +226,6 @@ void GpencilExporterPDF::export_gpencil_layers()
   }
 }
 
-/**
- * Export a stroke using polyline or polygon
- * \param do_fill: True if the stroke is only fill
- */
 void GpencilExporterPDF::export_stroke_to_polyline(bGPDlayer *gpl,
                                                    bGPDstroke *gps,
                                                    const bool is_stroke,
@@ -288,10 +281,6 @@ void GpencilExporterPDF::export_stroke_to_polyline(bGPDlayer *gpl,
   HPDF_Page_GRestore(page_);
 }
 
-/**
- * Set color.
- * \param do_fill: True if the stroke is only fill.
- */
 void GpencilExporterPDF::color_set(bGPDlayer *gpl, const bool do_fill)
 {
   const float fill_opacity = fill_color_[3] * gpl->opacity;
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh
index 89d97f79783..18de321914c 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh
@@ -45,20 +45,31 @@ class GpencilExporterPDF : public GpencilExporter {
 
  protected:
  private:
-  /* PDF document. */
+  /** PDF document. */
   HPDF_Doc pdf_;
-  /* PDF page. */
+  /** PDF page. */
   HPDF_Page page_;
 
+  /** Create PDF document. */
   bool create_document();
+  /** Add page. */
   bool add_page();
+  /** Main layer loop. */
   void export_gpencil_layers();
 
+  /**
+   * Export a stroke using poly-line or polygon
+   * \param do_fill: True if the stroke is only fill
+   */
   void export_stroke_to_polyline(bGPDlayer *gpl,
                                  bGPDstroke *gps,
                                  const bool is_stroke,
                                  const bool do_fill,
                                  const bool normalize);
+  /**
+   * Set color.
+   * \param do_fill: True if the stroke is only fill.
+   */
   void color_set(bGPDlayer *gpl, const bool do_fill);
 };
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
index a9745415d40..09eac7a2813 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
@@ -97,7 +97,6 @@ bool GpencilExporterSVG::write()
   return result;
 }
 
-/* Create document header and main svg node. */
 void GpencilExporterSVG::create_document_header()
 {
   /* Add a custom document declaration node. */
@@ -133,7 +132,6 @@ void GpencilExporterSVG::create_document_header()
   main_node_.append_attribute("viewBox").set_value(viewbox.c_str());
 }
 
-/* Main layer loop. */
 void GpencilExporterSVG::export_gpencil_layers()
 {
   const bool is_clipping = is_camera_mode() && (params_.flag & GP_EXPORT_CLIP_CAMERA) != 0;
@@ -254,11 +252,6 @@ void GpencilExporterSVG::export_gpencil_layers()
   }
 }
 
-/**
- * Export a stroke using SVG path
- * \param node_gpl: Node of the layer.
- * \param do_fill: True if the stroke is only fill
- */
 void GpencilExporterSVG::export_stroke_to_path(bGPDlayer *gpl,
                                                bGPDstroke *gps,
                                                pugi::xml_node node_gpl,
@@ -303,11 +296,6 @@ void GpencilExporterSVG::export_stroke_to_path(bGPDlayer *gpl,
   node_gps.append_attribute("d").set_value(txt.c_str());
 }
 
-/**
- * Export a stroke using polyline or polygon
- * \param node_gpl: Node of the layer.
- * \param do_fill: True if the stroke is only fill
- */
 void GpencilExporterSVG::export_stroke_to_polyline(bGPDlayer *gpl,
                                                    bGPDstroke *gps,
                                                    pugi::xml_node node_gpl,
@@ -351,11 +339,6 @@ void GpencilExporterSVG::export_stroke_to_polyline(bGPDlayer *gpl,
   node_gps.append_attribute("points").set_value(txt.c_str());
 }
 
-/**
- * Set color SVG string for stroke
- * \param node_gps: Stroke node.
- * \param do_fill: True if the stroke is only fill.
- */
 void GpencilExporterSVG::color_string_set(bGPDlayer *gpl,
                                           bGPDstroke *gps,
                                           pugi::xml_node node_gps,
@@ -392,16 +375,6 @@ void GpencilExporterSVG::color_string_set(bGPDlayer *gpl,
   }
 }
 
-/**
- * Create a SVG rectangle
- * \param node: Parent node
- * \param x: X locat

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list