示例#1
0
 public ScriptAtlas(string name, double xMax, double xMin, double yMax, double yMin, double zMax,
                    double zMin, List <string> regions, string srciptArgs, IMifScript script)
     : base(name, xMax, xMin, yMax, yMin, zMax, zMin)
 {
     Regions    = regions;
     ScriptArgs = srciptArgs;
     Script     = script;
 }
示例#2
0
 public ScriptAtlas(string name, Range x, Range y, Range z, List <string> regions,
                    string srciptArgs, IMifScript script)
     : base(name, x, y, z)
 {
     Regions    = regions;
     ScriptArgs = srciptArgs;
     Script     = script;
 }
        public IObject Create(string name, AtlasType type, double xMin, double xMax, double yMin, double yMax,
                              double zMin, double zMax, IColor color, List <string> regions, IScript script, string ScriptArgs)
        {
            IMifScript mifScript = script != null? new ScriptObject(script.Name, script.Text, script.Args):null;
            var        mifObject = _atlasFactory.Create(name, new Range(xMin, xMax), new Range(yMin, yMax),
                                                        new Range(zMin, zMax), ConvertAtlasType(type), regions, mifScript, ScriptArgs);
            var graphicObject = _graphicCreator.CreateGraphic(mifObject, color);

            return(new SpintronicsObject(mifObject, graphicObject));
        }
        public void CreateScriptTestArgs()
        {
            string[] lines = new string[] { "proc EllipseZ { x y z } {", "set r1 [expr 2.*$x -1. ]"
                                            , "set r2 [expr 2.*$y -1. ]", "set r [expr {sqrt($r1*$r1+$r2*$r2)}]", "if {$r > 1.0} { return 0}"
                                            , "return 1", "}" };
            var        factory        = new ScriptFactoryText();
            IMifScript script         = factory.CreateScript(lines);
            IMifScript expectedScript = new ScriptObject(" EllipseZ ",
                                                         string.Join(Environment.NewLine, lines.Skip(1).Take(lines.Length - 2)), " x y z ");

            Assert.Equal(expectedScript.Args, script.Args);
        }
示例#5
0
        public IMifAtlas Create(string name, Range x, Range y, Range z, AtlasType type, List <string> regions, IMifScript script = null, string scriptArgs = null)
        {
            switch (type)
            {
            case AtlasType.BoxAtlas: return(new BoxAtlas(name, x, y, z, regions[0]));

            case AtlasType.ScriptAtlas: return(new ScriptAtlas(name, x, y, z, regions, scriptArgs, script));

            case AtlasType.ImageAtlas: throw new NotImplementedException();
            }
            throw new NotImplementedException();
        }
示例#6
0
 public MifScript(IMifScript scriptObject)
 {
     Name   = scriptObject.Name;
     Args   = scriptObject.Args;
     Script = scriptObject.Script;
 }