Inheritance: MonoBehaviour
	// Use this for initialization
	void Awake () {
        UITimer = GetComponent<Text>();
        normalTextColor = UITimer.color;
        timeOutline = GetComponent<Outline>();
        normalOutlineColor = timeOutline.effectColor;
        setTime();
	}
        public override void GetOutline(View view, Outline outline)
        {
            int margin = Math.Min (view.Width, view.Height) / 10;

            outline.SetRoundRect (margin, margin, view.Width - margin,
                view.Height - margin, margin / 2);
        }
	private void Init(Vector3 position, string value, Color color) {
		originalPosition = position;
		text = GetComponent<Text>();
		outline = GetComponent<Outline>();
		text.text = value;
		text.color = color;
	}
Exemple #4
0
        public void ShowType(Type t)
        {
            Buffer.Clear ();

            current_tag = "default";

            GuiStream guistream = new GuiStream (null, (x,y) => {
                TextIter end = Buffer.EndIter;
                Buffer.InsertWithTagsByName (ref end, y, current_tag);
            });

            StreamWriter writer = new StreamWriter (guistream);
            Outline outliner = new Outline (t, writer, true, false, false);

            outliner.OutlineNotificationEvent += delegate (int kind, object value) {
                switch (kind){
                case 0:
                    current_tag = "default";
                    break;
                case 1:
                    current_tag = GetTypeTag ((Type) value);
                    break;
                }
            };
            outliner.OutlineType ();
            writer.Flush ();
        }
		public override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			// Create your fragment here
			SetHasOptionsMenu (true);
			clip = new Outline ();
			sample_texts = Resources.GetStringArray (Resource.Array.sample_texts);
		}
        protected override void OnSizeChanged(int w, int h, int oldw, int oldh)
        {
            base.OnSizeChanged (w, h, oldw, oldh);

            var outline = new Outline ();
            OutlineProvider = new OutlineProv ();
            outline.SetOval (0, 0, w, h);
            OutlineProvider.GetOutline (this, outline);
            ClipToOutline = true;
        }
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			var rootView = inflater.Inflate (Resource.Layout.ztranslation, container, false);


			//Find view to apply Z-translation to
			floatingShape = rootView.FindViewById (Resource.Id.circle);

			//Create the outlines
			mOutline = new Outline ();

			circleProvider = new CircleOutlineProvider ();
			circleProvider.GetOutline (floatingShape, mOutline);

			rectProvider = new RectOutlineProvider ();
			rectProvider.GetOutline (floatingShape, mOutline);
			/*
			//Define the view's shape
			floatingShape.OutlineProvider = circleProvider;
			//Clip view to outline
			floatingShape.ClipToOutline = true;
			*/
			var dragLayout = rootView.FindViewById<DragFrameLayout> (Resource.Id.main_layout);

			dragLayout.mDragFrameLayoutController = new DragFrameLayoutController ((bool captured) => {
				floatingShape.Animate ()
					.TranslationZ (captured ? 50 : 0)
					.SetDuration (100);
				Log.Debug (TAG, captured ? "drag" : "drop");
			});

			dragLayout.AddDragView (floatingShape);

			rootView.FindViewById (Resource.Id.raise_bt).Click += delegate {
				mElevation += ELEVATION_STEP;
				Log.Debug (TAG, string.Format ("Elevation: {0:0.#}", mElevation));
				floatingShape.Elevation = mElevation;
			};

			rootView.FindViewById (Resource.Id.lower_bt).Click += delegate {
				mElevation = Math.Max (mElevation - ELEVATION_STEP, 0);
				Log.Debug (TAG, string.Format ("Elevation: {0:0.#}", mElevation));
				floatingShape.Elevation = mElevation;
			};

			/* Create a spinner with options to change the shape of the object. */
			var spinner = rootView.FindViewById<Spinner> (Resource.Id.shapes_spinner);
			spinner.Adapter = new ArrayAdapter<string> (
				this.Activity,
				Android.Resource.Layout.SimpleSpinnerDropDownItem,
				this.Resources.GetStringArray (Resource.Array.shapes));

			spinner.OnItemSelectedListener = this;
			return rootView;
		}
Exemple #8
0
    void Awake()
    {
        text = GameObject.Find("Text").GetComponent<Text>();
        textOutline = GameObject.Find("Text").GetComponent<Outline>();
        AudioListener.volume = 1;

        text.text += "\n\n(";
        for (int i = 0; i < GameController.GAME_SECRETS.Length; i++)
            text.text += (GameController.GAME_SECRETS[i] ? "*" : ".");
        text.text += ")";
    }
    void Start()
    {
        tempCol = new Color(255, 255, 255, 0);

        if(gameOverText != null)
        {
            victoryText = gameOverText.GetComponent<Text>();
            //victoryText.enabled = false;
            victoryOutline = victoryText.GetComponent<Outline>();
            victoryShadow = victoryText.GetComponent<Shadow>();
        }
    }
Exemple #10
0
    void Awake()
    {
        game = FindObjectOfType<GameController>();
        text = GameObject.Find("Text").GetComponent<Text>();
        textActive = GameObject.Find("TextActive").GetComponent<Text>();
        textOutline = GameObject.Find("Text").GetComponent<Outline>();
        textActiveOutline = GameObject.Find("TextActive").GetComponent<Outline>();

        canSkip = (game.levelType != LevelType.Other);                                              // You can only skip this level IF: you're in a level in any of the three wings

        if (!GameController.CAN_SKIP_ALL && canSkip == true)                                        // ... and if you've beaten this specific level before (accelerates backtracking for secrets)
            canSkip &= (game.levelNumber <= GameController.LEVEL_PROGRESS[(int) game.levelType]);   // Comment out these 2 lines for the "nice" version of the game where you can skip any puzzle
    }
Exemple #11
0
        private static IEnumerable<Outline> ParseOutline(XElement item)
        {
            List<Outline> output = new List<Outline>();

            foreach (var subItem in item.Descendants("outline"))
            {
                output.AddRange(ParseOutline(subItem));
            }

            if (item.Attribute("xmlUrl") != null)
            {
                Outline newOutline = new Outline()
                           {
                               Title = GetAttributeValue(item.Attribute("title")),
                               Text = GetAttributeValue(item.Attribute("text")),
                               Type = GetAttributeValue(item.Attribute("type"))
                           };

                try
                {
                    newOutline.XmlUrl = new Uri(GetAttributeValue(item.Attribute("xmlUrl")));
                }
                catch (UriFormatException)
                {
                }

                try
                {
                    newOutline.HtmlUrl = new Uri(GetAttributeValue(item.Attribute("htmlUrl")));
                }
                catch (UriFormatException)
                {
                    newOutline.HtmlUrl = newOutline.XmlUrl;
                }

                if (  ( newOutline.XmlUrl != null && newOutline.XmlUrl.ToString().Length > 0 ) || (  newOutline.HtmlUrl != null && newOutline.HtmlUrl.ToString().Length > 0 ) )
                {
                    output.Add(newOutline);
                }
                else
                {
                    // Didn't get a good html or xml value, don't both adding
                }
            }

            return output;
        }
Exemple #12
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIDocument uidoc = commandData.Application.ActiveUIDocument;
            Document   doc   = uidoc.Document;
            Selection  sel   = uidoc.Selection;

            try
            {
                ElementsJoinUI currentUI = new ElementsJoinUI();
                currentUI.ShowDialog();

                if (currentUI.DialogResult == false)
                {
                    return(Result.Cancelled);
                }

                string firstCatName = (currentUI.comboFirstCategory.SelectedItem as ComboBoxItem).Content.ToString();
                string seconCatName = (currentUI.comboSecondCategory.SelectedItem as ComboBoxItem).Content.ToString();

                BuiltInCategory firstCat  = checkCategory(firstCatName);
                BuiltInCategory secondCat = checkCategory(seconCatName);

                if (firstCat == BuiltInCategory.INVALID || secondCat == BuiltInCategory.INVALID)
                {
                    return(Result.Cancelled);
                }

                IList <Element> ElementsToJoin = new FilteredElementCollector(doc).OfCategory(firstCat).WhereElementIsNotElementType().ToList();

                using (Transaction t = new Transaction(doc, Properties.Messages.ElementJoin_Transaction))
                {
                    t.Start();

                    FailureHandlingOptions joinFailOp = t.GetFailureHandlingOptions();
                    joinFailOp.SetFailuresPreprocessor(new JoinFailureHandler());
                    t.SetFailureHandlingOptions(joinFailOp);

                    foreach (Element currentElementToJoin in ElementsToJoin)
                    {
                        BoundingBoxXYZ bBox = currentElementToJoin.get_BoundingBox(null);
                        bBox.Enabled = true;
                        Outline outLine = new Outline(bBox.Min, bBox.Max);

                        BoundingBoxIntersectsFilter bbIntersects = new BoundingBoxIntersectsFilter(outLine, Utils.ConvertM.cmToFeet(3));

                        IList <Element> elementsIntersecting = new FilteredElementCollector(doc).OfCategory(secondCat).WhereElementIsNotElementType().WherePasses(bbIntersects).ToList();

                        foreach (Element currentElementToBeJoined in elementsIntersecting)
                        {
                            try
                            {
                                JoinGeometryUtils.JoinGeometry(doc, currentElementToJoin, currentElementToBeJoined);
                            }
                            catch
                            {
                            }
                        }
                    }
                    t.Commit();
                }
            }
            catch (Exception excep)
            {
                ExceptionManager eManager = new ExceptionManager(excep);
            }

            return(Result.Succeeded);
        }
 void Start()
 {
     _text = GetComponent<Text>();
     _outline = GetComponent<Outline>();
     _ypos = transform.position.y;
 }
Exemple #14
0
 void Start()
 {
     outline = GetComponent <Outline>();
 }
Exemple #15
0
 void Awake()
 {
     rt      = GetComponent <RectTransform>();
     outline = GetComponent <Outline>();
 }
    void Start()
    {
        sounds = GameObject.FindObjectOfType<SoundsController>();

        rifleAmmoText.text = rifleAmmo.ToString();
        shotgunAmmoText.text = shotgunAmmo.ToString();
        laserAmmoText.text = laserAmmo.ToString();

        shotgunAmmoText.color = Color.gray;
        laserAmmoText.color = Color.gray;

        rifleAmmoTextOutline = rifleAmmoText.GetComponent<Outline>();
        shotgunAmmoTextOutline = shotgunAmmoText.GetComponent<Outline>();
        laserAmmoTextOutline = laserAmmoText.GetComponent<Outline>();

        rifleSymbolOutline = rifleSymbol.GetComponent<Outline>();
        shotgunSymbolOutline = shotgunSymbol.GetComponent<Outline>();
        laserSymbolOutline = laserSymbol.GetComponent<Outline>();

        gravGunBarObj.SendMessage("SetNewValue", GRAVGUN_INIT_VALUE);
        InvokeRepeating("RegenerateGravGun", 0.5f, 0.5f);

        if (Application.loadedLevelName == "TestScene-WeaponsEnabled")
        {
            EnableShotgun();
            UpdateShotgunAmmo(10);

            EnableLaser();
            UpdateLaserAmmo(15);

            GameObject[] allEnemies = GameObject.FindGameObjectsWithTag("Enemy");

            foreach (GameObject enemy in allEnemies)
            {
                if (enemy)
                {
                    enemy.SendMessage("CanDropShotgunAmmo");
                    enemy.SendMessage("CanDropLaserAmmo");
                }
            }

        }
    }
Exemple #17
0
 protected override void OnDragging()
 {
     Outline.Show(GetSplitterOutlineBounds(Control.MousePosition));
 }
Exemple #18
0
 void Awake()
 {
     trackedObj = GetComponent <SteamVR_TrackedObject>();
     _outline   = GetComponent <Outline>();
 }
Exemple #19
0
 /// <summary>
 /// Makes a UI element blink red.
 /// </summary>
 /// <param name="timer">The timer's value {0:duration}</param>
 /// <param name="duration">The duration of the blink effect, in seconds</param>
 /// <param name="count">The number of blink cycles to perform in the duration</param>
 /// <param name="base_color">The (not red) base color of the blinking element</param>
 /// <param name="outline">The UI element to blink</param>
 private void BlinkRed(float timer, float duration, float count, Color base_color, ref Outline outline)
 {
     outline.effectColor = BlinkColor(timer, duration, count, base_color);
 }
 private void Start()
 {
     outL = gameObject.GetComponent <Outline>();
     DisplayHighlight();
 }
Exemple #21
0
            public override void GetOutline(View view, Outline outline)
            {
                int shapeSize = view.Resources.GetDimensionPixelSize(Resource.Dimension.shape_size);

                outline.SetRoundRect(0, 0, shapeSize, shapeSize, shapeSize / 2);
            }
Exemple #22
0
        public void ReadGGO(int indexGlyph,
                            out Outline outl,
                            DIAction dia)
        {
            this.m_validator.DIA = dia;
            outl = null;

            GConsts.TypeGlyph typeGlyph;
            this.ReadTypeGlyph(indexGlyph, out typeGlyph, dia);
            if (typeGlyph != GConsts.TypeGlyph.Simple)
            {
                return;
            }
            int offsStart, length;

            if (!this.m_tableLoca.GetValidateEntryGlyf(indexGlyph,
                                                       out offsStart, out length, this.m_validator, this.m_font))
            {
                return;
            }
            MBOBuffer buffer = this.m_tableGlyf.Buffer;
            int       iKnot;

            ushort[] arrIndKnotEnd;
            short[]  arrXRel, arrYRel;
            byte[]   arrFlag;
            int      numCont;

            try
            {
                numCont       = buffer.GetShort((uint)(offsStart + (int)Table_glyf.FieldOffsets.numCont));
                arrIndKnotEnd = new ushort [numCont];
                for (short iCont = 0; iCont < numCont; iCont++)
                {
                    arrIndKnotEnd[iCont] = buffer.GetUshort((uint)(offsStart + Table_glyf.FieldOffsets.nextAfterHeader + iCont * 2));
                }
                int    numKnot         = arrIndKnotEnd[numCont - 1] + 1;
                uint   offsInstrLength = (uint)(offsStart + Table_glyf.FieldOffsets.nextAfterHeader + 2 * numCont);
                ushort lengthInstr     = buffer.GetUshort(offsInstrLength);
                uint   offsInstr       = offsInstrLength + 2;
                uint   offsFlag        = offsInstr + lengthInstr;
                arrFlag = new byte [numKnot];
                iKnot   = 0;                // index of flag in array flags
                uint offsCur = offsFlag;    // counter of flag in the file
                while (iKnot < numKnot)
                {
                    byte flag = buffer.GetByte(offsCur++);
                    arrFlag[iKnot++] = flag;
                    bool toRepeat = ((flag & (byte)(Table_glyf.MaskFlagKnot.toRepeat)) != 0);
                    if (toRepeat)
                    {
                        byte numRepeat = buffer.GetByte(offsCur++);
                        for (byte iRepeat = 0; iRepeat < numRepeat; iRepeat++)
                        {
                            arrFlag[iKnot++] = flag;
                        }
                    }
                }
                arrXRel = new short [numKnot];
                arrYRel = new short [numKnot];
                // read data for x-coordinates
                for (iKnot = 0; iKnot < numKnot; iKnot++)
                {
                    if ((arrFlag[iKnot] & (byte)(Table_glyf.MaskFlagKnot.isXByte)) != 0)
                    {
                        byte xRel = buffer.GetByte(offsCur++);
                        if ((arrFlag[iKnot] & (byte)(Table_glyf.MaskFlagKnot.isXSameOrPozitive)) != 0)
                        {
                            arrXRel[iKnot] = xRel;
                        }
                        else
                        {
                            arrXRel[iKnot] = (short)(-xRel);
                        }
                    }
                    else
                    {
                        if ((arrFlag[iKnot] & (byte)(Table_glyf.MaskFlagKnot.isXSameOrPozitive)) != 0)
                        {
                            arrXRel[iKnot] = 0;
                        }
                        else
                        {
                            arrXRel[iKnot] = buffer.GetShort(offsCur);
                            offsCur       += 2;
                        }
                    }
                }
                // read data for y-coordinates
                for (iKnot = 0; iKnot < numKnot; iKnot++)
                {
                    if ((arrFlag[iKnot] & (byte)(Table_glyf.MaskFlagKnot.isYByte)) != 0)
                    {
                        byte yRel = buffer.GetByte(offsCur++);
                        if ((arrFlag[iKnot] & (byte)(Table_glyf.MaskFlagKnot.isYSameOrPozitive)) != 0)
                        {
                            arrYRel[iKnot] = yRel;
                        }
                        else
                        {
                            arrYRel[iKnot] = (short)(-yRel);
                        }
                    }
                    else
                    {
                        if ((arrFlag[iKnot] & (byte)(Table_glyf.MaskFlagKnot.isYSameOrPozitive)) != 0)
                        {
                            arrYRel[iKnot] = 0;
                        }
                        else
                        {
                            arrYRel[iKnot] = buffer.GetShort(offsCur);
                            offsCur       += 2;
                        }
                    }
                }
                if (offsCur - 2 >= offsStart + length)
                {
                    throw new System.IndexOutOfRangeException();
                }
            }
            catch (System.IndexOutOfRangeException)
            {
                this.m_validator.Error(
                    E._GEN_E_OffsetExceedsTableLength,
                    (OTTag)"glyf");
                return;
            }

            try
            {
                short xAbs = 0;
                short yAbs = 0;
                int   indKnotStart, indKnotEnd = -1;
                outl = new Outline();
                for (ushort iCont = 0; iCont < numCont; iCont++)
                {
                    indKnotStart = indKnotEnd + 1;
                    indKnotEnd   = arrIndKnotEnd[iCont];
                    Contour cont = null;
                    cont = new Contour();
                    for (iKnot = indKnotStart; iKnot <= indKnotEnd; iKnot++)
                    {
                        xAbs += arrXRel[iKnot];
                        yAbs += arrYRel[iKnot];
                        bool isOn = ((arrFlag[iKnot] & ((byte)(Table_glyf.MaskFlagKnot.isOnCurve))) != 0);
                        Knot knot = new Knot(iKnot, xAbs, yAbs, isOn);
                        cont.KnotAdd(knot);
                    }
                    outl.ContourAdd(cont);
                }
            }
            catch
            {
                outl.ClearDestroy();
                outl = null;
            }
        }
Exemple #23
0
    public void Awake()
    {
        childrenHolder = transform.Find("Children").gameObject;
        outline        = GetComponent <Outline>();

        if (outline != null)
        {
            outline.enabled = false;
        }

        int offset = 0, i = 0, inventory = 0;

        for (; i < childrenHolder.transform.childCount && inventory < (itemRecipe.ingredients.Count + itemRecipe.output.Count); i++, offset++)
        {
            if (inventory < itemRecipe.ingredients.Count)
            {
                if (offset < itemRecipe.ingredients[inventory].maxStorage)
                {
                    itemRecipe.ingredients[inventory].spawnLocations.Add(childrenHolder.transform.GetChild(i));
                }
                else
                {
                    inventory++;
                    offset = -1;
                    i--;
                }
            }
            else
            {
                int inven = inventory - itemRecipe.ingredients.Count;
                if (offset < itemRecipe.output[inven].maxStorage)
                {
                    itemRecipe.output[inven].spawnLocations.Add(childrenHolder.transform.GetChild(i));
                }
                else
                {
                    inventory++;
                    offset = -1;
                    i--;
                }
            }
        }

        foreach (Ingredient ing in itemRecipe.ingredients)
        {
            foreach (Transform t in ing.spawnLocations)
            {
                if (t.childCount > 0)
                {
                    GameObject.Destroy(t.GetChild(0).gameObject);
                }
            }
        }
        foreach (Ingredient ing in itemRecipe.output)
        {
            foreach (Transform t in ing.spawnLocations)
            {
                if (t.childCount > 0)
                {
                    GameObject.Destroy(t.GetChild(0).gameObject);
                }
            }
        }
    }
Exemple #24
0
 void Start()
 {
     rb              = GetComponent <Rigidbody> ();
     outline         = GetComponent <Outline> ();
     initConstraints = rb.constraints;
 }
Exemple #25
0
 public virtual void DeselectNode()
 {
     Destroy(outline);
     outline = null;
     onDeselect.Invoke();
 }
Exemple #26
0
 public static LTDescr LTEffectColor(this Outline self, Color to, float time)
 {
     return(self.transform.LTValue(self.effectColor, to, time).setOnUpdate((Color x) => self.effectColor = x));
 }
 // Use this for initialization
 void Start()
 {
     _myOutline = GetComponent<Outline>();
 }
Exemple #28
0
 public static LTDescr LTAlpha(this Outline self, float to, float time)
 {
     return(self.LTEffectColor(new Color(self.effectColor.r, self.effectColor.g, self.effectColor.b, to), time));
 }
Exemple #29
0
        /// <summary>
        /// Adds a cell to the stored outline of the point cloud.  If the cell boundaries extend beyond the current outline, the outline 
        /// is adjusted.
        /// </summary>
        /// <param name="storage"></param>
        private void AddCellToOutline(PointCloudCellStorage storage)
        {
            XYZ lowerLeft = storage.LowerLeft;
            XYZ upperRight = storage.UpperRight;
            if (m_outline == null)
                m_outline = new Outline(lowerLeft, upperRight);
            else
            {
                XYZ minimumPoint = m_outline.MinimumPoint;

                m_outline.MinimumPoint = new XYZ(Math.Min(minimumPoint.X, lowerLeft.X),
                                                Math.Min(minimumPoint.Y, lowerLeft.Y),
                                                Math.Min(minimumPoint.Z, lowerLeft.Z));

                XYZ maximumPoint = m_outline.MaximumPoint;
                m_outline.MaximumPoint = new XYZ(Math.Max(maximumPoint.X, upperRight.X),
                                                Math.Max(maximumPoint.Y, upperRight.Y),
                                                Math.Max(maximumPoint.Z, upperRight.Z));
            }
        }
        private bool CopyLinkedRoomData(List <FamilyInstance> doorInstances)
        {
            bool result = true;

            try
            {
                Dictionary <int, LinkedInstanceProperties> linkedInstanceDictionary = CollectLinkedInstances();

                StringBuilder strBuilder = new StringBuilder();
                using (TransactionGroup tg = new TransactionGroup(m_doc, "Set Door Parameters"))
                {
                    tg.Start();
                    try
                    {
                        foreach (FamilyInstance door in doorInstances)
                        {
                            using (Transaction trans = new Transaction(m_doc, "Set Parameter"))
                            {
                                trans.Start();
                                try
                                {
                                    DoorProperties dp = new DoorProperties(door);
                                    if (null != dp.FromPoint && null != dp.ToPoint)
                                    {
                                        GeometryElement geomElem  = door.get_Geometry(new Options());
                                        XYZ             direction = door.FacingOrientation;

                                        Dictionary <int, LinkedRoomProperties> linkedRooms = new Dictionary <int, LinkedRoomProperties>();
                                        foreach (LinkedInstanceProperties lip in linkedInstanceDictionary.Values)
                                        {
                                            GeometryElement trnasformedElem = geomElem.GetTransformed(lip.TransformValue.Inverse);
                                            BoundingBoxXYZ  bb = trnasformedElem.GetBoundingBox();
                                            //extended bounding box

                                            XYZ midPt  = 0.5 * (bb.Min + bb.Max);
                                            XYZ extMin = bb.Min + (bb.Min - midPt).Normalize();
                                            XYZ extMax = bb.Max + (bb.Max - midPt).Normalize();

                                            Outline outline = new Outline(extMin, extMax);

                                            BoundingBoxIntersectsFilter bbIntersectFilter = new BoundingBoxIntersectsFilter(outline);
                                            BoundingBoxIsInsideFilter   bbInsideFilter    = new BoundingBoxIsInsideFilter(outline);
                                            LogicalOrFilter             orFilter          = new LogicalOrFilter(bbIntersectFilter, bbInsideFilter);
                                            FilteredElementCollector    collector         = new FilteredElementCollector(lip.LinkedDocument);
                                            List <Room> roomList = collector.OfCategory(BuiltInCategory.OST_Rooms).WherePasses(orFilter).WhereElementIsNotElementType().ToElements().Cast <Room>().ToList();
                                            if (roomList.Count > 0)
                                            {
                                                foreach (Room room in roomList)
                                                {
                                                    LinkedRoomProperties lrp = new LinkedRoomProperties(room);
                                                    lrp.LinkedInstance = lip;
                                                    if (!linkedRooms.ContainsKey(lrp.RoomId))
                                                    {
                                                        linkedRooms.Add(lrp.RoomId, lrp);
                                                    }
                                                }
                                            }
                                        }

                                        LinkedRoomProperties fromRoom = null;
                                        LinkedRoomProperties toRoom   = null;

                                        if (linkedRooms.Count > 0)
                                        {
                                            foreach (LinkedRoomProperties lrp in linkedRooms.Values)
                                            {
                                                XYZ tFrom = lrp.LinkedInstance.TransformValue.Inverse.OfPoint(dp.FromPoint);
                                                XYZ tTo   = lrp.LinkedInstance.TransformValue.Inverse.OfPoint(dp.ToPoint);

                                                if (lrp.RoomObject.IsPointInRoom(tFrom))
                                                {
                                                    dp.FromRoom = lrp.RoomObject;
                                                    fromRoom    = lrp;
                                                }
                                                if (lrp.RoomObject.IsPointInRoom(tTo))
                                                {
                                                    dp.ToRoom = lrp.RoomObject;
                                                    toRoom    = lrp;
                                                }
                                            }
                                        }

                                        if (null != fromRoom)
                                        {
                                            Parameter fParam = door.LookupParameter(fromRoomNumber);
                                            if (null != fParam)
                                            {
                                                fParam.Set(fromRoom.RoomNumber);
                                            }
                                            fParam = door.LookupParameter(fromRoomName);
                                            if (null != fParam)
                                            {
                                                fParam.Set(fromRoom.RoomName);
                                            }
                                        }


                                        if (null != toRoom)
                                        {
                                            Parameter tParam = door.LookupParameter(toRoomNumber);
                                            if (null != tParam)
                                            {
                                                tParam.Set(toRoom.RoomNumber);
                                            }
                                            tParam = door.LookupParameter(toRoomName);
                                            if (null != tParam)
                                            {
                                                tParam.Set(toRoom.RoomName);
                                            }
                                        }

                                        if (!doorDictionary.ContainsKey(dp.DoorId))
                                        {
                                            doorDictionary.Add(dp.DoorId, dp);
                                        }
                                    }
                                    trans.Commit();
                                }
                                catch (Exception ex)
                                {
                                    trans.RollBack();
                                    string message = ex.Message;
                                    result = false;
                                    strBuilder.AppendLine(door.Id.IntegerValue + "\t" + door.Name + ": " + ex.Message);
                                }
                            }
                        }
                        tg.Assimilate();
                    }
                    catch (Exception ex)
                    {
                        tg.RollBack();
                        string message = ex.Message;
                    }

                    if (strBuilder.Length > 0)
                    {
                        MessageBox.Show("The following doors have been skipped due to some issues.\n\n" + strBuilder.ToString(), "Skipped Door Elements", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to collect door data.\n" + ex.Message, "Collect Door Data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            return(result);
        }
			public override void GetOutline (View view, Outline outline)
			{
				outline.SetRoundRect (0, 0, c.vw, c.vh, c.radius);
			}
 public override void GetOutline(Android.Views.View view, Outline outline)
 {
     outline?.SetRoundRect(0, 0, view.Width, view.Height, _radius);
 }
Exemple #33
0
 // Start is called before the first frame update
 void Start()
 {
     text = GetComponent <Text>();
     Line = GetComponent <Outline>();
 }
        /// <summary>
        /// Return the element ids of all furniture and 
        /// equipment family instances contained in the 
        /// given room.
        /// </summary>
        static List<Element> GetFurniture( Room room )
        {
            BoundingBoxXYZ bb = room.get_BoundingBox( null );

              Outline outline = new Outline( bb.Min, bb.Max );

              BoundingBoxIntersectsFilter filter
            = new BoundingBoxIntersectsFilter( outline );

              Document doc = room.Document;

              // Todo: add category filters and other
              // properties to narrow down the results

              // what categories of family instances
              // are we interested in?

              BuiltInCategory[] bics = new BuiltInCategory[] {
            BuiltInCategory.OST_Furniture,
            BuiltInCategory.OST_PlumbingFixtures,
            BuiltInCategory.OST_SpecialityEquipment
              };

              LogicalOrFilter categoryFilter
            = new LogicalOrFilter( bics
              .Select<BuiltInCategory,ElementFilter>(
            bic => new ElementCategoryFilter( bic ) )
              .ToList<ElementFilter>() );

              FilteredElementCollector familyInstances
            = new FilteredElementCollector( doc )
              .WhereElementIsNotElementType()
              .WhereElementIsViewIndependent()
              .OfClass( typeof( FamilyInstance ) )
              .WherePasses( categoryFilter )
              .WherePasses( filter );

              int roomid = room.Id.IntegerValue;

              List<Element> a = new List<Element>();

              foreach( FamilyInstance fi in familyInstances )
              {
            if( null != fi.Room
              && fi.Room.Id.IntegerValue.Equals( roomid ) )
            {
              Debug.Assert( fi.Location is LocationPoint,
            "expected all furniture to have a location point" );

              a.Add( fi );
            }
              }
              return a;
        }
Exemple #35
0
        /// <summary>
        /// The internal implementation for point cloud read requests from Revit.
        /// </summary>
        /// <remarks>Both IPointCloudAccess.ReadPoints() and IPointSetIterator.ReadPoints() are served by this method.</remarks>
        /// <param name="rFilter">The point cloud filter.</param>
        /// <param name="buffer">The point cloud buffer.</param>
        /// <param name="nBufferSize">The maximum number of points in the buffer.</param>
        /// <param name="startIndex">The start index for points.  Pass 0 if called from IPointCloudAccess.ReadPoints() or if this is the first
        /// call to IPointSetIterator.ReadPoints().  Pass the previous cumulative number of read points for second and successive calls to
        /// IPointSetIterator.ReadPoints().</param>
        /// <returns>The number of points read.</returns>
        protected unsafe int ReadSomePoints(PointCloudFilter rFilter, IntPtr buffer, int nBufferSize, int startIndex)
        {
            // Get the pointer to the buffer.
            CloudPoint *cpBuffer     = (CloudPoint *)buffer.ToPointer();
            int         pointIndex   = 0;
            int         currentIndex = startIndex;
            int         totalPoints  = 0;
            int         startCell    = 0;
            Outline     fullOutline  = GetOutline();

            // Test each cell until the first cell with needed points is found.
            for (int i = 0; i < m_storedCells.Count; i++)
            {
                PointCloudCellStorage cell = m_storedCells[i];

                // Pass the cell outline to the filter.
                int filterResult = rFilter.TestCell(cell.LowerLeft, cell.UpperRight);

                // Filter result == -1 means the cell is completely out of scope for the filter.
                if (filterResult == -1)
                {
                    continue;
                }

                // The cell is at least partially in scope.  If the cell has more points than
                // the number read in previous calls, we should start with this cell.
                // If it has less points than the number read, the cell was already processed and we
                // should move to the next one.
                totalPoints += cell.NumberOfPoints;
                if (currentIndex < totalPoints)
                {
                    startCell    = i;
                    currentIndex = Math.Max(0, startIndex - totalPoints);
                    break;
                }
            }

            // Start with the current candidate cell and read cells until there are no more to read.
            for (int i = startCell; i < m_storedCells.Count; i++)
            {
                // Test the cell against the filter.
                PointCloudCellStorage cell = m_storedCells[i];
                int filterResult           = rFilter.TestCell(cell.LowerLeft, cell.UpperRight);

                // Filter result == -1 means the cell is entirely out of scope, skip it.
                if (filterResult == -1)
                {
                    continue;
                }

                // Filter result == 0 means some part of the cell is in scope.
                // Prepare for cell is called to process the cell's points.
                if (filterResult == 0)
                {
                    rFilter.PrepareForCell(fullOutline.MinimumPoint, fullOutline.MaximumPoint, cell.NumberOfPoints);
                }

                // Loop through all points in the cell.
                for (int j = currentIndex; j < cell.NumberOfPoints; j++)
                {
                    // If we need to test the point for acceptance, use the filter to do so.
                    // If filter result == 1 the entire cell was in scope, no need to test.
                    if (filterResult == 0)
                    {
                        if (!rFilter.TestPoint(cell.PointsBuffer[j]))
                        {
                            continue;
                        }
                    }

                    // Add the point to the buffer and increment the counter
                    *(cpBuffer + pointIndex) = cell.PointsBuffer[j];
                    pointIndex++;

                    // Stop when the max number of points is reached
                    if (pointIndex >= nBufferSize)
                    {
                        break;
                    }
                }

                // Stop when the max number of points is reached
                if (pointIndex >= nBufferSize)
                {
                    break;
                }
                currentIndex = 0;
            }

            return(pointIndex);
        }
Exemple #36
0
    public void disableOutline()
    {
        Outline myOutline = GetComponent <Outline>();

        myOutline.enabled = false;
    }
 private void Awake()
 {
     outline = label.GetComponent <Outline>();
 }
Exemple #38
0
    public void enableOutline()
    {
        Outline myOutline = GetComponent <Outline>();

        myOutline.enabled = true;
    }
Exemple #39
0
 private void Start()
 {
     outline = gameObject.GetComponent <Outline>();
 }
Exemple #40
0
 private void Awake()
 {
     _rigidbody     = gameObject.GetComponent <Rigidbody>();
     _outline       = transform.GetComponent <Outline>();
     isInteractable = false;
 }
Exemple #41
0
 private void Start()
 {
     Outline             = this.gameObject.GetComponent <Outline>();
     Outline.effectColor = nullColor;
 }
        /// <summary>
        /// View extension predicate method: does 
        /// this view intersect the given bounding box?
        /// </summary>
        public static bool IntersectsBoundingBox( 
            this View view,
            BoundingBoxXYZ targetBoundingBox)
        {
            Document doc = view.Document;
              var viewBoundingBox = view.CropBox;

              if( !view.CropBoxActive )
              {
            using( Transaction tr = new Transaction( doc ) )
            {
              //If the cropbox is not active we can't
              //extract the boundingbox (we rollback so we
              //don't change anything and also increase
              //performance)
              tr.Start( "Temp" );
              view.CropBoxActive = true;
              viewBoundingBox = view.CropBox;
              tr.RollBack();
            }
              }

              Outline viewOutline = null;

              if( view is ViewPlan )
              {
            var viewRange = ( view as ViewPlan ).GetViewRange();

            //We need to change the boundingbox Z-values because
            //they are not correct (for some reason).

            var bottomXYZ = ( doc.GetElement( viewRange
              .GetLevelId( PlanViewPlane.BottomClipPlane ) )
            as Level ).Elevation
              + viewRange.GetOffset( PlanViewPlane.BottomClipPlane );

            var topXYZ = ( doc.GetElement( viewRange
              .GetLevelId( PlanViewPlane.CutPlane ) )
            as Level ).Elevation
              + viewRange.GetOffset( PlanViewPlane.CutPlane );

            viewOutline = new Outline( new XYZ(
              viewBoundingBox.Min.X, viewBoundingBox.Min.Y,
              bottomXYZ ), new XYZ( viewBoundingBox.Max.X,
              viewBoundingBox.Max.Y, topXYZ ) );
              }

              //this is where I try to handle viewsections.
              //But I can't get it to work!!

              if( !viewBoundingBox.Transform.BasisY.IsAlmostEqualTo(
            XYZ.BasisY ) )
              {
            viewOutline = new Outline(
              new XYZ( viewBoundingBox.Min.X,
               viewBoundingBox.Min.Z, viewBoundingBox.Min.Y ),
              new XYZ( viewBoundingBox.Max.X,
            viewBoundingBox.Max.Z, viewBoundingBox.Max.Y ) );
              }

              using( var boundingBoxAsOutline = new Outline(
            targetBoundingBox.Min, targetBoundingBox.Max ) )
              {
            return boundingBoxAsOutline.Intersects(
              viewOutline, 0 );
              }
        }
 // Use this for initialization
 void Start()
 {
     outliner         = gameObject.GetComponent <Outline>();
     outliner.enabled = false;
 }
Exemple #44
0
    void Awake()
    {
        // If there's no save file, don't bother with any loading. Just go straight to the living room

        if (!File.Exists(filename))
        {
            SceneManager.LoadScene(1);
            return;
        }

        // Otherwise, we have something to load. Get the data from the save file and store it

        BinaryFormatter bf = new BinaryFormatter();
        FileStream file = File.Open(filename, FileMode.Open);
        data = (GameSaveData)bf.Deserialize(file);
        file.Close();

        printGameSaveData(data);

        text = GameObject.Find("Text").GetComponent<Text>();
        textActive = GameObject.Find("TextActive").GetComponent<Text>();
        textDisabled = GameObject.Find("TextDisabled").GetComponent<Text>();
        textOutline = GameObject.Find("Text").GetComponent<Outline>();
        textActiveOutline = GameObject.Find("TextActive").GetComponent<Outline>();
        textDisabledOutline = GameObject.Find("TextDisabled").GetComponent<Outline>();
        sounds = GetComponents<AudioSource>();
        fx = FindObjectOfType<PostProcessing>();
        audioExtrasPlayer = transform.Find("AudioExtras").GetComponent<AudioSource>();

        dataCompletion = gameCompletion(data);
        tMain[0] = "== " + dataCompletion + "% COMPLETE ==" + tMain[0];
    }
 void Start( )
 {
     m_OutlineComponent = GetComponent<Outline>( );
     m_y_Dist = -m_NormalDist;
 }
 public override void GetOutline (View view, Outline outline)
 {
   var size = res.GetDimensionPixelSize (fabSize == FabSize.Normal ? Resource.Dimension.fab_size_normal : Resource.Dimension.fab_size_mini);
   outline.SetOval (0, 0, size, size);
 }
Exemple #47
0
 void Awake()
 {
     outline = label.GetComponent<Outline>();
 }
			public override void GetOutline (View view, Outline outline)
			{
				outline.SetOval (0, 0, view.Width, view.Height);
			}
Exemple #49
0
    /// <summary>
    /// Return a string for an Outline
    /// formatted to two decimal places.
    /// </summary>
    public static string OutlineString( Outline o )
    {
      //XYZ d = o.MaximumPoint - o.MinimumPoint;

      return string.Format( "({0},{1})",
        PointString( o.MinimumPoint ),
        PointString( o.MaximumPoint ) );
    }
 public void addOutline(Outline o)
 {
     o.attachTo(pictureBox1);
     listBox1.Items.Add(o);
     redraw();
 }
			public override void GetOutline (View view, Outline outline)
			{
				int shapeSize = view.Resources.GetDimensionPixelSize (Resource.Dimension.shape_size);
				outline.SetRoundRect (0, 0, shapeSize, shapeSize, shapeSize / 2);
			}
Exemple #52
0
 private RectTransform SetupOutline(Outline outline, Vector2 size)
 {
     return(UtilsClass.DrawSprite(outline.color, gameObject.transform, Vector2.zero, size + new Vector2(outline.size, outline.size), "Outline"));
 }
Exemple #53
0
 // Use this for initialization
 private void Start()
 {
     _outline = GetComponent <Outline>();
 }
 void Start()
 {
     slamText = GameObject.Find("Canvas/Slam - Team " + (int)((team % 2 + 1 ) % 2 + 1)).GetComponent<Text>();
     //Handle player boost meter
     meter = GameObject.Find("Canvas/BoostMeter - Player " + team).GetComponent<Slider>();
     meter.maxValue = maxBoost;
     outline = meter.transform.FindChild("Background").GetComponent<Outline>();
     particles = GameObject.FindGameObjectsWithTag("SlamZone");
     for(int i = 0; i < particles.Length; i++) {
         if(particles[i].transform.root.GetComponent<Hoop>().team == team) {
             particles[i] = null;
         }
     }
     mashText.text = "";
     dunkPanel.gameObject.SetActive(false);
     for(int i = 0; i < particles.Length; i++) {
         if(particles[i]) {
             particles[i].SetActive(false);
         }
     }
     victoryString = slamText.text;
     slamText.text = "";
     origPos = transform.position;
 }
Exemple #55
0
    public void SetOutline(Outline outline)
    {
        this.outline = outline;

        if(style != null)
        {
            this.style.SetOutline(outline, this);
        }
    }
 // Use this for initialization
 void Start()
 {
     startRect.DOLocalMoveY(-200, 2).From();
     logoRect.DOLocalMoveY(325, 2).From().OnComplete(SpreadOutline);
     outline = logoRect.gameObject.GetComponent <Outline>();
 }
		public override void GetOutline (View view, Outline outline)
		{
			outline.SetOval (0, 0, size, size);
		}
Exemple #58
0
        public void AddOutline(Outline outline)
        {
            RectTransform outlineRectTransform = SetupOutline(outline, size);

            outlineRectTransform.transform.SetAsFirstSibling();
        }
        // from RevitAPI.chm description of BoundingBoxIntersectsFilter Class
        // case 1260682 [Find walls in a specific area]
        void f2()
        {
            // Use BoundingBoxIntersects filter to find
              // elements with a bounding box that intersects
              // the given outline.

              // Create a Outline, uses a minimum and maximum
              // XYZ point to initialize the outline.

              Outline myOutLn = new Outline(
            XYZ.Zero, new XYZ( 100, 100, 100 ) );

              // Create a BoundingBoxIntersects filter with
              // this Outline

              BoundingBoxIntersectsFilter filter
            = new BoundingBoxIntersectsFilter( myOutLn );

              // Apply the filter to the elements in the
              // active document.  This filter excludes all
              // objects derived from View and objects
              // derived from ElementType

              FilteredElementCollector collector
            = new FilteredElementCollector( _doc );

              IList<Element> elements =
            collector.WherePasses( filter ).ToElements();

              // Find all walls which don't intersect with
              // BoundingBox: use an inverted filter to match
              // elements.  Use shortcut command OfClass()
              // to find walls only

              BoundingBoxIntersectsFilter invertFilter
            = new BoundingBoxIntersectsFilter( myOutLn,
              true ); // inverted filter

              collector = new FilteredElementCollector( _doc );

              IList<Element> notIntersectWalls
            = collector.OfClass( typeof( Wall ) )
              .WherePasses( invertFilter ).ToElements();
        }
Exemple #60
0
 public UI_Bar(Transform parent, Vector2 anchoredPosition, Vector2 size, Color backgroundColor, Color barColor, float sizeRatio, Outline outline)
 {
     SetupParent(parent, anchoredPosition, size);
     if (outline != null)
     {
         SetupOutline(outline, size);
     }
     SetupBackground(backgroundColor);
     SetupBar(barColor);
     SetSize(sizeRatio);
 }