Example #1
0
        public static void CreateDefault(string styleName)
        {
            try
            {
                using (Transaction tr = CivilApplicationManager.StartTransaction())
                {
                    CivilDocument          doc    = CivilApplication.ActiveDocument;
                    SurfaceStyleCollection styles = doc.Styles.SurfaceStyles;
                    ObjectId     styleId          = styles.Add(styleName == String.Empty?"Style-" + DateTime.Now.Millisecond:styleName);
                    SurfaceStyle style            = styleId.GetObject(OpenMode.ForWrite) as SurfaceStyle;
                    DisplayStyle majorContours    = style.GetDisplayStylePlan(SurfaceDisplayStyleType.MajorContour);
                    majorContours.Visible = true;
                    majorContours.Color   = Color.FromRgb(255, 255, 0);
                    style.ContourStyle.BaseElevationInterval = 5.0;
                    style.ContourStyle.MajorContourInterval  = 20.0;
                    DisplayStyle minorContours = style.GetDisplayStylePlan(SurfaceDisplayStyleType.MinorContour);
                    minorContours.Visible = true;
                    minorContours.Color   = Color.FromRgb(0, 255, 0);
                    DisplayStyle triangles = style.GetDisplayStylePlan(SurfaceDisplayStyleType.Triangles);

                    tr.Commit();
                }
            }
            catch (System.Exception ex)
            {
                PGA.MessengerManager.MessengerManager.LogException(ex);
            }
        }
Example #2
0
        copySurfaceStyle()
        {
            Document acDocTar = BaseObjs._acadDoc;                                                              // target - Active Document
            Database dbTar    = acDocTar.Database;                                                              // target database

            Document acDocSrc = BaseObjs.openDwg("R:\\TSet\\Template\\CIVIL3D2010\\EW.dwt");                    // source - Active Document

            Application.DocumentManager.MdiActiveDocument = acDocSrc;
            CivilDocument civDocSrc = BaseObjs._civDoc;

            SurfaceStyleCollection objSurfaceStyles = civDocSrc.Styles.SurfaceStyles;

            using (Transaction tr = BaseObjs.startTransactionDb()) {
                foreach (ObjectId idStyle in objSurfaceStyles)
                {
                    SurfaceStyle objSurfaceStyle = (SurfaceStyle)tr.GetObject(idStyle, OpenMode.ForRead);

                    if (objSurfaceStyle.Name != "Standard")
                    {
                        objSurfaceStyle.ExportTo(dbTar, Autodesk.Civil.StyleConflictResolverType.Override);
                    }
                }

                tr.Commit();
            }
            Application.DocumentManager.MdiActiveDocument = acDocTar;
            acDocSrc.CloseAndDiscard();
        }
        public void CDS_TurnDisplayRepresentationsOn()
        {
            ObjectId styleId = findSurfaceStyle("SampleStyle");

            if (styleId == ObjectId.Null)
            {
                styleId = _civildoc.Styles.SurfaceStyles.Add("SampleStyle");
            }

            using (Transaction tr = startTransaction())
            {
                SurfaceStyle style = styleId.GetObject(OpenMode.ForWrite)
                                     as SurfaceStyle;
                SurfaceDisplayStyleType[] settings =
                    new SurfaceDisplayStyleType[]
                {
                    SurfaceDisplayStyleType.MajorContour,
                    SurfaceDisplayStyleType.MinorContour,
                    SurfaceDisplayStyleType.Points,
                    SurfaceDisplayStyleType.Triangles
                };

                applySettings(style, settings);

                tr.Commit();
            }
        }
Example #4
0
        findSurfaceStyle(string name)
        {
            ObjectId idStyle = ObjectId.Null;

            try
            {
                using (Transaction tr = BaseObjs.startTransactionDb())
                {
                    foreach (ObjectId id in BaseObjs._civDoc.Styles.SurfaceStyles)
                    {
                        SurfaceStyle style = (SurfaceStyle)id.GetObject(OpenMode.ForRead);
                        if (style.Name == name)
                        {
                            idStyle = id;
                            break;
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(string.Format("{0} Surf_Styles.cs: line: 59", ex.Message));
            }
            return(idStyle);
        }
Example #5
0
        addSurfaceStyleSettings(string nameStyle)
        {
            ObjectId styleId = findSurfaceStyle(nameStyle);

            if (styleId == ObjectId.Null)
            {
                styleId = BaseObjs._civDoc.Styles.SurfaceStyles.Add(nameStyle);
            }

            try
            {
                using (Transaction tr = BaseObjs.startTransactionDb())
                {
                    SurfaceStyle style = (SurfaceStyle)styleId.GetObject(OpenMode.ForWrite);
                    SurfaceDisplayStyleType[] settings =
                    {
                        SurfaceDisplayStyleType.MajorContour,
                        SurfaceDisplayStyleType.MinorContour,
                        SurfaceDisplayStyleType.Points,
                        SurfaceDisplayStyleType.Triangles
                    };

                    applySettings(style, settings);

                    tr.Commit();
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(string.Format("{0} Surf_Styles.cs: line: 40", ex.Message));
            }
        }
        /// <summary>
        /// Smoothes the contours.
        /// </summary>
        /// <param name="surfaceStyleId">The surface style identifier.</param>
        /// <returns>SurfaceStyle.</returns>
        public SurfaceStyle SmoothContours(ObjectId surfaceStyleId)
        {
            try
            {
                SurfaceStyle surfaceStyle = null;
                using (Transaction ts = CivilApplicationManager.StartTransaction())
                {
                    surfaceStyle = surfaceStyleId.GetObject(
                        OpenMode.ForWrite) as SurfaceStyle;

                    surfaceStyle.ContourStyle.SmoothContours = true;
                    surfaceStyle.ContourStyle.SmoothingType
                        = ContourSmoothingType.AddVertices;
                    surfaceStyle.ContourStyle.SmoothingFactor = 10;

                    ts.Commit();
                }
                return(surfaceStyle);
            }
            catch (System.Exception ex)
            {
                PGA.MessengerManager.MessengerManager.LogException(ex);
            }
            return(null);
        }
Example #7
0
        void IScene3D.DrawSurface(ReadOnlySpan <Point3> vertices, SurfaceStyle brush)
        {
            Span <XYZ> clippedVertices = stackalloc XYZ[vertices.Length * 2];

            var cvertices = _FrustumNearPlane.ClipPolygonToPlane(clippedVertices, Point3.AsNumerics(vertices));

            if (cvertices < 3)
            {
                return;
            }

            clippedVertices = clippedVertices.Slice(0, cvertices);

            Span <Point2> points = stackalloc Point2[clippedVertices.Length];

            var center = XYZ.Zero;

            for (int i = 0; i < points.Length; ++i)
            {
                var v = clippedVertices[i];

                center   += v;
                points[i] = _ProjectPoint(v).SelectXY();
            }

            center /= points.Length;

            brush = brush.WithOutline(_ProjectRadius(center, brush.Style.OutlineWidth));

            _RenderTarget.DrawPolygon(points, brush.Style);
        }
Example #8
0
        getSurfaceStyle(ObjectId idStyle)
        {
            SurfaceStyle style = null;

            using (Transaction tr = BaseObjs.startTransactionDb()){
                style = (SurfaceStyle)tr.GetObject(idStyle, OpenMode.ForRead);
            }

            return(style);
        }
Example #9
0
        applySettings(SurfaceStyle style, IList <SurfaceDisplayStyleType> settings)
        {
            IEnumerable <SurfaceDisplayStyleType> displayTypes =
                (IEnumerable <SurfaceDisplayStyleType>)Enum.GetValues(typeof(SurfaceDisplayStyleType));

            foreach (SurfaceDisplayStyleType displayType in displayTypes)
            {
                bool state = settings.Contains(displayType);                //if type is in list -> true then visible -> true;
                style.GetDisplayStylePlan(displayType).Visible  = state;
                style.GetDisplayStyleModel(displayType).Visible = state;
            }
        }
Example #10
0
        /// <summary>
        /// Initializes a new GameWindow class.
        /// </summary>
        /// <param name="handle">The Handle.</param>
        internal GameWindow(IntPtr handle)
        {
            _surface = (Form) Control.FromHandle(handle);
            _surfaceStyle = SurfaceStyle.Normal;
            _surfaceLayout = new SurfaceLayout(true, false, true);
            CursorVisibility = false;
            _surface.FormClosing += _surface_FormClosing;
            _surface.Activated += _surface_Activated;
            _surface.Deactivate += _surface_Deactivate;

            MethodInvoker br = delegate { _surface.KeyPreview = true; };
            _surface.Invoke(br);
        }
        private void applySettings(SurfaceStyle style,
                                   IList <SurfaceDisplayStyleType> settings)
        {
            IEnumerable <SurfaceDisplayStyleType> displayTypes =
                Enum.GetValues(typeof(SurfaceDisplayStyleType))
                as IEnumerable <SurfaceDisplayStyleType>;

            foreach (SurfaceDisplayStyleType displayType in displayTypes)
            {
                bool state = settings.Contains(displayType);
                style.GetDisplayStylePlan(displayType).Visible  = state;
                style.GetDisplayStyleModel(displayType).Visible = state;
            }
        }
Example #12
0
        /// <summary>
        /// Initializes a new GameWindow class.
        /// </summary>
        /// <param name="handle">The Handle.</param>
        internal GameWindow(IntPtr handle)
        {
            _surface              = (Form)Control.FromHandle(handle);
            _surfaceStyle         = SurfaceStyle.Normal;
            _surfaceLayout        = new SurfaceLayout(true, false, true);
            CursorVisibility      = false;
            _surface.FormClosing += _surface_FormClosing;
            _surface.Activated   += _surface_Activated;
            _surface.Deactivate  += _surface_Deactivate;

            MethodInvoker br = delegate { _surface.KeyPreview = true; };

            _surface.Invoke(br);
        }
Example #13
0
        getTinSurface(string nameSurf, out bool exists)
        {
            TinSurface objSurface = null;
            ObjectId   idStyle    = ObjectId.Null;

            exists = false;
            try
            {
                using (Transaction tr = BaseObjs.startTransactionDoc())
                {
                    ObjectIdCollection surfaceIDs = BaseObjs._civDoc.GetSurfaceIds();

                    foreach (ObjectId surfaceID in surfaceIDs)
                    {
                        Autodesk.Civil.DatabaseServices.TinSurface objTinSurface = (TinSurface)surfaceID.GetObject(OpenMode.ForRead);
                        if (objTinSurface.Name == nameSurf)
                        {
                            objSurface = objTinSurface;
                            exists     = true;
                            tr.Commit();
                            return(objSurface);
                        }
                    }
                    foreach (ObjectId idSty in BaseObjs._civDoc.Styles.SurfaceStyles)
                    {
                        SurfaceStyle style = (SurfaceStyle)tr.GetObject(idSty, OpenMode.ForRead);
                        if (style.Name == nameSurf)
                        {
                            idStyle = idSty;
                            break;
                        }
                    }
                    if (idStyle == ObjectId.Null)
                    {
                        idStyle = BaseObjs._civDoc.Styles.SurfaceStyles[0];
                    }
                    ObjectId idSurf = TinSurface.Create(nameSurf, idStyle);
                    objSurface = (TinSurface)tr.GetObject(idSurf, OpenMode.ForWrite);
                    Layer.manageLayers(string.Format("{0}_SURFACE", nameSurf));
                    objSurface.Layer = string.Format("{0}_SURFACE", nameSurf);
                    tr.Commit();
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(string.Format("{0} Surf.cs: line: 143", ex.Message));
            }
            return(objSurface);
        }
Example #14
0
        private static void extractContours(Surface surf)
        {
            if (surf is TinSurface)
            {
                if (surf.IsReferenceObject)
                {
                    Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(string.Format("Surface {0} is from {1}", surf.Name, surf.OwnerId.ToString()));
                    return;
                }
                TinSurface   tinSurf  = (TinSurface)surf;
                string       nameSurf = tinSurf.Name;
                ObjectId     idStyle  = tinSurf.StyleId;
                SurfaceStyle style    = Surf_Styles.getSurfaceStyle(idStyle);

                double majorInt = style.ContourStyle.MajorContourInterval;
                double minorInt = style.ContourStyle.MinorContourInterval;

                DisplayStyle planDispStyle = style.GetDisplayStylePlan(SurfaceDisplayStyleType.MajorContour);
                string       majorLay      = planDispStyle.Layer;

                planDispStyle = style.GetDisplayStylePlan(SurfaceDisplayStyleType.MinorContour);
                string minorLay = planDispStyle.Layer;

                ObjectIdCollection idsContours = tinSurf.ExtractContours(minorInt);

                Color color = new Color();
                color = Color.FromColorIndex(ColorMethod.ByLayer, 256);

                using (Transaction tr = BaseObjs.startTransactionDb()) {
                    foreach (ObjectId id in idsContours)
                    {
                        Polyline poly = (Polyline)tr.GetObject(id, OpenMode.ForRead);
                        double   elev = System.Math.Round(poly.Elevation, 2);
                        if ((elev / majorInt).mantissa() == 0)
                        {
                            id.changeProp(color, majorLay, LineWeight.LineWeight030);
                        }
                        else
                        {
                            id.changeProp(color, minorLay, LineWeight.LineWeight020);
                        }
                    }
                    tr.Commit();
                }
            }
        }
        /// <summary>
        /// Surfaces the style and attach.
        /// </summary>
        public void SurfaceStyleAndAttach()
        {
            using (
                Transaction ts =
                    Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
            {
                var doc = CivilApplicationManager.ActiveCivilDocument;

                // create a new style called 'example style':
                ObjectId styleId = doc.Styles.SurfaceStyles.Add("pga-tour-style");

                // modify the style:
                SurfaceStyle surfaceStyle = styleId.GetObject(OpenMode.ForWrite) as SurfaceStyle;

                // display surface triangles
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.Triangles).Visible  = true;
                surfaceStyle.GetDisplayStyleModel(SurfaceDisplayStyleType.Triangles).Visible = true;

                // display boundaries, exterior only:
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.Boundary).Visible = true;
                surfaceStyle.BoundaryStyle.DisplayExteriorBoundaries = true;
                surfaceStyle.BoundaryStyle.DisplayInteriorBoundaries = false;

                // display major contours:
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.MajorContour).Visible = true;

                // turn off display of other items:
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.MinorContour).Visible = false;
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.UserContours).Visible = false;
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.Directions).Visible   = false;
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.Elevations).Visible   = false;
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.Slopes).Visible       = false;
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.SlopeArrows).Visible  = false;
                surfaceStyle.GetDisplayStylePlan(SurfaceDisplayStyleType.Watersheds).Visible   = false;

                // do the same for all model display settings as well


                // assign the style to the first surface in the document:
                TinSurface surf = doc.GetSurfaceIds()[0].GetObject(OpenMode.ForWrite) as TinSurface;
                surf.StyleId = styleId;

                // commit the transaction
                ts.Commit();
            }
        }
        private ObjectId findSurfaceStyle(string name)
        {
            using (Transaction tr = startTransaction())
            {
                foreach (ObjectId styleId in _civildoc.Styles.SurfaceStyles)
                {
                    SurfaceStyle style = styleId.GetObject(OpenMode.ForRead)
                                         as SurfaceStyle;
                    if (style.Name == name)
                    {
                        return(styleId);
                    }
                }
            }

            return(ObjectId.Null);
        }
Example #17
0
        public static ObjectId GetStyleId(string styleName)
        {
            using (Transaction tr = CivilApplicationManager.StartTransaction())
            {
                CivilDocument          doc    = CivilApplicationManager.ActiveCivilDocument;
                SurfaceStyleCollection styles = doc.Styles.SurfaceStyles;
                foreach (ObjectId styleId in styles)
                {
                    SurfaceStyle style = styleId.GetObject(OpenMode.ForRead) as SurfaceStyle;
                    if (styleName == style.Name)
                    {
                        tr.Commit();
                        return(styleId);
                    }
                }
                tr.Abort();
            }

            return(ObjectId.Null);
        }
        /// <summary>
        /// Gets the surface style.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>SurfaceStyle.</returns>
        public SurfaceStyle GetSurfaceStyle(string name)
        {
            using (Transaction ts = CivilApplicationManager.StartTransaction())
            {
                var doc = CivilApplicationManager.ActiveCivilDocument;

                int total = doc.Styles.SurfaceStyles.Count();
                for (int i = 0; i < total; i++)
                {
                    ObjectId     surfaceStyleId = doc.Styles.SurfaceStyles[i]; // ("pga-tour-style");
                    SurfaceStyle s      = surfaceStyleId.GetObject(OpenMode.ForRead) as SurfaceStyle;
                    var          result = s.Name == name;
                    if (result)
                    {
                        return(s);
                    }
                    Debug.WriteLine(s.Name);
                }
            }
            return(null);
        }
Example #19
0
        public static void CreateDefault(string styleName)
        {
            using (Transaction tr = CivilApplicationManager.StartTransaction())
            {
                CivilDocument          doc    = CivilApplication.ActiveDocument;
                SurfaceStyleCollection styles = doc.Styles.SurfaceStyles;
                ObjectId     styleId          = styles.Add(styleName);
                SurfaceStyle style            = styleId.GetObject(OpenMode.ForWrite) as SurfaceStyle;
                DisplayStyle majorContours    = style.GetDisplayStylePlan(SurfaceDisplayStyleType.MajorContour);
                majorContours.Visible = true;
                majorContours.Color   = Color.FromRgb(255, 255, 0);
                style.ContourStyle.BaseElevationInterval = 5.0;
                style.ContourStyle.MajorContourInterval  = 20.0;
                DisplayStyle minorContours = style.GetDisplayStylePlan(SurfaceDisplayStyleType.MinorContour);
                minorContours.Visible = true;
                minorContours.Color   = Color.FromRgb(0, 255, 0);
                DisplayStyle triangles = style.GetDisplayStylePlan(SurfaceDisplayStyleType.Triangles);

                tr.Commit();
            }
        }
 // Register the custom archetypes
 public ExpressionGraphSurface(IVisjectSurfaceOwner owner, Action onSave, Undo undo = null, SurfaceStyle style = null)
     : base(owner, onSave, undo, style, ExpressionGraphGroups) // Passing in our own archetypes
 {
 }
Example #21
0
        getSurfaceStyle(string nameStyle)
        {
            ObjectId idStyle = ObjectId.Null;

            idStyle = findSurfaceStyle(nameStyle);
            if (idStyle == ObjectId.Null)
            {
                idStyle = BaseObjs._civDoc.Styles.SurfaceStyles.Add(nameStyle);
                try
                {
                    using (Transaction tr = BaseObjs.startTransactionDb())
                    {
                        SurfaceStyle style = (SurfaceStyle)idStyle.GetObject(OpenMode.ForWrite);
                        style.BoundaryStyle.DisplayMode = SurfaceDisplay3dType.UseSurfaceElevation;
                        style.BoundaryStyle.DisplayExteriorBoundaries = true;
                        style.BoundaryStyle.DisplayInteriorBoundaries = true;
                        style.BoundaryStyle.UseDatum = false;

                        style.ContourStyle.GroupRangeValuesBy    = SurfaceGroupValuesByType.Quantile;
                        style.ContourStyle.NumberOfRanges        = 1;
                        style.ContourStyle.RangePrecision        = PrecisionRangeType.Precision000001;
                        style.ContourStyle.UseColorScheme        = false;
                        style.ContourStyle.DisplayMode           = SurfaceDisplay3dType.UseSurfaceElevation;
                        style.ContourStyle.LegendStyleName       = "Standard";
                        style.ContourStyle.BaseElevationInterval = 0.000;
                        style.ContourStyle.MinorContourInterval  = 0.200;
                        style.ContourStyle.MajorContourInterval  = 1.000;
                        style.ContourStyle.DisplayDepressions    = false;
                        style.ContourStyle.SmoothContours        = false;

                        style.GridStyle.DisplayMode              = SurfaceDisplay3dType.UseSurfaceElevation;
                        style.GridStyle.UsePrimaryGrid           = true;
                        style.GridStyle.PrimaryGridInterval      = 25.00;
                        style.GridStyle.PrimaryGridOrientation   = System.Math.PI / 2;
                        style.GridStyle.UseSecondaryGrid         = true;
                        style.GridStyle.SecondaryGridInterval    = 25.00;
                        style.GridStyle.SecondaryGridOrientation = 0.0;

                        style.PointStyle.DisplayMode                = SurfaceDisplay3dType.UseSurfaceElevation;
                        style.PointStyle.ScalingMethodType          = ScaleType.SizeInAbsoluteUnits;
                        style.PointStyle.Units                      = 3.000;
                        style.PointStyle.DataPointsSymbol           = PointSymbolType.K2;
                        style.PointStyle.DataPointsColor            = Color.FromColorIndex(ColorMethod.ByLayer, 1);
                        style.PointStyle.DerivedPointsSymbol        = PointSymbolType.K34;
                        style.PointStyle.DerivedPointsColor         = Color.FromColorIndex(ColorMethod.ByLayer, 3);
                        style.PointStyle.NondestructivePointsSymbol = PointSymbolType.K66;
                        style.PointStyle.NondestructivePointsColor  = Color.FromColorIndex(ColorMethod.ByLayer, 11);

                        style.TriangleStyle.DisplayMode = SurfaceDisplay3dType.UseSurfaceElevation;

                        style.DirectionStyle.ColorScheme       = new ColorSchemeType();
                        style.DirectionStyle.GroupValuesBy     = SurfaceGroupValuesByType.Quantile;
                        style.DirectionStyle.NumberOfRanges    = 8;
                        style.DirectionStyle.RangePrecision    = PrecisionRangeType.Precision000001;
                        style.DirectionStyle.DisplayEntityMode = SurfaceDisplayType.Solid2d;
                        style.DirectionStyle.LegendStyleName   = "Standard";
                        style.DirectionStyle.DisplayMode       = SurfaceDisplay3dType.UseSurfaceElevation;

                        style.ElevationStyle.ColorScheme       = ColorSchemeType.Blues;
                        style.ElevationStyle.GroupValuesBy     = SurfaceGroupValuesByType.Quantile;
                        style.ElevationStyle.NumberOfRanges    = 8;
                        style.ElevationStyle.RangePrecision    = PrecisionRangeType.Precision000001;
                        style.ElevationStyle.DisplayEntityMode = SurfaceDisplayType.Solid2d;
                        style.ElevationStyle.LegendStyleName   = "Standard";
                        style.ElevationStyle.DisplayMode       = SurfaceDisplay3dType.UseSurfaceElevation;

                        style.SlopeStyle.ColorScheme     = ColorSchemeType.Reds;
                        style.SlopeStyle.GroupValuesBy   = SurfaceGroupValuesByType.Quantile;
                        style.SlopeStyle.NumberOfRanges  = 10;
                        style.SlopeStyle.RangePrecision  = PrecisionRangeType.Precision000001;
                        style.SlopeStyle.LegendStyleName = "Standard";
                        style.SlopeStyle.DisplayMode     = SurfaceDisplay3dType.UseSurfaceElevation;

                        style.SlopeArrowStyle.ColorScheme     = ColorSchemeType.Rainbow;
                        style.SlopeArrowStyle.GroupValuesBy   = SurfaceGroupValuesByType.Quantile;
                        style.SlopeArrowStyle.NumberOfRanges  = 8;
                        style.SlopeArrowStyle.RangePrecision  = PrecisionRangeType.Precision000001;
                        style.SlopeArrowStyle.ArrowType       = SlopeArrowType.Filled;
                        style.SlopeArrowStyle.ArrowScale      = 5;
                        style.SlopeArrowStyle.LegendStyleName = "Standard";
                        style.SlopeArrowStyle.DisplayMode     = SurfaceDisplay3dType.UseSurfaceElevation;

                        Layer.manageLayers("SURF_POINTS");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Points).Layer = "SURF_POINTS";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Points).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 1);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Points).Layer = "SURF_POINTS";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Points).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 1);

                        Layer.manageLayers("SURF_trIANGLES");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Triangles).Layer = "SURF_trIANGLES";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Triangles).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 3);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Triangles).Layer = "SURF_trIANGLES";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Triangles).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 3);

                        Layer.manageLayers("SURF_BORDER");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Boundary).Layer = "SURF_BORDER";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Boundary).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Boundary).Layer = "SURF_BORDER";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Boundary).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        Layer.manageLayers("SURF_CMAJOR");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.MajorContour).Layer = "SURF_CMAJOR";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.MajorContour).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 4);
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.MajorContour).Visible = true;

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.MajorContour).Layer = "SURF_CMAJOR";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.MajorContour).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 4);
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.MajorContour).Visible = true;

                        Layer.manageLayers("SURF_CMINOR");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.MinorContour).Layer = "SURF_CMINOR";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.MinorContour).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 9);
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.MinorContour).Visible = true;

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.MinorContour).Layer = "SURF_CMINOR";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.MinorContour).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 9);
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.MinorContour).Visible = true;

                        Layer.manageLayers("SURF_USERCONTOURS");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.UserContours).Layer = "SURF_USERCONTOURS";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.UserContours).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 6);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.UserContours).Layer = "SURF_USERCONTOURS";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.UserContours).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 6);

                        Layer.manageLayers("SURF_GRIDDED");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Gridded).Layer = "SURF_GRIDDED";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Gridded).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 5);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Gridded).Layer = "SURF_GRIDDED";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Gridded).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 5);

                        Layer.manageLayers("SURF_DIRECTIONS");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Directions).Layer = "SURF_DIRECTIONS";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Directions).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Directions).Layer = "SURF_DIRECTIONS";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Directions).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        Layer.manageLayers("SURF_ELEVATIONS");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Elevations).Layer = "SURF_ELEVATIONS";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Elevations).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Elevations).Layer = "SURF_ELEVATIONS";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Elevations).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        Layer.manageLayers("SURF_SLOPES");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Slopes).Layer = "SURF_SLOPES";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Slopes).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Slopes).Layer = "SURF_SLOPES";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Slopes).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        Layer.manageLayers("SURF_SLOPE ARROWS");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.SlopeArrows).Layer = "SURF_SLOPE ARROWS";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.SlopeArrows).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.SlopeArrows).Layer = "SURF_SLOPE ARROWS";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.SlopeArrows).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        Layer.manageLayers("SURF_WATERSHED");
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Watersheds).Layer = "SURF_WATERSHED";
                        style.GetDisplayStyleModel(SurfaceDisplayStyleType.Watersheds).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Watersheds).Layer = "SURF_WATERSHED";
                        style.GetDisplayStylePlan(SurfaceDisplayStyleType.Watersheds).Color =
                            Color.FromColorIndex(ColorMethod.ByLayer, 2);

                        tr.Commit();
                    }
                }
                catch (System.Exception ex)
                {
                    BaseObjs.writeDebug(string.Format("{0} Surf_Styles.cs: line: 274", ex.Message));
                }
            }
            return(idStyle);
        }
 /// <inheritdoc/>
 public void DrawSurface(ReadOnlySpan <Point3> vertices, SurfaceStyle style)
 {
     Decompose3D.DrawSurface(this, vertices, style);
 }
 public RenderingGraphSurface(IVisjectSurfaceOwner owner, Action onSave, FlaxEditor.Undo undo = null, SurfaceStyle style = null)
     : base(owner, onSave, undo, style, GetGroupArchetypes())
 {
 }
 /// <inheritdoc/>
 public void DrawSurface(ReadOnlySpan <Point3> vertices, SurfaceStyle style)
 {
     _Check(); Decompose3D.DrawSurface(_Target, vertices, style);
 }