diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-30 03:00:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-30 03:00:43 +0000 |
commit | bbbe8128e7ae9d816a221377dbf5ff3969bb203b (patch) | |
tree | 0283a521760b879b30e61872f14f235645745675 /graphics/asymptote/jsfile.h | |
parent | 14ce8b68fe7df49e8a8891bb94c63b9a846da232 (diff) |
CTAN sync 201909300300
Diffstat (limited to 'graphics/asymptote/jsfile.h')
-rw-r--r-- | graphics/asymptote/jsfile.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/graphics/asymptote/jsfile.h b/graphics/asymptote/jsfile.h new file mode 100644 index 0000000000..883cb4a70f --- /dev/null +++ b/graphics/asymptote/jsfile.h @@ -0,0 +1,55 @@ +#ifndef JSFILE_H +#define JSFILE_H + +#include <fstream> +#include <glm/glm.hpp> + +#include "common.h" +#include "triple.h" +#include "locate.h" +#include "prcfile.h" + +namespace gl { +extern glm::mat4 projViewMat; +} + +namespace camp { + +class jsfile { + jsofstream out; + +public: + jsfile() {} + ~jsfile(); + + void open(string name); + void copy(string name); + + void addColor(const prc::RGBAColour& c); + void addIndices(const uint32_t *I); + + void addPatch(const triple* controls, size_t n, const triple& Min, + const triple& Max, const prc::RGBAColour *colors); + + void addCurve(const triple& z0, const triple& c0, + const triple& c1, const triple& z1, + const triple& Min, const triple& Max); + + void addCurve(const triple& z0, const triple& z1, + const triple& Min, const triple& Max); + + void addPixel(const triple& z0, double width, + const triple& Min, const triple& Max); + + void addMaterial(size_t index); + + void addTriangles(size_t nP, const triple* P, size_t nN, const triple* N, + size_t nC, const prc::RGBAColour* C, size_t nI, + const uint32_t (*PI)[3], const uint32_t (*NI)[3], + const uint32_t (*CI)[3], + const triple& Min, const triple& Max); +}; + +} //namespace camp + +#endif |