コード例 #1
0
        private IGraphicsObject CreateCuboid(IMifAtlas atlas, OpenTK.Color color)
        {
            var figureType = FigureType.Cuboid;
            var shapeData  = _calculler.Calculate(atlas.X, atlas.Y, atlas.Z, false, 1, 1, 1, XyzConstrainsModifier.Norm);

            return(_factory.Create(figureType, shapeData.Item1, shapeData.Item2, shapeData.Item3, shapeData.Item4, color));
        }
コード例 #2
0
 public Surface(IMifAtlas atlas, string region, IMifScalarField scalarField, double scalarFieldValue, bool scalarSideSign)
 {
     Atlas            = atlas;
     Region           = region;
     ScalarField      = scalarField;
     ScalarFieldValue = scalarFieldValue;
     ScalarSideSign   = scalarSideSign;
 }
コード例 #3
0
 public IGraphicsObject AddGraphic(IMifAtlas atlas, IColor color)
 {
     if (atlas != null)
     {
         return(_graphicCreator.CreateGraphic(atlas, color));
     }
     throw new NullReferenceException();
 }
コード例 #4
0
        public IGraphicsObject CreateGraphic(IMifAtlas atlas, IColor color)
        {
            OpenTK.Color colorOpenTk = GetColor(color);
            switch (atlas.GetType())
            {
            case Type T when T == typeof(BoxAtlas):
                return(CreateCuboid(atlas, colorOpenTk));

            case Type T when T == typeof(ScriptAtlas):
                return(CreateCylinder(atlas, colorOpenTk));

            default: throw new NotSupportedException("Atlas Type: " + atlas.GetType() + " is not supported");
            }
        }
コード例 #5
0
        private IGraphicsObject CreateCylinder(IMifAtlas atlas, OpenTK.Color color)
        {
            var scriptAtlas = (ScriptAtlas)atlas;

            if (scriptAtlas.Script == null)
            {
                throw new FormatException("ScriptAtlas " + atlas.Name
                                          + " doesn't have script.");
            }
            var tuple = _calculler.Calculate(atlas.X, atlas.Y, atlas.Z, true);

            if (!(scriptAtlas.Script.Name.Contains("Ellipse")))
            {
                throw new FormatException("Unknown script " + scriptAtlas.Script.Name + " is in Oxs_ScriptAtlas "
                                          + scriptAtlas.Name + ". Only EllipseX, EllipseY, EllipseZ are supported");
            }
            return(_factory.Create(FigureType.Cylinder, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, color));
        }
コード例 #6
0
 public IMifEnergy Create(string name, double defaultValue, Vector defaultVector,
                          Vector defaultVector2 = null, IMifAtlas atlas = null,
                          List <(string, Vector, double)> regionDirectionValueList = null, List <Vector> vector2List = null)