Beispiel #1
0
 public void KeyUp(Intergraph.GTechnology.API.IGTMapWindow MapWindow, int KeyCode, int ShiftState, Intergraph.GTechnology.API.IGTPlacementTechniqueEventMode EventMode)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
Beispiel #2
0
 public void MouseClick(Intergraph.GTechnology.API.IGTMapWindow MapWindow, Intergraph.GTechnology.API.IGTPoint UserPoint, int Button, int ShiftState, Intergraph.GTechnology.API.IGTDDCKeyObjects LocatedObjects, Intergraph.GTechnology.API.IGTPlacementTechniqueEventMode EventMode)
 {
     try
     {
         string ownerFeatureName = m_ActiveMapWindow.DetailID == 0 ? "Pad" : "Vault";
         if (0 == LocatedObjects.Count)
         {
             // If there are no linear objects in the collection, then there is nothing to use to create
             // the new geometry.  Beep to notify the user and display a message in the status bar.
             System.Console.Beep();
             m_GTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "There is no existing " + ownerFeatureName + " symbol feature to Own the Primary switch gear which is to be placed adjacent to it.");
         }
         else
         {
             if (1 == LocatedObjects.Count && ((LocatedObjects[0].FNO == 108 && LocatedObjects[0].ComponentViewName == "V_PAD_S" && m_ActiveMapWindow.DetailID == 0) || (LocatedObjects[0].FNO == 117 && LocatedObjects[0].ComponentViewName == "V_VAULT_DP" && m_GTApplication.ActiveMapWindow.DetailID != 0)))
             {
                 // There is exactly 1 linear object in the collection, so use it to creat the new geometry.
                 this.PlacePrimarySwitchGear(LocatedObjects[0]);
                 MapWindow.HighlightedObjects.Clear();
             }
             else
             {
                 m_GTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Please identify only " + ownerFeatureName + " symbol feature to Own the Primary switch gear which is to be placed adjacent to it.");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #3
0
 public void MouseMove(Intergraph.GTechnology.API.IGTMapWindow MapWindow, Intergraph.GTechnology.API.IGTPoint UserPoint, int ShiftState, Intergraph.GTechnology.API.IGTDDCKeyObjects LocatedObjects, Intergraph.GTechnology.API.IGTPlacementTechniqueEventMode EventMode)
 {
 }
Beispiel #4
0
 public void KeyUp(Intergraph.GTechnology.API.IGTMapWindow MapWindow, int KeyCode, int ShiftState, Intergraph.GTechnology.API.IGTPlacementTechniqueEventMode EventMode)
 {
 }
Beispiel #5
0
 public virtual void MouseClick(Intergraph.GTechnology.API.IGTMapWindow MapWindow, Intergraph.GTechnology.API.IGTPoint UserPoint, int Button, int ShiftState, Intergraph.GTechnology.API.IGTDDCKeyObjects LocatedObjects, Intergraph.GTechnology.API.IGTPlacementTechniqueEventMode EventMode)
 {
     if (!bSilent)
     {
         if (m_PTHelper != null)
         {
             m_PTHelper.MouseClick(UserPoint, Button, ShiftState);
         }
     }
 }
Beispiel #6
0
 public virtual void MouseMove(IGTMapWindow MapWindow, Intergraph.GTechnology.API.IGTPoint UserPoint, int ShiftState, Intergraph.GTechnology.API.IGTDDCKeyObjects LocatedObjects, Intergraph.GTechnology.API.IGTPlacementTechniqueEventMode EventMode)
 {
     if (!bSilent)
     {
         if (m_PTHelper != null)
         {
             m_PTHelper.MouseMove(UserPoint, ShiftState);
         }
         if (m_gtApplication != null)
         {
             m_gtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Please click on related Primary Conductor feature.");
         }
     }
 }
Beispiel #7
0
 public override void MouseClick(IGTMapWindow MapWindow, Intergraph.GTechnology.API.IGTPoint UserPoint, int Button, int ShiftState, Intergraph.GTechnology.API.IGTDDCKeyObjects LocatedObjects, Intergraph.GTechnology.API.IGTPlacementTechniqueEventMode EventMode)
 {
     try
     {
         if (!bSilent)
         {
             bool     pointSelected     = false;
             bool     lineSelected      = false;
             IGTPoint m_gtOrientedPoint = null;
             //verify if the located object is point feature
             for (int i = 0; i < LocatedObjects.Count; i++)
             {
                 if (LocatedObjects[i].Geometry.Type == "OrientedPointGeometry")
                 {
                     pointSelected = true;
                     break;
                 }
                 else
                 {
                     for (int indx = 0; indx < linearFNOs.Count; indx++)
                     {
                         if (linearFNOs[indx] == LocatedObjects[i].FNO)
                         {
                             if (!lineSelected)
                             {
                                 //Get point and angle of the located linear feature
                                 m_gtOrientedPoint = GetPointAndAngle(LocatedObjects[i].Geometry, UserPoint);
                                 lineSelected      = true;
                                 //Add Property "LinearFno" to Session to hold value located Linear fno and used by ByPassSPT Placement Technique
                                 //ByPassSPT Placement Technique get located Linear Fno
                                 AddProperty("LinearFno", linearFNOs[indx]);
                                 break;
                             }
                         }
                     }
                 }
             }
             if ((!pointSelected) && (m_gtOrientedPoint != null))
             {
                 pointSelected = true;
                 m_GComp.Geometry.FirstPoint.X = m_gtOrientedPoint.X;
                 m_GComp.Geometry.FirstPoint.Y = m_gtOrientedPoint.Y;
                 m_gtPointGeometry             = (IGTOrientedPointGeometry)m_GComp.Geometry;
                 m_gtPointGeometry.Origin      = m_gtOrientedPoint;
                 //set the orientation of the point feature same as located linear feature
                 m_gtPointGeometry.Orientation = VectorByAngle(ang);
                 m_PTHelper.SetGeometry(m_gtPointGeometry);
                 m_PTHelper.EndPlacement();
                 flag = true;
             }
             else
             {
                 MessageBox.Show("Please click on related Primary Conductor feature.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Please click on related Primary Conductor feature. \n" + ex.Message, "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error);
         AbortPlacement();
     }
     finally
     {
         if (flag)
         {
             Exitcommand();
         }
     }
 }