Пример #1
0
        /// <summary>
        /// Draws a TextGraphics primitive
        /// </summary>
        public TextGraphics DrawText(
            string text,
            bool scalable,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                TextGraphics graphic = (scalable ? node.AddScalableTextGraphics() : node.AddTextGraphics());

                graphic.Text = text;

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #2
0
        /// <summary>
        /// Draws a PointGraphics  primitive
        /// </summary>
        public PointGraphics DrawPoint(
            double[] position,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                PointGraphics graphic = node.AddPointGraphics();

                if (position != null)
                {
                    GraphicsCoordinateSet coordSet =
                        graphicsData.GraphicsDataSets.CreateCoordinateSet(
                            graphicsData.GetDataSetFreeId());

                    coordSet.PutCoordinates(ref position);

                    graphic.CoordinateSet = coordSet;
                }

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #3
0
        /// <summary>
        /// Draws a TriangleStripGraphics primitive
        /// </summary>
        /// <returns>TriangleStripGraphics</returns>
        public TriangleStripGraphics DrawTriangleStrip(
            double[] coordinates,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                TriangleStripGraphics graphic = node.AddTriangleStripGraphics();

                if (coordinates != null)
                {
                    GraphicsCoordinateSet coordSet =
                        graphicsData.GraphicsDataSets.CreateCoordinateSet(
                            graphicsData.GetDataSetFreeId());

                    coordSet.PutCoordinates(ref coordinates);

                    graphic.CoordinateSet = coordSet;
                }

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #4
0
        /// <summary>
        /// Returns a new GraphicsNode
        /// </summary>
        /// <returns>GraphicsNode</returns>
        public GraphicsNode CreateNewGraphicsNode()
        {
            CGraphics graphicsData = WorkingGraphics;

            GraphicsNode node = graphicsData.ClientGraphics.AddNode(
                graphicsData.GetGraphicNodeFreeId());

            return(node);
        }
Пример #5
0
        /// <summary>
        /// Use: Delete all graphics for input source created by the AdnClientGraphicsManager
        /// </summary>
        /// <returns>Void</returns>
        public void DeleteGraphics(Sheet sheet, bool deleteData)
        {
            CGraphics dataTx = new CGraphics(sheet, _clientId, true);

            dataTx.Delete(deleteData);

            CGraphics dataNonTx = new CGraphics(sheet, _clientId, false);

            dataNonTx.Delete(deleteData);
        }
Пример #6
0
        /// <summary>
        /// Use: Delete all graphics for input source created by the AdnClientGraphicsManager
        /// </summary>
        /// <returns>Void</returns>
        public void DeleteGraphics(DrawingView drawingView, bool deleteData)
        {
            CGraphics dataTx = new CGraphics(drawingView, _clientId, true);

            dataTx.Delete(deleteData);

            CGraphics dataNonTx = new CGraphics(drawingView, _clientId, false);

            dataNonTx.Delete(deleteData);
        }
Пример #7
0
        /// <summary>
        /// Use: Delete all graphics for input source created by the AdnClientGraphicsManager
        /// </summary>
        /// <returns>Void</returns>
        public void DeleteGraphics(Document document, bool deleteData)
        {
            CGraphics dataTx = new CGraphics(document, _clientId, true, false);

            dataTx.Delete(deleteData);

            CGraphics dataNonTx = new CGraphics(document, _clientId, false, false);

            dataNonTx.Delete(deleteData);
        }
Пример #8
0
        /// <summary>
        /// Returns a new GraphicsNode
        /// </summary>
        /// <returns>GraphicsNode</returns>
        public GraphicsNode CreateNewGraphicsNode(int customId)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                GraphicsNode node = graphicsData.ClientGraphics.AddNode(customId);

                return(node);
            }
            catch
            {
                return(null);
            }
        }
Пример #9
0
        /// <summary>
        /// Draws a TriangleGraphics primitive
        /// </summary>
        /// <returns>TriangleGraphics</returns>
        public TriangleGraphics DrawTriangle(
            double[] v1,
            double[] v2,
            double[] v3,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                TriangleGraphics graphic = node.AddTriangleGraphics();

                if ((v1 != null) && (v2 != null) && (v3 != null))
                {
                    GraphicsCoordinateSet coordSet =
                        graphicsData.GraphicsDataSets.CreateCoordinateSet(
                            graphicsData.GetDataSetFreeId());

                    List <double> coordinates = new List <double>();

                    coordinates.AddRange(v1);
                    coordinates.AddRange(v2);
                    coordinates.AddRange(v3);

                    double[] coordsArray = coordinates.ToArray();

                    coordSet.PutCoordinates(ref coordsArray);

                    graphic.CoordinateSet = coordSet;
                }

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #10
0
        /// <summary>
        /// Draws a ComponentGraphics primitive
        /// </summary>
        public ComponentGraphics DrawComponent(
            ComponentDefinition compDef,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                ComponentGraphics graphic = node.AddComponentGraphics(compDef);

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #11
0
        /// <summary>
        /// Draws a SurfaceGraphics primitive
        /// </summary>
        public SurfaceGraphics DrawSurface(
            object surface,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                SurfaceGraphics graphic = node.AddSurfaceGraphics(surface);

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #12
0
        /// <summary>
        /// Draws a CurveGraphics primitive
        /// </summary>
        public CurveGraphics DrawCurve(
            object curve,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                CurveGraphics graphic = node.AddCurveGraphics(curve);

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #13
0
        /// <summary>
        /// Draws a LineGraphics primitive
        /// </summary>
        /// <returns>LineGraphics</returns>
        public LineGraphics DrawLine(
            double[] startPoint,
            double[] endPoint,
            GraphicsNode node)
        {
            try
            {
                CGraphics graphicsData = WorkingGraphics;

                if (node == null)
                {
                    node = graphicsData.ClientGraphics.AddNode(
                        graphicsData.GetGraphicNodeFreeId());
                }

                LineGraphics graphic = node.AddLineGraphics();

                if ((startPoint != null) && (endPoint != null))
                {
                    GraphicsCoordinateSet coordSet =
                        graphicsData.GraphicsDataSets.CreateCoordinateSet(
                            graphicsData.GetDataSetFreeId());

                    double[] coordsArray = startPoint.Concat(endPoint).ToArray();

                    coordSet.PutCoordinates(ref coordsArray);

                    graphic.CoordinateSet = coordSet;
                }

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
Пример #14
0
        /// <summary>
        /// Use: Delete all graphics for input source created by the AdnClientGraphicsManager
        /// </summary>
        /// <returns>Void</returns>
        public void DeleteGraphics(ClientFeature feature, bool deleteData)
        {
            CGraphics data = new CGraphics(feature, _clientId, true);

            data.Delete(deleteData);
        }
Пример #15
0
        /// <summary>
        /// Use: Delete all graphics for input source created by the AdnClientGraphicsManager
        /// </summary>
        /// <returns>Void</returns>
        public void DeleteGraphics(InteractionEvents interactionEvents, bool deleteData)
        {
            CGraphics data = new CGraphics(interactionEvents, InteractionGraphicsMode);

            data.Delete(deleteData);
        }