OpenCMISS-Zinc C++ API Documentation
graphics.hpp
Go to the documentation of this file.
1 
4 /* OpenCMISS-Zinc Library
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #ifndef CMZN_GRAPHICS_HPP__
10 #define CMZN_GRAPHICS_HPP__
11 
12 #include "opencmiss/zinc/types/scenecoordinatesystem.hpp"
13 #include "opencmiss/zinc/graphics.h"
14 #include "opencmiss/zinc/element.hpp"
15 #include "opencmiss/zinc/field.hpp"
16 #include "opencmiss/zinc/glyph.hpp"
17 #include "opencmiss/zinc/font.hpp"
18 #include "opencmiss/zinc/material.hpp"
19 #include "opencmiss/zinc/spectrum.hpp"
20 #include "opencmiss/zinc/tessellation.hpp"
21 
22 namespace OpenCMISS
23 {
24 namespace Zinc
25 {
26 
27 class GraphicsContours;
28 class GraphicsLines;
29 class GraphicsPoints;
30 class GraphicsStreamlines;
31 class GraphicsSurfaces;
32 class Graphicslineattributes;
33 class Graphicspointattributes;
34 class Graphicssamplingattributes;
35 class Scene;
36 
45 class Graphics
46 {
47 
48 protected:
49  cmzn_graphics_id id;
50 
51 public:
52 
53  Graphics() : id(0)
54  { }
55 
56  // takes ownership of C handle, responsibility for destroying it
57  explicit Graphics(cmzn_graphics_id graphics_id) : id(graphics_id)
58  { }
59 
60  Graphics(const Graphics& graphics) : id(cmzn_graphics_access(graphics.id))
61  { }
62 
63  Graphics& operator=(const Graphics& graphics)
64  {
65  cmzn_graphics_id temp_id = cmzn_graphics_access(graphics.id);
66  if (0 != id)
67  {
68  cmzn_graphics_destroy(&id);
69  }
70  id = temp_id;
71  return *this;
72  }
73 
74  ~Graphics()
75  {
76  if (0 != id)
77  {
78  cmzn_graphics_destroy(&id);
79  }
80  }
81 
87  bool isValid() const
88  {
89  return (0 != id);
90  }
91 
96  {
97  RENDER_POLYGON_MODE_INVALID = CMZN_GRAPHICS_RENDER_POLYGON_MODE_INVALID,
99  RENDER_POLYGON_MODE_SHADED = CMZN_GRAPHICS_RENDER_POLYGON_MODE_SHADED,
101  RENDER_POLYGON_MODE_WIREFRAME = CMZN_GRAPHICS_RENDER_POLYGON_MODE_WIREFRAME
103  };
104 
111  {
112  SELECT_MODE_INVALID = CMZN_GRAPHICS_SELECT_MODE_INVALID,
114  SELECT_MODE_ON = CMZN_GRAPHICS_SELECT_MODE_ON,
118  SELECT_MODE_OFF = CMZN_GRAPHICS_SELECT_MODE_OFF,
122  SELECT_MODE_DRAW_SELECTED = CMZN_GRAPHICS_SELECT_MODE_DRAW_SELECTED,
124  SELECT_MODE_DRAW_UNSELECTED = CMZN_GRAPHICS_SELECT_MODE_DRAW_UNSELECTED
126  };
127 
131  enum Type
132  {
133  TYPE_INVALID = CMZN_GRAPHICS_TYPE_INVALID,
135  TYPE_POINTS = CMZN_GRAPHICS_TYPE_POINTS,
137  TYPE_LINES = CMZN_GRAPHICS_TYPE_LINES,
139  TYPE_SURFACES = CMZN_GRAPHICS_TYPE_SURFACES,
141  TYPE_CONTOURS = CMZN_GRAPHICS_TYPE_CONTOURS,
143  TYPE_STREAMLINES = CMZN_GRAPHICS_TYPE_STREAMLINES
146  };
147 
153  cmzn_graphics_id getId() const
154  {
155  return id;
156  }
157 
164  {
165  return Field(cmzn_graphics_get_coordinate_field(id));
166  }
167 
176  int setCoordinateField(const Field& coordinateField)
177  {
178  return cmzn_graphics_set_coordinate_field(id, coordinateField.getId());
179  }
180 
187  {
188  return Field(cmzn_graphics_get_data_field(id));
189  }
190 
197  int setDataField(const Field& dataField)
198  {
199  return cmzn_graphics_set_data_field(id, dataField.getId());
200  }
201 
209  {
210  return cmzn_graphics_get_render_line_width(id);
211  }
212 
224  int setRenderLineWidth(double width)
225  {
226  return cmzn_graphics_set_render_line_width(id, width);
227  }
228 
236  {
237  return cmzn_graphics_get_render_point_size(id);
238  }
239 
251  int setRenderPointSize(double size)
252  {
253  return cmzn_graphics_set_render_point_size(id, size);
254  }
255 
263  {
264  return static_cast<RenderPolygonMode>(cmzn_graphics_get_render_polygon_mode(id));
265  }
266 
276  {
277  return cmzn_graphics_set_render_polygon_mode(id,
278  static_cast<cmzn_graphics_render_polygon_mode>(renderPolygonMode));
279  }
280 
286  inline Scene getScene();
287 
295  {
296  return static_cast<SelectMode>(cmzn_graphics_get_select_mode(id));
297  }
298 
309  int setSelectMode(SelectMode selectMode)
310  {
311  return cmzn_graphics_set_select_mode(id, static_cast<cmzn_graphics_select_mode>(selectMode));
312  }
313 
320  {
321  return Field(cmzn_graphics_get_subgroup_field(id));
322  }
323 
333  int setSubgroupField(const Field& subgroupField)
334  {
335  return cmzn_graphics_set_subgroup_field(id, subgroupField.getId());
336  }
337 
346  {
347  return Field(cmzn_graphics_get_texture_coordinate_field(id));
348  }
349 
359  int setTextureCoordinateField(const Field& textureCoordinateField)
360  {
361  return cmzn_graphics_set_texture_coordinate_field(id, textureCoordinateField.getId());
362  }
363 
370  {
371  return Material(cmzn_graphics_get_material(id));
372  }
373 
380  int setMaterial(const Material& material)
381  {
382  return cmzn_graphics_set_material(id, material.getId());
383  }
384 
393 
402 
411 
418  {
419  return Material(cmzn_graphics_get_selected_material(id));
420  }
421 
428  int setSelectedMaterial(const Material& material)
429  {
430  return cmzn_graphics_set_selected_material(id, material.getId());
431  }
432 
439  {
440  return Spectrum(cmzn_graphics_get_spectrum(id));
441  }
442 
449  int setSpectrum(const Spectrum& spectrum)
450  {
451  return cmzn_graphics_set_spectrum(id, spectrum.getId());
452  }
453 
459  enum Type getType()
460  {
461  return static_cast<Type>(cmzn_graphics_get_type(id));
462  }
463 
471  {
472  return Tessellation(cmzn_graphics_get_tessellation(id));
473  }
474 
482  int setTessellation(const Tessellation& tessellation)
483  {
484  return cmzn_graphics_set_tessellation(id, tessellation.getId());
485  }
486 
493  {
494  return Field(cmzn_graphics_get_tessellation_field(id));
495  }
496 
507  int setTessellationField(const Field& tessellationField)
508  {
509  return cmzn_graphics_set_tessellation_field(id, tessellationField.getId());
510  }
511 
518  {
519  return cmzn_graphics_get_visibility_flag(id);
520  }
521 
529  int setVisibilityFlag(bool visibilityFlag)
530  {
531  return cmzn_graphics_set_visibility_flag(id, visibilityFlag);
532  }
533 
540  {
541  return static_cast<Scenecoordinatesystem>(cmzn_graphics_get_scenecoordinatesystem(id));
542  }
543 
552  {
553  return cmzn_graphics_set_scenecoordinatesystem(id,
554  static_cast<cmzn_scenecoordinatesystem>(coordinateSystem));
555  }
556 
564  {
565  return static_cast<Field::DomainType>(cmzn_graphics_get_field_domain_type(id));
566  }
567 
578  {
579  return cmzn_graphics_set_field_domain_type(id, static_cast<cmzn_field_domain_type>(domainType));
580  }
581 
588  char *getName()
589  {
590  return cmzn_graphics_get_name(id);
591  }
592 
602  int setName(const char *name)
603  {
604  return cmzn_graphics_set_name(id, name);
605  }
606 
618  {
619  return cmzn_graphics_set_element_face_type(id, static_cast<cmzn_element_face_type>(faceType));
620  }
621 
629  {
630  return static_cast<Element::FaceType>(cmzn_graphics_get_element_face_type(id));
631  }
632 
638  bool isExterior()
639  {
640  return cmzn_graphics_is_exterior(id);
641  }
642 
649  int setExterior(bool exterior)
650  {
651  return cmzn_graphics_set_exterior(id, exterior);
652  }
653 
669  inline GraphicsLines castLines();
677  inline GraphicsPoints castPoints();
694 };
695 
696 inline bool operator==(const Graphics& a, const Graphics& b)
697 {
698  return a.getId() == b.getId();
699 }
700 
709 {
710 friend class Scene;
711 private:
712  explicit GraphicsContours(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
713 
719  inline cmzn_graphics_contours_id getDerivedId()
720  {
721  return reinterpret_cast<cmzn_graphics_contours_id>(this->id);
722  }
723 
724 public:
725  GraphicsContours() : Graphics(0) {}
726 
727  explicit GraphicsContours(cmzn_graphics_contours_id contours_id)
728  : Graphics(reinterpret_cast<cmzn_graphics_id>(contours_id))
729  {}
730 
737  {
738  return Field(cmzn_graphics_contours_get_isoscalar_field(this->getDerivedId()));
739  }
740 
748  int setIsoscalarField(const Field& field)
749  {
750  return cmzn_graphics_contours_set_isoscalar_field(this->getDerivedId(), field.getId());
751  }
752 
765  int getListIsovalues(int valuesCount, double *valuesOut)
766  {
767  return cmzn_graphics_contours_get_list_isovalues(this->getDerivedId(),
768  valuesCount, valuesOut);
769  }
770 
778  int setListIsovalues(int valuesCount, const double *valuesIn)
779  {
780  return cmzn_graphics_contours_set_list_isovalues(this->getDerivedId(),
781  valuesCount, valuesIn);
782  }
783 
792  {
793  return cmzn_graphics_contours_get_range_first_isovalue(this->getDerivedId());
794  }
795 
804  {
805  return cmzn_graphics_contours_get_range_last_isovalue(this->getDerivedId());
806  }
807 
816  {
817  return cmzn_graphics_contours_get_range_number_of_isovalues(this->getDerivedId());
818  }
819 
831  int setRangeIsovalues(int numberOfValues, double firstIsovalue, double lastIsovalue)
832  {
833  return cmzn_graphics_contours_set_range_isovalues(this->getDerivedId(),
834  numberOfValues, firstIsovalue, lastIsovalue);
835  }
836 
837 };
838 
848 class GraphicsLines : public Graphics
849 {
850 friend class Scene;
851 private:
852  explicit GraphicsLines(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
853 
854 public:
855  GraphicsLines() : Graphics(0) {}
856 
857  explicit GraphicsLines(cmzn_graphics_lines_id lines_id)
858  : Graphics(reinterpret_cast<cmzn_graphics_id>(lines_id))
859  {}
860 };
861 
875 class GraphicsPoints : public Graphics
876 {
877 friend class Scene;
878 private:
879  explicit GraphicsPoints(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
880 
881 public:
882  GraphicsPoints() : Graphics(0) {}
883 
884  explicit GraphicsPoints(cmzn_graphics_points_id points_id)
885  : Graphics(reinterpret_cast<cmzn_graphics_id>(points_id))
886  {}
887 };
888 
905 {
906 friend class Scene;
907 private:
908  explicit GraphicsStreamlines(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
909 
915  inline cmzn_graphics_streamlines_id getDerivedId()
916  {
917  return reinterpret_cast<cmzn_graphics_streamlines_id>(this->id);
918  }
919 
920 public:
921  GraphicsStreamlines() : Graphics(0) {}
922 
923  explicit GraphicsStreamlines(cmzn_graphics_streamlines_id streamlines_id)
924  : Graphics(reinterpret_cast<cmzn_graphics_id>(streamlines_id))
925  {}
926 
931  {
932  COLOUR_DATA_TYPE_INVALID = CMZN_GRAPHICS_STREAMLINES_COLOUR_DATA_TYPE_INVALID,
934  COLOUR_DATA_TYPE_FIELD = CMZN_GRAPHICS_STREAMLINES_COLOUR_DATA_TYPE_FIELD,
936  COLOUR_DATA_TYPE_MAGNITUDE = CMZN_GRAPHICS_STREAMLINES_COLOUR_DATA_TYPE_MAGNITUDE,
939  COLOUR_DATA_TYPE_TRAVEL_TIME = CMZN_GRAPHICS_STREAMLINES_COLOUR_DATA_TYPE_TRAVEL_TIME
942  };
943 
951  {
952  TRACK_DIRECTION_INVALID = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_INVALID,
954  TRACK_DIRECTION_FORWARD = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_FORWARD,
956  TRACK_DIRECTION_REVERSE = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_REVERSE
958  };
959 
966  {
967  return static_cast<ColourDataType>(cmzn_graphics_streamlines_get_colour_data_type(this->getDerivedId()));
968  }
969 
980  {
981  return cmzn_graphics_streamlines_set_colour_data_type(this->getDerivedId(),
982  static_cast<cmzn_graphics_streamlines_colour_data_type>(dataType));
983  }
984 
992  {
993  return Field(cmzn_graphics_streamlines_get_stream_vector_field(this->getDerivedId()));
994  }
995 
1005  int setStreamVectorField(const Field& field)
1006  {
1007  return cmzn_graphics_streamlines_set_stream_vector_field(this->getDerivedId(), field.getId());
1008  }
1009 
1017  {
1018  return static_cast<TrackDirection>(
1019  cmzn_graphics_streamlines_get_track_direction(this->getDerivedId()));
1020  }
1021 
1030  int setTrackDirection(TrackDirection trackDirection)
1031  {
1032  return cmzn_graphics_streamlines_set_track_direction(this->getDerivedId(),
1033  static_cast<cmzn_graphics_streamlines_track_direction>(trackDirection));
1034  }
1035 
1042  {
1043  return cmzn_graphics_streamlines_get_track_length(this->getDerivedId());
1044  }
1045 
1054  int setTrackLength(double length)
1055  {
1056  return cmzn_graphics_streamlines_set_track_length(this->getDerivedId(), length);
1057  }
1058 
1059 };
1060 
1068 {
1069 friend class Scene;
1070 private:
1071  explicit GraphicsSurfaces(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
1072 
1073 public:
1074  GraphicsSurfaces() : Graphics(0) {}
1075 
1076  explicit GraphicsSurfaces(cmzn_graphics_surfaces_id surfaces_id)
1077  : Graphics(reinterpret_cast<cmzn_graphics_id>(surfaces_id))
1078  {}
1079 };
1080 
1082 {
1083  return GraphicsContours(cmzn_graphics_cast_contours(id));
1084 }
1085 
1087 {
1088  return GraphicsLines(cmzn_graphics_cast_lines(id));
1089 }
1090 
1092 {
1093  return GraphicsPoints(cmzn_graphics_cast_points(id));
1094 }
1095 
1097 {
1098  return GraphicsStreamlines(cmzn_graphics_cast_streamlines(id));
1099 }
1100 
1102 {
1103  return GraphicsSurfaces(cmzn_graphics_cast_surfaces(id));
1104 }
1105 
1114 {
1115 protected:
1116  cmzn_graphicslineattributes_id id;
1117 
1118 public:
1119  Graphicslineattributes() : id(0)
1120  {}
1121 
1122  // takes ownership of C handle, responsibility for destroying it
1123  explicit Graphicslineattributes(cmzn_graphicslineattributes_id line_attributes_id) :
1124  id(line_attributes_id)
1125  {}
1126 
1127  Graphicslineattributes(const Graphicslineattributes& lineAttributes) :
1128  id(cmzn_graphicslineattributes_access(lineAttributes.id))
1129  {}
1130 
1131  Graphicslineattributes& operator=(const Graphicslineattributes& graphicslineattributes)
1132  {
1133  cmzn_graphicslineattributes_id temp_id = cmzn_graphicslineattributes_access(graphicslineattributes.id);
1134  if (0 != id)
1135  cmzn_graphicslineattributes_destroy(&id);
1136  id = temp_id;
1137  return *this;
1138  }
1139 
1141  {
1142  cmzn_graphicslineattributes_destroy(&id);
1143  }
1144 
1150  bool isValid() const
1151  {
1152  return (0 != id);
1153  }
1154 
1159  {
1160  SHAPE_TYPE_INVALID = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_INVALID,
1162  SHAPE_TYPE_LINE = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_LINE,
1164  SHAPE_TYPE_RIBBON = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_RIBBON,
1166  SHAPE_TYPE_CIRCLE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_CIRCLE_EXTRUSION,
1168  SHAPE_TYPE_SQUARE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_SQUARE_EXTRUSION
1170  };
1171 
1183  int getBaseSize(int valuesCount, double *valuesOut)
1184  {
1185  return cmzn_graphicslineattributes_get_base_size(id, valuesCount, valuesOut);
1186  }
1187 
1206  int setBaseSize(int valuesCount, const double *valuesIn)
1207  {
1208  return cmzn_graphicslineattributes_set_base_size(id, valuesCount, valuesIn);
1209  }
1210 
1219  {
1220  return Field(cmzn_graphicslineattributes_get_orientation_scale_field(id));
1221  }
1222 
1233  int setOrientationScaleField(const Field& orientationScaleField)
1234  {
1235  return cmzn_graphicslineattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1236  }
1237 
1250  int getScaleFactors(int valuesCount, double *valuesOut)
1251  {
1252  return cmzn_graphicslineattributes_get_scale_factors(id, valuesCount, valuesOut);
1253  }
1254 
1274  int setScaleFactors(int valuesCount, const double *valuesIn)
1275  {
1276  return cmzn_graphicslineattributes_set_scale_factors(id, valuesCount, valuesIn);
1277  }
1278 
1286  {
1287  return static_cast<ShapeType>(cmzn_graphicslineattributes_get_shape_type(id));
1288  }
1289 
1300  int setShapeType(ShapeType shapeType)
1301  {
1302  return cmzn_graphicslineattributes_set_shape_type(id, static_cast<cmzn_graphicslineattributes_shape_type>(shapeType));
1303  }
1304 
1305 };
1306 
1308 {
1309  return Graphicslineattributes(cmzn_graphics_get_graphicslineattributes(id));
1310 }
1311 
1320 {
1321 protected:
1322  cmzn_graphicspointattributes_id id;
1323 
1324 public:
1325  Graphicspointattributes() : id(0)
1326  {}
1327 
1328  // takes ownership of C handle, responsibility for destroying it
1329  explicit Graphicspointattributes(cmzn_graphicspointattributes_id point_attributes_id) :
1330  id(point_attributes_id)
1331  {}
1332 
1333  Graphicspointattributes(const Graphicspointattributes& pointAttributes) :
1334  id(cmzn_graphicspointattributes_access(pointAttributes.id))
1335  {}
1336 
1337  Graphicspointattributes& operator=(const Graphicspointattributes& graphicspointattributes)
1338  {
1339  cmzn_graphicspointattributes_id temp_id = cmzn_graphicspointattributes_access(graphicspointattributes.id);
1340  if (0 != id)
1341  cmzn_graphicspointattributes_destroy(&id);
1342  id = temp_id;
1343  return *this;
1344  }
1345 
1347  {
1348  cmzn_graphicspointattributes_destroy(&id);
1349  }
1350 
1356  bool isValid() const
1357  {
1358  return (0 != id);
1359  }
1360 
1372  int getBaseSize(int valuesCount, double *valuesOut)
1373  {
1374  return cmzn_graphicspointattributes_get_base_size(id, valuesCount, valuesOut);
1375  }
1376 
1395  int setBaseSize(int valuesCount, const double *valuesIn)
1396  {
1397  return cmzn_graphicspointattributes_set_base_size(id, valuesCount, valuesIn);
1398  }
1399 
1406  {
1407  return Font(cmzn_graphicspointattributes_get_font(id));
1408  }
1409 
1416  int setFont(const Font& font)
1417  {
1418  return cmzn_graphicspointattributes_set_font(id, font.getId());
1419  }
1420 
1427  {
1428  return Glyph(cmzn_graphicspointattributes_get_glyph(id));
1429  }
1430 
1437  int setGlyph(const Glyph& glyph)
1438  {
1439  return cmzn_graphicspointattributes_set_glyph(id, glyph.getId());
1440  }
1441 
1452  int getGlyphOffset(int valuesCount, double *valuesOut)
1453  {
1454  return cmzn_graphicspointattributes_get_glyph_offset(id, valuesCount, valuesOut);
1455  }
1456 
1469  int setGlyphOffset(int valuesCount, const double *valuesIn)
1470  {
1471  return cmzn_graphicspointattributes_set_glyph_offset(id, valuesCount, valuesIn);
1472  }
1473 
1481  {
1482  return static_cast<Glyph::RepeatMode>(cmzn_graphicspointattributes_get_glyph_repeat_mode(id));
1483  }
1484 
1494  {
1495  return cmzn_graphicspointattributes_set_glyph_repeat_mode(id,
1496  static_cast<enum cmzn_glyph_repeat_mode>(glyphRepeatMode));
1497  }
1498 
1507  {
1508  return static_cast<Glyph::ShapeType>(cmzn_graphicspointattributes_get_glyph_shape_type(id));
1509  }
1510 
1521  {
1522  return cmzn_graphicspointattributes_set_glyph_shape_type(id,
1523  static_cast<cmzn_glyph_shape_type>(shapeType));
1524  }
1525 
1532  {
1533  return Field(cmzn_graphicspointattributes_get_label_field(id));
1534  }
1535 
1544  int setLabelField(const Field& labelField)
1545  {
1546  return cmzn_graphicspointattributes_set_label_field(id, labelField.getId());
1547  }
1548 
1558  int getLabelOffset(int valuesCount, double *valuesOut)
1559  {
1560  return cmzn_graphicspointattributes_get_label_offset(id, valuesCount, valuesOut);
1561  }
1562 
1573  int setLabelOffset(int valuesCount, const double *valuesIn)
1574  {
1575  return cmzn_graphicspointattributes_set_label_offset(id, valuesCount, valuesIn);
1576  }
1577 
1586  char *getLabelText(int labelNumber)
1587  {
1588  return cmzn_graphicspointattributes_get_label_text(id, labelNumber);
1589  }
1590 
1602  int setLabelText(int labelNumber, const char *labelText)
1603  {
1604  return cmzn_graphicspointattributes_set_label_text(id, labelNumber, labelText);
1605  }
1606 
1615  {
1616  return Field(cmzn_graphicspointattributes_get_orientation_scale_field(id));
1617  }
1618 
1646  int setOrientationScaleField(const Field& orientationScaleField)
1647  {
1648  return cmzn_graphicspointattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1649  }
1650 
1663  int getScaleFactors(int valuesCount, double *valuesOut)
1664  {
1665  return cmzn_graphicspointattributes_get_scale_factors(id, valuesCount, valuesOut);
1666  }
1667 
1687  int setScaleFactors(int valuesCount, const double *valuesIn)
1688  {
1689  return cmzn_graphicspointattributes_set_scale_factors(id, valuesCount, valuesIn);
1690  }
1691 
1699  {
1700  return Field(cmzn_graphicspointattributes_get_signed_scale_field(id));
1701  }
1702 
1720  int setSignedScaleField(const Field& signedScaleField)
1721  {
1722  return cmzn_graphicspointattributes_set_signed_scale_field(id, signedScaleField.getId());
1723  }
1724 
1725 };
1726 
1728 {
1729  return Graphicspointattributes(cmzn_graphics_get_graphicspointattributes(id));
1730 }
1731 
1740 {
1741 protected:
1742  cmzn_graphicssamplingattributes_id id;
1743 
1744 public:
1745  Graphicssamplingattributes() : id(0)
1746  {}
1747 
1748  // takes ownership of C handle, responsibility for destroying it
1749  explicit Graphicssamplingattributes(cmzn_graphicssamplingattributes_id sampling_attributes_id) :
1750  id(sampling_attributes_id)
1751  {}
1752 
1753  Graphicssamplingattributes(const Graphicssamplingattributes& samplingAttributes) :
1754  id(cmzn_graphicssamplingattributes_access(samplingAttributes.id))
1755  {}
1756 
1757  Graphicssamplingattributes& operator=(const Graphicssamplingattributes& graphicssamplingattributes)
1758  {
1759  cmzn_graphicssamplingattributes_id temp_id = cmzn_graphicssamplingattributes_access(graphicssamplingattributes.id);
1760  if (0 != id)
1761  cmzn_graphicssamplingattributes_destroy(&id);
1762  id = temp_id;
1763  return *this;
1764  }
1765 
1767  {
1768  cmzn_graphicssamplingattributes_destroy(&id);
1769  }
1770 
1776  bool isValid() const
1777  {
1778  return (0 != id);
1779  }
1780 
1788  {
1789  return Field(cmzn_graphicssamplingattributes_get_density_field(id));
1790  }
1791 
1801  int setDensityField(const Field& densityField)
1802  {
1803  return cmzn_graphicssamplingattributes_set_density_field(id, densityField.getId());
1804  }
1805 
1814  int getLocation(int valuesCount, double *valuesOut)
1815  {
1816  return cmzn_graphicssamplingattributes_get_location(id, valuesCount, valuesOut);
1817  }
1818 
1829  int setLocation(int valuesCount, const double *valuesIn)
1830  {
1831  return cmzn_graphicssamplingattributes_set_location(id, valuesCount, valuesIn);
1832  }
1833 
1840  {
1841  return static_cast<Element::PointSamplingMode>(cmzn_graphicssamplingattributes_get_element_point_sampling_mode(id));
1842  }
1843 
1852  {
1853  return cmzn_graphicssamplingattributes_set_element_point_sampling_mode(id,
1854  static_cast<cmzn_element_point_sampling_mode>(samplingMode));
1855  }
1856 
1857 };
1858 
1860 {
1861  return Glyph(cmzn_glyphmodule_create_static_glyph_from_graphics(id, graphics.getId()));
1862 }
1863 
1865 {
1866  return Graphicssamplingattributes(cmzn_graphics_get_graphicssamplingattributes(id));
1867 }
1868 
1869 } // namespace Zinc
1870 }
1871 
1872 #endif
int setSignedScaleField(const Field &signedScaleField)
Definition: graphics.hpp:1720
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:1506
Graphicspointattributes getGraphicspointattributes()
Definition: graphics.hpp:1727
int setShapeType(ShapeType shapeType)
Definition: graphics.hpp:1300
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:1851
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1663
int setRenderPolygonMode(RenderPolygonMode renderPolygonMode)
Definition: graphics.hpp:275
char * getLabelText(int labelNumber)
Definition: graphics.hpp:1586
cmzn_tessellation_id getId() const
Definition: tessellation.hpp:112
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1687
Field getOrientationScaleField()
Definition: graphics.hpp:1218
Surfaces visualise 2-D elements in the model.
Definition: graphics.hpp:1067
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:51
int setName(const char *name)
Definition: graphics.hpp:602
int setGlyphOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1469
bool isValid() const
Definition: graphics.hpp:1356
Field getCoordinateField()
Definition: graphics.hpp:163
int getLocation(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1814
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:1829
bool isValid() const
Definition: graphics.hpp:1776
int getListIsovalues(int valuesCount, double *valuesOut)
Definition: graphics.hpp:765
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1646
int setSpectrum(const Spectrum &spectrum)
Definition: graphics.hpp:449
Material getSelectedMaterial()
Definition: graphics.hpp:417
Glyph createStaticGlyphFromGraphics(const Graphics &graphics)
Definition: graphics.hpp:1859
Material getMaterial()
Definition: graphics.hpp:369
Container/manager for graphics visualising a region.
Definition: scene.hpp:38
Definition: graphics.hpp:114
cmzn_material_id getId() const
Definition: material.hpp:83
RepeatMode
Definition: glyph.hpp:127
bool isValid() const
Definition: graphics.hpp:1150
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:1480
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:1250
char * getName()
Definition: graphics.hpp:588
Field getStreamVectorField()
Definition: graphics.hpp:991
Field getLabelField()
Definition: graphics.hpp:1531
Base graphics type: produces 3-D graphics visualising domains and fields.
Definition: graphics.hpp:45
cmzn_spectrum_id getId() const
Definition: spectrum.hpp:741
Font getFont()
Definition: graphics.hpp:1405
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:37
Definition: graphics.hpp:141
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1395
int setSelectedMaterial(const Material &material)
Definition: graphics.hpp:428
cmzn_field_id getId() const
Definition: field.hpp:103
double getRangeLastIsovalue()
Definition: graphics.hpp:803
ShapeType getShapeType()
Definition: graphics.hpp:1285
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:1372
int setTessellationField(const Field &tessellationField)
Definition: graphics.hpp:507
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1206
int getRangeNumberOfIsovalues()
Definition: graphics.hpp:815
int setDataField(const Field &dataField)
Definition: graphics.hpp:197
RenderPolygonMode
Definition: graphics.hpp:95
DomainType
Definition: field.hpp:210
int setLabelField(const Field &labelField)
Definition: graphics.hpp:1544
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:1839
int setGlyphShapeType(Glyph::ShapeType shapeType)
Definition: graphics.hpp:1520
bool isExterior()
Definition: graphics.hpp:638
ShapeType
Definition: graphics.hpp:1158
Zinc Spectrum maps values of graphics data fields to colours.
Definition: spectrum.hpp:656
int setRenderLineWidth(double width)
Definition: graphics.hpp:224
ColourDataType getColourDataType()
Definition: graphics.hpp:965
ShapeType
Definition: glyph.hpp:160
bool getVisibilityFlag()
Definition: graphics.hpp:517
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1233
Field getTessellationField()
Definition: graphics.hpp:492
Field::DomainType getFieldDomainType()
Definition: graphics.hpp:563
Graphicslineattributes getGraphicslineattributes()
Definition: graphics.hpp:1307
Attributes object specifying how points are visualised.
Definition: graphics.hpp:1319
The tessellation controls the number of polygons or line segments.
Definition: tessellation.hpp:30
int setFieldDomainType(Field::DomainType domainType)
Definition: graphics.hpp:577
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1183
int setFont(const Font &font)
Definition: graphics.hpp:1416
int setLabelText(int labelNumber, const char *labelText)
Definition: graphics.hpp:1602
ColourDataType
Definition: graphics.hpp:930
cmzn_font_id getId() const
Definition: font.hpp:103
Graphicssamplingattributes getGraphicssamplingattributes()
Definition: graphics.hpp:1864
Glyph getGlyph()
Definition: graphics.hpp:1426
GraphicsLines castLines()
Definition: graphics.hpp:1086
int setSubgroupField(const Field &subgroupField)
Definition: graphics.hpp:333
PointSamplingMode
Definition: element.hpp:162
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
GraphicsSurfaces castSurfaces()
Definition: graphics.hpp:1101
TrackDirection
Definition: graphics.hpp:950
int setGlyphRepeatMode(Glyph::RepeatMode glyphRepeatMode)
Definition: graphics.hpp:1493
int getLabelOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1558
int setRenderPointSize(double size)
Definition: graphics.hpp:251
int setExterior(bool exterior)
Definition: graphics.hpp:649
double getRenderPointSize()
Definition: graphics.hpp:235
int getGlyphOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1452
Definition: graphics.hpp:135
Type
Definition: graphics.hpp:131
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1274
Field getOrientationScaleField()
Definition: graphics.hpp:1614
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:1787
The OpenCMISS namespace.
Definition: context.hpp:20
Field getTextureCoordinateField()
Definition: graphics.hpp:345
Field getSignedScaleField()
Definition: graphics.hpp:1698
Definition: graphics.hpp:139
cmzn_glyph_id getId() const
Definition: glyph.hpp:90
Graphics attributes object specifying how points are sampled in elements.
Definition: graphics.hpp:1739
int setLabelOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1573
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:110
int setIsoscalarField(const Field &field)
Definition: graphics.hpp:748
Font object controlling attributes of rendering text.
Definition: font.hpp:26
Scene getScene()
Definition: scene.hpp:742
Tessellation getTessellation()
Definition: graphics.hpp:470
cmzn_graphics_id getId() const
Definition: graphics.hpp:153
Definition: graphics.hpp:133
int setGlyph(const Glyph &glyph)
Definition: graphics.hpp:1437
int setDensityField(const Field &densityField)
Definition: graphics.hpp:1801
double getRenderLineWidth()
Definition: graphics.hpp:208
int setStreamVectorField(const Field &field)
Definition: graphics.hpp:1005