<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.14">
  <compounddef id="light_8c" kind="file" language="C++">
    <compoundname>light.c</compoundname>
    <includes local="no">stdio.h</includes>
    <includes local="no">stdlib.h</includes>
    <includes local="no">math.h</includes>
    <includes refid="CisInterface_8h" local="yes">CisInterface.h</includes>
    <incdepgraph>
      <node id="482">
        <label>stdint.h</label>
        <link refid="stdint_8h_source"/>
        <childnode refid="483" relation="include">
        </childnode>
        <childnode refid="484" relation="include">
        </childnode>
      </node>
      <node id="504">
        <label>AsciiTableComm.h</label>
        <link refid="AsciiTableComm_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="490" relation="include">
        </childnode>
      </node>
      <node id="477">
        <label>stdarg.h</label>
      </node>
      <node id="490">
        <label>../dataio/AsciiTable.h</label>
        <link refid="AsciiTable_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="491" relation="include">
        </childnode>
      </node>
      <node id="472">
        <label>stdlib.h</label>
      </node>
      <node id="478">
        <label>errno.h</label>
      </node>
      <node id="470">
        <label>/root/cis_interface/cis_interface/cis_interface/examples/fakeplant/src/light.c</label>
        <link refid="light_8c"/>
        <childnode refid="471" relation="include">
        </childnode>
        <childnode refid="472" relation="include">
        </childnode>
        <childnode refid="473" relation="include">
        </childnode>
        <childnode refid="474" relation="include">
        </childnode>
      </node>
      <node id="503">
        <label>AsciiFileComm.h</label>
        <link refid="AsciiFileComm_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="491" relation="include">
        </childnode>
        <childnode refid="490" relation="include">
        </childnode>
      </node>
      <node id="492">
        <label>AsciiTableSerialize.h</label>
        <link refid="AsciiTableSerialize_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="488" relation="include">
        </childnode>
        <childnode refid="490" relation="include">
        </childnode>
      </node>
      <node id="494">
        <label>ObjSerialize.h</label>
        <link refid="ObjSerialize_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
      </node>
      <node id="484">
        <label>stddef.h</label>
      </node>
      <node id="475">
        <label>../tools.h</label>
        <link refid="tools_8h_source"/>
        <childnode refid="476" relation="include">
        </childnode>
        <childnode refid="471" relation="include">
        </childnode>
        <childnode refid="472" relation="include">
        </childnode>
        <childnode refid="477" relation="include">
        </childnode>
        <childnode refid="478" relation="include">
        </childnode>
        <childnode refid="479" relation="include">
        </childnode>
        <childnode refid="480" relation="include">
        </childnode>
        <childnode refid="482" relation="include">
        </childnode>
        <childnode refid="485" relation="include">
        </childnode>
      </node>
      <node id="497">
        <label>IPCComm.h</label>
        <link refid="IPCComm_8h_source"/>
        <childnode refid="496" relation="include">
        </childnode>
      </node>
      <node id="489">
        <label>FormatSerialize.h</label>
        <link refid="FormatSerialize_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="488" relation="include">
        </childnode>
        <childnode refid="490" relation="include">
        </childnode>
      </node>
      <node id="501">
        <label>ServerComm.h</label>
        <link refid="ServerComm_8h_source"/>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="500" relation="include">
        </childnode>
        <childnode refid="495" relation="include">
        </childnode>
      </node>
      <node id="474">
        <label>CisInterface.h</label>
        <link refid="CisInterface_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="486" relation="include">
        </childnode>
        <childnode refid="491" relation="include">
        </childnode>
        <childnode refid="490" relation="include">
        </childnode>
      </node>
      <node id="487">
        <label>../serialize/serialize.h</label>
        <link refid="serialize_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="488" relation="include">
        </childnode>
        <childnode refid="489" relation="include">
        </childnode>
        <childnode refid="492" relation="include">
        </childnode>
        <childnode refid="493" relation="include">
        </childnode>
        <childnode refid="494" relation="include">
        </childnode>
      </node>
      <node id="491">
        <label>AsciiFile.h</label>
        <link refid="AsciiFile_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
      </node>
      <node id="493">
        <label>PlySerialize.h</label>
        <link refid="PlySerialize_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
      </node>
      <node id="495">
        <label>comm_header.h</label>
        <link refid="comm__header_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="490" relation="include">
        </childnode>
      </node>
      <node id="483">
        <label>wchar.h</label>
      </node>
      <node id="476">
        <label>string.h</label>
      </node>
      <node id="496">
        <label>CommBase.h</label>
        <link refid="CommBase_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
      </node>
      <node id="499">
        <label>RPCComm.h</label>
        <link refid="RPCComm_8h_source"/>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="500" relation="include">
        </childnode>
        <childnode refid="495" relation="include">
        </childnode>
      </node>
      <node id="485">
        <label>unistd.h</label>
      </node>
      <node id="498">
        <label>ZMQComm.h</label>
        <link refid="ZMQComm_8h_source"/>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="495" relation="include">
        </childnode>
      </node>
      <node id="500">
        <label>DefaultComm.h</label>
        <link refid="DefaultComm_8h_source"/>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="498" relation="include">
        </childnode>
      </node>
      <node id="480">
        <label>regex_posix.h</label>
        <link refid="regex__posix_8h_source"/>
        <childnode refid="481" relation="include">
        </childnode>
        <childnode refid="482" relation="include">
        </childnode>
      </node>
      <node id="479">
        <label>time.h</label>
      </node>
      <node id="473">
        <label>math.h</label>
      </node>
      <node id="488">
        <label>SerializeBase.h</label>
        <link refid="SerializeBase_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
      </node>
      <node id="502">
        <label>ClientComm.h</label>
        <link refid="ClientComm_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="500" relation="include">
        </childnode>
        <childnode refid="495" relation="include">
        </childnode>
      </node>
      <node id="486">
        <label>../communication/communication.h</label>
        <link refid="communication_8h_source"/>
        <childnode refid="475" relation="include">
        </childnode>
        <childnode refid="487" relation="include">
        </childnode>
        <childnode refid="495" relation="include">
        </childnode>
        <childnode refid="496" relation="include">
        </childnode>
        <childnode refid="497" relation="include">
        </childnode>
        <childnode refid="498" relation="include">
        </childnode>
        <childnode refid="499" relation="include">
        </childnode>
        <childnode refid="501" relation="include">
        </childnode>
        <childnode refid="502" relation="include">
        </childnode>
        <childnode refid="503" relation="include">
        </childnode>
        <childnode refid="504" relation="include">
        </childnode>
        <childnode refid="500" relation="include">
        </childnode>
      </node>
      <node id="481">
        <label>regex.h</label>
      </node>
      <node id="471">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="light_8c_1a02b4459174b154df31d103bec990f8f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>double</type>
        <definition>double calc_light_intensity</definition>
        <argsstring>(double ambient_light, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)</argsstring>
        <name>calc_light_intensity</name>
        <param>
          <type>double</type>
          <declname>ambient_light</declname>
        </param>
        <param>
          <type>double</type>
          <declname>x1</declname>
        </param>
        <param>
          <type>double</type>
          <declname>y1</declname>
        </param>
        <param>
          <type>double</type>
          <declname>z1</declname>
        </param>
        <param>
          <type>double</type>
          <declname>x2</declname>
        </param>
        <param>
          <type>double</type>
          <declname>y2</declname>
        </param>
        <param>
          <type>double</type>
          <declname>z2</declname>
        </param>
        <param>
          <type>double</type>
          <declname>x3</declname>
        </param>
        <param>
          <type>double</type>
          <declname>y3</declname>
        </param>
        <param>
          <type>double</type>
          <declname>z3</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/examples/fakeplant/src/light.c" line="7" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/examples/fakeplant/src/light.c" bodystart="7" bodyend="17"/>
      </memberdef>
      <memberdef kind="function" id="light_8c_1a0ddf1224851353fc92bfbff6f499fa97" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int main</definition>
        <argsstring>(int argc, char *argv[])</argsstring>
        <name>main</name>
        <param>
          <type>int</type>
          <declname>argc</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>argv</declname>
          <array>[]</array>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/examples/fakeplant/src/light.c" line="20" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/examples/fakeplant/src/light.c" bodystart="20" bodyend="87"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;stdio.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;stdlib.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;math.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;CisInterface.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>calc_light_intensity(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ambient_light,<sp/></highlight></codeline>
<codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x1,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>y1,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>z1,</highlight></codeline>
<codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x2,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>y2,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>z2,</highlight></codeline>
<codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x3,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>y3,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>z3)<sp/>{</highlight></codeline>
<codeline lineno="11"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>a<sp/>=<sp/>sqrt(pow(x2<sp/>-<sp/>x1,<sp/>2)<sp/>+<sp/>pow(y2<sp/>-<sp/>y1,<sp/>2));</highlight></codeline>
<codeline lineno="12"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>b<sp/>=<sp/>sqrt(pow(x3<sp/>-<sp/>x2,<sp/>2)<sp/>+<sp/>pow(y3<sp/>-<sp/>y2,<sp/>2));</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>c<sp/>=<sp/>sqrt(pow(x1<sp/>-<sp/>x2,<sp/>2)<sp/>+<sp/>pow(y1<sp/>-<sp/>y2,<sp/>2));</highlight></codeline>
<codeline lineno="14"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>s<sp/>=<sp/>(a<sp/>+<sp/>b<sp/>+<sp/>c)/2.0;</highlight></codeline>
<codeline lineno="15"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>A<sp/>=<sp/>sqrt(s*(s<sp/>-<sp/>a)*(s<sp/>-<sp/>b)*(s<sp/>-<sp/>c));</highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ambient_light<sp/>*<sp/>A<sp/>*<sp/>(10.0<sp/>-<sp/>(z1<sp/>+<sp/>z2<sp/>+<sp/>z3)/3.0)/10.0;</highlight></codeline>
<codeline lineno="17"><highlight class="normal">}</highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>main(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>argc,</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*argv[])<sp/>{</highlight></codeline>
<codeline lineno="21"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>ret,<sp/>return_code<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/>cisInput_t<sp/>AmbInput<sp/>=<sp/>cisAsciiTableInput(</highlight><highlight class="stringliteral">&quot;ambient_light&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="24"><highlight class="normal"><sp/><sp/>cisInput_t<sp/>StructInput<sp/>=<sp/>cisAsciiArrayInput(</highlight><highlight class="stringliteral">&quot;canopy_structure&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="25"><highlight class="normal"><sp/><sp/>cisOutput_t<sp/>LightOutput<sp/>=<sp/>cisAsciiTableOutput(</highlight><highlight class="stringliteral">&quot;light_intensity&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;%lf\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Receive<sp/>Ambient<sp/>light</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ambient_light;</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>cisRecv(AmbInput,<sp/>&amp;ambient_light);</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;light:<sp/>Error<sp/>receiving<sp/>ambient<sp/>light.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;light:<sp/>ambient<sp/>light<sp/>=<sp/>%f\n&quot;</highlight><highlight class="normal">,<sp/>ambient_light);</highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Malloc<sp/>arrays<sp/>for<sp/>use</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>**x1<sp/>=<sp/>(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">**)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>**x2<sp/>=<sp/>(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">**)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>**x3<sp/>=<sp/>(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">**)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>3;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/>x1[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/>x2[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/>x3[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Loop<sp/>over<sp/>canopy<sp/>structures</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>npatch<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>light_intensity<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(1)<sp/>{</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/>npatch<sp/>=<sp/>cisRecv(StructInput,<sp/>&amp;x1[0],<sp/>&amp;x1[1],<sp/>&amp;x1[2],</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;x2[0],<sp/>&amp;x2[1],<sp/>&amp;x2[2],</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;x3[0],<sp/>&amp;x3[1],<sp/>&amp;x3[2]);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(npatch<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;light:<sp/>End<sp/>of<sp/>input.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>npatch;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>light_intensity<sp/>=<sp/>calc_light_intensity(ambient_light,</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x1[0][i],<sp/>x1[1][i],<sp/>x1[2][i],</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x2[0][i],<sp/>x2[1][i],<sp/>x2[2][i],</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x3[0][i],<sp/>x3[1][i],<sp/>x3[2][i]);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;light:<sp/>structure<sp/>=<sp/>\t%f\t%f\t%f<sp/>--&gt;<sp/>light_intensity<sp/>=<sp/>%f\n\t\t\t%f\t%f\t%f\n\t\t\t%f\t%f\t%f\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x1[0][i],<sp/>x1[1][i],<sp/>x1[2][i],<sp/>light_intensity,</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x2[0][i],<sp/>x2[1][i],<sp/>x2[2][i],</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x3[0][i],<sp/>x3[1][i],<sp/>x3[2][i]);</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>cisSend(LightOutput,<sp/>light_intensity);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;light:<sp/>Error<sp/>sending<sp/>light<sp/>intensity<sp/>output.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/>return_code<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="77"><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>3;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x1[i]<sp/>!=<sp/>NULL)<sp/>free(x1[i]);</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x2[i]<sp/>!=<sp/>NULL)<sp/>free(x2[i]);</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x3[i]<sp/>!=<sp/>NULL)<sp/>free(x3[i]);</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/>free(x1);</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/>free(x2);</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/>free(x3);</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>return_code;</highlight></codeline>
<codeline lineno="87"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/root/cis_interface/cis_interface/cis_interface/examples/fakeplant/src/light.c"/>
  </compounddef>
</doxygen>
