OpenCMISS-Zinc C++ API Documentation
streamscene.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_STREAMSCENE_HPP__
10 #define CMZN_STREAMSCENE_HPP__
11 
12 #include "opencmiss/zinc/streamscene.h"
13 #include "opencmiss/zinc/scene.hpp"
14 #include "opencmiss/zinc/stream.hpp"
15 #include "opencmiss/zinc/scenefilter.hpp"
16 
17 namespace OpenCMISS
18 {
19 namespace Zinc
20 {
21 
32 {
33 public:
35  { }
36 
37  // takes ownership of C handle, responsibility for destroying it
38  explicit StreaminformationScene(cmzn_streaminformation_scene_id streaminformation_scene_id) :
39  Streaminformation(reinterpret_cast<cmzn_streaminformation_id>(streaminformation_scene_id))
40  { }
41 
47  bool isValid() const
48  {
49  return (0 != id);
50  }
51 
57  cmzn_streaminformation_scene_id getDerivedId() const
58  {
59  return reinterpret_cast<cmzn_streaminformation_scene_id>(id);
60  }
61 
66  {
67  IO_DATA_TYPE_INVALID = CMZN_STREAMINFORMATION_SCENE_IO_DATA_TYPE_INVALID,
69  IO_DATA_TYPE_COLOUR = CMZN_STREAMINFORMATION_SCENE_IO_DATA_TYPE_COLOUR ,
71  IO_DATA_TYPE_PER_VERTEX_VALUE = CMZN_STREAMINFORMATION_SCENE_IO_DATA_TYPE_PER_VERTEX_VALUE,
73  IO_DATA_TYPE_PER_FACE_VALUE = CMZN_STREAMINFORMATION_SCENE_IO_DATA_TYPE_PER_FACE_VALUE
75  };
76 
81  enum IOFormat
82  {
83  IO_FORMAT_INVALID = CMZN_STREAMINFORMATION_SCENE_IO_FORMAT_INVALID,
85  IO_FORMAT_THREEJS = CMZN_STREAMINFORMATION_SCENE_IO_FORMAT_THREEJS,
87  IO_FORMAT_DESCRIPTION = CMZN_STREAMINFORMATION_SCENE_IO_FORMAT_DESCRIPTION
89  };
90 
97  {
98  return Scenefilter(cmzn_streaminformation_scene_get_scenefilter(getDerivedId()));
99  }
100 
108  int setScenefilter(const Scenefilter& scenefilter)
109  {
110  return cmzn_streaminformation_scene_set_scenefilter(getDerivedId(), scenefilter.getId());
111  }
112 
113  IODataType getIODataType()
114  {
115  return static_cast<IODataType>(cmzn_streaminformation_scene_get_io_data_type(getDerivedId()));
116  }
117 
118  int setIODataType(IODataType ioDataType)
119  {
120  return cmzn_streaminformation_scene_set_io_data_type(getDerivedId(),
121  static_cast<cmzn_streaminformation_scene_io_data_type>(ioDataType));
122  }
123 
124  IOFormat getIOFormat()
125  {
126  return static_cast<IOFormat>(cmzn_streaminformation_scene_get_io_format(getDerivedId()));
127  }
128 
129  int setIOFormat(IOFormat ioFormat)
130  {
131  return cmzn_streaminformation_scene_set_io_format(getDerivedId(),
132  static_cast<cmzn_streaminformation_scene_io_format>(ioFormat));
133  }
134 
141  {
142  return cmzn_streaminformation_scene_get_number_of_time_steps(getDerivedId());
143  }
144 
157  int setNumberOfTimeSteps(int numberOfTimeSteps)
158  {
159  return cmzn_streaminformation_scene_set_number_of_time_steps(getDerivedId(), numberOfTimeSteps);
160  }
161 
167  double getFinishTime()
168  {
169  return cmzn_streaminformation_scene_get_finish_time(getDerivedId());
170  }
171 
178  int setFinishTime(double finishTime)
179  {
180  return cmzn_streaminformation_scene_set_finish_time(getDerivedId(), finishTime);
181  }
182 
188  double getInitialTime()
189  {
190  return cmzn_streaminformation_scene_get_initial_time(getDerivedId());
191  }
192 
199  int setInitialTime(double initialTime)
200  {
201  return cmzn_streaminformation_scene_set_initial_time(getDerivedId(), initialTime);
202  }
203 
212  {
213  return cmzn_streaminformation_scene_get_number_of_resources_required(getDerivedId());
214  }
215 
223  int setOverwriteSceneGraphics(int overwrite)
224  {
225  return cmzn_streaminformation_scene_set_overwrite_scene_graphics(getDerivedId(),
226  overwrite);
227  }
228 
236  {
237  return cmzn_streaminformation_scene_get_output_time_dependent_vertices(getDerivedId());
238  }
239 
249  int setOutputTimeDependentVertices(int outputTimeDependentVertices)
250  {
251  return cmzn_streaminformation_scene_set_output_time_dependent_vertices(getDerivedId(),
252  outputTimeDependentVertices);
253  }
254 
262  {
263  return cmzn_streaminformation_scene_get_output_time_dependent_colours(getDerivedId());
264  }
265 
275  int setOutputTimeDependentColours(int outputTimeDependentColours)
276  {
277  return cmzn_streaminformation_scene_set_output_time_dependent_colours(getDerivedId(),
278  outputTimeDependentColours);
279  }
280 
288  {
289  return cmzn_streaminformation_scene_get_output_time_dependent_normals(getDerivedId());
290  }
291 
301  int setOutputTimeDependentNormals(int outputTimeDependentNormals)
302  {
303  return cmzn_streaminformation_scene_set_output_time_dependent_normals(getDerivedId(),
304  outputTimeDependentNormals);
305  }
306 };
307 
309 {
310  return StreaminformationScene(cmzn_streaminformation_cast_scene(id));
311 }
312 
314 {
315  return StreaminformationScene(reinterpret_cast<cmzn_streaminformation_scene_id>(
316  cmzn_scene_create_streaminformation_scene(id)));
317 }
318 
320 {
321  return cmzn_scene_write(id, StreaminformationScene.getDerivedId());
322 }
323 
325 {
326  return cmzn_scene_read(id, StreaminformationScene.getDerivedId());
327 }
328 
329 } // namespace Zinc
330 }
331 
332 #endif
cmzn_scenefilter_id getId() const
Definition: scenefilter.hpp:86
int setOutputTimeDependentColours(int outputTimeDependentColours)
Definition: streamscene.hpp:275
int setOutputTimeDependentNormals(int outputTimeDependentNormals)
Definition: streamscene.hpp:301
int getNumberOfResourcesRequired()
Definition: streamscene.hpp:211
double getFinishTime()
Definition: streamscene.hpp:167
int getNumberOfTimeSteps()
Definition: streamscene.hpp:140
Base type listing resources and options for stream I/O.
Definition: stream.hpp:213
int getOutputTimeDependentNormals()
Definition: streamscene.hpp:287
A scene-specific stream information object.
Definition: streamscene.hpp:31
int getOutputTimeDependentVertices()
Definition: streamscene.hpp:235
Scenefilter getScenefilter()
Definition: streamscene.hpp:96
bool isValid() const
Definition: streamscene.hpp:47
cmzn_streaminformation_scene_id getDerivedId() const
Definition: streamscene.hpp:57
double getInitialTime()
Definition: streamscene.hpp:188
int getOutputTimeDependentColours()
Definition: streamscene.hpp:261
int read(const StreaminformationScene &streaminformationScene)
Definition: streamscene.hpp:324
int setOverwriteSceneGraphics(int overwrite)
Definition: streamscene.hpp:223
int setInitialTime(double initialTime)
Definition: streamscene.hpp:199
int write(const StreaminformationScene &streaminformationScene)
Definition: streamscene.hpp:319
int setFinishTime(double finishTime)
Definition: streamscene.hpp:178
int setOutputTimeDependentVertices(int outputTimeDependentVertices)
Definition: streamscene.hpp:249
The OpenCMISS namespace.
Definition: context.hpp:20
StreaminformationScene createStreaminformationScene()
Definition: streamscene.hpp:313
Scene filters determines which graphics are drawn.
Definition: scenefilter.hpp:33
StreaminformationScene castScene()
Definition: streamscene.hpp:308
IODataType
Definition: streamscene.hpp:65
int setScenefilter(const Scenefilter &scenefilter)
Definition: streamscene.hpp:108
int setNumberOfTimeSteps(int numberOfTimeSteps)
Definition: streamscene.hpp:157
IOFormat
Definition: streamscene.hpp:81