[Bf-blender-cvs] [86a2041d472] greasepencil-object: GPencil: Cleanup code
Antonio Vazquez
noreply at git.blender.org
Wed Aug 12 22:46:08 CEST 2020
Commit: 86a2041d4722e86b1da04ef55862d4d40f88e55d
Author: Antonio Vazquez
Date: Wed Aug 12 22:46:00 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB86a2041d4722e86b1da04ef55862d4d40f88e55d
GPencil: Cleanup code
===================================================================
M source/blender/io/gpencil/intern/gpencil_io_export_base.cc
M source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
===================================================================
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_base.cc b/source/blender/io/gpencil/intern/gpencil_io_export_base.cc
index 643238698af..b3cddea67dd 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_base.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_base.cc
@@ -193,7 +193,12 @@ void GpencilExporter::set_out_filename(char *filename)
BLI_path_abs(out_filename_, BKE_main_blendfile_path(bmain));
}
-/* Convert to screen space. */
+/**
+ * Convert to screenspace
+ * \param co: 3D position
+ * \param r_co: 2D position
+ * \return False if error
+ */
bool GpencilExporter::gpencil_3d_point_to_screen_space(const float co[3], float r_co[2])
{
float parent_co[3];
@@ -285,6 +290,11 @@ bool GpencilExporter::is_stroke_thickness_constant(struct bGPDstroke *gps)
return true;
}
+/**
+ * Get radius of point
+ * \param gps: Stroke
+ * \return Radius in pixels
+ */
float GpencilExporter::stroke_point_radius_get(struct bGPDstroke *gps)
{
const bGPDlayer *gpl = gpl_current_get();
@@ -328,6 +338,7 @@ std::string GpencilExporter::rgb_to_hex(float color[3])
/**
* Convert a color to gray scale.
+ * \param color: Color to convert
*/
void GpencilExporter::rgb_to_grayscale(float color[3])
{
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 f2e282b3ab3..4f784eee926 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
@@ -161,6 +161,7 @@ void GpencilExporterSVG::create_document_header(void)
"#000000");
}
}
+
/* Main layer loop. */
void GpencilExporterSVG::export_layers(void)
{
@@ -333,8 +334,6 @@ void GpencilExporterSVG::export_layers(void)
/**
* Export a point
* \param gpl_node: Node of the layer.
- * \param gps: Stroke to export.
- * \param diff_mat_: Transformation matrix.
*/
void GpencilExporterSVG::export_point(pugi::xml_node gpl_node)
{
@@ -359,10 +358,8 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node)
}
/**
- * Export a stroke using path
+ * Export a stroke using SVG path
* \param gpl_node: Node of the layer.
- * \param gps: Stroke to export.
- * \param diff_mat_: Transformation matrix.
* \param is_fill: True if the stroke is only fill
*/
void GpencilExporterSVG::export_stroke_path(pugi::xml_node gpl_node, const bool is_fill)
@@ -416,8 +413,6 @@ void GpencilExporterSVG::export_stroke_path(pugi::xml_node gpl_node, const bool
/**
* Export a stroke using polyline or polygon
* \param gpl_node: Node of the layer.
- * \param gps: Stroke to export.
- * \param diff_mat_: Transformation matrix.
* \param is_fill: True if the stroke is only fill
*/
void GpencilExporterSVG::export_stroke_polyline(pugi::xml_node gpl_node, const bool is_fill)
@@ -470,6 +465,11 @@ void GpencilExporterSVG::export_stroke_polyline(pugi::xml_node gpl_node, const b
gps_node.append_attribute("points").set_value(txt.c_str());
}
+/**
+ * Set color SVG string for stroke
+ * \param gps_node: Stroke node
+ * @param is_fill: True if the stroke is only fill
+ */
void GpencilExporterSVG::color_string_set(pugi::xml_node gps_node, const bool is_fill)
{
bGPDlayer *gpl = gpl_current_get();
@@ -512,6 +512,16 @@ void GpencilExporterSVG::color_string_set(pugi::xml_node gps_node, const bool is
}
}
+/**
+ * Create a SVG rectangle
+ * \param node: Parent node
+ * \param x: X location
+ * \param y: Y location
+ * \param width: width of the recntagle
+ * \param height: Height of the rectangle
+ * \param thickness: Thickness of the line
+ * \param hexcolor: Color of the line
+ */
void GpencilExporterSVG::create_rect(pugi::xml_node node,
float x,
float y,
@@ -532,6 +542,15 @@ void GpencilExporterSVG::create_rect(pugi::xml_node node,
}
}
+/**
+ * Create SVG text
+ * \param node: Parent node
+ * \param x: X location
+ * \param y: Y location
+ * \param text: Text to include
+ * \param size: Size of th etext
+ * \param hexcolor: Color of the text
+ */
void GpencilExporterSVG::create_text(pugi::xml_node node,
float x,
float y,
More information about the Bf-blender-cvs
mailing list