private ICategoryObject GetObject(ICategoryObject obj) { if (obj is RelativeMeasurements) { return(obj); } IPosition p = obj.GetObject <IPosition>(); if (p != null) { return(p as ICategoryObject); } throw new Exception("Illegal type"); }
IObjectLabelUI IDefaultLabelFactory.CreateObjectLabel(ICategoryObject obj) { IPropertiesEditor pe = obj.GetObject <IPropertiesEditor>(); if (pe != null) { object ob = pe.Properties; if (ob is object[]) { object[] o = ob as object[]; if (o.Length >= 2) { object oi = o[1]; } } } return(null); }
/// <summary> /// Creates object label from object /// </summary> /// <param name="obj">The object</param> /// <returns>The label</returns> public override IObjectLabelUI CreateLabel(ICategoryObject obj) { Camera camera = obj.GetSimpleObject <Camera>(); if (camera != null) { return(factory.CreateLabel(camera) as IObjectLabelUI); } if (obj is Motion6D.SerializablePosition) { Motion6D.SerializablePosition sp = obj.GetObject <Motion6D.SerializablePosition>(); object lp = sp.Parameters; Motion6D.Interfaces.IVisible vis = lp.GetSimpleObject <Motion6D.Interfaces.IVisible>(); if (vis != null) { object vl = factory.CreateLabel(sp, vis); if (vl is IObjectLabelUI) { return(vl as IObjectLabelUI); } } } return(null); }