Ejemplo n.º 1
0
        /// <summary> Draws a block on the specified level. </summary>
        ///
        /// <param name="topPoint1">    The first top point. </param>
        /// <param name="topPoint2">    The second top point. </param>
        /// <param name="depth"> The depth. </param>
        /// <param name="level">        The level. </param>
        internal static void DrawBlock(Point3D topPoint1, Point3D topPoint2, double depth, int level)
        {
            SelectionManager.UnselectAllGeometry();

            // Create the top rectangle
            var topRectangle = GeometryCreationManager.CreateRectangle(topPoint1, topPoint2);

            foreach (var element in topRectangle)
            {
                element.Color = 48; // Green
                element.Level = level;
                element.Commit();
            }

            SelectionManager.SelectGeometryByMask(QuickMaskType.Lines);

            // Translate a copy down in Z for the bottom rectangle
            GeometryManipulationManager.TranslateGeometry(
                new Point3D(0, 0, topPoint1.z),
                new Point3D(0, 0, depth),
                ViewManager.GraphicsView,
                ViewManager.GraphicsView,
                true);

            SelectionManager.UnselectAllGeometry();

            // Create the vertices
            var verticalLines = new ArrayList
            {
                new LineGeometry(new Point3D(topPoint1.x, topPoint1.y, topPoint1.z), new Point3D(topPoint1.x, topPoint1.y, depth)),
                new LineGeometry(new Point3D(topPoint1.x, topPoint2.y, topPoint1.z), new Point3D(topPoint1.x, topPoint2.y, depth)),
                new LineGeometry(new Point3D(topPoint2.x, topPoint2.y, topPoint1.z), new Point3D(topPoint2.x, topPoint2.y, depth)),
                new LineGeometry(new Point3D(topPoint2.x, topPoint1.y, topPoint1.z), new Point3D(topPoint2.x, topPoint1.y, depth))
            };

            foreach (Geometry line in verticalLines)
            {
                line.Color = 48; // Green
                line.Level = level;
                line.Commit();
            }

            const int ViewNumber = (int)GraphicsViewType.Iso;

            ViewManager.GraphicsView = SearchManager.GetViews(ViewNumber)[0];
            GraphicsManager.FitScreen();
            GraphicsManager.ClearColors(new GroupSelectionMask());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The draw polygon.
        /// </summary>
        internal static void DrawPolygon()
        {
            var polyParams = new PolygonCreationParams
            {
                CenterPoint    = new Point3D(0, 0, 0),
                FilletRadius   = 0.2,
                NumberSides    = 5,
                MeasureCorner  = false,
                Radius         = 5,
                RotationAngle  = 45,
                ShowCenter     = false,
                TrimmedSurface = false
            };

            // Draw a rectangle
            GeometryCreationManager.CreatePolygon(polyParams);
        }
Ejemplo n.º 3
0
        /// <summary> Draw rectangle. </summary>
        ///
        /// <returns> An array of Geometry. </returns>
        internal static Geometry[] DrawRectangle()
        {
            var lines = GeometryCreationManager.CreateRectangle(new Point3D(0, 0, 0), new Point3D(10, 10, 0));

            return(lines.Cast <Geometry>().ToArray());
        }