9 #ifndef CMZN_SCENEVIEWER_HPP__ 10 #define CMZN_SCENEVIEWER_HPP__ 12 #include "opencmiss/zinc/sceneviewer.h" 13 #include "opencmiss/zinc/context.hpp" 14 #include "opencmiss/zinc/light.hpp" 15 #include "opencmiss/zinc/scene.hpp" 16 #include "opencmiss/zinc/scenefilter.hpp" 23 class Sceneviewerinput;
34 cmzn_sceneviewerevent_id id;
42 explicit Sceneviewerevent(cmzn_sceneviewerevent_id in_sceneviewer_event_id) :
43 id(in_sceneviewer_event_id)
47 id(cmzn_sceneviewerevent_access(sceneviewerEvent.id))
73 cmzn_sceneviewerevent_id temp_id = cmzn_sceneviewerevent_access(sceneviewerEvent.id);
76 cmzn_sceneviewerevent_destroy(&
id);
86 cmzn_sceneviewerevent_destroy(&
id);
105 cmzn_sceneviewerevent_id
getId()
const 119 return static_cast<ChangeFlag>(cmzn_sceneviewerevent_get_change_flags(
id));
139 static void C_callback(cmzn_sceneviewerevent_id sceneviewerevent_id,
void *callbackVoid)
141 Sceneviewerevent sceneviewerevent(cmzn_sceneviewerevent_access(sceneviewerevent_id));
143 (*callback)(sceneviewerevent);
165 cmzn_sceneviewernotifier_id id;
174 id(in_sceneviewernotifier_id)
178 id(cmzn_sceneviewernotifier_access(sceneviewerNotifier.id))
183 cmzn_sceneviewernotifier_id temp_id = cmzn_sceneviewernotifier_access(sceneviewerNotifier.id);
186 cmzn_sceneviewernotifier_destroy(&
id);
196 cmzn_sceneviewernotifier_destroy(&
id);
215 cmzn_sceneviewernotifier_id
getId()
const 232 return cmzn_sceneviewernotifier_set_callback(
233 id, callback.C_callback, static_cast<void*>(&callback));
244 return cmzn_sceneviewernotifier_clear_callback(
id);
263 cmzn_sceneviewer_id id;
280 BUFFERING_MODE_INVALID = CMZN_SCENEVIEWER_BUFFERING_MODE_INVALID,
282 BUFFERING_MODE_DEFAULT = CMZN_SCENEVIEWER_BUFFERING_MODE_DEFAULT,
285 BUFFERING_MODE_SINGLE = CMZN_SCENEVIEWER_BUFFERING_MODE_SINGLE,
288 BUFFERING_MODE_DOUBLE = CMZN_SCENEVIEWER_BUFFERING_MODE_DOUBLE,
291 BUFFERING_MODE_RENDER_OFFSCREEN_AND_COPY = CMZN_SCENEVIEWER_BUFFERING_MODE_RENDER_OFFSCREEN_AND_COPY,
298 BUFFERING_MODE_RENDER_OFFSCREEN_AND_BLEND = CMZN_SCENEVIEWER_BUFFERING_MODE_RENDER_OFFSCREEN_AND_BLEND
310 INTERACT_MODE_INVALID = CMZN_SCENEVIEWER_INTERACT_MODE_INVALID,
312 INTERACT_MODE_STANDARD = CMZN_SCENEVIEWER_INTERACT_MODE_STANDARD,
317 INTERACT_MODE_2D = CMZN_SCENEVIEWER_INTERACT_MODE_2D
329 PROJECTION_MODE_INVALID = CMZN_SCENEVIEWER_PROJECTION_MODE_INVALID,
331 PROJECTION_MODE_PARALLEL = CMZN_SCENEVIEWER_PROJECTION_MODE_PARALLEL,
333 PROJECTION_MODE_PERSPECTIVE = CMZN_SCENEVIEWER_PROJECTION_MODE_PERSPECTIVE
343 STEREO_MODE_INVALID = CMZN_SCENEVIEWER_STEREO_MODE_INVALID,
345 STEREO_MODE_DEFAULT = CMZN_SCENEVIEWER_STEREO_MODE_DEFAULT,
347 STEREO_MODE_MONO = CMZN_SCENEVIEWER_STEREO_MODE_MONO,
349 STEREO_MODE_STEREO = CMZN_SCENEVIEWER_STEREO_MODE_STEREO
358 TRANSPARENCY_MODE_INVALID = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_INVALID,
360 TRANSPARENCY_MODE_FAST = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_FAST,
365 TRANSPARENCY_MODE_SLOW = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_SLOW,
373 TRANSPARENCY_MODE_ORDER_INDEPENDENT = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_ORDER_INDEPENDENT
389 VIEWPORT_MODE_INVALID = CMZN_SCENEVIEWER_VIEWPORT_MODE_INVALID,
391 VIEWPORT_MODE_ABSOLUTE = CMZN_SCENEVIEWER_VIEWPORT_MODE_ABSOLUTE,
394 VIEWPORT_MODE_RELATIVE = CMZN_SCENEVIEWER_VIEWPORT_MODE_RELATIVE,
397 VIEWPORT_MODE_DISTORTING_RELATIVE = CMZN_SCENEVIEWER_VIEWPORT_MODE_DISTORTING_RELATIVE
406 explicit Sceneviewer(cmzn_sceneviewer_id in_sceneviewer_id) :
407 id(in_sceneviewer_id)
411 id(cmzn_sceneviewer_access(sceneviewermodule.id))
416 cmzn_sceneviewer_id temp_id = cmzn_sceneviewer_access(sceneviewer.id);
419 cmzn_sceneviewer_destroy(&
id);
429 cmzn_sceneviewer_destroy(&
id);
464 return cmzn_sceneviewer_begin_change(
id);
479 return cmzn_sceneviewer_end_change(
id);
487 return cmzn_sceneviewer_render_scene(
id);
500 return cmzn_sceneviewer_set_scene(
id, scene.
getId());
510 return Scene(cmzn_sceneviewer_get_scene(
id));
523 return cmzn_sceneviewer_set_scenefilter(
id, scenefilter.
getId());
533 return Scenefilter(cmzn_sceneviewer_get_scenefilter(
id));
541 return cmzn_sceneviewer_set_viewport_size(
id, width, height);
569 return cmzn_sceneviewer_get_antialias_sampling(
id);
581 return cmzn_sceneviewer_set_antialias_sampling(
id, numberOfSamples);
591 return cmzn_sceneviewer_get_background_colour_alpha(
id);
604 return cmzn_sceneviewer_set_background_colour_alpha(
id, alpha);
618 return cmzn_sceneviewer_set_background_colour_component_rgb(
id, red, green, blue);
621 int setBackgroundColourComponentRGBA(
double red,
double green,
double blue,
double alpha)
623 return cmzn_sceneviewer_set_background_colour_component_rgba(
id, red, green, blue, alpha);
635 return cmzn_sceneviewer_get_background_colour_rgb(
id, valuesOut3);
647 return cmzn_sceneviewer_set_background_colour_rgb(
id, valuesIn3);
650 int getBackgroundColourRGBA(
double *valuesOut4)
652 return cmzn_sceneviewer_get_background_colour_rgba(
id, valuesOut4);
655 int setBackgroundColourRGBA(
const double *valuesIn4)
657 return cmzn_sceneviewer_set_background_colour_rgba(
id, valuesIn4);
668 return cmzn_sceneviewer_get_eye_position(
id, eyeValuesOut3);
679 return cmzn_sceneviewer_set_eye_position(
id, eyeValuesIn3);
690 return static_cast<InteractMode>(cmzn_sceneviewer_get_interact_mode(
id));
701 return cmzn_sceneviewer_set_interact_mode(
id,
702 static_cast<cmzn_sceneviewer_interact_mode>(interactMode));
713 return cmzn_sceneviewer_get_lookat_position(
id, lookatValuesOut3);
724 return cmzn_sceneviewer_set_lookat_position(
id, lookatValuesIn3);
735 return cmzn_sceneviewer_get_perturb_lines_flag(
id);
748 return cmzn_sceneviewer_set_perturb_lines_flag(
id, value);
758 return static_cast<ProjectionMode>(cmzn_sceneviewer_get_projection_mode(
id));
769 return cmzn_sceneviewer_set_projection_mode(
id,
770 static_cast<cmzn_sceneviewer_projection_mode>(projectionMode));
781 return cmzn_sceneviewer_get_translation_rate(
id);
793 return cmzn_sceneviewer_set_translation_rate(
id, translationRate);
804 return cmzn_sceneviewer_get_tumble_rate(
id);
816 return cmzn_sceneviewer_set_tumble_rate(
id, tumbleRate);
827 return cmzn_sceneviewer_get_zoom_rate(
id);
839 return cmzn_sceneviewer_set_zoom_rate(
id, zoomRate);
850 return cmzn_sceneviewer_get_up_vector(
id, upVectorValuesOut3);
862 return cmzn_sceneviewer_set_up_vector(
id, upVectorValuesIn3);
879 return cmzn_sceneviewer_get_lookat_parameters(
id,
880 eyeValuesOut3, lookatValuesOut3, upVectorValuesOut3);
900 return cmzn_sceneviewer_set_lookat_parameters_non_skew(
id,
901 eyeValuesIn3, lookatValuesIn3, upVectorValuesIn3);
908 double *near_plane,
double *far_plane)
910 return cmzn_sceneviewer_get_viewing_volume(
id, left, right, bottom, top,
911 near_plane, far_plane);
925 double near_plane,
double far_plane)
927 return cmzn_sceneviewer_set_viewing_volume(
id, left, right, bottom, top,
928 near_plane, far_plane);
939 return cmzn_sceneviewer_view_all(
id);
959 return static_cast<TransparencyMode>(cmzn_sceneviewer_get_transparency_mode(
id));
975 return cmzn_sceneviewer_set_transparency_mode(
id,
976 static_cast<cmzn_sceneviewer_transparency_mode>(transparencyMode));
989 return cmzn_sceneviewer_get_transparency_layers(
id);
1004 return cmzn_sceneviewer_set_transparency_layers(
id, layers);
1016 return cmzn_sceneviewer_get_view_angle(
id);
1029 return cmzn_sceneviewer_set_view_angle(
id, viewAngle);
1040 return static_cast<ViewportMode>(cmzn_sceneviewer_get_viewport_mode(
id));
1051 return cmzn_sceneviewer_set_viewport_mode(
id,
1052 static_cast<cmzn_sceneviewer_viewport_mode>(viewportMode));
1063 return cmzn_sceneviewer_get_far_clipping_plane(
id);
1074 return cmzn_sceneviewer_get_near_clipping_plane(
id);
1085 return cmzn_sceneviewer_set_far_clipping_plane(
id, farClippingPlane);
1096 return cmzn_sceneviewer_set_near_clipping_plane(
id, nearClippingPlane);
1107 int preferred_height,
int preferred_antialias,
int preferred_transparency_layers)
1109 return cmzn_sceneviewer_write_image_to_file(
id, file_name, force_onscreen, preferred_width,
1110 preferred_height, preferred_antialias, preferred_transparency_layers);
1121 return cmzn_sceneviewer_add_light(
id, light.
getId());
1132 return cmzn_sceneviewer_has_light(
id, light.
getId());
1143 return cmzn_sceneviewer_remove_light(
id, light.
getId());
1155 return cmzn_sceneviewer_is_lighting_local_viewer(this->
id);
1174 return cmzn_sceneviewer_set_lighting_local_viewer(this->
id, value);
1185 return cmzn_sceneviewer_is_lighting_two_sided(this->
id);
1204 return cmzn_sceneviewer_set_lighting_two_sided(this->
id, value);
1223 const double *valuesIn3,
double *valuesOut3)
1225 return cmzn_sceneviewer_transform_coordinates(
id,
1226 static_cast<cmzn_scenecoordinatesystem>(inCoordinateSystem),
1227 static_cast<cmzn_scenecoordinatesystem>(outCoordinateSystem),
1228 localScene.
getId(), valuesIn3, valuesOut3);
1240 return cmzn_sceneviewer_read_description(this->
id, description);
1251 return cmzn_sceneviewer_write_description(this->
id);
1274 cmzn_sceneviewermodule_id id;
1283 id(in_sceneviewermodule_id)
1287 id(cmzn_sceneviewermodule_access(sceneviewermodule.id))
1292 cmzn_sceneviewermodule_id temp_id = cmzn_sceneviewermodule_access(sceneviewermodule.id);
1295 cmzn_sceneviewermodule_destroy(&
id);
1305 cmzn_sceneviewermodule_destroy(&
id);
1339 return Sceneviewer(cmzn_sceneviewermodule_create_sceneviewer(
id,
1340 static_cast<cmzn_sceneviewer_buffering_mode>(buffering_mode),
1341 static_cast<cmzn_sceneviewer_stereo_mode>(stereo_mode)));
1353 return cmzn_sceneviewermodule_get_default_background_colour_alpha(
id);
1367 return cmzn_sceneviewermodule_set_default_background_colour_alpha(
id, alpha);
1381 return cmzn_sceneviewermodule_get_default_background_colour_rgb(
id, valuesOut3);
1394 return cmzn_sceneviewermodule_set_default_background_colour_rgb(
id, valuesIn3);
1397 int getDefaultBackgroundColourRGBA(
double *valuesOut4)
1399 return cmzn_sceneviewermodule_get_default_background_colour_rgba(
id, valuesOut4);
1402 int setDefaultBackgroundColourRGBA(
const double *valuesIn4)
1404 return cmzn_sceneviewermodule_set_default_background_colour_rgba(
id, valuesIn4);
Scenefilter getScenefilter()
Definition: sceneviewer.hpp:531
cmzn_sceneviewer_id getId() const
Definition: sceneviewer.hpp:448
bool isValid() const
Definition: sceneviewer.hpp:95
int setFarClippingPlane(double farClippingPlane)
Definition: sceneviewer.hpp:1083
double getViewAngle()
Definition: sceneviewer.hpp:1014
int setScene(const Scene &scene)
Definition: sceneviewer.hpp:498
int setLookatParametersNonSkew(const double *eyeValuesIn3, const double *lookatValuesIn3, const double *upVectorValuesIn3)
Definition: sceneviewer.hpp:898
int removeLight(const Light &light)
Definition: sceneviewer.hpp:1141
cmzn_scenefilter_id getId() const
Definition: scenefilter.hpp:86
int setViewportMode(ViewportMode viewportMode)
Definition: sceneviewer.hpp:1049
int ChangeFlags
Definition: sceneviewer.hpp:69
TransparencyMode getTransparencyMode()
Definition: sceneviewer.hpp:957
int setAntialiasSampling(int numberOfSamples)
Definition: sceneviewer.hpp:579
Definition: sceneviewer.hpp:61
int renderScene()
Definition: sceneviewer.hpp:485
int endChange()
Definition: sceneviewer.hpp:477
Scenecoordinatesystem
Definition: scenecoordinatesystem.hpp:26
double getDefaultBackgroundColourAlpha()
Definition: sceneviewer.hpp:1351
int setDefaultBackgroundColourAlpha(const double alpha)
Definition: sceneviewer.hpp:1365
bool hasLight(const Light &light)
Definition: sceneviewer.hpp:1130
Container/manager for graphics visualising a region.
Definition: scene.hpp:38
The light controls how vertices will be lit on a sceneviewer.
Definition: light.hpp:28
TransparencyMode
Definition: sceneviewer.hpp:356
int setBackgroundColourAlpha(const double alpha)
Definition: sceneviewer.hpp:602
int writeImageToFile(const char *file_name, int force_onscreen, int preferred_width, int preferred_height, int preferred_antialias, int preferred_transparency_layers)
Definition: sceneviewer.hpp:1106
int readDescription(const char *description)
Definition: sceneviewer.hpp:1238
int setLightingLocalViewer(bool value)
Definition: sceneviewer.hpp:1172
int setTumbleRate(double tumbleRate)
Definition: sceneviewer.hpp:814
bool isValid() const
Definition: sceneviewer.hpp:438
int setProjectionMode(ProjectionMode projectionMode)
Definition: sceneviewer.hpp:767
int setDefaultBackgroundColourRGB(const double *valuesIn3)
Definition: sceneviewer.hpp:1392
double getBackgroundColourAlpha()
Definition: sceneviewer.hpp:589
Definition: sceneviewer.hpp:55
ViewportMode
Definition: sceneviewer.hpp:387
int setTransparencyMode(TransparencyMode transparencyMode)
Definition: sceneviewer.hpp:973
bool isValid() const
Definition: sceneviewer.hpp:1314
int setViewportSize(int width, int height)
Definition: sceneviewer.hpp:539
int getLookatParameters(double *eyeValuesOut3, double *lookatValuesOut3, double *upVectorValuesOut3)
Definition: sceneviewer.hpp:877
int viewAll()
Definition: sceneviewer.hpp:937
int setInteractMode(InteractMode interactMode)
Definition: sceneviewer.hpp:699
double getNearClippingPlane()
Definition: sceneviewer.hpp:1072
int transformCoordinates(Scenecoordinatesystem inCoordinateSystem, Scenecoordinatesystem outCoordinateSystem, const Scene &localScene, const double *valuesIn3, double *valuesOut3)
Definition: sceneviewer.hpp:1221
cmzn_light_id getId() const
Definition: light.hpp:102
int setViewAngle(double viewAngle)
Definition: sceneviewer.hpp:1027
Sceneviewer createSceneviewer(Sceneviewer::BufferingMode buffering_mode, Sceneviewer::StereoMode stereo_mode)
Definition: sceneviewer.hpp:1337
int setUpVector(const double *upVectorValuesIn3)
Definition: sceneviewer.hpp:860
int clearCallback()
Definition: sceneviewer.hpp:242
cmzn_sceneviewerevent_id getId() const
Definition: sceneviewer.hpp:105
int setBackgroundColourComponentRGB(double red, double green, double blue)
Definition: sceneviewer.hpp:616
BufferingMode
Definition: sceneviewer.hpp:278
ViewportMode getViewportMode()
Definition: sceneviewer.hpp:1038
Module object for creating and managing scene viewers.
Definition: sceneviewer.hpp:1271
int beginChange()
Definition: sceneviewer.hpp:462
StereoMode
Definition: sceneviewer.hpp:341
Sceneviewermodule getSceneviewermodule()
Definition: sceneviewer.hpp:1409
Sceneviewernotifier createSceneviewernotifier()
Definition: sceneviewer.hpp:1259
cmzn_scene_id getId() const
Definition: scene.hpp:90
int setTransparencyLayers(int layers)
Definition: sceneviewer.hpp:1002
int getAntialiasSampling()
Definition: sceneviewer.hpp:567
int setViewingVolume(double left, double right, double bottom, double top, double near_plane, double far_plane)
Definition: sceneviewer.hpp:924
int setPerturbLinesFlag(bool value)
Definition: sceneviewer.hpp:746
ProjectionMode getProjectionMode()
Definition: sceneviewer.hpp:756
ProjectionMode
Definition: sceneviewer.hpp:327
cmzn_sceneviewernotifier_id getId() const
Definition: sceneviewer.hpp:215
int getViewingVolume(double *left, double *right, double *bottom, double *top, double *near_plane, double *far_plane)
Definition: sceneviewer.hpp:907
Definition: sceneviewer.hpp:57
char * writeDescription()
Definition: sceneviewer.hpp:1249
Sceneviewermodule getSceneviewermodule()
Definition: sceneviewer.hpp:1414
ChangeFlag
Definition: sceneviewer.hpp:53
int setZoomRate(double zoomRate)
Definition: sceneviewer.hpp:837
Scene getScene()
Definition: sceneviewer.hpp:508
int setCallback(Sceneviewercallback &callback)
Definition: sceneviewer.hpp:230
int setTranslationRate(double translationRate)
Definition: sceneviewer.hpp:791
bool isLightingTwoSided()
Definition: sceneviewer.hpp:1183
double getTumbleRate()
Definition: sceneviewer.hpp:802
int setNearClippingPlane(double nearClippingPlane)
Definition: sceneviewer.hpp:1094
int setEyePosition(const double *eyeValuesIn3)
Definition: sceneviewer.hpp:677
Manages individual user notification of changes with a scene viewer.
Definition: sceneviewer.hpp:162
int getTransparencyLayers()
Definition: sceneviewer.hpp:987
int setLookatPosition(const double *lookatValuesIn3)
Definition: sceneviewer.hpp:722
double getTranslationRate()
Definition: sceneviewer.hpp:779
cmzn_sceneviewermodule_id getId() const
Definition: sceneviewer.hpp:1324
ChangeFlags getChangeFlags() const
Definition: sceneviewer.hpp:117
int getUpVector(double *upVectorValuesOut3)
Definition: sceneviewer.hpp:848
bool isValid() const
Definition: sceneviewer.hpp:205
int addLight(const Light &light)
Definition: sceneviewer.hpp:1119
InteractMode
Definition: sceneviewer.hpp:308
Definition: sceneviewer.hpp:59
double getZoomRate()
Definition: sceneviewer.hpp:825
int getLookatPosition(double *lookatValuesOut3)
Definition: sceneviewer.hpp:711
bool isLightingLocalViewer()
Definition: sceneviewer.hpp:1153
The OpenCMISS namespace.
Definition: context.hpp:20
Scene filters determines which graphics are drawn.
Definition: scenefilter.hpp:33
int setLightingTwoSided(bool value)
Definition: sceneviewer.hpp:1202
Information about changes to fields and other objects in the scene viewer.
Definition: sceneviewer.hpp:31
double getFarClippingPlane()
Definition: sceneviewer.hpp:1061
The Zinc sceneviewer is responsible for rendering the graphical Scene.
Definition: sceneviewer.hpp:260
bool getPerturbLinesFlag()
Definition: sceneviewer.hpp:733
int setBackgroundColourRGB(const double *valuesIn3)
Definition: sceneviewer.hpp:645
Base class functor for Sceneviewer notifier callbacks:
Definition: sceneviewer.hpp:132
int getDefaultBackgroundColourRGB(double *valuesOut3)
Definition: sceneviewer.hpp:1379
int getBackgroundColourRGB(double *valuesOut3)
Definition: sceneviewer.hpp:633
InteractMode getInteractMode()
Definition: sceneviewer.hpp:688
int setScenefilter(const Scenefilter &scenefilter)
Definition: sceneviewer.hpp:521
int getEyePosition(double *eyeValuesOut3)
Definition: sceneviewer.hpp:666