octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #9040] Add function "lighting"


From: Rik
Subject: [Octave-patch-tracker] [patch #9040] Add function "lighting"
Date: Mon, 18 Jul 2016 18:24:15 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Update of patch #9040 (project octave):

                  Status:                    None => Done                   
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #7:

@Markus: I pushed your patch here
(http://hg.savannah.gnu.org/hgweb/octave/rev/18eae417ffec).

I had to remove the u umlaut in your name and replace with 'ue' because I was
getting some crazy encoding error that prevented Mercurial from applying the
patch


applying lighting
transaction abort!
rollback completed
cleaning up working directory...done
abort: decoding near 'Markus M�tzel <mar': 'utf8' codec can't decode byte
0xfc in position 8: invalid start byte!


Basically, I think you understand the Octave coding conventions, but here is
what I changed:

1) "!CONDITION" => "! CONDITION".  In English, one can read this as two words
"NOT" "CONDITION" so it makes it easier to understand.

2) "function_name (...)".  I found one instance of "cellfun(...)" which I
changed to "cellfun (...)".

3) strcmp instead of strcmpi for all comparisons to graphics properties
retrieved from a graphic object.  Internally, Octave normalizes all graphics
properties to lower case so it is shorter code, and slightly less work for the
CPU work, touse strcmp.  For properties that a user might enter, such as
inputs to a function, there is no guarantee and there strcmpi is useful.

Finally, I added a BIST test for


figure
lighting flat


This failed in the original code because there were no mesh or patch objects,
but strcmp ([], 'none') returns 0, not an empty matrix.  This then caused
trouble later on.  I fixed the code by adding an early return if there are no
objects to process.


if (isempty (hlist))
   return;
endif




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?9040>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]