Inkscape
Vector Graphics Editor
|
Output bezier splines in POVRay format. More...
#include <pov-out.h>
Classes | |
class | PovShapeInfo |
used for saving information about shapes More... | |
Public Types | |
typedef Glib::ustring | String |
Our internal String definition. | |
Public Member Functions | |
PovOutput () | |
bool | check (Inkscape::Extension::Extension *module) override |
Check whether we can actually output using this module. | |
void | save (Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) override |
API call to perform the output to a file. | |
void | reset () |
Reset variables to initial state. | |
![]() | |
Implementation ()=default | |
virtual | ~Implementation ()=default |
virtual bool | load (Inkscape::Extension::Extension *) |
virtual void | unload (Inkscape::Extension::Extension *) |
virtual ImplementationDocumentCache * | newDocCache (Inkscape::Extension::Extension *, SPDesktop *) |
Create a new document cache object. | |
virtual bool | cancelProcessing () |
virtual void | commitDocument () |
virtual std::unique_ptr< SPDocument > | new_from_template (Inkscape::Extension::Template *) |
virtual void | get_template_presets (const Template *tmod, TemplatePresets &presets) const |
virtual void | resize_to_template (Inkscape::Extension::Template *tmod, SPDocument *doc, SPPage *page) |
virtual bool | match_template_size (Inkscape::Extension::Template *tmod, double width, double height) |
virtual std::unique_ptr< SPDocument > | open (Inkscape::Extension::Input *module, char const *filename, bool is_importing) |
Open a file. | |
virtual void | export_raster (Inkscape::Extension::Output *module, const SPDocument *doc, std::string const &png_file, gchar const *filename) |
Convert from PNG to raster format. | |
virtual Gtk::Widget * | prefs_effect (Inkscape::Extension::Effect *module, SPDesktop *desktop, sigc::signal< void()> *changeSignal, ImplementationDocumentCache *docCache) |
Find out information about the file. | |
virtual void | effect (Inkscape::Extension::Effect *, ExecutionEnv *, SPDesktop *, ImplementationDocumentCache *) |
virtual void | effect (Inkscape::Extension::Effect *, ExecutionEnv *, SPDocument *document) |
virtual bool | apply_filter (Inkscape::Extension::Effect *module, SPItem *item) |
virtual unsigned | setup (Inkscape::Extension::Print *) |
virtual unsigned | set_preview (Inkscape::Extension::Print *) |
virtual unsigned | begin (Inkscape::Extension::Print *, SPDocument *) |
virtual unsigned | finish (Inkscape::Extension::Print *) |
virtual bool | textToPath (Inkscape::Extension::Print *) |
Tell the printing engine whether text should be text or path. | |
virtual bool | fontEmbedded (Inkscape::Extension::Print *) |
Get "fontEmbedded" param, i.e. | |
virtual unsigned | bind (Inkscape::Extension::Print *, Geom::Affine const &, float) |
virtual unsigned | release (Inkscape::Extension::Print *) |
virtual unsigned | fill (Inkscape::Extension::Print *, Geom::PathVector const &, Geom::Affine const &, SPStyle const *, Geom::OptRect const &, Geom::OptRect const &, Geom::OptRect const &) |
virtual unsigned | stroke (Inkscape::Extension::Print *, Geom::PathVector const &, Geom::Affine const &, SPStyle const *, Geom::OptRect const &, Geom::OptRect const &, Geom::OptRect const &) |
virtual unsigned | image (Inkscape::Extension::Print *, unsigned char *, unsigned int, unsigned int, unsigned int, Geom::Affine const &, SPStyle const *) |
virtual unsigned | text (Inkscape::Extension::Print *, char const *, Geom::Point const &, SPStyle const *) |
virtual void | processPath (Inkscape::XML::Node *) |
virtual void | setDetachBase (bool detach) |
If detach = true, when saving to a file, don't store URIs relative to the filename. | |
Static Public Member Functions | |
static void | init () |
Inkscape runtime startup call. | |
Private Member Functions | |
void | out (const char *fmt,...) G_GNUC_PRINTF(2 |
Format text to our output buffer. | |
void void | vec2 (double a, double b) |
Output a 2d vector. | |
void | vec3 (double a, double b, double c) |
Output a 3d vector. | |
void | vec4 (double a, double b, double c, double d) |
Output a 4d vector. | |
void | rgbf (double r, double g, double b, double f) |
Output an rgbf color vector. | |
void | segment (int segNr, double a0, double a1, double b0, double b1, double c0, double c1, double d0, double d1) |
Output one bezier's start, start-control, end-control, and end nodes. | |
bool | doHeader () |
Output the file header. | |
bool | doTail () |
Output the file footer. | |
bool | doCurve (SPItem *item, const String &id) |
Output the SVG document's curve data as POV curves. | |
bool | doTreeRecursive (SPDocument *doc, SPObject *obj) |
Descend the svg tree recursively, translating data. | |
bool | doTree (SPDocument *doc) |
Output the curve data to buffer. | |
void | saveDocument (SPDocument *doc, gchar const *filename) |
Actual method to save document. | |
Private Attributes | |
std::vector< PovShapeInfo > | povShapes |
String | outbuf |
int | nrNodes |
int | nrSegments |
int | nrShapes |
int | idIndex |
double | minx |
double | miny |
double | maxx |
double | maxy |
typedef Glib::ustring Inkscape::Extension::Internal::PovOutput::String |
Inkscape::Extension::Internal::PovOutput::PovOutput | ( | ) |
Definition at line 96 of file pov-out.cpp.
|
overridevirtual |
Check whether we can actually output using this module.
Make sure that we are in the database.
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 679 of file pov-out.cpp.
Output the SVG document's curve data as POV curves.
Output the curve data to buffer.
For all Subpaths in the <path>
For all segments in the subpath, including extra closing segment defined by 2geom
at moment of writing, 2geom lacks proper initialization of empty intervals in rect...
For all Subpaths in the <path>
For all segments in the subpath, including extra closing segment defined by 2geom
Definition at line 269 of file pov-out.cpp.
References Inkscape::Extension::Internal::PovOutput::PovShapeInfo::color, Inkscape::Extension::Internal::dstr(), Inkscape::Extension::Internal::effective_opacity(), Inkscape::Extension::Internal::err(), Geom::GenericRect< C >::expandTo(), SPStyle::fill, SPStyle::fill_opacity, Geom::PathVector::front(), SPItem::i2dt_affine(), Inkscape::Extension::Internal::PovOutput::PovShapeInfo::id, Geom::Path::initialPoint(), is_straight_curve(), item, Geom::GenericRect< C >::max(), maxx, maxy, Geom::GenericRect< C >::min(), minx, miny, nrNodes, nrSegments, nrShapes, out(), pathv_to_linear_and_cubic_beziers(), povShapes, Inkscape::Colors::Space::RGB, rgbf(), segment(), Geom::X, and Geom::Y.
Referenced by doTreeRecursive().
|
private |
Output the file header.
Definition at line 210 of file pov-out.cpp.
References nrNodes, nrSegments, nrShapes, out(), and Inkscape::version_string.
Referenced by saveDocument().
|
private |
Output the file footer.
Definition at line 254 of file pov-out.cpp.
References out().
Referenced by saveDocument().
|
private |
Output the curve data to buffer.
Definition at line 481 of file pov-out.cpp.
References doTreeRecursive(), SPDocument::getRoot(), maxx, maxy, minx, miny, out(), and povShapes.
Referenced by saveDocument().
|
private |
Descend the svg tree recursively, translating data.
Descend into children
Definition at line 448 of file pov-out.cpp.
References buf, child, SPObject::children, doCurve(), doTreeRecursive(), SPObject::getId(), idIndex, and item.
Referenced by doTree(), and doTreeRecursive().
|
static |
Inkscape runtime startup call.
This is the definition of PovRay output.
This function just calls the extension system with the memory allocated XML that describes the data.
Definition at line 697 of file pov-out.cpp.
References Inkscape::Extension::build_from_mem().
Referenced by Inkscape::Extension::init().
|
private |
void Inkscape::Extension::Internal::PovOutput::reset | ( | ) |
Reset variables to initial state.
Set values back to initial state.
Definition at line 588 of file pov-out.cpp.
References idIndex, nrNodes, nrSegments, nrShapes, outbuf, and povShapes.
Referenced by saveDocument().
|
private |
|
overridevirtual |
API call to perform the output to a file.
API call to save document.
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 667 of file pov-out.cpp.
References saveDocument().
|
private |
Actual method to save document.
Saves the Shapes of an Inkscape SVG file as PovRay spline definitions.
Definition at line 603 of file pov-out.cpp.
References doHeader(), doTail(), doTree(), Inkscape::IO::dump_fopen_call(), Inkscape::Extension::Internal::err(), Inkscape::IO::fopen_utf8name(), outbuf, and reset().
Referenced by save().
|
private |
|
private |
Output a 2d vector.
Definition at line 144 of file pov-out.cpp.
References out().
Referenced by segment().
|
private |
|
private |
|
private |
Definition at line 171 of file pov-out.h.
Referenced by doTreeRecursive(), and reset().
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 168 of file pov-out.h.
Referenced by doCurve(), doHeader(), and reset().
|
private |
Definition at line 169 of file pov-out.h.
Referenced by doCurve(), doHeader(), and reset().
|
private |
Definition at line 170 of file pov-out.h.
Referenced by doCurve(), doHeader(), and reset().
|
private |
Definition at line 165 of file pov-out.h.
Referenced by out(), reset(), and saveDocument().
|
private |