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 
277  {
278  return cmzn_graphics_set_render_polygon_mode(id,
279  static_cast<cmzn_graphics_render_polygon_mode>(renderPolygonMode));
280  }
281 
287  inline Scene getScene();
288 
296  {
297  return static_cast<SelectMode>(cmzn_graphics_get_select_mode(id));
298  }
299 
310  int setSelectMode(SelectMode selectMode)
311  {
312  return cmzn_graphics_set_select_mode(id, static_cast<cmzn_graphics_select_mode>(selectMode));
313  }
314 
321  {
322  return Field(cmzn_graphics_get_subgroup_field(id));
323  }
324 
334  int setSubgroupField(const Field& subgroupField)
335  {
336  return cmzn_graphics_set_subgroup_field(id, subgroupField.getId());
337  }
338 
347  {
348  return Field(cmzn_graphics_get_texture_coordinate_field(id));
349  }
350 
360  int setTextureCoordinateField(const Field& textureCoordinateField)
361  {
362  return cmzn_graphics_set_texture_coordinate_field(id, textureCoordinateField.getId());
363  }
364 
371  {
372  return Material(cmzn_graphics_get_material(id));
373  }
374 
381  int setMaterial(const Material& material)
382  {
383  return cmzn_graphics_set_material(id, material.getId());
384  }
385 
394 
403 
412 
419  {
420  return Material(cmzn_graphics_get_selected_material(id));
421  }
422 
429  int setSelectedMaterial(const Material& material)
430  {
431  return cmzn_graphics_set_selected_material(id, material.getId());
432  }
433 
440  {
441  return Spectrum(cmzn_graphics_get_spectrum(id));
442  }
443 
450  int setSpectrum(const Spectrum& spectrum)
451  {
452  return cmzn_graphics_set_spectrum(id, spectrum.getId());
453  }
454 
462  {
463  return Tessellation(cmzn_graphics_get_tessellation(id));
464  }
465 
473  int setTessellation(const Tessellation& tessellation)
474  {
475  return cmzn_graphics_set_tessellation(id, tessellation.getId());
476  }
477 
484  {
485  return Field(cmzn_graphics_get_tessellation_field(id));
486  }
487 
498  int setTessellationField(const Field& tessellationField)
499  {
500  return cmzn_graphics_set_tessellation_field(id, tessellationField.getId());
501  }
502 
509  {
510  return cmzn_graphics_get_visibility_flag(id);
511  }
512 
520  int setVisibilityFlag(bool visibilityFlag)
521  {
522  return cmzn_graphics_set_visibility_flag(id, visibilityFlag);
523  }
524 
531  {
532  return static_cast<Scenecoordinatesystem>(cmzn_graphics_get_scenecoordinatesystem(id));
533  }
534 
543  {
544  return cmzn_graphics_set_scenecoordinatesystem(id,
545  static_cast<cmzn_scenecoordinatesystem>(coordinateSystem));
546  }
547 
548  Field::DomainType getFieldDomainType()
549  {
550  return static_cast<Field::DomainType>(cmzn_graphics_get_field_domain_type(id));
551  }
552 
553  int setFieldDomainType(Field::DomainType domainType)
554  {
555  return cmzn_graphics_set_field_domain_type(id, static_cast<cmzn_field_domain_type>(domainType));
556  }
557 
564  char *getName()
565  {
566  return cmzn_graphics_get_name(id);
567  }
568 
578  int setName(const char *name)
579  {
580  return cmzn_graphics_set_name(id, name);
581  }
582 
583  int setElementFaceType(Element::FaceType faceType)
584  {
585  return cmzn_graphics_set_element_face_type(id, static_cast<cmzn_element_face_type>(faceType));
586  }
587 
588  Element::FaceType getElementFaceType()
589  {
590  return static_cast<Element::FaceType>(cmzn_graphics_get_element_face_type(id));
591  }
592 
598  bool isExterior()
599  {
600  return cmzn_graphics_is_exterior(id);
601  }
602 
609  int setExterior(bool exterior)
610  {
611  return cmzn_graphics_set_exterior(id, exterior);
612  }
613 
629  inline GraphicsLines castLines();
637  inline GraphicsPoints castPoints();
654 };
655 
664 {
665 friend class Scene;
666 private:
667  explicit GraphicsContours(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
668 
669 public:
670  GraphicsContours() : Graphics(0) {}
671 
672  explicit GraphicsContours(cmzn_graphics_contours_id contours_id)
673  : Graphics(reinterpret_cast<cmzn_graphics_id>(contours_id))
674  {}
675 
682  {
683  return Field(cmzn_graphics_contours_get_isoscalar_field(reinterpret_cast<cmzn_graphics_contours_id>(id)));
684  }
685 
693  int setIsoscalarField(const Field& field)
694  {
695  return cmzn_graphics_contours_set_isoscalar_field(reinterpret_cast<cmzn_graphics_contours_id>(id), field.getId());
696  }
697 
710  int getListIsovalues(int valuesCount, double *valuesOut)
711  {
712  return cmzn_graphics_contours_get_list_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(id),
713  valuesCount, valuesOut);
714  }
715 
723  int setListIsovalues(int valuesCount, const double *valuesIn)
724  {
725  return cmzn_graphics_contours_set_list_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(id),
726  valuesCount, valuesIn);
727  }
728 
737  {
738  return cmzn_graphics_contours_get_range_first_isovalue(
739  reinterpret_cast<cmzn_graphics_contours_id>(id));
740  }
741 
750  {
751  return cmzn_graphics_contours_get_range_last_isovalue(
752  reinterpret_cast<cmzn_graphics_contours_id>(id));
753  }
754 
763  {
764  return cmzn_graphics_contours_get_range_number_of_isovalues(
765  reinterpret_cast<cmzn_graphics_contours_id>(id));
766  }
767 
779  int setRangeIsovalues(int numberOfValues, double firstIsovalue, double lastIsovalue)
780  {
781  return cmzn_graphics_contours_set_range_isovalues(reinterpret_cast<cmzn_graphics_contours_id>(id),
782  numberOfValues, firstIsovalue, lastIsovalue);
783  }
784 
785 };
786 
796 class GraphicsLines : public Graphics
797 {
798 friend class Scene;
799 private:
800  explicit GraphicsLines(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
801 
802 public:
803  GraphicsLines() : Graphics(0) {}
804 
805  explicit GraphicsLines(cmzn_graphics_lines_id lines_id)
806  : Graphics(reinterpret_cast<cmzn_graphics_id>(lines_id))
807  {}
808 };
809 
823 class GraphicsPoints : public Graphics
824 {
825 friend class Scene;
826 private:
827  explicit GraphicsPoints(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
828 
829 public:
830  GraphicsPoints() : Graphics(0) {}
831 
832  explicit GraphicsPoints(cmzn_graphics_points_id points_id)
833  : Graphics(reinterpret_cast<cmzn_graphics_id>(points_id))
834  {}
835 };
836 
853 {
854 friend class Scene;
855 private:
856  explicit GraphicsStreamlines(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
857 
858 public:
859  GraphicsStreamlines() : Graphics(0) {}
860 
861  explicit GraphicsStreamlines(cmzn_graphics_streamlines_id streamlines_id)
862  : Graphics(reinterpret_cast<cmzn_graphics_id>(streamlines_id))
863  {}
864 
872  {
873  TRACK_DIRECTION_INVALID = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_INVALID,
875  TRACK_DIRECTION_FORWARD = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_FORWARD,
877  TRACK_DIRECTION_REVERSE = CMZN_GRAPHICS_STREAMLINES_TRACK_DIRECTION_REVERSE
879  };
880 
888  {
889  return Field(cmzn_graphics_streamlines_get_stream_vector_field(reinterpret_cast<cmzn_graphics_streamlines_id>(id)));
890  }
891 
901  int setStreamVectorField(const Field& field)
902  {
903  return cmzn_graphics_streamlines_set_stream_vector_field(reinterpret_cast<cmzn_graphics_streamlines_id>(id), field.getId());
904  }
905 
913  {
914  return static_cast<TrackDirection>(
915  cmzn_graphics_streamlines_get_track_direction(reinterpret_cast<cmzn_graphics_streamlines_id>(id)));
916  }
917 
927  int setTrackDirection(TrackDirection trackDirection)
928  {
929  return cmzn_graphics_streamlines_set_track_direction(reinterpret_cast<cmzn_graphics_streamlines_id>(id),
930  static_cast<cmzn_graphics_streamlines_track_direction>(trackDirection));
931  }
932 
938  double getTrackLength()
939  {
940  return cmzn_graphics_streamlines_get_track_length(reinterpret_cast<cmzn_graphics_streamlines_id>(id));
941  }
942 
951  int setTrackLength(double length)
952  {
953  return cmzn_graphics_streamlines_set_track_length(reinterpret_cast<cmzn_graphics_streamlines_id>(id), length);
954  }
955 
956 };
957 
965 {
966 friend class Scene;
967 private:
968  explicit GraphicsSurfaces(cmzn_graphics_id graphics_id) : Graphics(graphics_id) {}
969 
970 public:
971  GraphicsSurfaces() : Graphics(0) {}
972 
973  explicit GraphicsSurfaces(cmzn_graphics_surfaces_id surfaces_id)
974  : Graphics(reinterpret_cast<cmzn_graphics_id>(surfaces_id))
975  {}
976 };
977 
979 {
980  return GraphicsContours(cmzn_graphics_cast_contours(id));
981 }
982 
984 {
985  return GraphicsLines(cmzn_graphics_cast_lines(id));
986 }
987 
989 {
990  return GraphicsPoints(cmzn_graphics_cast_points(id));
991 }
992 
994 {
995  return GraphicsStreamlines(cmzn_graphics_cast_streamlines(id));
996 }
997 
999 {
1000  return GraphicsSurfaces(cmzn_graphics_cast_surfaces(id));
1001 }
1002 
1011 {
1012 protected:
1013  cmzn_graphicslineattributes_id id;
1014 
1015 public:
1016 
1017  // takes ownership of C handle, responsibility for destroying it
1018  explicit Graphicslineattributes(cmzn_graphicslineattributes_id line_attributes_id) :
1019  id(line_attributes_id)
1020  {}
1021 
1022  Graphicslineattributes(const Graphicslineattributes& lineAttributes) :
1023  id(cmzn_graphicslineattributes_access(lineAttributes.id))
1024  {}
1025 
1026  Graphicslineattributes& operator=(const Graphicslineattributes& graphicslineattributes)
1027  {
1028  cmzn_graphicslineattributes_id temp_id = cmzn_graphicslineattributes_access(graphicslineattributes.id);
1029  if (0 != id)
1030  cmzn_graphicslineattributes_destroy(&id);
1031  id = temp_id;
1032  return *this;
1033  }
1034 
1036  {
1037  cmzn_graphicslineattributes_destroy(&id);
1038  }
1039 
1045  bool isValid() const
1046  {
1047  return (0 != id);
1048  }
1049 
1054  {
1055  SHAPE_TYPE_INVALID = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_INVALID,
1057  SHAPE_TYPE_LINE = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_LINE,
1059  SHAPE_TYPE_RIBBON = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_RIBBON,
1061  SHAPE_TYPE_CIRCLE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_CIRCLE_EXTRUSION,
1063  SHAPE_TYPE_SQUARE_EXTRUSION = CMZN_GRAPHICSLINEATTRIBUTES_SHAPE_TYPE_SQUARE_EXTRUSION
1065  };
1066 
1078  int getBaseSize(int valuesCount, double *valuesOut)
1079  {
1080  return cmzn_graphicslineattributes_get_base_size(id, valuesCount, valuesOut);
1081  }
1082 
1101  int setBaseSize(int valuesCount, const double *valuesIn)
1102  {
1103  return cmzn_graphicslineattributes_set_base_size(id, valuesCount, valuesIn);
1104  }
1105 
1114  {
1115  return Field(cmzn_graphicslineattributes_get_orientation_scale_field(id));
1116  }
1117 
1128  int setOrientationScaleField(const Field& orientationScaleField)
1129  {
1130  return cmzn_graphicslineattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1131  }
1132 
1145  int getScaleFactors(int valuesCount, double *valuesOut)
1146  {
1147  return cmzn_graphicslineattributes_get_scale_factors(id, valuesCount, valuesOut);
1148  }
1149 
1169  int setScaleFactors(int valuesCount, const double *valuesIn)
1170  {
1171  return cmzn_graphicslineattributes_set_scale_factors(id, valuesCount, valuesIn);
1172  }
1173 
1181  {
1182  return static_cast<ShapeType>(cmzn_graphicslineattributes_get_shape_type(id));
1183  }
1184 
1196  int setShapeType(ShapeType shapeType)
1197  {
1198  return cmzn_graphicslineattributes_set_shape_type(id, static_cast<cmzn_graphicslineattributes_shape_type>(shapeType));
1199  }
1200 
1201 };
1202 
1204 {
1205  return Graphicslineattributes(cmzn_graphics_get_graphicslineattributes(id));
1206 }
1207 
1216 {
1217 protected:
1218  cmzn_graphicspointattributes_id id;
1219 
1220 public:
1221 
1222  // takes ownership of C handle, responsibility for destroying it
1223  explicit Graphicspointattributes(cmzn_graphicspointattributes_id point_attributes_id) :
1224  id(point_attributes_id)
1225  {}
1226 
1227  Graphicspointattributes(const Graphicspointattributes& pointAttributes) :
1228  id(cmzn_graphicspointattributes_access(pointAttributes.id))
1229  {}
1230 
1231  Graphicspointattributes& operator=(const Graphicspointattributes& graphicspointattributes)
1232  {
1233  cmzn_graphicspointattributes_id temp_id = cmzn_graphicspointattributes_access(graphicspointattributes.id);
1234  if (0 != id)
1235  cmzn_graphicspointattributes_destroy(&id);
1236  id = temp_id;
1237  return *this;
1238  }
1239 
1241  {
1242  cmzn_graphicspointattributes_destroy(&id);
1243  }
1244 
1250  bool isValid() const
1251  {
1252  return (0 != id);
1253  }
1254 
1266  int getBaseSize(int valuesCount, double *valuesOut)
1267  {
1268  return cmzn_graphicspointattributes_get_base_size(id, valuesCount, valuesOut);
1269  }
1270 
1289  int setBaseSize(int valuesCount, const double *valuesIn)
1290  {
1291  return cmzn_graphicspointattributes_set_base_size(id, valuesCount, valuesIn);
1292  }
1293 
1300  {
1301  return Font(cmzn_graphicspointattributes_get_font(id));
1302  }
1303 
1310  int setFont(const Font& font)
1311  {
1312  return cmzn_graphicspointattributes_set_font(id, font.getId());
1313  }
1314 
1321  {
1322  return Glyph(cmzn_graphicspointattributes_get_glyph(id));
1323  }
1324 
1331  int setGlyph(const Glyph& glyph)
1332  {
1333  return cmzn_graphicspointattributes_set_glyph(id, glyph.getId());
1334  }
1335 
1346  int getGlyphOffset(int valuesCount, double *valuesOut)
1347  {
1348  return cmzn_graphicspointattributes_get_glyph_offset(id, valuesCount, valuesOut);
1349  }
1350 
1363  int setGlyphOffset(int valuesCount, const double *valuesIn)
1364  {
1365  return cmzn_graphicspointattributes_set_glyph_offset(id, valuesCount, valuesIn);
1366  }
1367 
1368  Glyph::RepeatMode getGlyphRepeatMode()
1369  {
1370  return static_cast<Glyph::RepeatMode>(cmzn_graphicspointattributes_get_glyph_repeat_mode(id));
1371  }
1372 
1373  int setGlyphRepeatMode(Glyph::RepeatMode glyphRepeatMode)
1374  {
1375  return cmzn_graphicspointattributes_set_glyph_repeat_mode(id,
1376  static_cast<enum cmzn_glyph_repeat_mode>(glyphRepeatMode));
1377  }
1378 
1379  Glyph::ShapeType getGlyphShapeType()
1380  {
1381  return static_cast<Glyph::ShapeType>(cmzn_graphicspointattributes_get_glyph_shape_type(id));
1382  }
1383 
1384  int setGlyphShapeType(Glyph::ShapeType shapeType)
1385  {
1386  return cmzn_graphicspointattributes_set_glyph_shape_type(id,
1387  static_cast<cmzn_glyph_shape_type>(shapeType));
1388  }
1389 
1396  {
1397  return Field(cmzn_graphicspointattributes_get_label_field(id));
1398  }
1399 
1408  int setLabelField(const Field& labelField)
1409  {
1410  return cmzn_graphicspointattributes_set_label_field(id, labelField.getId());
1411  }
1412 
1422  int getLabelOffset(int valuesCount, double *valuesOut)
1423  {
1424  return cmzn_graphicspointattributes_get_label_offset(id, valuesCount, valuesOut);
1425  }
1426 
1437  int setLabelOffset(int valuesCount, const double *valuesIn)
1438  {
1439  return cmzn_graphicspointattributes_set_label_offset(id, valuesCount, valuesIn);
1440  }
1441 
1450  char *getLabelText(int labelNumber)
1451  {
1452  return cmzn_graphicspointattributes_get_label_text(id, labelNumber);
1453  }
1454 
1466  int setLabelText(int labelNumber, const char *labelText)
1467  {
1468  return cmzn_graphicspointattributes_set_label_text(id, labelNumber, labelText);
1469  }
1470 
1479  {
1480  return Field(cmzn_graphicspointattributes_get_orientation_scale_field(id));
1481  }
1482 
1510  int setOrientationScaleField(const Field& orientationScaleField)
1511  {
1512  return cmzn_graphicspointattributes_set_orientation_scale_field(id, orientationScaleField.getId());
1513  }
1514 
1527  int getScaleFactors(int valuesCount, double *valuesOut)
1528  {
1529  return cmzn_graphicspointattributes_get_scale_factors(id, valuesCount, valuesOut);
1530  }
1531 
1551  int setScaleFactors(int valuesCount, const double *valuesIn)
1552  {
1553  return cmzn_graphicspointattributes_set_scale_factors(id, valuesCount, valuesIn);
1554  }
1555 
1563  {
1564  return Field(cmzn_graphicspointattributes_get_signed_scale_field(id));
1565  }
1566 
1584  int setSignedScaleField(const Field& signedScaleField)
1585  {
1586  return cmzn_graphicspointattributes_set_signed_scale_field(id, signedScaleField.getId());
1587  }
1588 
1589 };
1590 
1592 {
1593  return Graphicspointattributes(cmzn_graphics_get_graphicspointattributes(id));
1594 }
1595 
1604 {
1605 protected:
1606  cmzn_graphicssamplingattributes_id id;
1607 
1608 public:
1609 
1610  // takes ownership of C handle, responsibility for destroying it
1611  explicit Graphicssamplingattributes(cmzn_graphicssamplingattributes_id sampling_attributes_id) :
1612  id(sampling_attributes_id)
1613  {}
1614 
1615  Graphicssamplingattributes(const Graphicssamplingattributes& samplingAttributes) :
1616  id(cmzn_graphicssamplingattributes_access(samplingAttributes.id))
1617  {}
1618 
1619  Graphicssamplingattributes& operator=(const Graphicssamplingattributes& graphicssamplingattributes)
1620  {
1621  cmzn_graphicssamplingattributes_id temp_id = cmzn_graphicssamplingattributes_access(graphicssamplingattributes.id);
1622  if (0 != id)
1623  cmzn_graphicssamplingattributes_destroy(&id);
1624  id = temp_id;
1625  return *this;
1626  }
1627 
1629  {
1630  cmzn_graphicssamplingattributes_destroy(&id);
1631  }
1632 
1638  bool isValid() const
1639  {
1640  return (0 != id);
1641  }
1642 
1650  {
1651  return Field(cmzn_graphicssamplingattributes_get_density_field(id));
1652  }
1653 
1663  int setDensityField(const Field& densityField)
1664  {
1665  return cmzn_graphicssamplingattributes_set_density_field(id, densityField.getId());
1666  }
1667 
1676  int getLocation(int valuesCount, double *valuesOut)
1677  {
1678  return cmzn_graphicssamplingattributes_get_location(id, valuesCount, valuesOut);
1679  }
1680 
1691  int setLocation(int valuesCount, const double *valuesIn)
1692  {
1693  return cmzn_graphicssamplingattributes_set_location(id, valuesCount, valuesIn);
1694  }
1695 
1696  Element::PointSamplingMode getElementPointSamplingMode()
1697  {
1698  return static_cast<Element::PointSamplingMode>(cmzn_graphicssamplingattributes_get_element_point_sampling_mode(id));
1699  }
1700 
1701  int setElementPointSamplingMode(Element::PointSamplingMode samplingMode)
1702  {
1703  return cmzn_graphicssamplingattributes_set_element_point_sampling_mode(id,
1704  static_cast<cmzn_element_point_sampling_mode>(samplingMode));
1705  }
1706 
1707 };
1708 
1710 {
1711  return Graphicssamplingattributes(cmzn_graphics_get_graphicssamplingattributes(id));
1712 }
1713 
1714 } // namespace Zinc
1715 }
1716 
1717 #endif
int setSignedScaleField(const Field &signedScaleField)
Definition: graphics.hpp:1584
int setListIsovalues(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:723
enum Scenecoordinatesystem getScenecoordinatesystem()
Definition: graphics.hpp:530
int setTextureCoordinateField(const Field &textureCoordinateField)
Definition: graphics.hpp:360
enum RenderPolygonMode getRenderPolygonMode()
Definition: graphics.hpp:262
Graphicspointattributes getGraphicspointattributes()
Definition: graphics.hpp:1591
int setShapeType(ShapeType shapeType)
Definition: graphics.hpp:1196
Attributes object specifying how lines are visualised.
Definition: graphics.hpp:1010
Lines visualise 1-D elements in the model.
Definition: graphics.hpp:796
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1527
int setRenderPolygonMode(RenderPolygonMode renderPolygonMode)
Definition: graphics.hpp:276
char * getLabelText(int labelNumber)
Definition: graphics.hpp:1450
cmzn_tessellation_id getId() const
Definition: tessellation.hpp:81
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1551
Field getOrientationScaleField()
Definition: graphics.hpp:1113
Surfaces visualise 2-D elements in the model.
Definition: graphics.hpp:964
int setVisibilityFlag(bool visibilityFlag)
Definition: graphics.hpp:520
int setTrackDirection(TrackDirection trackDirection)
Definition: graphics.hpp:927
int setMaterial(const Material &material)
Definition: graphics.hpp:381
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
int setName(const char *name)
Definition: graphics.hpp:578
int setGlyphOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1363
bool isValid() const
Definition: graphics.hpp:1250
Field getCoordinateField()
Definition: graphics.hpp:163
int getLocation(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1676
int setTessellation(const Tessellation &tessellation)
Definition: graphics.hpp:473
SelectMode
Definition: graphics.hpp:110
Scenecoordinatesystem
Definition: scenecoordinatesystem.hpp:26
int setLocation(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1691
bool isValid() const
Definition: graphics.hpp:1638
int getListIsovalues(int valuesCount, double *valuesOut)
Definition: graphics.hpp:710
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1510
int setSpectrum(const Spectrum &spectrum)
Definition: graphics.hpp:450
Material getSelectedMaterial()
Definition: graphics.hpp:418
Material getMaterial()
Definition: graphics.hpp:370
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:1045
int setRangeIsovalues(int numberOfValues, double firstIsovalue, double lastIsovalue)
Definition: graphics.hpp:779
Points graphics visualise discrete locations in the model.
Definition: graphics.hpp:823
double getRangeFirstIsovalue()
Definition: graphics.hpp:736
Field getDataField()
Definition: graphics.hpp:186
Definition: graphics.hpp:118
int setTrackLength(double length)
Definition: graphics.hpp:951
GraphicsContours castContours()
Definition: graphics.hpp:978
Definition: graphics.hpp:137
int setScenecoordinatesystem(Scenecoordinatesystem coordinateSystem)
Definition: graphics.hpp:542
int getScaleFactors(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1145
char * getName()
Definition: graphics.hpp:564
Field getStreamVectorField()
Definition: graphics.hpp:887
Field getLabelField()
Definition: graphics.hpp:1395
Base graphics type: produces 3-D graphics visualising domains and fields.
Definition: graphics.hpp:45
cmzn_spectrum_id getId() const
Definition: spectrum.hpp:638
Font getFont()
Definition: graphics.hpp:1299
Spectrum getSpectrum()
Definition: graphics.hpp:439
A glyph is a static graphics object used to visualise a point in space.
Definition: glyph.hpp:35
Definition: graphics.hpp:141
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1289
int setSelectedMaterial(const Material &material)
Definition: graphics.hpp:429
cmzn_field_id getId() const
Definition: field.hpp:98
double getRangeLastIsovalue()
Definition: graphics.hpp:749
ShapeType getShapeType()
Definition: graphics.hpp:1180
Zinc materials specify colouring of graphics.
Definition: material.hpp:29
TrackDirection getTrackDirection()
Definition: graphics.hpp:912
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1266
int setTessellationField(const Field &tessellationField)
Definition: graphics.hpp:498
int setBaseSize(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1101
int getRangeNumberOfIsovalues()
Definition: graphics.hpp:762
int setDataField(const Field &dataField)
Definition: graphics.hpp:197
RenderPolygonMode
Definition: graphics.hpp:95
DomainType
Definition: field.hpp:190
int setLabelField(const Field &labelField)
Definition: graphics.hpp:1408
int setSelectMode(SelectMode selectMode)
Definition: graphics.hpp:310
Field getSubgroupField()
Definition: graphics.hpp:320
GraphicsPoints castPoints()
Definition: graphics.hpp:988
bool isExterior()
Definition: graphics.hpp:598
ShapeType
Definition: graphics.hpp:1053
Zinc Spectrum maps values of graphics data fields to colours.
Definition: spectrum.hpp:581
int setRenderLineWidth(double width)
Definition: graphics.hpp:224
ShapeType
Definition: glyph.hpp:130
bool getVisibilityFlag()
Definition: graphics.hpp:508
int setOrientationScaleField(const Field &orientationScaleField)
Definition: graphics.hpp:1128
Field getTessellationField()
Definition: graphics.hpp:483
Graphicslineattributes getGraphicslineattributes()
Definition: graphics.hpp:1203
Attributes object specifying how points are visualised.
Definition: graphics.hpp:1215
The tessellation controls the number of polygons or line segments.
Definition: tessellation.hpp:28
int getBaseSize(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1078
int setFont(const Font &font)
Definition: graphics.hpp:1310
int setLabelText(int labelNumber, const char *labelText)
Definition: graphics.hpp:1466
cmzn_font_id getId() const
Definition: font.hpp:103
Graphicssamplingattributes getGraphicssamplingattributes()
Definition: graphics.hpp:1709
Glyph getGlyph()
Definition: graphics.hpp:1320
GraphicsLines castLines()
Definition: graphics.hpp:983
int setSubgroupField(const Field &subgroupField)
Definition: graphics.hpp:334
PointSamplingMode
Definition: element.hpp:329
GraphicsStreamlines castStreamlines()
Definition: graphics.hpp:993
Streamlines visualise the path of a fluid particle tracking along a vector field. ...
Definition: graphics.hpp:852
GraphicsSurfaces castSurfaces()
Definition: graphics.hpp:998
TrackDirection
Definition: graphics.hpp:871
int getLabelOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1422
int setRenderPointSize(double size)
Definition: graphics.hpp:251
int setExterior(bool exterior)
Definition: graphics.hpp:609
double getRenderPointSize()
Definition: graphics.hpp:235
int getGlyphOffset(int valuesCount, double *valuesOut)
Definition: graphics.hpp:1346
Definition: graphics.hpp:135
Type
Definition: graphics.hpp:131
int setScaleFactors(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1169
Field getOrientationScaleField()
Definition: graphics.hpp:1478
double getTrackLength()
Definition: graphics.hpp:938
enum SelectMode getSelectMode()
Definition: graphics.hpp:295
bool isValid() const
Definition: graphics.hpp:87
Field getDensityField()
Definition: graphics.hpp:1649
Field getTextureCoordinateField()
Definition: graphics.hpp:346
Field getSignedScaleField()
Definition: graphics.hpp:1562
Definition: graphics.hpp:139
cmzn_glyph_id getId() const
Definition: glyph.hpp:88
Graphics attributes object specifying how points are sampled in elements.
Definition: graphics.hpp:1603
int setLabelOffset(int valuesCount, const double *valuesIn)
Definition: graphics.hpp:1437
The contours derived graphics type.
Definition: graphics.hpp:663
int setCoordinateField(const Field &coordinateField)
Definition: graphics.hpp:176
Field getIsoscalarField()
Definition: graphics.hpp:681
FaceType
Definition: element.hpp:270
int setIsoscalarField(const Field &field)
Definition: graphics.hpp:693
Font object controlling attributes of rendering text.
Definition: font.hpp:26
Scene getScene()
Definition: scene.hpp:517
Tessellation getTessellation()
Definition: graphics.hpp:461
cmzn_graphics_id getId() const
Definition: graphics.hpp:153
Definition: graphics.hpp:133
int setGlyph(const Glyph &glyph)
Definition: graphics.hpp:1331
int setDensityField(const Field &densityField)
Definition: graphics.hpp:1663
double getRenderLineWidth()
Definition: graphics.hpp:208
int setStreamVectorField(const Field &field)
Definition: graphics.hpp:901