コード例 #1
0
        private void Form1_Paint(object sender, PaintEventArgs args)
        {
            var e = new StructureEngine();

            var i = new If();

            i.Condition = null;
            e.Root.Body.Statements.Add(i);

            var v = new VariableDeclaration();

            v.Name         = null;
            v.InitialValue = null;

            var p = new Print();

            var s1 = new StringLiteral
            {
                Value = "hej du glade Tag en spade och..."
            };
            var s2 = new StringLiteral
            {
                Value = "Mer text",
            };

            var exp = new AddOperator()
            {
                LeftOperand  = s1,
                RightOperand = s2,
            };

            p.Value = exp;

            i.Body.Statements.Add(v);
            i.Body.Statements.Add(p);

            args.Graphics.Clear(Color.White);
            e.Render(args.Graphics);
        }
コード例 #2
0
        public static void FiniteElement()
        {
            var structure = new ParticleStructure();

            structure.GroundForceOn = true;

            var engine = new StructureEngine();

            engine.Structure = structure;

            var adapter = new FEEngineAdapter(engine);

            VisualizerNamespace.Visualizer.Radius = .1;
            VisualizerNamespace.Visualizer viz = new VisualizerNamespace.Visualizer(adapter);
            viz.SpherePrecision = 40;
            viz.CylinderRadius  = .01;
            viz.TimeIncrement   = .01;
            viz.AddGround(10, new Vector3D(0, 0, 0), "dirt.jpg");

            //viz.Add3DGraph("Center of Mass", (() => viz.Time), structure.CenterOfMass, "Time (s)", "Position (m)");

            addConnectorsToVisualizer(viz, structure, adapter);
            viz.Show();
        }
コード例 #3
0
 public FEEngineAdapter(StructureEngine engine)
 {
     this.engine = engine;
 }