OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
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 "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"
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 
1120  // takes ownership of C handle, responsibility for destroying it
1121  explicit Graphicslineattributes(cmzn_graphicslineattributes_id line_attributes_id) :
1122  id(line_attributes_id)
1123  {}
1124 
1125  Graphicslineattributes(const Graphicslineattributes& lineAttributes) :
1126  id(cmzn_graphicslineattributes_access(lineAttributes.id))
1127  {}
1128 
1129  Graphicslineattributes& operator=(const Graphicslineattributes& graphicslineattributes)
1130  {
1131  cmzn_graphicslineattributes_id temp_id = cmzn_graphicslineattributes_access(graphicslineattributes.id);
1132  if (0 != id)
1133  cmzn_graphicslineattributes_destroy(&id);
1134  id = temp_id;
1135  return *this;
1136  }
1137 
1139  {
1140  cmzn_graphicslineattributes_destroy(&id);
1141  }
1142 
1148  bool isValid() const
1149  {
1150  return (0 != id);
1151  }
1152 
1157  {
1158  SHAPE_TYPE_INVALID = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_INVALID,
1160  SHAPE_TYPE_LINE = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_LINE,
1162  SHAPE_TYPE_RIBBON = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_RIBBON,
1164  SHAPE_TYPE_CIRCLE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_CIRCLE_EXTRUSION,
1166  SHAPE_TYPE_SQUARE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_SQUARE_EXTRUSION
1168  };
1169 
1181  int getBaseSize(int valuesCount, double *valuesOut)
1182  {
1183  return cmzn_graphicslineattributes_get_base_size(id, valuesCount, valuesOut);
1184  }
1185 
1204  int setBaseSize(int valuesCount, const double *valuesIn)
1205  {
1206  return cmzn_graphicslineattributes_set_base_size(id, valuesCount, valuesIn);
1207  }
1208 
1217  {
1218  return Field(cmzn_graphicslineattributes_get_orientation_scale_field(id));
1219  }
1220 
1231  int setOrientationScaleField(const Field& orientationScaleField)
1232  {
1233  return cmzn_graphicslineattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1234  }
1235 
1248  int getScaleFactors(int valuesCount, double *valuesOut)
1249  {
1250  return cmzn_graphicslineattributes_get_scale_factors(id, valuesCount, valuesOut);
1251  }
1252 
1272  int setScaleFactors(int valuesCount, const double *valuesIn)
1273  {
1274  return cmzn_graphicslineattributes_set_scale_factors(id, valuesCount, valuesIn);
1275  }
1276 
1284  {
1285  return static_cast<ShapeType>(cmzn_graphicslineattributes_get_shape_type(id));
1286  }
1287 
1298  int setShapeType(ShapeType shapeType)
1299  {
1300  return cmzn_graphicslineattributes_set_shape_type(id, static_cast<cmzn_graphicslineattributes_shape_type>(shapeType));
1301  }
1302 
1303 };
1304 
1306 {
1307  return Graphicslineattributes(cmzn_graphics_get_graphicslineattributes(id));
1308 }
1309 
1318 {
1319 protected:
1320  cmzn_graphicspointattributes_id id;
1321 
1322 public:
1323 
1324  // takes ownership of C handle, responsibility for destroying it
1325  explicit Graphicspointattributes(cmzn_graphicspointattributes_id point_attributes_id) :
1326  id(point_attributes_id)
1327  {}
1328 
1329  Graphicspointattributes(const Graphicspointattributes& pointAttributes) :
1330  id(cmzn_graphicspointattributes_access(pointAttributes.id))
1331  {}
1332 
1333  Graphicspointattributes& operator=(const Graphicspointattributes& graphicspointattributes)
1334  {
1335  cmzn_graphicspointattributes_id temp_id = cmzn_graphicspointattributes_access(graphicspointattributes.id);
1336  if (0 != id)
1337  cmzn_graphicspointattributes_destroy(&id);
1338  id = temp_id;
1339  return *this;
1340  }
1341 
1343  {
1344  cmzn_graphicspointattributes_destroy(&id);
1345  }
1346 
1352  bool isValid() const
1353  {
1354  return (0 != id);
1355  }
1356 
1368  int getBaseSize(int valuesCount, double *valuesOut)
1369  {
1370  return cmzn_graphicspointattributes_get_base_size(id, valuesCount, valuesOut);
1371  }
1372 
1391  int setBaseSize(int valuesCount, const double *valuesIn)
1392  {
1393  return cmzn_graphicspointattributes_set_base_size(id, valuesCount, valuesIn);
1394  }
1395 
1402  {
1403  return Font(cmzn_graphicspointattributes_get_font(id));
1404  }
1405 
1412  int setFont(const Font& font)
1413  {
1414  return cmzn_graphicspointattributes_set_font(id, font.getId());
1415  }
1416 
1423  {
1424  return Glyph(cmzn_graphicspointattributes_get_glyph(id));
1425  }
1426 
1433  int setGlyph(const Glyph& glyph)
1434  {
1435  return cmzn_graphicspointattributes_set_glyph(id, glyph.getId());
1436  }
1437 
1448  int getGlyphOffset(int valuesCount, double *valuesOut)
1449  {
1450  return cmzn_graphicspointattributes_get_glyph_offset(id, valuesCount, valuesOut);
1451  }
1452 
1465  int setGlyphOffset(int valuesCount, const double *valuesIn)
1466  {
1467  return cmzn_graphicspointattributes_set_glyph_offset(id, valuesCount, valuesIn);
1468  }
1469 
1477  {
1478  return static_cast<Glyph::RepeatMode>(cmzn_graphicspointattributes_get_glyph_repeat_mode(id));
1479  }
1480 
1490  {
1491  return cmzn_graphicspointattributes_set_glyph_repeat_mode(id,
1492  static_cast<enum cmzn_glyph_repeat_mode>(glyphRepeatMode));
1493  }
1494 
1503  {
1504  return static_cast<Glyph::ShapeType>(cmzn_graphicspointattributes_get_glyph_shape_type(id));
1505  }
1506 
1517  {
1518  return cmzn_graphicspointattributes_set_glyph_shape_type(id,
1519  static_cast<cmzn_glyph_shape_type>(shapeType));
1520  }
1521 
1528  {
1529  return Field(cmzn_graphicspointattributes_get_label_field(id));
1530  }
1531 
1540  int setLabelField(const Field& labelField)
1541  {
1542  return cmzn_graphicspointattributes_set_label_field(id, labelField.getId());
1543  }
1544 
1554  int getLabelOffset(int valuesCount, double *valuesOut)
1555  {
1556  return cmzn_graphicspointattributes_get_label_offset(id, valuesCount, valuesOut);
1557  }
1558 
1569  int setLabelOffset(int valuesCount, const double *valuesIn)
1570  {
1571  return cmzn_graphicspointattributes_set_label_offset(id, valuesCount, valuesIn);
1572  }
1573 
1582  char *getLabelText(int labelNumber)
1583  {
1584  return cmzn_graphicspointattributes_get_label_text(id, labelNumber);
1585  }
1586 
1598  int setLabelText(int labelNumber, const char *labelText)
1599  {
1600  return cmzn_graphicspointattributes_set_label_text(id, labelNumber, labelText);
1601  }
1602 
1611  {
1612  return Field(cmzn_graphicspointattributes_get_orientation_scale_field(id));
1613  }
1614 
1642  int setOrientationScaleField(const Field& orientationScaleField)
1643  {
1644  return cmzn_graphicspointattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1645  }
1646 
1659  int getScaleFactors(int valuesCount, double *valuesOut)
1660  {
1661  return cmzn_graphicspointattributes_get_scale_factors(id, valuesCount, valuesOut);
1662  }
1663 
1683  int setScaleFactors(int valuesCount, const double *valuesIn)
1684  {
1685  return cmzn_graphicspointattributes_set_scale_factors(id, valuesCount, valuesIn);
1686  }
1687 
1695  {
1696  return Field(cmzn_graphicspointattributes_get_signed_scale_field(id));
1697  }
1698 
1716  int setSignedScaleField(const Field& signedScaleField)
1717  {
1718  return cmzn_graphicspointattributes_set_signed_scale_field(id, signedScaleField.getId());
1719  }
1720 
1721 };
1722 
1724 {
1725  return Graphicspointattributes(cmzn_graphics_get_graphicspointattributes(id));
1726 }
1727 
1736 {
1737 protected:
1738  cmzn_graphicssamplingattributes_id id;
1739 
1740 public:
1741 
1742  // takes ownership of C handle, responsibility for destroying it
1743  explicit Graphicssamplingattributes(cmzn_graphicssamplingattributes_id sampling_attributes_id) :
1744  id(sampling_attributes_id)
1745  {}
1746 
1747  Graphicssamplingattributes(const Graphicssamplingattributes& samplingAttributes) :
1748  id(cmzn_graphicssamplingattributes_access(samplingAttributes.id))
1749  {}
1750 
1751  Graphicssamplingattributes& operator=(const Graphicssamplingattributes& graphicssamplingattributes)
1752  {
1753  cmzn_graphicssamplingattributes_id temp_id = cmzn_graphicssamplingattributes_access(graphicssamplingattributes.id);
1754  if (0 != id)
1755  cmzn_graphicssamplingattributes_destroy(&id);
1756  id = temp_id;
1757  return *this;
1758  }
1759 
1761  {
1762  cmzn_graphicssamplingattributes_destroy(&id);
1763  }
1764 
1770  bool isValid() const
1771  {
1772  return (0 != id);
1773  }
1774 
1782  {
1783  return Field(cmzn_graphicssamplingattributes_get_density_field(id));
1784  }
1785 
1795  int setDensityField(const Field& densityField)
1796  {
1797  return cmzn_graphicssamplingattributes_set_density_field(id, densityField.getId());
1798  }
1799 
1808  int getLocation(int valuesCount, double *valuesOut)
1809  {
1810  return cmzn_graphicssamplingattributes_get_location(id, valuesCount, valuesOut);
1811  }
1812 
1823  int setLocation(int valuesCount, const double *valuesIn)
1824  {
1825  return cmzn_graphicssamplingattributes_set_location(id, valuesCount, valuesIn);
1826  }
1827 
1834  {
1835  return static_cast<Element::PointSamplingMode>(cmzn_graphicssamplingattributes_get_element_point_sampling_mode(id));
1836  }
1837 
1846  {
1847  return cmzn_graphicssamplingattributes_set_element_point_sampling_mode(id,
1848  static_cast<cmzn_element_point_sampling_mode>(samplingMode));
1849  }
1850 
1851 };
1852 
1854 {
1855  return Glyph(cmzn_glyphmodule_create_static_glyph_from_graphics(id, graphics.getId()));
1856 }
1857 
1859 {
1860  return Graphicssamplingattributes(cmzn_graphics_get_graphicssamplingattributes(id));
1861 }
1862 
1863 } // namespace Zinc
1864 }
1865 
1866 #endif
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
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
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
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:114
cmzn_material_id getId() const
Definition: material.hpp:83
RepeatMode
Definition: glyph.hpp:98
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
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
Zinc Spectrum maps values of graphics data fields to colours.
Definition: spectrum.hpp:581
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
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1231
Field getTessellationField()
Definition: graphics.hpp:492
Field::DomainType getFieldDomainType()
Definition: graphics.hpp:563
Graphicslineattributes getGraphicslineattributes()
Definition: graphics.hpp:1305
Attributes object specifying how points are visualised.
Definition: graphics.hpp:1317
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
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
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
int getGlyphOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1448
Definition: graphics.hpp:135
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
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
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: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