OpenCMISS-Zinc 3.0.0 Release 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 
461  {
462  return Tessellation(cmzn_graphics_get_tessellation(id));
463  }
464 
472  int setTessellation(const Tessellation& tessellation)
473  {
474  return cmzn_graphics_set_tessellation(id, tessellation.getId());
475  }
476 
483  {
484  return Field(cmzn_graphics_get_tessellation_field(id));
485  }
486 
497  int setTessellationField(const Field& tessellationField)
498  {
499  return cmzn_graphics_set_tessellation_field(id, tessellationField.getId());
500  }
501 
508  {
509  return cmzn_graphics_get_visibility_flag(id);
510  }
511 
519  int setVisibilityFlag(bool visibilityFlag)
520  {
521  return cmzn_graphics_set_visibility_flag(id, visibilityFlag);
522  }
523 
530  {
531  return static_cast<Scenecoordinatesystem>(cmzn_graphics_get_scenecoordinatesystem(id));
532  }
533 
542  {
543  return cmzn_graphics_set_scenecoordinatesystem(id,
544  static_cast<cmzn_scenecoordinatesystem>(coordinateSystem));
545  }
546 
554  {
555  return static_cast<Field::DomainType>(cmzn_graphics_get_field_domain_type(id));
556  }
557 
568  {
569  return cmzn_graphics_set_field_domain_type(id, static_cast<cmzn_field_domain_type>(domainType));
570  }
571 
578  char *getName()
579  {
580  return cmzn_graphics_get_name(id);
581  }
582 
592  int setName(const char *name)
593  {
594  return cmzn_graphics_set_name(id, name);
595  }
596 
606  {
607  return cmzn_graphics_set_element_face_type(id, static_cast<cmzn_element_face_type>(faceType));
608  }
609 
617  {
618  return static_cast<Element::FaceType>(cmzn_graphics_get_element_face_type(id));
619  }
620 
626  bool isExterior()
627  {
628  return cmzn_graphics_is_exterior(id);
629  }
630 
637  int setExterior(bool exterior)
638  {
639  return cmzn_graphics_set_exterior(id, exterior);
640  }
641 
657  inline GraphicsLines castLines();
665  inline GraphicsPoints castPoints();
682 };
683 
692 {
693 friend class Scene;
694 private:
695  explicit GraphicsContours(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
696 
697 public:
698  GraphicsContours() : Graphics(0) {}
699 
700  explicit GraphicsContours(cmzn_graphics_contours_id contours_id)
701  : Graphics(reinterpret_cast<cmzn_graphics_id>(contours_id))
702  {}
703 
710  {
711  return Field(cmzn_graphics_contours_get_isoscalar_field(reinterpret_cast<cmzn_graphics_contours_id>(id)));
712  }
713 
721  int setIsoscalarField(const Field& field)
722  {
723  return cmzn_graphics_contours_set_isoscalar_field(reinterpret_cast<cmzn_graphics_contours_id>(id), field.getId());
724  }
725 
738  int getListIsovalues(int valuesCount, double *valuesOut)
739  {
740  return cmzn_graphics_contours_get_list_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(id),
741  valuesCount, valuesOut);
742  }
743 
751  int setListIsovalues(int valuesCount, const double *valuesIn)
752  {
753  return cmzn_graphics_contours_set_list_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(id),
754  valuesCount, valuesIn);
755  }
756 
765  {
766  return cmzn_graphics_contours_get_range_first_isovalue(
767  reinterpret_cast<cmzn_graphics_contours_id>(id));
768  }
769 
778  {
779  return cmzn_graphics_contours_get_range_last_isovalue(
780  reinterpret_cast<cmzn_graphics_contours_id>(id));
781  }
782 
791  {
792  return cmzn_graphics_contours_get_range_number_of_isovalues(
793  reinterpret_cast<cmzn_graphics_contours_id>(id));
794  }
795 
807  int setRangeIsovalues(int numberOfValues, double firstIsovalue, double lastIsovalue)
808  {
809  return cmzn_graphics_contours_set_range_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(id),
810  numberOfValues, firstIsovalue, lastIsovalue);
811  }
812 
813 };
814 
824 class GraphicsLines : public Graphics
825 {
826 friend class Scene;
827 private:
828  explicit GraphicsLines(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
829 
830 public:
831  GraphicsLines() : Graphics(0) {}
832 
833  explicit GraphicsLines(cmzn_graphics_lines_id lines_id)
834  : Graphics(reinterpret_cast<cmzn_graphics_id>(lines_id))
835  {}
836 };
837 
851 class GraphicsPoints : public Graphics
852 {
853 friend class Scene;
854 private:
855  explicit GraphicsPoints(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
856 
857 public:
858  GraphicsPoints() : Graphics(0) {}
859 
860  explicit GraphicsPoints(cmzn_graphics_points_id points_id)
861  : Graphics(reinterpret_cast<cmzn_graphics_id>(points_id))
862  {}
863 };
864 
881 {
882 friend class Scene;
883 private:
884  explicit GraphicsStreamlines(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
885 
886 public:
887  GraphicsStreamlines() : Graphics(0) {}
888 
889  explicit GraphicsStreamlines(cmzn_graphics_streamlines_id streamlines_id)
890  : Graphics(reinterpret_cast<cmzn_graphics_id>(streamlines_id))
891  {}
892 
900  {
901  TRACK_DIRECTION_INVALID = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_INVALID,
903  TRACK_DIRECTION_FORWARD = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_FORWARD,
905  TRACK_DIRECTION_REVERSE = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_REVERSE
907  };
908 
916  {
917  return Field(cmzn_graphics_streamlines_get_stream_vector_field(reinterpret_cast<cmzn_graphics_streamlines_id>(id)));
918  }
919 
929  int setStreamVectorField(const Field& field)
930  {
931  return cmzn_graphics_streamlines_set_stream_vector_field(reinterpret_cast<cmzn_graphics_streamlines_id>(id), field.getId());
932  }
933 
941  {
942  return static_cast<TrackDirection>(
943  cmzn_graphics_streamlines_get_track_direction(reinterpret_cast<cmzn_graphics_streamlines_id>(id)));
944  }
945 
954  int setTrackDirection(TrackDirection trackDirection)
955  {
956  return cmzn_graphics_streamlines_set_track_direction(reinterpret_cast<cmzn_graphics_streamlines_id>(id),
957  static_cast<cmzn_graphics_streamlines_track_direction>(trackDirection));
958  }
959 
965  double getTrackLength()
966  {
967  return cmzn_graphics_streamlines_get_track_length(reinterpret_cast<cmzn_graphics_streamlines_id>(id));
968  }
969 
978  int setTrackLength(double length)
979  {
980  return cmzn_graphics_streamlines_set_track_length(reinterpret_cast<cmzn_graphics_streamlines_id>(id), length);
981  }
982 
983 };
984 
992 {
993 friend class Scene;
994 private:
995  explicit GraphicsSurfaces(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
996 
997 public:
998  GraphicsSurfaces() : Graphics(0) {}
999 
1000  explicit GraphicsSurfaces(cmzn_graphics_surfaces_id surfaces_id)
1001  : Graphics(reinterpret_cast<cmzn_graphics_id>(surfaces_id))
1002  {}
1003 };
1004 
1006 {
1007  return GraphicsContours(cmzn_graphics_cast_contours(id));
1008 }
1009 
1011 {
1012  return GraphicsLines(cmzn_graphics_cast_lines(id));
1013 }
1014 
1016 {
1017  return GraphicsPoints(cmzn_graphics_cast_points(id));
1018 }
1019 
1021 {
1022  return GraphicsStreamlines(cmzn_graphics_cast_streamlines(id));
1023 }
1024 
1026 {
1027  return GraphicsSurfaces(cmzn_graphics_cast_surfaces(id));
1028 }
1029 
1038 {
1039 protected:
1040  cmzn_graphicslineattributes_id id;
1041 
1042 public:
1043 
1044  // takes ownership of C handle, responsibility for destroying it
1045  explicit Graphicslineattributes(cmzn_graphicslineattributes_id line_attributes_id) :
1046  id(line_attributes_id)
1047  {}
1048 
1049  Graphicslineattributes(const Graphicslineattributes& lineAttributes) :
1050  id(cmzn_graphicslineattributes_access(lineAttributes.id))
1051  {}
1052 
1053  Graphicslineattributes& operator=(const Graphicslineattributes& graphicslineattributes)
1054  {
1055  cmzn_graphicslineattributes_id temp_id = cmzn_graphicslineattributes_access(graphicslineattributes.id);
1056  if (0 != id)
1057  cmzn_graphicslineattributes_destroy(&id);
1058  id = temp_id;
1059  return *this;
1060  }
1061 
1063  {
1064  cmzn_graphicslineattributes_destroy(&id);
1065  }
1066 
1072  bool isValid() const
1073  {
1074  return (0 != id);
1075  }
1076 
1081  {
1082  SHAPE_TYPE_INVALID = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_INVALID,
1084  SHAPE_TYPE_LINE = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_LINE,
1086  SHAPE_TYPE_RIBBON = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_RIBBON,
1088  SHAPE_TYPE_CIRCLE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_CIRCLE_EXTRUSION,
1090  SHAPE_TYPE_SQUARE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_SQUARE_EXTRUSION
1092  };
1093 
1105  int getBaseSize(int valuesCount, double *valuesOut)
1106  {
1107  return cmzn_graphicslineattributes_get_base_size(id, valuesCount, valuesOut);
1108  }
1109 
1128  int setBaseSize(int valuesCount, const double *valuesIn)
1129  {
1130  return cmzn_graphicslineattributes_set_base_size(id, valuesCount, valuesIn);
1131  }
1132 
1141  {
1142  return Field(cmzn_graphicslineattributes_get_orientation_scale_field(id));
1143  }
1144 
1155  int setOrientationScaleField(const Field& orientationScaleField)
1156  {
1157  return cmzn_graphicslineattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1158  }
1159 
1172  int getScaleFactors(int valuesCount, double *valuesOut)
1173  {
1174  return cmzn_graphicslineattributes_get_scale_factors(id, valuesCount, valuesOut);
1175  }
1176 
1196  int setScaleFactors(int valuesCount, const double *valuesIn)
1197  {
1198  return cmzn_graphicslineattributes_set_scale_factors(id, valuesCount, valuesIn);
1199  }
1200 
1208  {
1209  return static_cast<ShapeType>(cmzn_graphicslineattributes_get_shape_type(id));
1210  }
1211 
1222  int setShapeType(ShapeType shapeType)
1223  {
1224  return cmzn_graphicslineattributes_set_shape_type(id, static_cast<cmzn_graphicslineattributes_shape_type>(shapeType));
1225  }
1226 
1227 };
1228 
1230 {
1231  return Graphicslineattributes(cmzn_graphics_get_graphicslineattributes(id));
1232 }
1233 
1242 {
1243 protected:
1244  cmzn_graphicspointattributes_id id;
1245 
1246 public:
1247 
1248  // takes ownership of C handle, responsibility for destroying it
1249  explicit Graphicspointattributes(cmzn_graphicspointattributes_id point_attributes_id) :
1250  id(point_attributes_id)
1251  {}
1252 
1253  Graphicspointattributes(const Graphicspointattributes& pointAttributes) :
1254  id(cmzn_graphicspointattributes_access(pointAttributes.id))
1255  {}
1256 
1257  Graphicspointattributes& operator=(const Graphicspointattributes& graphicspointattributes)
1258  {
1259  cmzn_graphicspointattributes_id temp_id = cmzn_graphicspointattributes_access(graphicspointattributes.id);
1260  if (0 != id)
1261  cmzn_graphicspointattributes_destroy(&id);
1262  id = temp_id;
1263  return *this;
1264  }
1265 
1267  {
1268  cmzn_graphicspointattributes_destroy(&id);
1269  }
1270 
1276  bool isValid() const
1277  {
1278  return (0 != id);
1279  }
1280 
1292  int getBaseSize(int valuesCount, double *valuesOut)
1293  {
1294  return cmzn_graphicspointattributes_get_base_size(id, valuesCount, valuesOut);
1295  }
1296 
1315  int setBaseSize(int valuesCount, const double *valuesIn)
1316  {
1317  return cmzn_graphicspointattributes_set_base_size(id, valuesCount, valuesIn);
1318  }
1319 
1326  {
1327  return Font(cmzn_graphicspointattributes_get_font(id));
1328  }
1329 
1336  int setFont(const Font& font)
1337  {
1338  return cmzn_graphicspointattributes_set_font(id, font.getId());
1339  }
1340 
1347  {
1348  return Glyph(cmzn_graphicspointattributes_get_glyph(id));
1349  }
1350 
1357  int setGlyph(const Glyph& glyph)
1358  {
1359  return cmzn_graphicspointattributes_set_glyph(id, glyph.getId());
1360  }
1361 
1372  int getGlyphOffset(int valuesCount, double *valuesOut)
1373  {
1374  return cmzn_graphicspointattributes_get_glyph_offset(id, valuesCount, valuesOut);
1375  }
1376 
1389  int setGlyphOffset(int valuesCount, const double *valuesIn)
1390  {
1391  return cmzn_graphicspointattributes_set_glyph_offset(id, valuesCount, valuesIn);
1392  }
1393 
1401  {
1402  return static_cast<Glyph::RepeatMode>(cmzn_graphicspointattributes_get_glyph_repeat_mode(id));
1403  }
1404 
1414  {
1415  return cmzn_graphicspointattributes_set_glyph_repeat_mode(id,
1416  static_cast<enum cmzn_glyph_repeat_mode>(glyphRepeatMode));
1417  }
1418 
1427  {
1428  return static_cast<Glyph::ShapeType>(cmzn_graphicspointattributes_get_glyph_shape_type(id));
1429  }
1430 
1441  {
1442  return cmzn_graphicspointattributes_set_glyph_shape_type(id,
1443  static_cast<cmzn_glyph_shape_type>(shapeType));
1444  }
1445 
1452  {
1453  return Field(cmzn_graphicspointattributes_get_label_field(id));
1454  }
1455 
1464  int setLabelField(const Field& labelField)
1465  {
1466  return cmzn_graphicspointattributes_set_label_field(id, labelField.getId());
1467  }
1468 
1478  int getLabelOffset(int valuesCount, double *valuesOut)
1479  {
1480  return cmzn_graphicspointattributes_get_label_offset(id, valuesCount, valuesOut);
1481  }
1482 
1493  int setLabelOffset(int valuesCount, const double *valuesIn)
1494  {
1495  return cmzn_graphicspointattributes_set_label_offset(id, valuesCount, valuesIn);
1496  }
1497 
1506  char *getLabelText(int labelNumber)
1507  {
1508  return cmzn_graphicspointattributes_get_label_text(id, labelNumber);
1509  }
1510 
1522  int setLabelText(int labelNumber, const char *labelText)
1523  {
1524  return cmzn_graphicspointattributes_set_label_text(id, labelNumber, labelText);
1525  }
1526 
1535  {
1536  return Field(cmzn_graphicspointattributes_get_orientation_scale_field(id));
1537  }
1538 
1566  int setOrientationScaleField(const Field& orientationScaleField)
1567  {
1568  return cmzn_graphicspointattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1569  }
1570 
1583  int getScaleFactors(int valuesCount, double *valuesOut)
1584  {
1585  return cmzn_graphicspointattributes_get_scale_factors(id, valuesCount, valuesOut);
1586  }
1587 
1607  int setScaleFactors(int valuesCount, const double *valuesIn)
1608  {
1609  return cmzn_graphicspointattributes_set_scale_factors(id, valuesCount, valuesIn);
1610  }
1611 
1619  {
1620  return Field(cmzn_graphicspointattributes_get_signed_scale_field(id));
1621  }
1622 
1640  int setSignedScaleField(const Field& signedScaleField)
1641  {
1642  return cmzn_graphicspointattributes_set_signed_scale_field(id, signedScaleField.getId());
1643  }
1644 
1645 };
1646 
1648 {
1649  return Graphicspointattributes(cmzn_graphics_get_graphicspointattributes(id));
1650 }
1651 
1660 {
1661 protected:
1662  cmzn_graphicssamplingattributes_id id;
1663 
1664 public:
1665 
1666  // takes ownership of C handle, responsibility for destroying it
1667  explicit Graphicssamplingattributes(cmzn_graphicssamplingattributes_id sampling_attributes_id) :
1668  id(sampling_attributes_id)
1669  {}
1670 
1671  Graphicssamplingattributes(const Graphicssamplingattributes& samplingAttributes) :
1672  id(cmzn_graphicssamplingattributes_access(samplingAttributes.id))
1673  {}
1674 
1675  Graphicssamplingattributes& operator=(const Graphicssamplingattributes& graphicssamplingattributes)
1676  {
1677  cmzn_graphicssamplingattributes_id temp_id = cmzn_graphicssamplingattributes_access(graphicssamplingattributes.id);
1678  if (0 != id)
1679  cmzn_graphicssamplingattributes_destroy(&id);
1680  id = temp_id;
1681  return *this;
1682  }
1683 
1685  {
1686  cmzn_graphicssamplingattributes_destroy(&id);
1687  }
1688 
1694  bool isValid() const
1695  {
1696  return (0 != id);
1697  }
1698 
1706  {
1707  return Field(cmzn_graphicssamplingattributes_get_density_field(id));
1708  }
1709 
1719  int setDensityField(const Field& densityField)
1720  {
1721  return cmzn_graphicssamplingattributes_set_density_field(id, densityField.getId());
1722  }
1723 
1732  int getLocation(int valuesCount, double *valuesOut)
1733  {
1734  return cmzn_graphicssamplingattributes_get_location(id, valuesCount, valuesOut);
1735  }
1736 
1747  int setLocation(int valuesCount, const double *valuesIn)
1748  {
1749  return cmzn_graphicssamplingattributes_set_location(id, valuesCount, valuesIn);
1750  }
1751 
1758  {
1759  return static_cast<Element::PointSamplingMode>(cmzn_graphicssamplingattributes_get_element_point_sampling_mode(id));
1760  }
1761 
1770  {
1771  return cmzn_graphicssamplingattributes_set_element_point_sampling_mode(id,
1772  static_cast<cmzn_element_point_sampling_mode>(samplingMode));
1773  }
1774 
1775 };
1776 
1778 {
1779  return Graphicssamplingattributes(cmzn_graphics_get_graphicssamplingattributes(id));
1780 }
1781 
1782 } // namespace Zinc
1783 }
1784 
1785 #endif
int setSignedScaleField(const Field &signedScaleField)
Definition: graphics.hpp:1640
int setListIsovalues(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:751
enum Scenecoordinatesystem getScenecoordinatesystem()
Definition: graphics.hpp:529
int setTextureCoordinateField(const Field &textureCoordinateField)
Definition: graphics.hpp:359
enum RenderPolygonMode getRenderPolygonMode()
Definition: graphics.hpp:262
Glyph::ShapeType getGlyphShapeType()
Definition: graphics.hpp:1426
Graphicspointattributes getGraphicspointattributes()
Definition: graphics.hpp:1647
int setShapeType(ShapeType shapeType)
Definition: graphics.hpp:1222
Attributes object specifying how lines are visualised.
Definition: graphics.hpp:1037
Lines visualise 1-D elements in the model.
Definition: graphics.hpp:824
int setElementPointSamplingMode(Element::PointSamplingMode samplingMode)
Definition: graphics.hpp:1769
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1583
int setRenderPolygonMode(RenderPolygonMode renderPolygonMode)
Definition: graphics.hpp:275
char * getLabelText(int labelNumber)
Definition: graphics.hpp:1506
cmzn_tessellation_id getId() const
Definition: tessellation.hpp:81
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1607
Field getOrientationScaleField()
Definition: graphics.hpp:1140
Surfaces visualise 2-D elements in the model.
Definition: graphics.hpp:991
int setVisibilityFlag(bool visibilityFlag)
Definition: graphics.hpp:519
int setTrackDirection(TrackDirection trackDirection)
Definition: graphics.hpp:954
int setMaterial(const Material &material)
Definition: graphics.hpp:380
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
int setName(const char *name)
Definition: graphics.hpp:592
int setGlyphOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1389
bool isValid() const
Definition: graphics.hpp:1276
Field getCoordinateField()
Definition: graphics.hpp:163
int getLocation(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1732
int setTessellation(const Tessellation &tessellation)
Definition: graphics.hpp:472
SelectMode
Definition: graphics.hpp:110
Scenecoordinatesystem
Definition: scenecoordinatesystem.hpp:26
int setLocation(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1747
bool isValid() const
Definition: graphics.hpp:1694
int getListIsovalues(int valuesCount, double *valuesOut)
Definition: graphics.hpp:738
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1566
int setSpectrum(const Spectrum &spectrum)
Definition: graphics.hpp:449
Material getSelectedMaterial()
Definition: graphics.hpp:417
Material getMaterial()
Definition: graphics.hpp:369
Container/manager for graphics visualising a region.
Definition: scene.hpp:34
Definition: graphics.hpp:114
cmzn_material_id getId() const
Definition: material.hpp:83
RepeatMode
Definition: glyph.hpp:97
bool isValid() const
Definition: graphics.hpp:1072
int setRangeIsovalues(int numberOfValues, double firstIsovalue, double lastIsovalue)
Definition: graphics.hpp:807
Points graphics visualise discrete locations in the model.
Definition: graphics.hpp:851
double getRangeFirstIsovalue()
Definition: graphics.hpp:764
Field getDataField()
Definition: graphics.hpp:186
Definition: graphics.hpp:118
int setTrackLength(double length)
Definition: graphics.hpp:978
Glyph::RepeatMode getGlyphRepeatMode()
Definition: graphics.hpp:1400
GraphicsContours castContours()
Definition: graphics.hpp:1005
Definition: graphics.hpp:137
int setScenecoordinatesystem(Scenecoordinatesystem coordinateSystem)
Definition: graphics.hpp:541
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1172
char * getName()
Definition: graphics.hpp:578
Field getStreamVectorField()
Definition: graphics.hpp:915
Field getLabelField()
Definition: graphics.hpp:1451
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:1325
Spectrum getSpectrum()
Definition: graphics.hpp:438
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:1315
int setSelectedMaterial(const Material &material)
Definition: graphics.hpp:428
cmzn_field_id getId() const
Definition: field.hpp:98
double getRangeLastIsovalue()
Definition: graphics.hpp:777
ShapeType getShapeType()
Definition: graphics.hpp:1207
Zinc materials specify colouring of graphics.
Definition: material.hpp:29
TrackDirection getTrackDirection()
Definition: graphics.hpp:940
Element::FaceType getElementFaceType()
Definition: graphics.hpp:616
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1292
int setTessellationField(const Field &tessellationField)
Definition: graphics.hpp:497
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1128
int getRangeNumberOfIsovalues()
Definition: graphics.hpp:790
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:1464
int setSelectMode(SelectMode selectMode)
Definition: graphics.hpp:309
Field getSubgroupField()
Definition: graphics.hpp:319
GraphicsPoints castPoints()
Definition: graphics.hpp:1015
Element::PointSamplingMode getElementPointSamplingMode()
Definition: graphics.hpp:1757
int setGlyphShapeType(Glyph::ShapeType shapeType)
Definition: graphics.hpp:1440
bool isExterior()
Definition: graphics.hpp:626
ShapeType
Definition: graphics.hpp:1080
Zinc Spectrum maps values of graphics data fields to colours.
Definition: spectrum.hpp:581
int setRenderLineWidth(double width)
Definition: graphics.hpp:224
ShapeType
Definition: glyph.hpp:130
bool getVisibilityFlag()
Definition: graphics.hpp:507
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1155
Field getTessellationField()
Definition: graphics.hpp:482
Field::DomainType getFieldDomainType()
Definition: graphics.hpp:553
Graphicslineattributes getGraphicslineattributes()
Definition: graphics.hpp:1229
Attributes object specifying how points are visualised.
Definition: graphics.hpp:1241
The tessellation controls the number of polygons or line segments.
Definition: tessellation.hpp:28
int setFieldDomainType(Field::DomainType domainType)
Definition: graphics.hpp:567
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1105
int setFont(const Font &font)
Definition: graphics.hpp:1336
int setLabelText(int labelNumber, const char *labelText)
Definition: graphics.hpp:1522
cmzn_font_id getId() const
Definition: font.hpp:103
Graphicssamplingattributes getGraphicssamplingattributes()
Definition: graphics.hpp:1777
Glyph getGlyph()
Definition: graphics.hpp:1346
GraphicsLines castLines()
Definition: graphics.hpp:1010
int setSubgroupField(const Field &subgroupField)
Definition: graphics.hpp:333
PointSamplingMode
Definition: element.hpp:329
int setElementFaceType(Element::FaceType faceType)
Definition: graphics.hpp:605
GraphicsStreamlines castStreamlines()
Definition: graphics.hpp:1020
Streamlines visualise the path of a fluid particle tracking along a vector field. ...
Definition: graphics.hpp:880
GraphicsSurfaces castSurfaces()
Definition: graphics.hpp:1025
TrackDirection
Definition: graphics.hpp:899
int setGlyphRepeatMode(Glyph::RepeatMode glyphRepeatMode)
Definition: graphics.hpp:1413
int getLabelOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1478
int setRenderPointSize(double size)
Definition: graphics.hpp:251
int setExterior(bool exterior)
Definition: graphics.hpp:637
double getRenderPointSize()
Definition: graphics.hpp:235
int getGlyphOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1372
Definition: graphics.hpp:135
Type
Definition: graphics.hpp:131
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1196
Field getOrientationScaleField()
Definition: graphics.hpp:1534
double getTrackLength()
Definition: graphics.hpp:965
enum SelectMode getSelectMode()
Definition: graphics.hpp:294
bool isValid() const
Definition: graphics.hpp:87
Field getDensityField()
Definition: graphics.hpp:1705
Field getTextureCoordinateField()
Definition: graphics.hpp:345
Field getSignedScaleField()
Definition: graphics.hpp:1618
Definition: graphics.hpp:139
cmzn_glyph_id getId() const
Definition: glyph.hpp:88
Graphics attributes object specifying how points are sampled in elements.
Definition: graphics.hpp:1659
int setLabelOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1493
The contours derived graphics type.
Definition: graphics.hpp:691
int setCoordinateField(const Field &coordinateField)
Definition: graphics.hpp:176
Field getIsoscalarField()
Definition: graphics.hpp:709
FaceType
Definition: element.hpp:270
int setIsoscalarField(const Field &field)
Definition: graphics.hpp:721
Font object controlling attributes of rendering text.
Definition: font.hpp:26
Scene getScene()
Definition: scene.hpp:529
Tessellation getTessellation()
Definition: graphics.hpp:460
cmzn_graphics_id getId() const
Definition: graphics.hpp:153
Definition: graphics.hpp:133
int setGlyph(const Glyph &glyph)
Definition: graphics.hpp:1357
int setDensityField(const Field &densityField)
Definition: graphics.hpp:1719
double getRenderLineWidth()
Definition: graphics.hpp:208
int setStreamVectorField(const Field &field)
Definition: graphics.hpp:929