Beispiel #1
0
        /// <summary>
        /// UpdateWorkpointComponents : Update Workpoint feature  components.
        /// </summary>
        /// <param name="fno">Workpoint Fno</param>
        /// <param name="fid">Workpoint FID</param>
        /// <param name="workPointFeature">Workpoint Feature</param>
        /// <param name="geoUpdate">Bool value indicates the updation of geometry.</param>
        /// <param name="strStructureID">StructureID of Active Key Object</param>
        private void UpdateWorkpointComponents(short fno, int fid, IGTKeyObject workPointFeature, bool geoUpdate,
                                               string strStructureID, int ownerCount, bool isLinear)
        {
            IGTComponents workPointComponents = workPointFeature.Components;

            foreach (IGTComponent component in workPointComponents)
            {
                if (component.Name == "WORKPOINT_N" && geoUpdate)
                {
                    UpdateWorkPointAttributes(component, strStructureID);
                }
                else if (component.Name == "WORKPOINT_CU_N" && ownerCount == 0 && isLinear == true)
                {
                    UpdateWorkpointCUAttributes(workPointFeature.FID, component);
                }
                else if (component.Name == "WORKPOINT_CU_N" && isLinear == false)
                {
                    UpdateWorkpointCUAttributes(workPointFeature.FID, component);
                }
            }

            IGTKeyObject           oKeyObject       = m_dataContext.OpenFeature(fno, fid);
            IGTGeometry            gTGeometry       = oKeyObject.Components.GetComponent(m_gtcommonFunctions.GetPrimaryGraphicCno(fno, true)).Geometry;
            customWorkPointCreator workPointCreator = new customWorkPointCreator(m_dataContext, gTGeometry.FirstPoint.X, gTGeometry.FirstPoint.Y);

            workPointCreator.SynchronizeWPCuLabel(workPointFeature);
        }
Beispiel #2
0
        /// <summary>
        /// Creates new workpoint feature.
        /// </summary>
        private void CreateNewWorkpointFeature(short fno, int fid, bool isLinear, string strStructureID, int ownerCount,
                                               short formationOwnerFno = 0, int formationOwnerFid = 0)
        {
            try
            {
                IGTGeometry gTGeometry = null;

                if (fno == 2400)
                {
                    gTGeometry = m_dataContext.OpenFeature(formationOwnerFno, formationOwnerFid).Components.GetComponent(m_gtcommonFunctions.GetPrimaryGraphicCno(formationOwnerFno, true)).Geometry;
                }
                else
                {
                    gTGeometry = m_dataContext.OpenFeature(fno, fid).Components.GetComponent(m_gtcommonFunctions.GetPrimaryGraphicCno(fno, true)).Geometry;
                }

                customWorkPointCreator workPointCreator = new customWorkPointCreator(m_dataContext, gTGeometry.FirstPoint.X, gTGeometry.FirstPoint.Y);
                IGTKeyObject           workPointFeature = workPointCreator.CreateWorkPointFeature();

                if (fno == 2400)
                {
                    m_NewWorkpointFidList.Add(formationOwnerFid, workPointFeature.FID);
                    UpdateWorkpointComponents(formationOwnerFno, formationOwnerFid, workPointFeature, true, strStructureID, ownerCount, isLinear);
                }
                else
                {
                    m_NewWorkpointFidList.Add(fid, workPointFeature.FID);
                    UpdateWorkpointComponents(fno, fid, workPointFeature, true, strStructureID, ownerCount, isLinear);
                }



                //workPointCreator.SynchronizeWPCuLabel(workPointFeature);
            }
            catch
            {
                throw;
            }
        }