public TextGraphics DrawText(
            string text,
            bool scalable,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics 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);
            }
        }
        public PointGraphics DrawPoint(
            double[] position,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics 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);
            }
        }
        public TriangleStripGraphics DrawTriangleStrip(
            double[] coordinates,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics 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);
            }
        }
        //////////////////////////////////////////////////////////////////////////////////////
        // Use: Returns a new GraphicsNode
        //
        //////////////////////////////////////////////////////////////////////////////////////
        public GraphicsNode CreateNewGraphicsNode()
        {
            AdnGraphics graphicsData = WorkingGraphics;

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

            return(node);
        }
        public void DeleteGraphics(DrawingView drawingView, bool deleteData)
        {
            AdnGraphics dataTx = new AdnGraphics(drawingView, _clientId, true);

            dataTx.Delete(deleteData);

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

            dataNonTx.Delete(deleteData);
        }
        public void DeleteGraphics(Sheet sheet, bool deleteData)
        {
            AdnGraphics dataTx = new AdnGraphics(sheet, _clientId, true);

            dataTx.Delete(deleteData);

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

            dataNonTx.Delete(deleteData);
        }
        //////////////////////////////////////////////////////////////////////////////////////
        // Use: Delete all graphics for input source created by the AdnClientGraphicsManager
        //
        //////////////////////////////////////////////////////////////////////////////////////
        public void DeleteGraphics(Document document, bool deleteData)
        {
            AdnGraphics dataTx = new AdnGraphics(document, _clientId, true, false);

            dataTx.Delete(deleteData);

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

            dataNonTx.Delete(deleteData);
        }
        public GraphicsNode CreateNewGraphicsNode(int customId)
        {
            try
            {
                AdnGraphics graphicsData = WorkingGraphics;

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

                return(node);
            }
            catch
            {
                return(null);
            }
        }
        public TriangleGraphics DrawTriangle(
            double[] v1,
            double[] v2,
            double[] v3,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics 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);
            }
        }
        public CurveGraphics DrawCurve(
            object curve,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics graphicsData = WorkingGraphics;

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

                CurveGraphics graphic = node.AddCurveGraphics(curve);

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
        public ComponentGraphics DrawComponent(
            ComponentDefinition compDef,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics graphicsData = WorkingGraphics;

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

                ComponentGraphics graphic = node.AddComponentGraphics(compDef);

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
        public SurfaceGraphics DrawSurface(
            object surface,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics graphicsData = WorkingGraphics;

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

                SurfaceGraphics graphic = node.AddSurfaceGraphics(surface);

                return(graphic);
            }
            catch
            {
                return(null);
            }
        }
        public LineGraphics DrawLine(
            double[] startPoint,
            double[] endPoint,
            GraphicsNode node)
        {
            try
            {
                AdnGraphics 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);
            }
        }
 public void DeleteGraphics(ClientFeature feature, bool deleteData)
 {
     AdnGraphics data = new AdnGraphics(feature, _clientId, true);
     data.Delete(deleteData);
 }
 public void DeleteGraphics(InteractionEvents interactionEvents, bool deleteData)
 {
     AdnGraphics data = new AdnGraphics(interactionEvents, InteractionGraphicsMode);
     data.Delete(deleteData);
 }
        public void DeleteGraphics(Sheet sheet, bool deleteData)
        {
            AdnGraphics dataTx = new AdnGraphics(sheet, _clientId, true);
            dataTx.Delete(deleteData);

            AdnGraphics dataNonTx = new AdnGraphics(sheet, _clientId, false);
            dataNonTx.Delete(deleteData);
        }
        public void DeleteGraphics(DrawingView drawingView, bool deleteData)
        {
            AdnGraphics dataTx = new AdnGraphics(drawingView, _clientId, true);
            dataTx.Delete(deleteData);

            AdnGraphics dataNonTx = new AdnGraphics(drawingView, _clientId, false);
            dataNonTx.Delete(deleteData);
        }
        //////////////////////////////////////////////////////////////////////////////////////
        // Use: Delete all graphics for input source created by the AdnClientGraphicsManager
        //
        //////////////////////////////////////////////////////////////////////////////////////
        public void DeleteGraphics(Document document, bool deleteData)
        {
            AdnGraphics dataTx = new AdnGraphics(document, _clientId, true, false);
            dataTx.Delete(deleteData);

            AdnGraphics dataNonTx = new AdnGraphics(document, _clientId, false, false);
            dataNonTx.Delete(deleteData);
        }
        public void DeleteGraphics(InteractionEvents interactionEvents, bool deleteData)
        {
            AdnGraphics data = new AdnGraphics(interactionEvents, InteractionGraphicsMode);

            data.Delete(deleteData);
        }
        public void DeleteGraphics(ClientFeature feature, bool deleteData)
        {
            AdnGraphics data = new AdnGraphics(feature, _clientId, true);

            data.Delete(deleteData);
        }