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));
278 return cmzn_graphics_set_render_polygon_mode(
id,
279 static_cast<cmzn_graphics_render_polygon_mode>(renderPolygonMode));
297 return static_cast<SelectMode>(cmzn_graphics_get_select_mode(
id));
312 return cmzn_graphics_set_select_mode(
id, static_cast<cmzn_graphics_select_mode>(selectMode));
322 return Field(cmzn_graphics_get_subgroup_field(
id));
336 return cmzn_graphics_set_subgroup_field(
id, subgroupField.
getId());
348 return Field(cmzn_graphics_get_texture_coordinate_field(
id));
362 return cmzn_graphics_set_texture_coordinate_field(
id, textureCoordinateField.
getId());
372 return Material(cmzn_graphics_get_material(
id));
383 return cmzn_graphics_set_material(
id, material.
getId());
420 return Material(cmzn_graphics_get_selected_material(
id));
431 return cmzn_graphics_set_selected_material(
id, material.
getId());
441 return Spectrum(cmzn_graphics_get_spectrum(
id));
452 return cmzn_graphics_set_spectrum(
id, spectrum.
getId());
463 return Tessellation(cmzn_graphics_get_tessellation(
id));
475 return cmzn_graphics_set_tessellation(
id, tessellation.
getId());
485 return Field(cmzn_graphics_get_tessellation_field(
id));
500 return cmzn_graphics_set_tessellation_field(
id, tessellationField.
getId());
510 return cmzn_graphics_get_visibility_flag(
id);
522 return cmzn_graphics_set_visibility_flag(
id, visibilityFlag);
544 return cmzn_graphics_set_scenecoordinatesystem(
id,
545 static_cast<cmzn_scenecoordinatesystem>(coordinateSystem));
555 return cmzn_graphics_set_field_domain_type(
id, static_cast<cmzn_field_domain_type>(domainType));
566 return cmzn_graphics_get_name(
id);
580 return cmzn_graphics_set_name(
id, name);
585 return cmzn_graphics_set_element_face_type(
id, static_cast<cmzn_element_face_type>(faceType));
600 return cmzn_graphics_is_exterior(
id);
611 return cmzn_graphics_set_exterior(
id, exterior);
673 :
Graphics(reinterpret_cast<cmzn_graphics_id>(contours_id))
683 return Field(cmzn_graphics_contours_get_isoscalar_field(reinterpret_cast<cmzn_graphics_contours_id>(
id)));
695 return cmzn_graphics_contours_set_isoscalar_field(reinterpret_cast<cmzn_graphics_contours_id>(
id), field.
getId());
712 return cmzn_graphics_contours_get_list_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(
id),
713 valuesCount, valuesOut);
725 return cmzn_graphics_contours_set_list_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(
id),
726 valuesCount, valuesIn);
738 return cmzn_graphics_contours_get_range_first_isovalue(
739 reinterpret_cast<cmzn_graphics_contours_id>(
id));
751 return cmzn_graphics_contours_get_range_last_isovalue(
752 reinterpret_cast<cmzn_graphics_contours_id>(
id));
764 return cmzn_graphics_contours_get_range_number_of_isovalues(
765 reinterpret_cast<cmzn_graphics_contours_id>(
id));
781 return cmzn_graphics_contours_set_range_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(
id),
782 numberOfValues, firstIsovalue, lastIsovalue);
806 :
Graphics(reinterpret_cast<cmzn_graphics_id>(lines_id))
833 :
Graphics(reinterpret_cast<cmzn_graphics_id>(points_id))
862 :
Graphics(reinterpret_cast<cmzn_graphics_id>(streamlines_id))
889 return Field(cmzn_graphics_streamlines_get_stream_vector_field(reinterpret_cast<cmzn_graphics_streamlines_id>(
id)));
903 return cmzn_graphics_streamlines_set_stream_vector_field(reinterpret_cast<cmzn_graphics_streamlines_id>(
id), field.
getId());
915 cmzn_graphics_streamlines_get_track_direction(reinterpret_cast<cmzn_graphics_streamlines_id>(
id)));
929 return cmzn_graphics_streamlines_set_track_direction(reinterpret_cast<cmzn_graphics_streamlines_id>(
id),
930 static_cast<cmzn_graphics_streamlines_track_direction>(trackDirection));
940 return cmzn_graphics_streamlines_get_track_length(reinterpret_cast<cmzn_graphics_streamlines_id>(
id));
953 return cmzn_graphics_streamlines_set_track_length(reinterpret_cast<cmzn_graphics_streamlines_id>(
id), length);
974 :
Graphics(reinterpret_cast<cmzn_graphics_id>(surfaces_id))
1013 cmzn_graphicslineattributes_id id;
1019 id(line_attributes_id)
1023 id(cmzn_graphicslineattributes_access(lineAttributes.id))
1028 cmzn_graphicslineattributes_id temp_id = cmzn_graphicslineattributes_access(graphicslineattributes.id);
1030 cmzn_graphicslineattributes_destroy(&
id);
1037 cmzn_graphicslineattributes_destroy(&
id);
1080 return cmzn_graphicslineattributes_get_base_size(
id, valuesCount, valuesOut);
1103 return cmzn_graphicslineattributes_set_base_size(
id, valuesCount, valuesIn);
1115 return Field(cmzn_graphicslineattributes_get_orientation_scale_field(
id));
1130 return cmzn_graphicslineattributes_set_orientation_scale_field(
id, orientationScaleField.
getId());
1147 return cmzn_graphicslineattributes_get_scale_factors(
id, valuesCount, valuesOut);
1171 return cmzn_graphicslineattributes_set_scale_factors(
id, valuesCount, valuesIn);
1182 return static_cast<ShapeType>(cmzn_graphicslineattributes_get_shape_type(
id));
1198 return cmzn_graphicslineattributes_set_shape_type(
id, static_cast<cmzn_graphicslineattributes_shape_type>(shapeType));
1218 cmzn_graphicspointattributes_id id;
1224 id(point_attributes_id)
1228 id(cmzn_graphicspointattributes_access(pointAttributes.id))
1233 cmzn_graphicspointattributes_id temp_id = cmzn_graphicspointattributes_access(graphicspointattributes.id);
1235 cmzn_graphicspointattributes_destroy(&
id);
1242 cmzn_graphicspointattributes_destroy(&
id);
1268 return cmzn_graphicspointattributes_get_base_size(
id, valuesCount, valuesOut);
1291 return cmzn_graphicspointattributes_set_base_size(
id, valuesCount, valuesIn);
1301 return Font(cmzn_graphicspointattributes_get_font(
id));
1312 return cmzn_graphicspointattributes_set_font(
id, font.
getId());
1322 return Glyph(cmzn_graphicspointattributes_get_glyph(
id));
1333 return cmzn_graphicspointattributes_set_glyph(
id, glyph.
getId());
1348 return cmzn_graphicspointattributes_get_glyph_offset(
id, valuesCount, valuesOut);
1365 return cmzn_graphicspointattributes_set_glyph_offset(
id, valuesCount, valuesIn);
1370 return static_cast<Glyph::RepeatMode>(cmzn_graphicspointattributes_get_glyph_repeat_mode(
id));
1375 return cmzn_graphicspointattributes_set_glyph_repeat_mode(
id,
1376 static_cast<enum cmzn_glyph_repeat_mode>(glyphRepeatMode));
1381 return static_cast<Glyph::ShapeType>(cmzn_graphicspointattributes_get_glyph_shape_type(
id));
1386 return cmzn_graphicspointattributes_set_glyph_shape_type(
id,
1387 static_cast<cmzn_glyph_shape_type>(shapeType));
1397 return Field(cmzn_graphicspointattributes_get_label_field(
id));
1410 return cmzn_graphicspointattributes_set_label_field(
id, labelField.
getId());
1424 return cmzn_graphicspointattributes_get_label_offset(
id, valuesCount, valuesOut);
1439 return cmzn_graphicspointattributes_set_label_offset(
id, valuesCount, valuesIn);
1452 return cmzn_graphicspointattributes_get_label_text(
id, labelNumber);
1468 return cmzn_graphicspointattributes_set_label_text(
id, labelNumber, labelText);
1480 return Field(cmzn_graphicspointattributes_get_orientation_scale_field(
id));
1512 return cmzn_graphicspointattributes_set_orientation_scale_field(
id, orientationScaleField.
getId());
1529 return cmzn_graphicspointattributes_get_scale_factors(
id, valuesCount, valuesOut);
1553 return cmzn_graphicspointattributes_set_scale_factors(
id, valuesCount, valuesIn);
1564 return Field(cmzn_graphicspointattributes_get_signed_scale_field(
id));
1586 return cmzn_graphicspointattributes_set_signed_scale_field(
id, signedScaleField.
getId());
1606 cmzn_graphicssamplingattributes_id id;
1612 id(sampling_attributes_id)
1616 id(cmzn_graphicssamplingattributes_access(samplingAttributes.id))
1621 cmzn_graphicssamplingattributes_id temp_id = cmzn_graphicssamplingattributes_access(graphicssamplingattributes.id);
1623 cmzn_graphicssamplingattributes_destroy(&
id);
1630 cmzn_graphicssamplingattributes_destroy(&
id);
1651 return Field(cmzn_graphicssamplingattributes_get_density_field(
id));
1665 return cmzn_graphicssamplingattributes_set_density_field(
id, densityField.
getId());
1678 return cmzn_graphicssamplingattributes_get_location(
id, valuesCount, valuesOut);
1693 return cmzn_graphicssamplingattributes_set_location(
id, valuesCount, valuesIn);
1703 return cmzn_graphicssamplingattributes_set_element_point_sampling_mode(
id,
1704 static_cast<cmzn_element_point_sampling_mode>(samplingMode));
int setSignedScaleField(const Field &signedScaleField)
Definition: graphics.hpp:1584
int setListIsovalues(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:723
enum Scenecoordinatesystem getScenecoordinatesystem()
Definition: graphics.hpp:530
int setTextureCoordinateField(const Field &textureCoordinateField)
Definition: graphics.hpp:360
enum RenderPolygonMode getRenderPolygonMode()
Definition: graphics.hpp:262
Graphicspointattributes getGraphicspointattributes()
Definition: graphics.hpp:1591
int setShapeType(ShapeType shapeType)
Definition: graphics.hpp:1196
Attributes object specifying how lines are visualised.
Definition: graphics.hpp:1010
Lines visualise 1-D elements in the model.
Definition: graphics.hpp:796
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1527
int setRenderPolygonMode(RenderPolygonMode renderPolygonMode)
Definition: graphics.hpp:276
Definition: graphics.hpp:124
char * getLabelText(int labelNumber)
Definition: graphics.hpp:1450
cmzn_tessellation_id getId() const
Definition: tessellation.hpp:81
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1551
Field getOrientationScaleField()
Definition: graphics.hpp:1113
Surfaces visualise 2-D elements in the model.
Definition: graphics.hpp:964
Definition: graphics.hpp:112
int setVisibilityFlag(bool visibilityFlag)
Definition: graphics.hpp:520
int setTrackDirection(TrackDirection trackDirection)
Definition: graphics.hpp:927
int setMaterial(const Material &material)
Definition: graphics.hpp:381
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
int setName(const char *name)
Definition: graphics.hpp:578
int setGlyphOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1363
bool isValid() const
Definition: graphics.hpp:1250
Field getCoordinateField()
Definition: graphics.hpp:163
int getLocation(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1676
int setTessellation(const Tessellation &tessellation)
Definition: graphics.hpp:473
SelectMode
Definition: graphics.hpp:110
Scenecoordinatesystem
Definition: scenecoordinatesystem.hpp:26
int setLocation(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1691
bool isValid() const
Definition: graphics.hpp:1638
int getListIsovalues(int valuesCount, double *valuesOut)
Definition: graphics.hpp:710
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1510
int setSpectrum(const Spectrum &spectrum)
Definition: graphics.hpp:450
Material getSelectedMaterial()
Definition: graphics.hpp:418
Definition: graphics.hpp:97
Material getMaterial()
Definition: graphics.hpp:370
Container/manager for graphics visualising a region.
Definition: scene.hpp:34
Definition: graphics.hpp:1063
Definition: graphics.hpp:114
cmzn_material_id getId() const
Definition: material.hpp:83
RepeatMode
Definition: glyph.hpp:97
Definition: graphics.hpp:875
bool isValid() const
Definition: graphics.hpp:1045
int setRangeIsovalues(int numberOfValues, double firstIsovalue, double lastIsovalue)
Definition: graphics.hpp:779
Points graphics visualise discrete locations in the model.
Definition: graphics.hpp:823
double getRangeFirstIsovalue()
Definition: graphics.hpp:736
Field getDataField()
Definition: graphics.hpp:186
Definition: graphics.hpp:118
int setTrackLength(double length)
Definition: graphics.hpp:951
GraphicsContours castContours()
Definition: graphics.hpp:978
Definition: graphics.hpp:137
int setScenecoordinatesystem(Scenecoordinatesystem coordinateSystem)
Definition: graphics.hpp:542
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1145
char * getName()
Definition: graphics.hpp:564
Field getStreamVectorField()
Definition: graphics.hpp:887
Field getLabelField()
Definition: graphics.hpp:1395
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:1299
Spectrum getSpectrum()
Definition: graphics.hpp:439
A glyph is a static graphics object used to visualise a point in space.
Definition: glyph.hpp:35
Definition: graphics.hpp:141
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1289
int setSelectedMaterial(const Material &material)
Definition: graphics.hpp:429
cmzn_field_id getId() const
Definition: field.hpp:98
double getRangeLastIsovalue()
Definition: graphics.hpp:749
ShapeType getShapeType()
Definition: graphics.hpp:1180
Zinc materials specify colouring of graphics.
Definition: material.hpp:29
TrackDirection getTrackDirection()
Definition: graphics.hpp:912
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1266
int setTessellationField(const Field &tessellationField)
Definition: graphics.hpp:498
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1101
int getRangeNumberOfIsovalues()
Definition: graphics.hpp:762
int setDataField(const Field &dataField)
Definition: graphics.hpp:197
RenderPolygonMode
Definition: graphics.hpp:95
DomainType
Definition: field.hpp:190
int setLabelField(const Field &labelField)
Definition: graphics.hpp:1408
Definition: graphics.hpp:1059
int setSelectMode(SelectMode selectMode)
Definition: graphics.hpp:310
Field getSubgroupField()
Definition: graphics.hpp:320
GraphicsPoints castPoints()
Definition: graphics.hpp:988
bool isExterior()
Definition: graphics.hpp:598
ShapeType
Definition: graphics.hpp:1053
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
ShapeType
Definition: glyph.hpp:130
bool getVisibilityFlag()
Definition: graphics.hpp:508
Definition: graphics.hpp:143
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1128
Field getTessellationField()
Definition: graphics.hpp:483
Definition: graphics.hpp:101
Definition: graphics.hpp:1061
Graphicslineattributes getGraphicslineattributes()
Definition: graphics.hpp:1203
Attributes object specifying how points are visualised.
Definition: graphics.hpp:1215
The tessellation controls the number of polygons or line segments.
Definition: tessellation.hpp:28
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1078
int setFont(const Font &font)
Definition: graphics.hpp:1310
Definition: graphics.hpp:122
int setLabelText(int labelNumber, const char *labelText)
Definition: graphics.hpp:1466
cmzn_font_id getId() const
Definition: font.hpp:103
Graphicssamplingattributes getGraphicssamplingattributes()
Definition: graphics.hpp:1709
Glyph getGlyph()
Definition: graphics.hpp:1320
GraphicsLines castLines()
Definition: graphics.hpp:983
int setSubgroupField(const Field &subgroupField)
Definition: graphics.hpp:334
PointSamplingMode
Definition: element.hpp:329
GraphicsStreamlines castStreamlines()
Definition: graphics.hpp:993
Streamlines visualise the path of a fluid particle tracking along a vector field. ...
Definition: graphics.hpp:852
Definition: graphics.hpp:873
GraphicsSurfaces castSurfaces()
Definition: graphics.hpp:998
TrackDirection
Definition: graphics.hpp:871
int getLabelOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1422
int setRenderPointSize(double size)
Definition: graphics.hpp:251
int setExterior(bool exterior)
Definition: graphics.hpp:609
double getRenderPointSize()
Definition: graphics.hpp:235
int getGlyphOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1346
Definition: graphics.hpp:135
Definition: graphics.hpp:1057
Type
Definition: graphics.hpp:131
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1169
Field getOrientationScaleField()
Definition: graphics.hpp:1478
double getTrackLength()
Definition: graphics.hpp:938
enum SelectMode getSelectMode()
Definition: graphics.hpp:295
bool isValid() const
Definition: graphics.hpp:87
Field getDensityField()
Definition: graphics.hpp:1649
Field getTextureCoordinateField()
Definition: graphics.hpp:346
Field getSignedScaleField()
Definition: graphics.hpp:1562
Definition: graphics.hpp:139
cmzn_glyph_id getId() const
Definition: glyph.hpp:88
Definition: graphics.hpp:1055
Graphics attributes object specifying how points are sampled in elements.
Definition: graphics.hpp:1603
int setLabelOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1437
The contours derived graphics type.
Definition: graphics.hpp:663
int setCoordinateField(const Field &coordinateField)
Definition: graphics.hpp:176
Field getIsoscalarField()
Definition: graphics.hpp:681
FaceType
Definition: element.hpp:270
int setIsoscalarField(const Field &field)
Definition: graphics.hpp:693
Definition: graphics.hpp:877
Font object controlling attributes of rendering text.
Definition: font.hpp:26
Scene getScene()
Definition: scene.hpp:517
Tessellation getTessellation()
Definition: graphics.hpp:461
cmzn_graphics_id getId() const
Definition: graphics.hpp:153
Definition: graphics.hpp:133
int setGlyph(const Glyph &glyph)
Definition: graphics.hpp:1331
int setDensityField(const Field &densityField)
Definition: graphics.hpp:1663
double getRenderLineWidth()
Definition: graphics.hpp:208
int setStreamVectorField(const Field &field)
Definition: graphics.hpp:901