Exemple #1
0
        private void getActors()
        {
            var parent = this.Parent;

            if (parent == null)
            {
                return;
            }

            Viewport3DXext vp = parent as Viewport3DXext;

            if (vp == null)
            {
                return;
            }

            foreach (var item in vp.Items)
            {
                this.viewPort = vp;
                LineGenerator3D      linGen      = item as LineGenerator3D;
                ArchitectureDisplay  arcDisp     = item as ArchitectureDisplay;
                ZoneGroupDisplay     zoneDisp    = item as ZoneGroupDisplay;
                ComponentDisplay     comprepDisp = item as ComponentDisplay;
                OcTreeManager        otMan       = item as OcTreeManager;
                ViewFrustumFunctions vfFunc      = item as ViewFrustumFunctions;
                if (linGen != null)
                {
                    this.LineGen = linGen;
                }
                if (arcDisp != null)
                {
                    this.ArcDisp = arcDisp;
                }
                if (zoneDisp != null)
                {
                    this.ZoneDisp = zoneDisp;
                    if (zoneDisp != null)
                    {
                        this.ZoneDisp.PropertyChanged += ZoneDisp_PropertyChanged;
                    }
                }
                if (comprepDisp != null)
                {
                    this.CompDisp = comprepDisp;
                }
                if (otMan != null)
                {
                    this.OTManager = otMan;
                }
                if (vfFunc != null)
                {
                    this.ViewFF = vfFunc;
                }
            }
        }
Exemple #2
0
        void ZoneDisp_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            ZoneGroupDisplay zgd = sender as ZoneGroupDisplay;

            if (zgd != null)
            {
                if (e != null && e.PropertyName == "PickedZonedVolume")
                {
                    if (this.comp_waiting_to_be_assoc_w_volume != null && this.comp_waiting_for_picked_volume)
                    {
                        // complete command OnAssociateCompRepWZonedVolumeCommand()
                        zgd.EManager.ReAssociateZonedVolumeWComp(this.comp_waiting_to_be_assoc_w_volume);

                        this.viewPort.SwitchActionModeCmd.Execute("SPACES_OPENINGS");
                        if (this.CompDisp != null)
                        {
                            this.CompDisp.CompRepMANAGER.UpdateFlatRecord();
                            this.CompDisp.UpdateCompRepList();
                        }
                        // this.viewPort.SendDataToCompBuilder(this.comp_waiting_to_be_assoc_w_volume); // not necessary, call is performed from the CompRep class
                        this.comp_waiting_for_picked_volume = false;
                    }
                    else if (this.comp_waiting_to_be_aligned_w_volume_wall != null && this.comp_waiting_for_alignment_w_picked_volume_wall)
                    {
                        // complete command OnAlignCompRepWZonedVolumeCommand()
                        ZonedVolume selected_vol = zgd.EManager.SelectedVolume;
                        CompRepContainedIn_Instance selected_comp = this.comp_waiting_to_be_aligned_w_volume_wall as CompRepContainedIn_Instance;
                        if (selected_vol != null && selected_comp != null && selected_comp.GR_Relationships[0].GrIds.X == selected_vol.ID)
                        {
                            bool    successful_wall_hit = false;
                            Vector3 new_X_Axis          = selected_vol.GetHorizontalAxisOfHitWall(zgd.HitPointOnVolumeMesh.ToVector3(), out successful_wall_hit);
                            if (successful_wall_hit)
                            {
                                selected_comp.AlignPlacement(new_X_Axis.ToVector3D());
                            }
                            this.viewPort.SwitchActionModeCmd.Execute("SPACES_OPENINGS");
                            if (this.CompDisp != null)
                            {
                                this.CompDisp.CompRepMANAGER.UpdateFlatRecord();
                                this.CompDisp.UpdateCompRepList();
                            }
                        }

                        this.comp_waiting_for_alignment_w_picked_volume_wall = false;
                    }
                }
            }
        }