Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        /// <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);
        }