Skip to content

Commit

Permalink
layer method for gds_element objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfgri committed Nov 6, 2016
1 parent de0fd81 commit 983e53b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
21 changes: 21 additions & 0 deletions Basic/@gds_element/layer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function [lay, dtype] = layer(gelm)
%function [lay, dtype] = layer(gelm)
%
% returns layer and data type properties of an element
% (this method is faster than field indexing)
%
% gelm : a gds_element object
% lay : layer property
% dtype : (Optional) data type property

if isref(gelm.data.internal)
error('gds_element: element has no layer/datatype property.');
end

lay = get_element_data(gelm.data.internal, 'layer');

if nargout > 1
dtype = get_element_data(gelm.data.internal, 'dtype');
end

end
2 changes: 1 addition & 1 deletion Basic/@gds_element/xy.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
% pos : a cell array containing one or more nx2 matrices
% with reference positions

if ~isfield(gelm.data, 'xy');
if ~isfield(gelm.data, 'xy')
error('gds_element.xy : element has no position data.');
end

Expand Down
4 changes: 2 additions & 2 deletions Basic/gdsii_version.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
%

% toolbox version and version date
tb_version = '137';
tb_date = '2016-November-05';
tb_version = '138';
tb_date = '2016-November-06';
ltb_ver = [tb_version, ' (', tb_date, ')'];
if exist('OCTAVE_VERSION')
interpreter = 'Octave';
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- new 'layer' method for gds_element objects to query layer/data type, which
is faster than field indexing.

2016-November-05
- version 137
- return [] in 'get_element_data' if an element does not have a requested
Expand Down

0 comments on commit 983e53b

Please sign in to comment.