Changeset - dcd49517f90b
[Not reviewed]
default
0 5 0
Roeland Merks - 15 years ago 2010-11-29 11:48:52
roeland.merks@cwi.nl
Two last corrections:
- Viewport was not written during automatic export of XML files, because Virtualization of XMLSettingsTree did not work due to inconsistent function definition (const vs. non-const)
- Some of the default parameter-file had "Start saving movie frames" switched on by default, dramatically slowing down the example runs. Now it is switched off in all example XML files.

user: Roeland Merks <roeland.merks@cwi.nl>
branch 'default'
changed data/leaves/auxin_growth.xml
changed data/leaves/tutorial5_init.xml
changed src/VirtualLeaf.cpp
changed src/mainbase.cpp
changed src/mainbase.h
5 files changed with 16 insertions and 16 deletions:
0 comments (0 inline, 0 general)
data/leaves/auxin_growth.xml
Show inline comments
 
<?xml version="1.0" encoding="UTF-8"?>
 
<leaf name="/ufs/merks/VLeaf1.0/V1.0/data/leaves/auxin_growth.xml" date="Thu Nov 25 13:13:31 2010" simtime="11660">
 
<leaf name="/ufs/merks/VLeaf1.0/V1.0/data/leaves/auxin_growth.xml" date="Mon Nov 29 11:43:46 2010" simtime="11660">
 
  <parameter>
 
    <par name="arrowcolor" val="white"/>
 
    <par name="arrowsize" val="10"/>
 
    <par name="textcolor" val="red"/>
 
    <par name="cellnumsize" val="1"/>
 
    <par name="nodenumsize" val="1"/>
 
    <par name="node_mag" val="1"/>
 
    <par name="outlinewidth" val="1"/>
 
    <par name="cell_outline_color" val="forestgreen"/>
 
    <par name="resize_stride" val="10"/>
 
    <par name="export_interval" val="0"/>
 
    <par name="export_fn_prefix" val="cell."/>
 
    <par name="storage_stride" val="100"/>
 
    <par name="xml_storage_stride" val="500"/>
 
    <par name="datadir" val="auxin_growth"/>
 
    <par name="T" val="1"/>
 
    <par name="lambda_length" val="100"/>
 
    <par name="yielding_threshold" val="4"/>
 
    <par name="lambda_celllength" val="0"/>
 
    <par name="target_length" val="60"/>
 
    <par name="cell_expansion_rate" val="10"/>
 
    <par name="cell_div_expansion_rate" val="10"/>
 
    <par name="auxin_dependent_growth" val="true"/>
 
    <par name="ode_accuracy" val="0.0001"/>
 
    <par name="mc_stepsize" val="0.4"/>
 
    <par name="mc_cell_stepsize" val="0.2"/>
 
    <par name="energy_threshold" val="1000"/>
 
    <par name="bend_lambda" val="0"/>
 
    <par name="alignment_lambda" val="0"/>
 
    <par name="rel_cell_div_threshold" val="2"/>
 
    <par name="rel_perimeter_stiffness" val="2"/>
 
    <par name="collapse_node_threshold" val="0.05"/>
 
    <par name="morphogen_div_threshold" val="0.2"/>
 
    <par name="morphogen_expansion_threshold" val="0.01"/>
 
    <par name="copy_wall" val="true"/>
 
    <par name="source" val="0"/>
 
    <par name="D">
 
      <valarray>
 
        <val v="1e-06"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </valarray>
 
    </par>
 
    <par name="initval">
 
      <valarray>
 
        <val v="0"/>
 
        <val v="1"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </valarray>
 
    </par>
 
    <par name="k1" val="1"/>
 
    <par name="k2" val="0.3"/>
 
    <par name="r" val="1"/>
 
    <par name="kr" val="1"/>
 
    <par name="km" val="1"/>
 
    <par name="Pi_tot" val="1"/>
 
    <par name="transport" val="0.36"/>
 
    <par name="ka" val="1"/>
 
    <par name="pin_prod" val="0"/>
 
    <par name="pin_prod_in_epidermis" val="0"/>
 
    <par name="pin_breakdown" val="0"/>
 
    <par name="pin_breakdown_internal" val="0.001"/>
 
    <par name="aux1prod" val="0.001"/>
 
    <par name="aux1prodmeso" val="0"/>
 
    <par name="aux1decay" val="0.001"/>
 
    <par name="aux1decaymeso" val="0.1"/>
 
    <par name="aux1transport" val="0.036"/>
 
    <par name="aux_cons" val="0"/>
 
    <par name="aux_breakdown" val="0.0001"/>
 
    <par name="kaux1" val="1"/>
 
    <par name="kap" val="1"/>
 
    <par name="leaf_tip_source" val="0.0001"/>
 
    <par name="sam_efflux" val="0.0001"/>
 
    <par name="sam_auxin" val="10"/>
 
    <par name="sam_auxin_breakdown" val="0"/>
 
    <par name="van3prod" val="0.002"/>
 
    <par name="van3autokat" val="0.1"/>
 
    <par name="van3sat" val="10"/>
 
    <par name="k2van3" val="0.3"/>
 
    <par name="dt" val="0.1"/>
 
    <par name="rd_dt" val="10"/>
 
    <par name="datadir" val="auxin_growth"/>
 
    <par name="movie" val="true"/>
 
    <par name="nit" val="100000"/>
 
    <par name="maxt" val="1e+06"/>
 
    <par name="rseed" val="-1"/>
 
    <par name="constituous_expansion_limit" val="16"/>
 
    <par name="vessel_inh_level" val="1"/>
 
    <par name="vessel_expansion_rate" val="0.25"/>
 
    <par name="d" val="0"/>
 
    <par name="e" val="0"/>
 
    <par name="f" val="0"/>
 
    <par name="c" val="0"/>
 
    <par name="mu" val="0"/>
 
    <par name="nu" val="0"/>
 
    <par name="rho0" val="0"/>
 
    <par name="rho1" val="0"/>
 
    <par name="c0" val="0"/>
 
    <par name="gamma" val="0"/>
 
    <par name="eps" val="0"/>
 
    <par name="k">
 
      <valarray>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </valarray>
 
    </par>
 
    <par name="i1" val="0"/>
 
    <par name="i2" val="0"/>
 
    <par name="i3" val="0"/>
 
    <par name="i4" val="0"/>
 
    <par name="i5" val="0"/>
 
    <par name="s1" val=""/>
 
    <par name="s2" val=""/>
 
    <par name="s3" val=""/>
 
    <par name="b1" val="false"/>
 
    <par name="b2" val="false"/>
 
    <par name="b3" val="false"/>
 
    <par name="b4" val="false"/>
 
    <par name="dir1" val="."/>
 
    <par name="dir2" val="."/>
 
  </parameter>
 
  <nodes n="22" target_length="3.09017">
 
    <node x="22.9634" y="-2.37264" fixed="false" boundary="true" sam="false"/>
 
    <node x="14.6882" y="17.9118" fixed="false" boundary="true" sam="false"/>
 
    <node x="1.57936" y="25.1246" fixed="false" boundary="true" sam="false"/>
 
    <node x="-9.0893" y="22.8165" fixed="false" boundary="true" sam="false"/>
 
    <node x="-19.7055" y="16.962" fixed="false" boundary="true" sam="false"/>
 
    <node x="-22.6839" y="5.00143" fixed="false" boundary="true" sam="false"/>
 
    <node x="-14.7271" y="-15.2131" fixed="false" boundary="true" sam="false"/>
 
    <node x="-6.78413" y="-23.4002" fixed="false" boundary="true" sam="false"/>
 
    <node x="3.60766" y="-25.1355" fixed="false" boundary="true" sam="false"/>
 
    <node x="21.3032" y="-13.6899" fixed="false" boundary="true" sam="false"/>
 
    <node x="17.4704" y="7.41573" fixed="false" boundary="true" sam="false"/>
 
    <node x="-17.5799" y="-5.20265" fixed="false" boundary="true" sam="false"/>
 
    <node x="9.86837" y="4.69636" fixed="false" boundary="false" sam="false"/>
 
    <node x="-9.28449" y="-3.92969" fixed="false" boundary="false" sam="false"/>
 
    <node x="12.5597" y="-20.5161" fixed="false" boundary="true" sam="false"/>
 
    <node x="-1.62187" y="-3.10623" fixed="false" boundary="false" sam="false"/>
 
    <node x="7.55765" y="-14.4922" fixed="false" boundary="false" sam="false"/>
 
    <node x="2.97596" y="-8.80653" fixed="false" boundary="false" sam="false"/>
 
    <node x="1.95125" y="3.2756" fixed="false" boundary="false" sam="false"/>
 
    <node x="-6.54614" y="15.4702" fixed="false" boundary="false" sam="false"/>
 
    <node x="-2.72983" y="8.96705" fixed="false" boundary="false" sam="false"/>
 
    <node x="9.33552" y="23.0046" fixed="false" boundary="true" sam="false"/>
 
  </nodes>
 
  <cells n="4" offsetx="0" offsety="0" magnification="1" base_area="293.893" nchem="2">
 
    <cell index="0" area="405.845" target_area="548.609" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="13"/>
 
      <node n="11"/>
 
      <node n="6"/>
 
      <node n="7"/>
 
      <node n="8"/>
 
      <node n="14"/>
 
      <node n="16"/>
 
      <node n="17"/>
 
      <node n="15"/>
 
      <wall w="6"/>
 
      <wall w="0"/>
 
      <wall w="1"/>
 
      <chem n="2">
 
        <val v="0.251808"/>
 
        <val v="0.481961"/>
 
      </chem>
 
    </cell>
 
    <cell index="1" area="385.557" target_area="547.081" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="12"/>
 
      <node n="10"/>
 
      <node n="1"/>
 
      <node n="21"/>
 
      <node n="2"/>
 
      <node n="3"/>
 
      <node n="19"/>
 
      <node n="20"/>
 
      <node n="18"/>
 
      <wall w="3"/>
 
      <wall w="4"/>
 
      <wall w="5"/>
 
      <chem n="2">
 
        <val v="0.250735"/>
 
        <val v="0.481961"/>
 
      </chem>
 
    </cell>
 
    <cell index="2" area="422.94" target_area="565.987" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="9"/>
 
      <node n="0"/>
 
      <node n="10"/>
 
      <node n="12"/>
 
      <node n="18"/>
 
      <node n="15"/>
 
      <node n="17"/>
 
      <node n="16"/>
 
      <node n="14"/>
 
      <wall w="1"/>
 
      <wall w="2"/>
 
      <wall w="8"/>
 
      <wall w="4"/>
 
      <chem n="2">
 
        <val v="0.307348"/>
 
        <val v="0.481245"/>
 
      </chem>
 
    </cell>
 
    <cell index="3" area="432.871" target_area="573.317" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="4"/>
 
      <node n="5"/>
 
      <node n="11"/>
 
      <node n="13"/>
 
      <node n="15"/>
 
      <node n="18"/>
 
      <node n="20"/>
 
      <node n="19"/>
 
      <node n="3"/>
 
      <wall w="5"/>
 
      <wall w="6"/>
 
      <wall w="7"/>
 
      <wall w="8"/>
 
      <chem n="2">
 
        <val v="0.321108"/>
 
        <val v="0.481222"/>
 
      </chem>
 
    </cell>
 
    <boundary_polygon index="-1" area="1647.21" target_area="1" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="false" dead="false" source="false" boundary="None" div_counter="0" cell_type="0">
 
      <node n="0"/>
 
      <node n="10"/>
 
      <node n="1"/>
 
      <node n="21"/>
 
      <node n="2"/>
 
      <node n="3"/>
 
      <node n="4"/>
 
      <node n="5"/>
 
      <node n="11"/>
 
      <node n="6"/>
 
      <node n="7"/>
 
      <node n="8"/>
 
      <node n="14"/>
 
      <node n="9"/>
 
      <wall w="2"/>
 
      <wall w="7"/>
 
      <wall w="0"/>
 
      <wall w="3"/>
 
      <chem n="2">
 
        <val v="0"/>
 
        <val v="0"/>
 
      </chem>
 
    </boundary_polygon>
 
  </cells>
 
  <walls n="9">
 
    <wall index="0" c1="0" c2="-1" n1="11" n2="14" length="42.4253" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="1" c1="0" c2="2" n1="14" n2="15" length="22.4554" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.254701"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.21777"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="2" c1="2" c2="-1" n1="14" n2="10" length="33.7553" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="3" c1="1" c2="-1" n1="10" n2="3" length="37.203" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="4" c1="2" c2="1" n1="10" n2="18" length="16.1174" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.217027"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.254701"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="5" c1="1" c2="3" n1="3" n2="18" length="22.6835" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.263338"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.217021"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="6" c1="0" c2="3" n1="15" n2="11" length="16.0993" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.263338"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.217763"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="7" c1="3" c2="-1" n1="3" n2="11" length="35.8587" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="8" c1="2" c2="3" n1="18" n2="15" length="7.31402" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.263073"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.254437"/>
 
      </transporters2>
 
    </wall>
 
  </walls>
 
  <nodesets n="0"/>
 
  <settings>
 
    <setting name="show_cell_centers" val="false"/>
 
    <setting name="show_nodes" val="false"/>
 
    <setting name="show_node_numbers" val="false"/>
 
    <setting name="show_cell_numbers" val="false"/>
 
    <setting name="show_border_cells" val="false"/>
 
    <setting name="show_cell_axes" val="false"/>
 
    <setting name="show_cell_strain" val="false"/>
 
    <setting name="show_fluxes" val="true"/>
 
    <setting name="show_walls" val="true"/>
 
    <setting name="save_movie_frames" val="true"/>
 
    <setting name="save_movie_frames" val="false"/>
 
    <setting name="show_only_leaf_boundary" val="false"/>
 
    <setting name="cell_growth" val="true"/>
 
    <setting name="hide_cells" val="false"/>
 
    <viewport m11="8.83883" m12="0" m21="0" m22="8.83883" dx="0" dy="0"/>
 
  </settings>
 
</leaf>
data/leaves/tutorial5_init.xml
Show inline comments
 
<?xml version="1.0" encoding="UTF-8"?>
 
<leaf name="/ufs/merks/VLeaf1.0/V1.0/data/leaves/tutorial5_init.xml" date="Thu Nov 25 14:30:29 2010" simtime="11660">
 
<leaf name="/ufs/merks/VLeaf1.0/V1.0/data/leaves/tutorial5_init.xml" date="Mon Nov 29 11:45:07 2010" simtime="11660">
 
  <parameter>
 
    <par name="arrowcolor" val="white"/>
 
    <par name="arrowsize" val="10"/>
 
    <par name="textcolor" val="red"/>
 
    <par name="cellnumsize" val="1"/>
 
    <par name="nodenumsize" val="1"/>
 
    <par name="node_mag" val="1"/>
 
    <par name="outlinewidth" val="1"/>
 
    <par name="cell_outline_color" val="forestgreen"/>
 
    <par name="resize_stride" val="10"/>
 
    <par name="export_interval" val="0"/>
 
    <par name="export_fn_prefix" val="cell."/>
 
    <par name="storage_stride" val="10"/>
 
    <par name="xml_storage_stride" val="500"/>
 
    <par name="datadir" val="tutorial5_data"/>
 
    <par name="T" val="1"/>
 
    <par name="lambda_length" val="100"/>
 
    <par name="yielding_threshold" val="4"/>
 
    <par name="lambda_celllength" val="0"/>
 
    <par name="target_length" val="60"/>
 
    <par name="cell_expansion_rate" val="10"/>
 
    <par name="cell_div_expansion_rate" val="10"/>
 
    <par name="auxin_dependent_growth" val="true"/>
 
    <par name="ode_accuracy" val="0.0001"/>
 
    <par name="mc_stepsize" val="0.4"/>
 
    <par name="mc_cell_stepsize" val="0.2"/>
 
    <par name="energy_threshold" val="1000"/>
 
    <par name="bend_lambda" val="0"/>
 
    <par name="alignment_lambda" val="0"/>
 
    <par name="rel_cell_div_threshold" val="2"/>
 
    <par name="rel_perimeter_stiffness" val="2"/>
 
    <par name="collapse_node_threshold" val="0.05"/>
 
    <par name="morphogen_div_threshold" val="0.2"/>
 
    <par name="morphogen_expansion_threshold" val="0.01"/>
 
    <par name="copy_wall" val="true"/>
 
    <par name="source" val="0"/>
 
    <par name="D">
 
      <valarray>
 
        <val v="1e-06"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </valarray>
 
    </par>
 
    <par name="initval">
 
      <valarray>
 
        <val v="0"/>
 
        <val v="1"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </valarray>
 
    </par>
 
    <par name="k1" val="1"/>
 
    <par name="k2" val="0.3"/>
 
    <par name="r" val="1"/>
 
    <par name="kr" val="1"/>
 
    <par name="km" val="1"/>
 
    <par name="Pi_tot" val="1"/>
 
    <par name="transport" val="0.36"/>
 
    <par name="ka" val="1"/>
 
    <par name="pin_prod" val="0"/>
 
    <par name="pin_prod_in_epidermis" val="0"/>
 
    <par name="pin_breakdown" val="0"/>
 
    <par name="pin_breakdown_internal" val="0.001"/>
 
    <par name="aux1prod" val="0.001"/>
 
    <par name="aux1prodmeso" val="0"/>
 
    <par name="aux1decay" val="0.001"/>
 
    <par name="aux1decaymeso" val="0.1"/>
 
    <par name="aux1transport" val="0.036"/>
 
    <par name="aux_cons" val="0"/>
 
    <par name="aux_breakdown" val="0.005"/>
 
    <par name="kaux1" val="1"/>
 
    <par name="kap" val="1"/>
 
    <par name="leaf_tip_source" val="0.001"/>
 
    <par name="sam_efflux" val="0.0001"/>
 
    <par name="sam_auxin" val="10"/>
 
    <par name="sam_auxin_breakdown" val="0"/>
 
    <par name="van3prod" val="0.002"/>
 
    <par name="van3autokat" val="0.1"/>
 
    <par name="van3sat" val="10"/>
 
    <par name="k2van3" val="0.3"/>
 
    <par name="dt" val="0.1"/>
 
    <par name="rd_dt" val="10"/>
 
    <par name="movie" val="true"/>
 
    <par name="nit" val="100000"/>
 
    <par name="maxt" val="1e+06"/>
 
    <par name="rseed" val="-1"/>
 
    <par name="constituous_expansion_limit" val="16"/>
 
    <par name="vessel_inh_level" val="1"/>
 
    <par name="vessel_expansion_rate" val="0.25"/>
 
    <par name="d" val="0"/>
 
    <par name="e" val="0"/>
 
    <par name="f" val="0"/>
 
    <par name="c" val="0"/>
 
    <par name="mu" val="0"/>
 
    <par name="nu" val="0"/>
 
    <par name="rho0" val="0"/>
 
    <par name="rho1" val="0"/>
 
    <par name="c0" val="0"/>
 
    <par name="gamma" val="0"/>
 
    <par name="eps" val="0"/>
 
    <par name="k">
 
      <valarray>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </valarray>
 
    </par>
 
    <par name="i1" val="0"/>
 
    <par name="i2" val="0"/>
 
    <par name="i3" val="0"/>
 
    <par name="i4" val="0"/>
 
    <par name="i5" val="0"/>
 
    <par name="s1" val=""/>
 
    <par name="s2" val=""/>
 
    <par name="s3" val=""/>
 
    <par name="b1" val="false"/>
 
    <par name="b2" val="false"/>
 
    <par name="b3" val="false"/>
 
    <par name="b4" val="false"/>
 
    <par name="dir1" val="."/>
 
    <par name="dir2" val="."/>
 
  </parameter>
 
  <nodes n="22" target_length="3.09017">
 
    <node x="22.9634" y="-2.37264" fixed="false" boundary="true" sam="false"/>
 
    <node x="14.6882" y="17.9118" fixed="false" boundary="true" sam="false"/>
 
    <node x="1.57936" y="25.1246" fixed="false" boundary="true" sam="false"/>
 
    <node x="-9.0893" y="22.8165" fixed="false" boundary="true" sam="false"/>
 
    <node x="-19.7055" y="16.962" fixed="false" boundary="true" sam="false"/>
 
    <node x="-22.6839" y="5.00143" fixed="false" boundary="true" sam="false"/>
 
    <node x="-14.7271" y="-15.2131" fixed="false" boundary="true" sam="false"/>
 
    <node x="-6.78413" y="-23.4002" fixed="false" boundary="true" sam="false"/>
 
    <node x="3.60766" y="-25.1355" fixed="false" boundary="true" sam="false"/>
 
    <node x="21.3032" y="-13.6899" fixed="false" boundary="true" sam="false"/>
 
    <node x="17.4704" y="7.41573" fixed="false" boundary="true" sam="false"/>
 
    <node x="-17.5799" y="-5.20265" fixed="false" boundary="true" sam="false"/>
 
    <node x="9.86837" y="4.69636" fixed="false" boundary="false" sam="false"/>
 
    <node x="-9.28449" y="-3.92969" fixed="false" boundary="false" sam="false"/>
 
    <node x="12.5597" y="-20.5161" fixed="false" boundary="true" sam="false"/>
 
    <node x="-1.62187" y="-3.10623" fixed="false" boundary="false" sam="false"/>
 
    <node x="7.55765" y="-14.4922" fixed="false" boundary="false" sam="false"/>
 
    <node x="2.97596" y="-8.80653" fixed="false" boundary="false" sam="false"/>
 
    <node x="1.95125" y="3.2756" fixed="false" boundary="false" sam="false"/>
 
    <node x="-6.54614" y="15.4702" fixed="false" boundary="false" sam="false"/>
 
    <node x="-2.72983" y="8.96705" fixed="false" boundary="false" sam="false"/>
 
    <node x="9.33552" y="23.0046" fixed="false" boundary="true" sam="false"/>
 
  </nodes>
 
  <cells n="4" offsetx="0" offsety="0" magnification="1" base_area="293.893" nchem="2">
 
    <cell index="0" area="405.845" target_area="548.609" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="13"/>
 
      <node n="11"/>
 
      <node n="6"/>
 
      <node n="7"/>
 
      <node n="8"/>
 
      <node n="14"/>
 
      <node n="16"/>
 
      <node n="17"/>
 
      <node n="15"/>
 
      <wall w="6"/>
 
      <wall w="0"/>
 
      <wall w="1"/>
 
      <chem n="2">
 
        <val v="0.251808"/>
 
        <val v="0.481961"/>
 
      </chem>
 
    </cell>
 
    <cell index="1" area="385.557" target_area="547.081" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="12"/>
 
      <node n="10"/>
 
      <node n="1"/>
 
      <node n="21"/>
 
      <node n="2"/>
 
      <node n="3"/>
 
      <node n="19"/>
 
      <node n="20"/>
 
      <node n="18"/>
 
      <wall w="3"/>
 
      <wall w="4"/>
 
      <wall w="5"/>
 
      <chem n="2">
 
        <val v="0.250735"/>
 
        <val v="0.481961"/>
 
      </chem>
 
    </cell>
 
    <cell index="2" area="422.94" target_area="565.987" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="9"/>
 
      <node n="0"/>
 
      <node n="10"/>
 
      <node n="12"/>
 
      <node n="18"/>
 
      <node n="15"/>
 
      <node n="17"/>
 
      <node n="16"/>
 
      <node n="14"/>
 
      <wall w="1"/>
 
      <wall w="2"/>
 
      <wall w="8"/>
 
      <wall w="4"/>
 
      <chem n="2">
 
        <val v="0.307348"/>
 
        <val v="0.481245"/>
 
      </chem>
 
    </cell>
 
    <cell index="3" area="432.871" target_area="573.317" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="true" dead="false" source="false" boundary="None" div_counter="2" cell_type="0">
 
      <node n="4"/>
 
      <node n="5"/>
 
      <node n="11"/>
 
      <node n="13"/>
 
      <node n="15"/>
 
      <node n="18"/>
 
      <node n="20"/>
 
      <node n="19"/>
 
      <node n="3"/>
 
      <wall w="5"/>
 
      <wall w="6"/>
 
      <wall w="7"/>
 
      <wall w="8"/>
 
      <chem n="2">
 
        <val v="0.321108"/>
 
        <val v="0.481222"/>
 
      </chem>
 
    </cell>
 
    <boundary_polygon index="-1" area="1647.21" target_area="1" target_length="60" lambda_celllength="0" stiffness="0" fixed="false" pin_fixed="false" at_boundary="false" dead="false" source="false" boundary="None" div_counter="0" cell_type="0">
 
      <node n="0"/>
 
      <node n="10"/>
 
      <node n="1"/>
 
      <node n="21"/>
 
      <node n="2"/>
 
      <node n="3"/>
 
      <node n="4"/>
 
      <node n="5"/>
 
      <node n="11"/>
 
      <node n="6"/>
 
      <node n="7"/>
 
      <node n="8"/>
 
      <node n="14"/>
 
      <node n="9"/>
 
      <wall w="2"/>
 
      <wall w="7"/>
 
      <wall w="0"/>
 
      <wall w="3"/>
 
      <chem n="2">
 
        <val v="0"/>
 
        <val v="0"/>
 
      </chem>
 
    </boundary_polygon>
 
  </cells>
 
  <walls n="9">
 
    <wall index="0" c1="0" c2="-1" n1="11" n2="14" length="42.4253" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="1" c1="0" c2="2" n1="14" n2="15" length="22.4554" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.254701"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.21777"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="2" c1="2" c2="-1" n1="14" n2="10" length="33.7553" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="3" c1="1" c2="-1" n1="10" n2="3" length="37.203" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="4" c1="2" c2="1" n1="10" n2="18" length="16.1174" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.217027"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.254701"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="5" c1="1" c2="3" n1="3" n2="18" length="22.6835" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.263338"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.217021"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="6" c1="0" c2="3" n1="15" n2="11" length="16.0993" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.263338"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.217763"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="7" c1="3" c2="-1" n1="3" n2="11" length="35.8587" viz_flux="0" wall_type="aux_source">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0"/>
 
      </transporters2>
 
    </wall>
 
    <wall index="8" c1="2" c2="3" n1="18" n2="15" length="7.31402" viz_flux="0" wall_type="normal">
 
      <transporters1>
 
        <val v="0"/>
 
        <val v="0.263073"/>
 
      </transporters1>
 
      <transporters2>
 
        <val v="0"/>
 
        <val v="0.254437"/>
 
      </transporters2>
 
    </wall>
 
  </walls>
 
  <nodesets n="0"/>
 
  <settings>
 
    <setting name="show_cell_centers" val="false"/>
 
    <setting name="show_nodes" val="false"/>
 
    <setting name="show_node_numbers" val="false"/>
 
    <setting name="show_cell_numbers" val="false"/>
 
    <setting name="show_border_cells" val="false"/>
 
    <setting name="show_cell_axes" val="false"/>
 
    <setting name="show_cell_strain" val="false"/>
 
    <setting name="show_fluxes" val="true"/>
 
    <setting name="show_walls" val="true"/>
 
    <setting name="save_movie_frames" val="true"/>
 
    <setting name="save_movie_frames" val="false"/>
 
    <setting name="show_only_leaf_boundary" val="false"/>
 
    <setting name="cell_growth" val="true"/>
 
    <setting name="hide_cells" val="false"/>
 
    <viewport m11="2.20971" m12="0" m21="0" m22="2.20971" dx="0" dy="0"/>
 
  </settings>
 
</leaf>
src/VirtualLeaf.cpp
Show inline comments
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <string>
 
#include <fstream>
 
#include <sstream>
 
#include <cstring>
 
#include <functional> 
 
#include <getopt.h>
 
#include <cerrno>
 
#include "mesh.h"
 
#include "parameter.h"
 
#include "random.h"
 
#include "pi.h"
 
#include "cellitem.h"
 
#include "canvas.h"
 
#include "cell.h"
 
#include "output.h"
 
#include <qwidget.h>
 
#include <q3process.h>
 
#include <qapplication.h>
 
#include <QDesktopWidget>
 
#include <QGraphicsScene>
 
#include <QMessageBox>
 
//Added by qt3to4:
 
#include <QMouseEvent>
 

	
 
#include <unistd.h>
 
#include <q3textstream.h> 
 

	
 
#ifdef HAVE_QWT
 
#include "data_plot.h"
 
#endif
 
#include <QPalette>
 
#include <QBrush>
 
#include <QToolTip>
 
#include "simplugin.h"
 
#include <QPluginLoader>
 
#include <QDir>
 
#include "modelcatalogue.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
extern Parameter par;
 

	
 
MainBase *main_window = 0;
 

	
 
#ifdef XFIGGRAPHICS
 
#define TIMESTEP double Graphics::TimeStep(void)
 
#endif
 

	
 
class PrintNode {
 
public:
 
  void operator() (const Node &n) const 
 
  {
 
    cerr << n.Index() << ": " << n <<  endl;
 
  }
 
};
 

	
 

	
 
class EdgeSource {
 

	
 
public:
 
  void operator() (Cell &c) {
 

	
 
    if (c.AtBoundaryP()) {
 
      cerr << "Cell " << c.Index() << " is a source cell.\n";
 
      c.SetSource(0,par.source);
 
    } else {
 
      cerr << "Cell " << c.Index() << " is _not_ a source cell.\n";
 
    }
 
  }
 
};
 

	
 

	
 

	
 
class CellInfo {
 
public:
 
  void operator() (Cell &c,std::ostream &os) const {
 
    os << "Cell " << c.index << " says: " << endl;
 
    os << "c.nodes.size() = " << c.nodes.size() << endl;
 
    for (list<Node *>::iterator i=c.nodes.begin(); i!=c.nodes.end(); i++) {
 
      cerr << (*i)->Index() << " ";
 
    }
 
    cerr << endl;
 
  }
 
};
 

	
 
double PINSum(Cell &c) {
 
  return c.Chemical(1) + c.SumTransporters(1);// + c.ReduceCellAndWalls<double>( complex_PijAj );
 
}
 

	
 

	
 
class DrawCell {
 
public:
 
  void operator() (Cell &c,QGraphicsScene &canvas, MainBase &m) const {
 
    if (m.ShowBorderCellsP() || c.Boundary()==Cell::None) {
 
      if (!m.ShowBoundaryOnlyP() && !m.HideCellsP()) {
 
	if (m.ShowToolTipsP()) {
 
	  //QString info_string=QString("Cell %1, chemicals: ( %2, %3, %4, %5, %6)\n %7 of PIN1 at walls.\n Area is %8\n PIN sum is %9\n Circumference is %10\n Boundary type is %11").arg(c.Index()).arg(c.Chemical(0)).arg(c.Chemical(1)).arg(c.Chemical(2)).arg(c.Chemical(3)).arg(c.Chemical(4)).arg(c.SumTransporters(1)).arg(c.Area()).arg(PINSum(c)).arg(c.Circumference()).arg(c.BoundaryStr());
 
		QString info_string=QString("Cell %1, chemicals(%2): ").arg(c.Index()).arg(Cell::NChem());
 
		for (int i=0;i<Cell::NChem();i++) {
 
			info_string += QString("%1 ").arg(c.Chemical(i));
 
		}
 
		info_string += QString("\nArea is %1\n Circumference is %2\n Boundary type is %3").arg(c.Area()).arg(c.WallCircumference()).arg(c.BoundaryStr());
 
		
 
	  info_string += "\nNodes: " + c.printednodelist();
 
	  c.Draw(&canvas, info_string);
 
	} else {
 
	  c.Draw(&canvas);
 
	}
 
      }
 
      if (m.ShowCentersP()){
 
	c.DrawCenter(&canvas);
 
      }
 
      if (m.ShowFluxesP()){
 
	c.DrawFluxes(&canvas, par.arrowsize);
 
      }
 
    }
 
  }
 
};
 

	
 
Mesh mesh;
 
bool batch=false;
 

	
 
void MainBase::Plot(int resize_stride)
 
{
 

	
 
  clear();
 

	
 
  int count=(int)mesh.getTime();
 

	
 
  if (resize_stride) {
 
    if ( !((count)%resize_stride) ) {
 
      FitLeafToCanvas();
 
    }
 
  }
 

	
 
  mesh.LoopCells(DrawCell(),canvas,*this);
 

	
 
  if (ShowNodeNumbersP()) 
 
    mesh.LoopNodes( bind2nd (mem_fun_ref ( &Node::DrawIndex), &canvas ) ) ;
 
  if (ShowCellNumbersP()) 
 
    mesh.LoopCells( bind2nd (mem_fun_ref ( &Cell::DrawIndex), &canvas ) ) ;
 

	
 
  if (ShowCellAxesP()) 
 
    mesh.LoopCells( bind2nd (mem_fun_ref ( &Cell::DrawAxis), &canvas ) );
 

	
 
  if (ShowCellStrainP()) 
 
    mesh.LoopCells( bind2nd (mem_fun_ref ( &Cell::DrawStrain), &canvas ) );
 

	
 
  if (ShowWallsP())
 
    mesh.LoopWalls( bind2nd( mem_fun_ref( &Wall::Draw ), &canvas ) );
 

	
 
/*  if (ShowApoplastsP()) 
 
    mesh.LoopWalls( bind2nd( mem_fun_ref( &Wall::DrawApoplast ), &canvas ) );
 
*/
 
  /*  if (ShowApoplastsP()) 
 
      mesh.LoopWalls( bind2nd( mem_fun_ref( &Wall::DrawApoplast ), &canvas ) );
 
  */
 
  if (ShowMeshP()) 
 
    mesh.DrawNodes(&canvas);
 

	
 
  if (ShowBoundaryOnlyP()) 
 
    mesh.DrawBoundary(&canvas);
 

	
 
  if ( ( batch || MovieFramesP() )) {
 
    if (!(count%par.storage_stride) ) {
 
      stringstream fname;
 
      fname << par.datadir << "/leaf.";
 
      fname.fill('0');
 
      fname.width(6);
 
      fname << count << ".png";
 
      // Write high-res PNG snapshot every plot step
 
      Save(fname.str().c_str(), "PNG", 1024, 768);
 
    }
 

	
 
    if (!(count%par.xml_storage_stride)) {
 
      stringstream fname;
 
      fname << par.datadir << "/leaf.";
 
      fname.fill('0');
 
      fname.width(6);
 
      fname << count << ".xml";
 
      // Write XML file every ten plot steps
 
      mesh.XMLSave(fname.str().c_str(), XMLSettingsTree());
 
    }
 
  }
 
}
 

	
 

	
 
INIT {
 

	
 
  //mesh.SetSimPlugin(plugin);
 
  if (leaffile) { 
 
    if (qApp->type()==QApplication::Tty) {
 
      
 
      xmlNode *settings;
 
      mesh.XMLRead(leaffile, &settings);
 
      
 
      main_window->XMLReadSettings(settings);
 
      xmlFree(settings);
 
      main_window->UserMessage(QString("Ready. Time is %1").arg(mesh.getTimeHours().c_str()));
 
    } else {
 
      ((Main *)main_window)->readStateXML(leaffile);
 
    }
 
    
 
  } else {
 
    mesh.StandardInit();
 
  }
 
  
 
  Cell::SetMagnification(1);
 
  Cell::setOffset(0,0);
 
  
 
  FitLeafToCanvas();
 
  Plot();
 

	
 
}
 

	
 
TIMESTEP {
 

	
 
  static int i=0;
 
  static int t=0;
 
  static int ncells;
 

	
 
  if (!batch) {
 
    UserMessage(QString("Time: %1").arg(mesh.getTimeHours().c_str()),0);
 
  }
 

	
 
  ncells=mesh.NCells();
 

	
 

	
 
  double dh;
 

	
 
  if(DynamicCellsP()) {
 
    dh = mesh.DisplaceNodes();
 

	
 
    // Only allow for node insertion, cell division and cell growth
 
    // if the system has equillibrized
 
    // i.e. cell wall tension equillibrization is much faster
 
    // than biological processes, including division, cell wall yielding
 
    // and cell expansion
 
    mesh.InsertNodes(); // (this amounts to cell wall yielding)
 

	
 
    if ( (-dh) < par.energy_threshold) {
 

	
 
      mesh.IncreaseCellCapacityIfNecessary();
 
      mesh.DoCellHouseKeeping();
 
      //mesh.LoopCurrentCells(mem_fun(&plugin->CellHouseKeeping)); // this includes cell division
 

	
 
      // Reaction diffusion	
 
      mesh.ReactDiffuse(par.rd_dt);
 
      t++;
 
      Plot(par.resize_stride);
 
    }
 
  } else {
 
    mesh.ReactDiffuse(par.rd_dt);
 
    Plot(par.resize_stride);
 
  }
 
  i++;
 
  return mesh.getTime();
 
}
 

	
 

	
 

	
 
/* Called if a cell is clicked */
 
  /* Called if a cell is clicked */
 
void Cell::OnClick(QMouseEvent *e){}
 

	
 

	
 
/* Custom message handler - Default appends a newline character to the end of each line. */ 
 
  /* Custom message handler - Default appends a newline character to the end of each line. */ 
 
void vlMessageOutput(QtMsgType type, const char *msg)
 
{
 
  switch (type) {
 
  case QtDebugMsg:
 
    //fprintf(stderr, "Debug: %s\n", msg);
 
    cerr << msg << flush;
 
    break;
 
  case QtWarningMsg:
 
    //fprintf(stderr, "Warning: %s\n", msg);
 
    cerr << "Warning: " << msg << flush;
 
    break;
 
  case QtCriticalMsg:
 
    fprintf(stderr, "Critical: %s\n", msg);
 
    cerr << "Critical: " << msg << flush;
 
    break;
 
  case QtFatalMsg:
 
    //fprintf(stderr, "Fatal: %s\n", msg);
 
    cerr << "Fatal: " << msg << flush;
 
    abort();
 
  }
 
}
 

	
 

	
 
Parameter par;
 

	
 
int main(int argc,char **argv) {
 

	
 
  try {
 
    int c;
 
    char *leaffile=0;
 
    char *modelfile=0;
 

	
 
    while (1) {
 

	
 
      //int this_option_optind = optind ? optind : 1;
 
      int option_index = 0;
 
      static struct option long_options[] = {
 
	{"batch", no_argument, NULL, 'b'},
 
	{"leaffile", required_argument, NULL, 'l'},
 
	{"model", required_argument, NULL, 'm'} 
 
      };
 

	
 
      // short option 'p' creates trouble for non-commandline usage on MacOSX. Option -p changed to -P (capital)
 
      static char *short_options = "blm";
 
      c = getopt_long (argc, argv, "bl:m:",
 
		       long_options, &option_index);
 
      if (c == -1)
 
	break;
 

	
 

	
 
      if (c==0) {
 
	printf ("option %s", long_options[option_index].name);
 
	if (optarg)
 
	  printf (" with arg %s", optarg);
 
	printf ("\n");
 

	
 
	c = short_options[option_index];
 
      }
 

	
 
      switch (c) {
 
      case 'b':
 
	cerr << "Running in batch mode\n";
 
	batch=true;
 
	break;
 

	
 
      case 'l':
 
	leaffile=strdup(optarg);
 
	if (!leaffile) {
 
	  throw("Out of memory");
 
	}
 
	printf("Reading leaf state file '%s'\n", leaffile);
 
	break;
 

	
 
      case 'm':
 
	modelfile=strdup(optarg);
 
	if (!modelfile) {
 
	  throw("Out of memory");
 
	}
 
	break;
 

	
 
      case '?':
 
	break;
 

	
 
      default:
 
	printf ("?? getopt returned character code 0%o ??\n", c);
 
      }
 
    }
 

	
 

	
 
    if (optind < argc) {
 
      printf ("non-option ARGV-elements: ");
 
      while (optind < argc)
 
	printf ("%s ", argv[optind++]);
 
      printf ("\n");
 
    }
 

	
 
    bool useGUI = !batch;
 
    qInstallMsgHandler(vlMessageOutput); // custom message handler
 
    QApplication app(argc,argv,useGUI);
 

	
 

	
 

	
 
    QPalette tooltippalette = QToolTip::palette();
 
    QColor transparentcolor = QColor(tooltippalette.brush(QPalette::Window).color());
 

	
 
    tooltippalette.setBrush (QPalette::Window, QBrush (transparentcolor) );
 
    QToolTip::setPalette( tooltippalette );
 

	
 
    QGraphicsScene canvas(0,0,8000,6000);
 

	
 

	
 
    if (useGUI) {
 
      main_window=new Main(canvas, mesh);
 
      if ( QApplication::desktop()->width() > ((Main *)main_window)->width() + 10
 
	   && QApplication::desktop()->height() > ((Main *)main_window)->height() +30 ) {
 

	
 
	((Main *)main_window)->show();
 
	((Main *)main_window)->resize( ((Main *)main_window)->sizeHint());
 
      } else {
 
        ((Main *)main_window)->showMaximized();
 
	((Main *)main_window)->showMaximized();
 
      }
 
      
 
      // show "About" window at start up
 
      ((Main *)main_window)->about();
 
    } else {
 
      main_window=new MainBase(canvas, mesh);
 
    }
 

	
 
    canvas.setSceneRect(QRectF());
 
    if (!batch) {
 
      QObject::connect( qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()) );
 
    }
 

	
 
    //    main_window->Init(leaffile);
 

	
 
    // Install model or read catalogue of models
 
    ModelCatalogue model_catalogue(&mesh, main_window,modelfile);
 

	
 

	
 
    if (useGUI)
 
      model_catalogue.PopulateModelMenu();
 
    model_catalogue.InstallFirstModel();
 
    
 
    
 

	
 
    /*    Cell::SetMagnification(1);
 
    Cell::setOffset(0,0);
 
	  Cell::setOffset(0,0);
 

	
 
    main_window->FitLeafToCanvas();
 
	  main_window->FitLeafToCanvas();
 

	
 
    main_window->Plot();
 
	  main_window->Plot();
 
    */
 
    if (batch) {
 
      double t=0.;
 
      do {
 
	t = main_window->TimeStep();
 
      } while (t < par.maxt);
 
    } else
 
      return app.exec();
 

	
 
  } catch (const char *message) {
 
    if (batch) { 
 
      cerr << "Exception caught:" << endl;
 
      cerr << message << endl;
 
      abort();
 
    } else {
 
      QString qmess=QString("Exception caught: %1").arg(message);
 
      QMessageBox::critical(0, "Critical Error", qmess);
 
      abort();
 
    }
 
  } catch (ios_base::failure) {
 
    stringstream error_message;
 
    error_message << "I/O failure: " << strerror(errno);
 
    if (batch) {
 
      cerr << error_message.str() <<endl;
 
      abort();
 
    } else {
 
      QString qmess(error_message.str().c_str());
 
      QMessageBox::critical(0, "I/O Error", qmess );
 
      abort();
 
    }
 
  }
 
}
 

	
 
/* finis */
src/mainbase.cpp
Show inline comments
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <libxml/xpath.h>
 
#include <libxml/xmlreader.h>
 

	
 
#include "mainbase.h"
 
#include "xmlwrite.h"
 

	
 
#include <sstream>
 
#include <string>
 

	
 
#include <QLocale>
 
#include <QDir>
 
#include <QDebug>
 

	
 
static const std::string _module_id("$Id$");
 

	
 
xmlNode *MainBase::XMLViewportTree(QTransform &transform) const {
 
  
 
  QLocale standardlocale(QLocale::C);
 
  
 

	
 
  xmlNode *xmlviewport = xmlNewNode(NULL, BAD_CAST "viewport");
 
  {
 
    xmlNewProp(xmlviewport, BAD_CAST "m11", BAD_CAST standardlocale.toString(transform.m11()).toStdString().c_str() );
 
    xmlNewProp(xmlviewport, BAD_CAST "m12", BAD_CAST standardlocale.toString(transform.m12()).toStdString().c_str() );    
 
    xmlNewProp(xmlviewport, BAD_CAST "m21", BAD_CAST standardlocale.toString(transform.m21()).toStdString().c_str() );    
 
    xmlNewProp(xmlviewport, BAD_CAST "m22", BAD_CAST standardlocale.toString(transform.m22()).toStdString().c_str() );    
 
    xmlNewProp(xmlviewport, BAD_CAST "dx", BAD_CAST standardlocale.toString(transform.dx()).toStdString().c_str() );    
 
    xmlNewProp(xmlviewport, BAD_CAST "dy", BAD_CAST standardlocale.toString(transform.dy()).toStdString().c_str() );    
 
 }
 
  
 
  return xmlviewport;
 
}
 

	
 
xmlNode *MainBase::XMLSettingsTree(void) const {
 
xmlNode *MainBase::XMLSettingsTree(void) {
 

	
 
  xmlNode *xmlsettings = xmlNewNode(NULL, BAD_CAST "settings");
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_cell_centers");
 
    ostringstream text;
 
    text << bool_name(showcentersp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_nodes");
 
    ostringstream text;
 
    text << bool_name(showmeshp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_node_numbers");
 
    ostringstream text;
 
    text << bool_name(shownodenumbersp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_cell_numbers");
 
    ostringstream text;
 
    text << bool_name(showcellnumbersp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_border_cells");
 
    ostringstream text;
 
    text << bool_name(showbordercellp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_cell_axes");
 
    ostringstream text;
 
    text << bool_name(showcellsaxesp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_cell_strain");
 
    ostringstream text;
 
    text << bool_name(showcellstrainp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_fluxes");
 
    ostringstream text;
 
    text << bool_name(showfluxesp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_walls");
 
    ostringstream text;
 
    text << bool_name(showwallsp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
 /* {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_apoplasts");
 
    ostringstream text;
 
    text << bool_name(showapoplastsp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }*/
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "save_movie_frames");
 
    ostringstream text;
 
    text << bool_name(movieframesp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "show_only_leaf_boundary");
 
    ostringstream text;
 
    text << bool_name(showboundaryonlyp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "cell_growth");
 
    ostringstream text;
 
    text << bool_name(dynamicscellsp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmloption = xmlNewChild(xmlsettings, NULL, BAD_CAST "setting", NULL);
 
    xmlNewProp(xmloption, BAD_CAST "name", BAD_CAST "hide_cells");
 
    ostringstream text;
 
    text << bool_name(hidecellsp);
 
    xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  return xmlsettings;
 
}
 

	
 
void MainBase::XMLReadViewport(xmlNode *settings) {
 

	
 
  if (settings == 0) {
 
    return;
 
  }
 

	
 
  qreal m11=25,m12=0,m21=0,m22=25,dx=0,dy=0;
 
  QLocale standardlocale(QLocale::C);
 
  xmlNode *cur = settings->xmlChildrenNode;
 

	
 
  while (cur!=NULL) {
 
    
 
    if (!xmlStrcmp(cur->name,(const xmlChar *)"viewport")) {
 
      bool ok;
 
      {
 
	xmlChar *v_str = xmlGetProp(cur, BAD_CAST "m11");
 
	
 
	if (v_str==0) {
 
	  MyWarning::unique_warning("Error reading viewport in mainbase.cpp");
 
	}
 
	if (v_str != NULL) {
 
	  m11=standardlocale.toDouble((char *)v_str, &ok);
 
	  if (!ok) MyWarning::error("Could Not Convert \"%S\" To Double In XMLRead.",(char *)v_str);
 
	  xmlFree(v_str);
 
	}
 
      }
 
      {
 
	xmlChar *v_str = xmlGetProp(cur, BAD_CAST "m12");
 
	
 
	if (v_str==0) {
 
	  MyWarning::unique_warning("Error reading viewport in mainbase.cpp");
 
	}
 
	if (v_str != NULL) {
 
	  m12=standardlocale.toDouble((char *)v_str, &ok);
 
	  if (!ok) MyWarning::error("Could Not Convert \"%S\" To Double In XMLRead.",(char *)v_str);
 
	  xmlFree(v_str);
 
	}
 
      }
 
      { 
 
	xmlChar *v_str = xmlGetProp(cur, BAD_CAST "m21");
 
	
 
	if (v_str==0) {
 
	  MyWarning::unique_warning("Error reading viewport in mainbase.cpp");
 
	}
 
	if (v_str != NULL) {
 
	  m21=standardlocale.toDouble((char *)v_str, &ok);
 
	  if (!ok) MyWarning::error("Could Not Convert \"%S\" To Double In XMLRead.",(char *)v_str);
 
	  xmlFree(v_str);
 
	}
 
      }
 
      {
 
	xmlChar *v_str = xmlGetProp(cur, BAD_CAST "m22");
 
	
 
	if (v_str==0) {
 
	  MyWarning::unique_warning("Error reading viewport in mainbase.cpp");
 
	}
 
	if (v_str != NULL) {
 
	  m22=standardlocale.toDouble((char *)v_str, &ok);
 
	  if (!ok) MyWarning::error("Could Not Convert \"%S\" To Double In XMLRead.",(char *)v_str);
 
	  xmlFree(v_str);
 
	}
 
      }
 
      {
 
	xmlChar *v_str = xmlGetProp(cur, BAD_CAST "dx");
 
	
 
	if (v_str==0) {
 
	  MyWarning::unique_warning("Error reading viewport in mainbase.cpp");
 
	}
 
	if (v_str != NULL) {
 
	  dx=standardlocale.toDouble((char *)v_str, &ok);
 
	  if (!ok) MyWarning::error("Could Not Convert \"%S\" To Double In XMLRead.",(char *)v_str);
 
	  xmlFree(v_str);
 
	}
 
      }
 
      {
 
	xmlChar *v_str = xmlGetProp(cur, BAD_CAST "dy");
 
	
 
	if (v_str==0) {
 
	  MyWarning::unique_warning("Error reading viewport in mainbase.cpp");
 
	}
 
	if (v_str != NULL) {
 
	  dy=standardlocale.toDouble((char *)v_str, &ok);
 
	  if (!ok) MyWarning::error("Could Not Convert \"%S\" To Double In XMLRead.",(char *)v_str);
 
	  xmlFree(v_str);
 
	}
 
      }
 
    }
 
    cur=cur->next;
 
  }
 
  viewport = QTransform(m11,m12,m21,m22,dx,dy);
 
}
 

	
 
void MainBase::XMLReadSettings(xmlNode *settings)
 
{
 

	
 
  // Many files have no settings section, so don't complain about it.
 
  // Defaults will be used instead.
 
  if (settings == 0) {
 
    return;
 
  }
 

	
 
  XMLReadViewport(settings);
 
  xmlNode *cur = settings->xmlChildrenNode;
 

	
 
  while (cur!=NULL) {
 

	
 
    if ((!xmlStrcmp(cur->name, (const xmlChar *)"setting"))){
 

	
 
      xmlChar *name = xmlGetProp(cur, BAD_CAST "name");
 
    
 
      xmlChar *val = xmlGetProp(cur, BAD_CAST "val");
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_cell_centers")) {
 
	showcentersp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_nodes")) {
 
	showmeshp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_node_numbers")) {
 
	shownodenumbersp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_cell_numbers")) {
 
	showcellnumbersp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_border_cells")) {
 
	showbordercellp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_cell_axes")) {
 
	showcellsaxesp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_cell_strain")) {
 
	showcellstrainp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_fluxes")) {
 
	showfluxesp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_walls")) {
 
	showwallsp = strtobool( (const char *)val );
 
      }
 
     /* if (!xmlStrcmp(name, (const xmlChar *)"show_apoplasts")) {
 
	showapoplastsp = strtobool( (const char *)val );
 
      }*/
 
      if (!xmlStrcmp(name, (const xmlChar *)"save_movie_frames")) {
 
	movieframesp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"show_only_leaf_boundary")) {
 
	showboundaryonlyp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name, (const xmlChar *)"cell_growth")) {
 
	dynamicscellsp = strtobool( (const char *)val );
 
      }
 
      if (!xmlStrcmp(name,(const xmlChar *)"hide_cells")) {
 
	hidecellsp = strtobool( (const char *)val ); 
 
      }
 
    
 
	
 
  
 
      xmlFree(name);
 
      xmlFree(val);
 
    }
 
    cur=cur->next;
 
  }
 
}
 

	
 
int MainBase::Save(const char *fname, const char *format, int sizex, int sizey)
 
{
 

	
 
  Vector ll,ur;
 
  mesh.BoundingBox(ll, ur);
 

	
 
  if (QString(fname).isEmpty()) {
 
    MyWarning::warning("No output filename given. Saving nothing.\n");
 
    return 1;
 
  }
 

	
 
  ll*=Cell::Magnification(); ur*=Cell::Magnification();
 

	
 
  // give the leaf some space
 
  Vector border = ((ur-ll)/5.);
 
  
 
  if (!QString(format).contains("PDF", Qt::CaseInsensitive)) {
 

	
 
    QImage *image = new QImage(QSize(sizex, sizey), QImage::Format_RGB32);
 
    image->fill(QColor(Qt::white).rgb());
 
    QPainter *painter=new QPainter(image);
 
    canvas.render(painter);
 
#ifdef QDEBUG
 
    qDebug() << "Native Image Filename: " << QDir::toNativeSeparators(QString(fname)) << endl;
 
#endif
 
    if (!image->save(QDir::toNativeSeparators(QString(fname)))) { // please do not add "format" here! It is much better to have the system guess the file format from the extension. That prevents loads of cross-platform problems.
 
      MyWarning::warning("Image '%s' not saved successfully. Is the disk full or the extension not recognized?",fname);
 
      delete painter;
 
      delete image;
 
      return 1;
 
    } 
 
    delete painter;
 
    delete image;
 
  } else {
 
    QPrinter pdf(QPrinter::HighResolution);
 
    pdf.setOutputFileName(fname);
 
    pdf.setOutputFormat(QPrinter::PdfFormat);
 
    QPainter painter(&pdf);
 
    canvas.render(&painter, QRectF(), QRectF(-5000,-5000, 10000, 10000));
 
    
 
    cerr << "Rendering to printer\n";
 
  }
 
  return 0;
 
}
 

	
 
void MainBase::CutSAM()
 
{
 
  mesh.CutAwaySAM();
 
}
 

	
 
/* finis */
src/mainbase.h
Show inline comments
 
/*
 
 *
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 

	
 
#ifndef _MAINBASE_H_
 
#define _MAINBASE_H_
 

	
 
#include <QGraphicsScene>
 
#include <qpixmap.h>
 
#include <q3picture.h>
 
#include <qpainter.h>
 
#include <qwidget.h>
 
#include <iostream>
 
#include <QGraphicsItem>
 
#include <QPrinter>
 
#include "mesh.h"
 
#include "warning.h"
 

	
 
using namespace std;
 

	
 
/*! Implement these functions in your main application */
 
class MainBase  {
 

	
 
 public:
 
 MainBase(QGraphicsScene &c, Mesh &m) : mesh(m), canvas(c) {
 

	
 
    // Standard options for batch version
 
    showcentersp =  false;
 
    showmeshp =  false;
 
    showbordercellp =  false;
 
    shownodenumbersp =  false;
 
    showcellnumbersp =  false;
 
    showcellsaxesp = false;
 
    showcellstrainp =  false;
 
    movieframesp = true;
 
    showboundaryonlyp =  false;
 
    showwallsp =  false;
 
    showfluxesp = false;
 
    dynamicscellsp = true;
 
    showtooltipsp = false;
 
    hidecellsp = false;
 
  }
 
  virtual ~MainBase() {};
 

	
 
  virtual double TimeStep();
 
  virtual void Init(const char *leaffile=0);
 

	
 
  virtual bool ShowCentersP(void) {return showcentersp;}
 
  virtual bool ShowMeshP(void) {return showmeshp; }
 
  virtual bool ShowBorderCellsP(void) {return showbordercellp; }
 
  virtual bool PausedP(void) {return false; }
 
  virtual bool ShowNodeNumbersP(void) {return shownodenumbersp; }
 
  virtual bool ShowCellNumbersP(void) {return showcellnumbersp;}
 
  virtual bool ShowCellAxesP(void) {return showcellsaxesp;}
 
  virtual bool ShowCellStrainP(void) {return showcellstrainp;}
 
  virtual bool MovieFramesP(void) {return movieframesp;}
 
  virtual bool ShowBoundaryOnlyP(void) {return showboundaryonlyp;}
 
  virtual bool ShowToolTipsP(void) {return showtooltipsp;}
 
  virtual bool ShowWallsP(void) {return showwallsp;}
 
 // virtual bool ShowApoplastsP(void) { return showapoplastsp;}
 
  virtual bool ShowFluxesP(void) { return showfluxesp; }
 
  virtual bool DynamicCellsP(void) { return dynamicscellsp; }
 
  virtual void FitCanvasToWindow() {};
 
  virtual void FitLeafToCanvas() {};
 
  virtual bool HideCellsP(void) { return hidecellsp; }
 
  virtual void clear(void) {
 
    QList<QGraphicsItem *> list = canvas.items();
 
    QList<QGraphicsItem *>::Iterator it = list.begin();
 
    for (; it != list.end(); ++it) {
 
      if ( *it )
 
	delete *it;
 
    }
 
  };
 
  virtual void XMLReadSettings(xmlNode *settings);
 
  virtual void XMLReadViewport(xmlNode *viewport);
 

	
 
  virtual double getFluxArrowsize(void) { return 10.;}
 

	
 
  int Save(const char *fname, const char *format, int sizex=640, int sizey=480);
 
  void CutSAM(void);
 

	
 
  void Plot(int resize_stride=10);
 

	
 
  virtual void UserMessage(QString message, int timeout = 0) {
 
    cerr << message.toAscii().constData() << endl;
 
  }
 

	
 
  Mesh &mesh;
 
  QTransform viewport;
 

	
 

	
 
 protected:
 
  QGraphicsScene &canvas;
 
  virtual xmlNode *XMLSettingsTree(void) const;
 
  virtual xmlNode *XMLSettingsTree(void);
 
  virtual xmlNode *XMLViewportTree(QTransform &transform) const;
 

	
 

	
 
  
 
 protected:
 
  bool showcentersp;
 
  bool showmeshp;
 
  bool showbordercellp;
 
  bool shownodenumbersp;
 
  bool showcellnumbersp;
 
  bool showcellsaxesp;
 
  bool showcellstrainp;
 
  bool movieframesp;
 
  bool showboundaryonlyp;
 
  bool showwallsp;
 
//  bool showapoplastsp;
 
  bool showfluxesp;
 
  bool dynamicscellsp;
 
  bool showtooltipsp;
 
  bool hidecellsp;
 
};
 

	
 
//#include <qapplication.h>
 
#define TIMESTEP double MainBase::TimeStep(void)
 
#define INIT void MainBase::Init(const char *leaffile)
 

	
 
#endif
 

	
 
/* finis */
0 comments (0 inline, 0 general)