9 #ifndef CMZN_GRAPHICS_HPP__
10 #define CMZN_GRAPHICS_HPP__
12 #include "zinc/types/scenecoordinatesystem.hpp"
13 #include "zinc/graphics.h"
14 #include "zinc/element.hpp"
15 #include "zinc/field.hpp"
16 #include "zinc/glyph.hpp"
17 #include "zinc/font.hpp"
18 #include "zinc/material.hpp"
19 #include "zinc/spectrum.hpp"
20 #include "zinc/tessellation.hpp"
27 class GraphicsContours;
30 class GraphicsStreamlines;
31 class GraphicsSurfaces;
32 class Graphicslineattributes;
33 class Graphicspointattributes;
34 class Graphicssamplingattributes;
57 explicit Graphics(cmzn_graphics_id graphics_id) : id(graphics_id)
65 cmzn_graphics_id temp_id = cmzn_graphics_access(graphics.id);
68 cmzn_graphics_destroy(&
id);
78 cmzn_graphics_destroy(&
id);
165 return Field(cmzn_graphics_get_coordinate_field(
id));
178 return cmzn_graphics_set_coordinate_field(
id, coordinateField.
getId());
188 return Field(cmzn_graphics_get_data_field(
id));
199 return cmzn_graphics_set_data_field(
id, dataField.
getId());
210 return cmzn_graphics_get_render_line_width(
id);
226 return cmzn_graphics_set_render_line_width(
id, width);
237 return cmzn_graphics_get_render_point_size(
id);
253 return cmzn_graphics_set_render_point_size(
id, size);
264 return static_cast<RenderPolygonMode>(cmzn_graphics_get_render_polygon_mode(
id));
277 return cmzn_graphics_set_render_polygon_mode(
id,
278 static_cast<cmzn_graphics_render_polygon_mode>(renderPolygonMode));
296 return static_cast<SelectMode>(cmzn_graphics_get_select_mode(
id));
311 return cmzn_graphics_set_select_mode(
id, static_cast<cmzn_graphics_select_mode>(selectMode));
321 return Field(cmzn_graphics_get_subgroup_field(
id));
335 return cmzn_graphics_set_subgroup_field(
id, subgroupField.
getId());
347 return Field(cmzn_graphics_get_texture_coordinate_field(
id));
361 return cmzn_graphics_set_texture_coordinate_field(
id, textureCoordinateField.
getId());
371 return Material(cmzn_graphics_get_material(
id));
382 return cmzn_graphics_set_material(
id, material.
getId());
419 return Material(cmzn_graphics_get_selected_material(
id));
430 return cmzn_graphics_set_selected_material(
id, material.
getId());
440 return Spectrum(cmzn_graphics_get_spectrum(
id));
451 return cmzn_graphics_set_spectrum(
id, spectrum.
getId());
461 return static_cast<Type>(cmzn_graphics_get_type(
id));
472 return Tessellation(cmzn_graphics_get_tessellation(
id));
484 return cmzn_graphics_set_tessellation(
id, tessellation.
getId());
494 return Field(cmzn_graphics_get_tessellation_field(
id));
509 return cmzn_graphics_set_tessellation_field(
id, tessellationField.
getId());
519 return cmzn_graphics_get_visibility_flag(
id);
531 return cmzn_graphics_set_visibility_flag(
id, visibilityFlag);
553 return cmzn_graphics_set_scenecoordinatesystem(
id,
554 static_cast<cmzn_scenecoordinatesystem>(coordinateSystem));
579 return cmzn_graphics_set_field_domain_type(
id, static_cast<cmzn_field_domain_type>(domainType));
590 return cmzn_graphics_get_name(
id);
604 return cmzn_graphics_set_name(
id, name);
619 return cmzn_graphics_set_element_face_type(
id, static_cast<cmzn_element_face_type>(faceType));
640 return cmzn_graphics_is_exterior(
id);
651 return cmzn_graphics_set_exterior(
id, exterior);
696 inline bool operator==(
const Graphics& a,
const Graphics& b)
698 return a.getId() == b.getId();
719 inline cmzn_graphics_contours_id getDerivedId()
721 return reinterpret_cast<cmzn_graphics_contours_id
>(this->id);
728 :
Graphics(reinterpret_cast<cmzn_graphics_id>(contours_id))
738 return Field(cmzn_graphics_contours_get_isoscalar_field(this->getDerivedId()));
750 return cmzn_graphics_contours_set_isoscalar_field(this->getDerivedId(), field.
getId());
767 return cmzn_graphics_contours_get_list_isovalues(this->getDerivedId(),
768 valuesCount, valuesOut);
780 return cmzn_graphics_contours_set_list_isovalues(this->getDerivedId(),
781 valuesCount, valuesIn);
793 return cmzn_graphics_contours_get_range_first_isovalue(this->getDerivedId());
805 return cmzn_graphics_contours_get_range_last_isovalue(this->getDerivedId());
817 return cmzn_graphics_contours_get_range_number_of_isovalues(this->getDerivedId());
833 return cmzn_graphics_contours_set_range_isovalues(this->getDerivedId(),
834 numberOfValues, firstIsovalue, lastIsovalue);
858 :
Graphics(reinterpret_cast<cmzn_graphics_id>(lines_id))
885 :
Graphics(reinterpret_cast<cmzn_graphics_id>(points_id))
915 inline cmzn_graphics_streamlines_id getDerivedId()
917 return reinterpret_cast<cmzn_graphics_streamlines_id
>(this->id);
924 :
Graphics(reinterpret_cast<cmzn_graphics_id>(streamlines_id))
967 return static_cast<ColourDataType>(cmzn_graphics_streamlines_get_colour_data_type(this->getDerivedId()));
981 return cmzn_graphics_streamlines_set_colour_data_type(this->getDerivedId(),
982 static_cast<cmzn_graphics_streamlines_colour_data_type>(dataType));
993 return Field(cmzn_graphics_streamlines_get_stream_vector_field(this->getDerivedId()));
1007 return cmzn_graphics_streamlines_set_stream_vector_field(this->getDerivedId(), field.
getId());
1019 cmzn_graphics_streamlines_get_track_direction(this->getDerivedId()));
1032 return cmzn_graphics_streamlines_set_track_direction(this->getDerivedId(),
1033 static_cast<cmzn_graphics_streamlines_track_direction>(trackDirection));
1043 return cmzn_graphics_streamlines_get_track_length(this->getDerivedId());
1056 return cmzn_graphics_streamlines_set_track_length(this->getDerivedId(), length);
1077 :
Graphics(reinterpret_cast<cmzn_graphics_id>(surfaces_id))
1116 cmzn_graphicslineattributes_id id;
1122 id(line_attributes_id)
1126 id(cmzn_graphicslineattributes_access(lineAttributes.id))
1131 cmzn_graphicslineattributes_id temp_id = cmzn_graphicslineattributes_access(graphicslineattributes.id);
1133 cmzn_graphicslineattributes_destroy(&
id);
1140 cmzn_graphicslineattributes_destroy(&
id);
1183 return cmzn_graphicslineattributes_get_base_size(
id, valuesCount, valuesOut);
1206 return cmzn_graphicslineattributes_set_base_size(
id, valuesCount, valuesIn);
1218 return Field(cmzn_graphicslineattributes_get_orientation_scale_field(
id));
1233 return cmzn_graphicslineattributes_set_orientation_scale_field(
id, orientationScaleField.
getId());
1250 return cmzn_graphicslineattributes_get_scale_factors(
id, valuesCount, valuesOut);
1274 return cmzn_graphicslineattributes_set_scale_factors(
id, valuesCount, valuesIn);
1285 return static_cast<ShapeType>(cmzn_graphicslineattributes_get_shape_type(
id));
1300 return cmzn_graphicslineattributes_set_shape_type(
id, static_cast<cmzn_graphicslineattributes_shape_type>(shapeType));
1320 cmzn_graphicspointattributes_id id;
1326 id(point_attributes_id)
1330 id(cmzn_graphicspointattributes_access(pointAttributes.id))
1335 cmzn_graphicspointattributes_id temp_id = cmzn_graphicspointattributes_access(graphicspointattributes.id);
1337 cmzn_graphicspointattributes_destroy(&
id);
1344 cmzn_graphicspointattributes_destroy(&
id);
1370 return cmzn_graphicspointattributes_get_base_size(
id, valuesCount, valuesOut);
1393 return cmzn_graphicspointattributes_set_base_size(
id, valuesCount, valuesIn);
1403 return Font(cmzn_graphicspointattributes_get_font(
id));
1414 return cmzn_graphicspointattributes_set_font(
id, font.
getId());
1424 return Glyph(cmzn_graphicspointattributes_get_glyph(
id));
1435 return cmzn_graphicspointattributes_set_glyph(
id, glyph.
getId());
1450 return cmzn_graphicspointattributes_get_glyph_offset(
id, valuesCount, valuesOut);
1467 return cmzn_graphicspointattributes_set_glyph_offset(
id, valuesCount, valuesIn);
1478 return static_cast<Glyph::RepeatMode>(cmzn_graphicspointattributes_get_glyph_repeat_mode(
id));
1491 return cmzn_graphicspointattributes_set_glyph_repeat_mode(
id,
1492 static_cast<enum cmzn_glyph_repeat_mode>(glyphRepeatMode));
1504 return static_cast<Glyph::ShapeType>(cmzn_graphicspointattributes_get_glyph_shape_type(
id));
1518 return cmzn_graphicspointattributes_set_glyph_shape_type(
id,
1519 static_cast<cmzn_glyph_shape_type>(shapeType));
1529 return Field(cmzn_graphicspointattributes_get_label_field(
id));
1542 return cmzn_graphicspointattributes_set_label_field(
id, labelField.
getId());
1556 return cmzn_graphicspointattributes_get_label_offset(
id, valuesCount, valuesOut);
1571 return cmzn_graphicspointattributes_set_label_offset(
id, valuesCount, valuesIn);
1584 return cmzn_graphicspointattributes_get_label_text(
id, labelNumber);
1600 return cmzn_graphicspointattributes_set_label_text(
id, labelNumber, labelText);
1612 return Field(cmzn_graphicspointattributes_get_orientation_scale_field(
id));
1644 return cmzn_graphicspointattributes_set_orientation_scale_field(
id, orientationScaleField.
getId());
1661 return cmzn_graphicspointattributes_get_scale_factors(
id, valuesCount, valuesOut);
1685 return cmzn_graphicspointattributes_set_scale_factors(
id, valuesCount, valuesIn);
1696 return Field(cmzn_graphicspointattributes_get_signed_scale_field(
id));
1718 return cmzn_graphicspointattributes_set_signed_scale_field(
id, signedScaleField.
getId());
1738 cmzn_graphicssamplingattributes_id id;
1744 id(sampling_attributes_id)
1748 id(cmzn_graphicssamplingattributes_access(samplingAttributes.id))
1753 cmzn_graphicssamplingattributes_id temp_id = cmzn_graphicssamplingattributes_access(graphicssamplingattributes.id);
1755 cmzn_graphicssamplingattributes_destroy(&
id);
1762 cmzn_graphicssamplingattributes_destroy(&
id);
1783 return Field(cmzn_graphicssamplingattributes_get_density_field(
id));
1797 return cmzn_graphicssamplingattributes_set_density_field(
id, densityField.
getId());
1810 return cmzn_graphicssamplingattributes_get_location(
id, valuesCount, valuesOut);
1825 return cmzn_graphicssamplingattributes_set_location(
id, valuesCount, valuesIn);
1847 return cmzn_graphicssamplingattributes_set_element_point_sampling_mode(
id,
1848 static_cast<cmzn_element_point_sampling_mode>(samplingMode));
1855 return Glyph(cmzn_glyphmodule_create_static_glyph_from_graphics(
id, graphics.
getId()));
int setSignedScaleField(const Field &signedScaleField)
Definition: graphics.hpp:1716
int setListIsovalues(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:778
enum Scenecoordinatesystem getScenecoordinatesystem()
Definition: graphics.hpp:539
int setTextureCoordinateField(const Field &textureCoordinateField)
Definition: graphics.hpp:359
enum RenderPolygonMode getRenderPolygonMode()
Definition: graphics.hpp:262
Glyph::ShapeType getGlyphShapeType()
Definition: graphics.hpp:1502
Graphicspointattributes getGraphicspointattributes()
Definition: graphics.hpp:1723
int setShapeType(ShapeType shapeType)
Definition: graphics.hpp:1298
Attributes object specifying how lines are visualised.
Definition: graphics.hpp:1113
Lines visualise 1-D elements in the model.
Definition: graphics.hpp:848
int setElementPointSamplingMode(Element::PointSamplingMode samplingMode)
Definition: graphics.hpp:1845
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1659
int setRenderPolygonMode(RenderPolygonMode renderPolygonMode)
Definition: graphics.hpp:275
Definition: graphics.hpp:124
char * getLabelText(int labelNumber)
Definition: graphics.hpp:1582
cmzn_tessellation_id getId() const
Definition: tessellation.hpp:81
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1683
Field getOrientationScaleField()
Definition: graphics.hpp:1216
Surfaces visualise 2-D elements in the model.
Definition: graphics.hpp:1067
Definition: graphics.hpp:112
int setVisibilityFlag(bool visibilityFlag)
Definition: graphics.hpp:529
int setTrackDirection(TrackDirection trackDirection)
Definition: graphics.hpp:1030
int setMaterial(const Material &material)
Definition: graphics.hpp:380
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:49
int setName(const char *name)
Definition: graphics.hpp:602
int setGlyphOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1465
bool isValid() const
Definition: graphics.hpp:1352
Field getCoordinateField()
Definition: graphics.hpp:163
int getLocation(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1808
int setTessellation(const Tessellation &tessellation)
Definition: graphics.hpp:482
SelectMode
Definition: graphics.hpp:110
Scenecoordinatesystem
Definition: scenecoordinatesystem.hpp:26
int setLocation(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1823
bool isValid() const
Definition: graphics.hpp:1770
int getListIsovalues(int valuesCount, double *valuesOut)
Definition: graphics.hpp:765
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1642
int setSpectrum(const Spectrum &spectrum)
Definition: graphics.hpp:449
Material getSelectedMaterial()
Definition: graphics.hpp:417
Definition: graphics.hpp:97
Glyph createStaticGlyphFromGraphics(const Graphics &graphics)
Definition: graphics.hpp:1853
Material getMaterial()
Definition: graphics.hpp:369
Container/manager for graphics visualising a region.
Definition: scene.hpp:36
Definition: graphics.hpp:1166
Definition: graphics.hpp:114
cmzn_material_id getId() const
Definition: material.hpp:83
RepeatMode
Definition: glyph.hpp:98
Definition: graphics.hpp:954
bool isValid() const
Definition: graphics.hpp:1148
int setRangeIsovalues(int numberOfValues, double firstIsovalue, double lastIsovalue)
Definition: graphics.hpp:831
Points graphics visualise discrete locations in the model.
Definition: graphics.hpp:875
double getRangeFirstIsovalue()
Definition: graphics.hpp:791
Field getDataField()
Definition: graphics.hpp:186
Definition: graphics.hpp:118
int setTrackLength(double length)
Definition: graphics.hpp:1054
Glyph::RepeatMode getGlyphRepeatMode()
Definition: graphics.hpp:1476
GraphicsContours castContours()
Definition: graphics.hpp:1081
Definition: graphics.hpp:137
int setScenecoordinatesystem(Scenecoordinatesystem coordinateSystem)
Definition: graphics.hpp:551
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1248
char * getName()
Definition: graphics.hpp:588
Field getStreamVectorField()
Definition: graphics.hpp:991
Field getLabelField()
Definition: graphics.hpp:1527
Base graphics type: produces 3-D graphics visualising domains and fields.
Definition: graphics.hpp:45
cmzn_spectrum_id getId() const
Definition: spectrum.hpp:638
Font getFont()
Definition: graphics.hpp:1401
Spectrum getSpectrum()
Definition: graphics.hpp:438
int setColourDataType(ColourDataType dataType)
Definition: graphics.hpp:979
A glyph is a static graphics object used to visualise a point in space.
Definition: glyph.hpp:36
Definition: graphics.hpp:141
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1391
int setSelectedMaterial(const Material &material)
Definition: graphics.hpp:428
cmzn_field_id getId() const
Definition: field.hpp:101
double getRangeLastIsovalue()
Definition: graphics.hpp:803
ShapeType getShapeType()
Definition: graphics.hpp:1283
Zinc materials specify colouring of graphics.
Definition: material.hpp:29
TrackDirection getTrackDirection()
Definition: graphics.hpp:1016
Element::FaceType getElementFaceType()
Definition: graphics.hpp:628
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1368
int setTessellationField(const Field &tessellationField)
Definition: graphics.hpp:507
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1204
int getRangeNumberOfIsovalues()
Definition: graphics.hpp:815
int setDataField(const Field &dataField)
Definition: graphics.hpp:197
RenderPolygonMode
Definition: graphics.hpp:95
DomainType
Definition: field.hpp:208
int setLabelField(const Field &labelField)
Definition: graphics.hpp:1540
Definition: graphics.hpp:1162
int setSelectMode(SelectMode selectMode)
Definition: graphics.hpp:309
Field getSubgroupField()
Definition: graphics.hpp:319
GraphicsPoints castPoints()
Definition: graphics.hpp:1091
Element::PointSamplingMode getElementPointSamplingMode()
Definition: graphics.hpp:1833
int setGlyphShapeType(Glyph::ShapeType shapeType)
Definition: graphics.hpp:1516
bool isExterior()
Definition: graphics.hpp:638
ShapeType
Definition: graphics.hpp:1156
Definition: graphics.hpp:932
Zinc Spectrum maps values of graphics data fields to colours.
Definition: spectrum.hpp:581
Definition: graphics.hpp:99
int setRenderLineWidth(double width)
Definition: graphics.hpp:224
ColourDataType getColourDataType()
Definition: graphics.hpp:965
ShapeType
Definition: glyph.hpp:131
bool getVisibilityFlag()
Definition: graphics.hpp:517
Definition: graphics.hpp:143
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1231
Field getTessellationField()
Definition: graphics.hpp:492
Field::DomainType getFieldDomainType()
Definition: graphics.hpp:563
Definition: graphics.hpp:101
Definition: graphics.hpp:1164
Graphicslineattributes getGraphicslineattributes()
Definition: graphics.hpp:1305
Attributes object specifying how points are visualised.
Definition: graphics.hpp:1317
Definition: graphics.hpp:939
The tessellation controls the number of polygons or line segments.
Definition: tessellation.hpp:28
int setFieldDomainType(Field::DomainType domainType)
Definition: graphics.hpp:577
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1181
int setFont(const Font &font)
Definition: graphics.hpp:1412
Definition: graphics.hpp:122
int setLabelText(int labelNumber, const char *labelText)
Definition: graphics.hpp:1598
ColourDataType
Definition: graphics.hpp:930
cmzn_font_id getId() const
Definition: font.hpp:103
Graphicssamplingattributes getGraphicssamplingattributes()
Definition: graphics.hpp:1858
Glyph getGlyph()
Definition: graphics.hpp:1422
GraphicsLines castLines()
Definition: graphics.hpp:1086
int setSubgroupField(const Field &subgroupField)
Definition: graphics.hpp:333
PointSamplingMode
Definition: element.hpp:343
int setElementFaceType(Element::FaceType faceType)
Definition: graphics.hpp:617
GraphicsStreamlines castStreamlines()
Definition: graphics.hpp:1096
Streamlines visualise the path of a fluid particle tracking along a vector field. ...
Definition: graphics.hpp:904
Definition: graphics.hpp:952
GraphicsSurfaces castSurfaces()
Definition: graphics.hpp:1101
TrackDirection
Definition: graphics.hpp:950
int setGlyphRepeatMode(Glyph::RepeatMode glyphRepeatMode)
Definition: graphics.hpp:1489
int getLabelOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1554
int setRenderPointSize(double size)
Definition: graphics.hpp:251
int setExterior(bool exterior)
Definition: graphics.hpp:649
double getRenderPointSize()
Definition: graphics.hpp:235
Definition: graphics.hpp:936
int getGlyphOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1448
Definition: graphics.hpp:135
Definition: graphics.hpp:1160
Type
Definition: graphics.hpp:131
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1272
Field getOrientationScaleField()
Definition: graphics.hpp:1610
enum Type getType()
Definition: graphics.hpp:459
double getTrackLength()
Definition: graphics.hpp:1041
enum SelectMode getSelectMode()
Definition: graphics.hpp:294
bool isValid() const
Definition: graphics.hpp:87
Field getDensityField()
Definition: graphics.hpp:1781
Field getTextureCoordinateField()
Definition: graphics.hpp:345
Field getSignedScaleField()
Definition: graphics.hpp:1694
Definition: graphics.hpp:139
cmzn_glyph_id getId() const
Definition: glyph.hpp:89
Definition: graphics.hpp:1158
Graphics attributes object specifying how points are sampled in elements.
Definition: graphics.hpp:1735
int setLabelOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1569
The contours derived graphics type.
Definition: graphics.hpp:708
int setCoordinateField(const Field &coordinateField)
Definition: graphics.hpp:176
Field getIsoscalarField()
Definition: graphics.hpp:736
FaceType
Definition: element.hpp:284
int setIsoscalarField(const Field &field)
Definition: graphics.hpp:748
Definition: graphics.hpp:956
Font object controlling attributes of rendering text.
Definition: font.hpp:26
Scene getScene()
Definition: scene.hpp:595
Tessellation getTessellation()
Definition: graphics.hpp:470
cmzn_graphics_id getId() const
Definition: graphics.hpp:153
Definition: graphics.hpp:934
Definition: graphics.hpp:133
int setGlyph(const Glyph &glyph)
Definition: graphics.hpp:1433
int setDensityField(const Field &densityField)
Definition: graphics.hpp:1795
double getRenderLineWidth()
Definition: graphics.hpp:208
int setStreamVectorField(const Field &field)
Definition: graphics.hpp:1005