diff options
author | Stavros Aronis <[email protected]> | 2011-04-02 18:57:42 +0300 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-05-04 15:06:15 +0200 |
commit | ca4633fd683527097451ca1398c90c87bb5c14fc (patch) | |
tree | 3d8e18c9becd4feb7d3ceb1eed24bdce2ef69dd6 /lib/dialyzer/test/opaque_tests_SUITE_data/src/wings/wings_sel.erl | |
parent | bc619f0cbf9555df6dfc44a499f0cd9cee8bd1be (diff) | |
download | otp-ca4633fd683527097451ca1398c90c87bb5c14fc.tar.gz otp-ca4633fd683527097451ca1398c90c87bb5c14fc.tar.bz2 otp-ca4633fd683527097451ca1398c90c87bb5c14fc.zip |
Rename suite data directories
Diffstat (limited to 'lib/dialyzer/test/opaque_tests_SUITE_data/src/wings/wings_sel.erl')
-rw-r--r-- | lib/dialyzer/test/opaque_tests_SUITE_data/src/wings/wings_sel.erl | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/dialyzer/test/opaque_tests_SUITE_data/src/wings/wings_sel.erl b/lib/dialyzer/test/opaque_tests_SUITE_data/src/wings/wings_sel.erl deleted file mode 100644 index eef797027e..0000000000 --- a/lib/dialyzer/test/opaque_tests_SUITE_data/src/wings/wings_sel.erl +++ /dev/null @@ -1,68 +0,0 @@ -%% -%% wings_sel.erl -- -%% -%% This module implements selection utilities. -%% - --module(wings_sel). - --export([face_regions/2, fold/3, set/3]). - --include("wings.hrl"). - -set(Mode, Sel, St) -> - St#st{selmode=Mode, sel=lists:sort(Sel), sh=false}. - -%%% -%%% Fold over the selection. -%%% - -fold(F, Acc, #st{sel=Sel,shapes=Shapes}) -> - fold_1(F, Acc, Shapes, Sel). - -fold_1(F, Acc0, Shapes, [{Id,Items}|T]) -> - We = gb_trees:get(Id, Shapes), - ?ASSERT(We#we.id =:= Id), - fold_1(F, F(Items, We, Acc0), Shapes, T); -fold_1(_F, Acc, _Shapes, []) -> Acc. - -%%% -%%% Divide the face selection into regions where each face shares at least -%%% one edge with another face in the same region. Two faces can share a -%%% vertex without necessarily being in the same region. -%%% - -face_regions(Faces, We) when is_list(Faces) -> - face_regions_1(gb_sets:from_list(Faces), We); -face_regions(Faces, We) -> - face_regions_1(Faces, We). - -face_regions_1(Faces, We) -> - find_face_regions(Faces, We, fun collect_face_fun/5, []). - -find_face_regions(Faces0, We, Coll, Acc) -> - case gb_sets:is_empty(Faces0) of - true -> Acc; - false -> - {Face,Faces1} = gb_sets:take_smallest(Faces0), - Ws = [Face], - {Reg,Faces} = collect_face_region(Ws, We, Coll, [], Faces1), - find_face_regions(Faces, We, Coll, [Reg|Acc]) - end. - -collect_face_region([_|_]=Ws0, We, Coll, Reg0, Faces0) -> - Reg = Ws0++Reg0, - {Ws,Faces} = wings_face:fold_faces(Coll, {[],Faces0}, Ws0, We), - collect_face_region(Ws, We, Coll, Reg, Faces); -collect_face_region([], _, _, Reg, Faces) -> - {gb_sets:from_list(Reg),Faces}. - -collect_face_fun(Face, _, _, Rec, {Ws,Faces}=A) -> - Of = case Rec of - #edge{lf=Face,rf=Of0} -> Of0; - #edge{rf=Face,lf=Of0} -> Of0 - end, - case gb_sets:is_member(Of, Faces) of - true -> {[Of|Ws],gb_sets:delete(Of, Faces)}; - false -> A - end. |