9 #ifndef CMZN_GLYPH_HPP__
10 #define CMZN_GLYPH_HPP__
12 #include "zinc/glyph.h"
13 #include "zinc/context.hpp"
14 #include "zinc/material.hpp"
15 #include "zinc/spectrum.hpp"
47 explicit Glyph(cmzn_glyph_id in_glyph_id) :
52 id(cmzn_glyph_access(glyph.id))
57 cmzn_glyph_id temp_id = cmzn_glyph_access(glyph.id);
60 cmzn_glyph_destroy(&
id);
70 cmzn_glyph_destroy(&
id);
195 return cmzn_glyph_get_name(
id);
206 return cmzn_glyph_set_name(
id, name);
217 return (0 != cmzn_glyph_is_managed(
id));
234 return cmzn_glyph_set_managed(
id, static_cast<int>(value));
253 inline bool operator==(
const Glyph& a,
const Glyph& b)
255 return a.getId() == b.getId();
272 inline cmzn_glyph_axes_id getDerivedId()
274 return reinterpret_cast<cmzn_glyph_axes_id
>(id);
280 explicit GlyphAxes(cmzn_glyph_axes_id axes_id)
281 :
Glyph(reinterpret_cast<cmzn_glyph_id>(axes_id))
291 return cmzn_glyph_axes_get_axis_width(getDerivedId());
304 return cmzn_glyph_axes_set_axis_width(getDerivedId(), axisWidth);
316 return cmzn_glyph_axes_get_axis_label(getDerivedId(), axisNumber);
328 return cmzn_glyph_axes_set_axis_label(getDerivedId(), axisNumber, label);
339 return Material(cmzn_glyph_axes_get_axis_material(getDerivedId(), axisNumber));
353 return cmzn_glyph_axes_set_axis_material(getDerivedId(), axisNumber, material.
getId());
360 return GlyphAxes(cmzn_glyph_cast_axes(
id));
378 inline cmzn_glyph_colour_bar_id getDerivedId()
380 return reinterpret_cast<cmzn_glyph_colour_bar_id
>(id);
387 :
Glyph(reinterpret_cast<cmzn_glyph_id>(colour_bar_id))
397 int getAxis(
int valuesCount,
double *valuesOut)
399 return cmzn_glyph_colour_bar_get_axis(getDerivedId(), valuesCount, valuesOut);
412 int setAxis(
int valuesCount,
const double *valuesIn)
414 return cmzn_glyph_colour_bar_set_axis(getDerivedId(), valuesCount, valuesIn);
426 return cmzn_glyph_colour_bar_get_centre(getDerivedId(), valuesCount, valuesOut);
442 return cmzn_glyph_colour_bar_set_centre(getDerivedId(), valuesCount, valuesIn);
453 return cmzn_glyph_colour_bar_get_extend_length(getDerivedId());
466 return cmzn_glyph_colour_bar_set_extend_length(getDerivedId(), extendLength);
476 return cmzn_glyph_colour_bar_get_label_divisions(getDerivedId());
489 return cmzn_glyph_colour_bar_set_label_divisions(getDerivedId(), labelDivisions);
499 return Material(cmzn_glyph_colour_bar_get_label_material(getDerivedId()));
512 return cmzn_glyph_colour_bar_set_label_material(getDerivedId(), material.
getId());
523 return cmzn_glyph_colour_bar_get_number_format(getDerivedId());
539 return cmzn_glyph_colour_bar_set_number_format(getDerivedId(), numberFormat);
551 return cmzn_glyph_colour_bar_get_side_axis(getDerivedId(), valuesCount, valuesOut);
567 return cmzn_glyph_colour_bar_set_side_axis(getDerivedId(), valuesCount, valuesIn);
577 return cmzn_glyph_colour_bar_get_tick_length(getDerivedId());
590 return cmzn_glyph_colour_bar_set_tick_length(getDerivedId(), tickLength);
609 cmzn_glyphiterator_id id;
622 id(cmzn_glyphiterator_access(glyphiterator.id))
627 cmzn_glyphiterator_id temp_id = cmzn_glyphiterator_access(glyphiterator.id);
630 cmzn_glyphiterator_destroy(&
id);
640 cmzn_glyphiterator_destroy(&
id);
663 return Glyph(cmzn_glyphiterator_next(
id));
678 cmzn_glyphmodule_id id;
686 explicit Glyphmodule(cmzn_glyphmodule_id in_glyphmodule_id) :
687 id(in_glyphmodule_id)
691 id(cmzn_glyphmodule_access(glyphModule.id))
696 cmzn_glyphmodule_id temp_id = cmzn_glyphmodule_access(glyphModule.id);
699 cmzn_glyphmodule_destroy(&
id);
709 cmzn_glyphmodule_destroy(&
id);
744 return cmzn_glyphmodule_begin_change(
id);
758 return cmzn_glyphmodule_end_change(
id);
773 return GlyphAxes(reinterpret_cast<cmzn_glyph_axes_id>(
774 cmzn_glyphmodule_create_glyph_axes(
id, axisGlyph.
getId(), axisWidth)));
788 cmzn_glyphmodule_create_glyph_colour_bar(
id, spectrum.
getId())));
805 return Glyphiterator(cmzn_glyphmodule_create_glyphiterator(
id));
853 return cmzn_glyphmodule_define_standard_glyphs(
id);
864 return Glyph(cmzn_glyphmodule_find_glyph_by_name(
id, name));
875 return Glyph(cmzn_glyphmodule_find_glyph_by_glyph_shape_type(
id, static_cast<cmzn_glyph_shape_type>(glyphShapeType)));
885 return Glyph(cmzn_glyphmodule_get_default_point_glyph(
id));
896 return cmzn_glyphmodule_set_default_point_glyph(
id, glyph.
getId());
913 return Glyphmodule(cmzn_context_get_glyphmodule(
id));
Definition: glyph.hpp:139
Material getAxisMaterial(int axisNumber)
Definition: glyph.hpp:337
char * getAxisLabel(int axisNumber)
Definition: glyph.hpp:314
A specialised glyph type which renders 3-D axes.
Definition: glyph.hpp:264
int endChange()
Definition: glyph.hpp:756
Definition: glyph.hpp:102
bool isManaged()
Definition: glyph.hpp:215
Definition: glyph.hpp:137
Definition: glyph.hpp:145
Definition: glyph.hpp:179
int defineStandardGlyphs()
Definition: glyph.hpp:851
Definition: glyph.hpp:143
GlyphColourBar castColourBar()
Definition: glyph.hpp:595
Definition: glyph.hpp:161
Glyph createStaticGlyphFromGraphics(const Graphics &graphics)
Definition: graphics.hpp:1853
Definition: glyph.hpp:110
Definition: glyph.hpp:141
Glyph findGlyphByGlyphShapeType(Glyph::ShapeType glyphShapeType)
Definition: glyph.hpp:873
double getTickLength()
Definition: glyph.hpp:575
cmzn_material_id getId() const
Definition: material.hpp:83
RepeatMode
Definition: glyph.hpp:98
Glyphmodule getGlyphmodule()
Definition: glyph.hpp:911
Definition: glyph.hpp:153
GlyphAxes createGlyphAxes(const Glyph &axisGlyph, double axisWidth)
Definition: glyph.hpp:771
Definition: glyph.hpp:165
Definition: glyph.hpp:163
int getAxis(int valuesCount, double *valuesOut)
Definition: glyph.hpp:397
Base graphics type: produces 3-D graphics visualising domains and fields.
Definition: graphics.hpp:45
cmzn_spectrum_id getId() const
Definition: spectrum.hpp:638
Definition: glyph.hpp:171
int setManaged(bool value)
Definition: glyph.hpp:232
Definition: glyph.hpp:155
Definition: glyph.hpp:173
A glyph is a static graphics object used to visualise a point in space.
Definition: glyph.hpp:36
Definition: glyph.hpp:133
Definition: glyph.hpp:159
Glyph findGlyphByName(const char *name)
Definition: glyph.hpp:862
Definition: glyph.hpp:149
int setAxisMaterial(int axisNumber, const Material &material)
Definition: glyph.hpp:351
Zinc materials specify colouring of graphics.
Definition: material.hpp:29
int getSideAxis(int valuesCount, double *valuesOut)
Definition: glyph.hpp:549
Definition: glyph.hpp:175
Definition: glyph.hpp:100
cmzn_glyphmodule_id getId() const
Definition: glyph.hpp:728
int setAxisWidth(double axisWidth)
Definition: glyph.hpp:302
int setDefaultPointGlyph(const Glyph &glyph)
Definition: glyph.hpp:894
Definition: glyph.hpp:114
int setNumberFormat(const char *numberFormat)
Definition: glyph.hpp:537
int setLabelDivisions(int labelDivisions)
Definition: glyph.hpp:487
bool isValid() const
Definition: glyph.hpp:718
char * getNumberFormat()
Definition: glyph.hpp:521
char * getName()
Definition: glyph.hpp:193
Zinc Spectrum maps values of graphics data fields to colours.
Definition: spectrum.hpp:581
int beginChange()
Definition: glyph.hpp:742
ShapeType
Definition: glyph.hpp:131
bool isValid() const
Definition: glyph.hpp:649
double getExtendLength()
Definition: glyph.hpp:451
Module managing all glyphs.
Definition: glyph.hpp:675
Definition: glyph.hpp:157
A specialised glyph type which draws a cylindrical colour bar.
Definition: glyph.hpp:370
Definition: glyph.hpp:181
double getAxisWidth()
Definition: glyph.hpp:289
int setAxisLabel(int axisNumber, const char *label)
Definition: glyph.hpp:326
An iterator for looping through all the glyphs in a glyphmodule.
Definition: glyph.hpp:605
Material getLabelMaterial()
Definition: glyph.hpp:497
int getCentre(int valuesCount, double *valuesOut)
Definition: glyph.hpp:424
Definition: glyph.hpp:177
Definition: glyph.hpp:151
int setCentre(int valuesCount, const double *valuesIn)
Definition: glyph.hpp:440
Glyphiterator createGlyphiterator()
Definition: glyph.hpp:803
Glyph next()
Definition: glyph.hpp:661
GlyphColourBar createGlyphColourBar(const Spectrum &spectrum)
Definition: glyph.hpp:785
int setSideAxis(int valuesCount, const double *valuesIn)
Definition: glyph.hpp:565
int setExtendLength(double extendLength)
Definition: glyph.hpp:464
GlyphAxes castAxes()
Definition: glyph.hpp:358
int setTickLength(double tickLength)
Definition: glyph.hpp:588
Glyph getDefaultPointGlyph()
Definition: glyph.hpp:883
Definition: glyph.hpp:106
cmzn_glyph_id getId() const
Definition: glyph.hpp:89
int getLabelDivisions()
Definition: glyph.hpp:474
Definition: glyph.hpp:169
int setLabelMaterial(const Material &material)
Definition: glyph.hpp:510
Definition: glyph.hpp:135
Definition: glyph.hpp:147
bool isValid() const
Definition: glyph.hpp:79
Definition: glyph.hpp:183
int setName(const char *name)
Definition: glyph.hpp:204
int setAxis(int valuesCount, const double *valuesIn)
Definition: glyph.hpp:412
Definition: glyph.hpp:167