Example #1
0
 public ConwayOperator ChangeFaceSelection(int val)
 {
     faceSelections += val;
     faceSelections  = (FaceSelections)Mathf.Clamp(
         (int)faceSelections, 0, Enum.GetNames(typeof(FaceSelections)).Length - 1
         );
     return(this);
 }
Example #2
0
 public OpParams(
     FaceSelections selection,
     string selectByTags = "",
     bool randomValues   = false
     )
 {
     facesel   = selection;
     randomize = randomValues;
     tags      = selectByTags;
 }
Example #3
0
 public OpParams(
     float a, float b,
     FaceSelections selection,
     string selectByTags = "",
     bool randomValues   = false
     )
 {
     valueA    = a;
     valueB    = b;
     facesel   = selection;
     randomize = randomValues;
     tags      = selectByTags;
 }
        public List <int> GetFaceSelection(FaceSelections facesel)
        {
            var selectedFaces = new List <int>();

            for (var faceIndex = 0; faceIndex < Faces.Count; faceIndex++)
            {
                var face = Faces[faceIndex];
                if (IncludeFace(faceIndex, facesel))
                {
                    selectedFaces.Add(faceIndex);
                }
            }

            return(selectedFaces);
        }
        public void TagFaces(string tags, FaceSelections facesel = FaceSelections.All, Func <FilterParams, bool> filter = null, bool introvert = false)
        {
            if (FaceTags == null || FaceTags.Count == 0)
            {
                InitTags();
            }

            var newTagList = OpParams.TagListFromString(tags, introvert);

            int counter = 0;

            for (var i = 0; i < Faces.Count; i++)
            {
                if (IncludeFace(i, facesel, null, filter))
                {
                    var existingTagSet = FaceTags[i];
                    existingTagSet.UnionWith(newTagList);
                    FaceTags[i] = existingTagSet;
                    counter++;
                }
            }
        }