1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
<!--
This example shows some possibilities of material configuration in the 3D scene:
- setting a material
- setting uniform parameters
-->
<plugin id="ex_material">
<requirement id="sight::module::service" />
<requirement id="sight::module::ui" />
<requirement id="sight::module::ui::qt" />
<requirement id="sight::module::viz::scene3d" />
<requirement id="sight::module::viz::scene3d_qt" />
<extension implements="sight::service::extension::config">
<id>vtk_srv_cfg</id>
<desc>VTK</desc>
<config>
<windowTitle>Open VTK file</windowTitle>
</config>
</extension>
<extension implements="sight::app::extension::config">
<id>ex_material_app_cfg</id>
<config>
<!-- ******************************* UI declaration *********************************** -->
<object uid="ghost_material_param" type="sight::data::dvec3" value="0.5;0.7;0.85" />
<!-- ******************************* Objects declaration ****************************** -->
<object uid="model_series" type="sight::data::model_series" />
<object uid="snapshot" type="sight::data::image" />
<!-- ******************************* UI declaration *********************************** -->
<service uid="main_frame" type="sight::module::ui::frame">
<gui>
<frame>
<name>ex_material</name>
<icon>ex_material/app.ico</icon>
<min_size width="720" height="480" />
</frame>
</gui>
<registry>
<view sid="main_view" />
</registry>
</service>
<!-- main view -->
<service uid="main_view" type="sight::module::ui::view">
<gui>
<layout type="sight::ui::layout::overlay">
<view />
<view x="1%" y="1%" />
<view x="0" y="-5%" width="100%" />
</layout>
</gui>
<registry>
<view sid="scene_srv" />
<view sid="toolbar_view" />
<view sid="progress_bar_view" />
</registry>
</service>
<service uid="toolbar_view" type="sight::module::ui::view">
<gui>
<toolbar background_color="#00000000" />
<layout type="sight::ui::layout::line">
<orientation value="vertical" />
</layout>
</gui>
<registry>
<toolbar sid="toolbar" />
</registry>
</service>
<service uid="toolbar" type="sight::module::ui::toolbar">
<gui>
<layout>
<menuItem name="Load a model series" icon="sight::module::ui::icons/model_series.svg" />
<menuItem name="Make a snapshot" icon="sight::module::ui::icons/frame.svg" />
</layout>
</gui>
<registry>
<menuItem sid="open_model_series_act" />
<menuItem sid="snapshot_act" />
</registry>
</service>
<!-- Status bar used to display the progress bar for reading -->
<service uid="progress_bar_view" type="sight::module::ui::qt::progress_bar" />
<!-- *************************** Begin generic scene *************************** -->
<!-- This scene display a 3D image and a textured model_series -->
<service uid="scene_srv" type="sight::viz::scene3d::render">
<scene>
<background topColor="#2c3c5c" bottomColor="#191234" topScale="0.6" bottomScale="1.0" />
<layer id="default" transparency="DepthPeeling">
<adaptor uid="trackball_interactor_adp" />
<adaptor uid="model_series_adp" />
<adaptor uid="snapshot_adp" />
</layer>
</scene>
</service>
<service uid="trackball_interactor_adp" type="sight::module::viz::scene3d::adaptor::trackball_camera">
<config priority="0" />
</service>
<service uid="model_series_adp" type="sight::module::viz::scene3d::adaptor::model_series">
<in key="model" uid="model_series" />
<inout group="uniforms">
<key uid="ghost_material_param" name="u_rim_params" />
</inout>
<config material_template="Ghost" />
</service>
<service uid="snapshot_adp" type="sight::module::viz::scene3d::adaptor::fragments_info">
<inout key="image" uid="snapshot" />
</service>
<!-- ******************************* Actions ****************************************** -->
<service uid="open_model_series_act" type="sight::module::ui::action" />
<service uid="snapshot_act" type="sight::module::ui::action" />
<!-- ******************************* Services ***************************************** -->
<!-- model_series reader -->
<service uid="model_series_reader_srv" type="sight::module::ui::io::selector">
<inout key="data" uid="model_series" />
<type mode="reader" />
<config id="vtk_srv_cfg" service="sight::module::io::vtk::model_series_reader" />
</service>
<!-- Write the snapshot image -->
<service uid="image_writer_srv" type="sight::module::io::bitmap::writer">
<in key="data" uid="snapshot" />
<dialog policy="always" />
<backends enable="all" mode="best" />
</service>
<!-- ******************************* Connections ***************************************** -->
<!-- Connects readers to status bar service -->
<connect>
<signal>model_series_reader_srv/monitor_created</signal>
<slot>progress_bar_view/add_monitor</slot>
</connect>
<connect>
<signal>snapshot_act/clicked</signal>
<slot>image_writer_srv/update</slot>
</connect>
<connect>
<signal>open_model_series_act/clicked</signal>
<slot>model_series_reader_srv/update</slot>
</connect>
</config>
</extension>
</plugin>
|