Example #1
0
        private void OnLoad(object sender, EventArgs e)
        {
            Lumberjack.Debug("Loading window state");
            // Set up lighting
            GL.ShadeModel(ShadingModel.Smooth);
            GL.Enable(EnableCap.ColorMaterial);

            // Set up caps
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.RescaleNormal);
            GL.Disable(EnableCap.Texture2D);
            GL.Disable(EnableCap.CullFace);

            // Set up blending
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);

            // Set background color
            GL.ClearColor(Color.FromArgb(255, 13, 13, 13));

            // Init keyboard to ensure first frame won't NPE
            _keyboard = Keyboard.GetState();

            Lumberjack.Debug("Loading render engine");
            _mappingEngine = new MappingEngine();
            _renderEngine  = new RenderEngine(this, _mappingEngine);

            _camera = new Camera();

            Lumberjack.Debug("Loading world");
            _structure = StructureLoader.Load(_args[0]);
            _renderEngine.LoadStructure(_structure);
        }
Example #2
0
 private void stashDifferentialStructure(Profile differential, Profile.ProfileStructureComponent structure)
 {
     structure.Name += "-differential";
     structure.SetStructureForm(StructureForm.Differential);
     structure.SetStructureBaseUri(StructureLoader.BuildBaseStructureUri(structure.TypeElement).ToString());
     structure.Publish = false;
 }
Example #3
0
        public void LocateStructure()
        {
            var locator    = new StructureLoader(ArtifactResolver.CreateDefault());
            var profileUri = new Uri("http://hl7.org/fhir/Profile/Profile");

            var prof = locator.LocateStructure(profileUri, new Code("Profile"));

            Assert.IsNotNull(prof);
            Assert.AreEqual("Profile", prof.Type);
            //Assert.AreEqual(profileUri.ToString(), prof.GetProfileLocation());

            // Try to locate a structure that cannot be found in the given profile
            prof = locator.LocateStructure(profileUri, new Code("Patient"));
            Assert.IsNull(prof);

            profileUri = new Uri("http://take.from.disk/Profile/example-lipid-profile");
            var profileUriWithFrag = new Uri(profileUri.ToString() + "#lipidResultMessage");

            prof = locator.LocateStructure(profileUriWithFrag, new Code("MessageHeader"));
            Assert.IsNotNull(prof);
            Assert.AreEqual("MessageHeader", prof.Type);
            Assert.AreEqual("lipidResultMessage", prof.Name);
            //Assert.AreEqual(profileUri.ToString(), prof.GetProfileLocation());

            // Try to locate a structure that cannot be found in the profile by name
            profileUriWithFrag = new Uri(profileUri.ToString() + "#XXX");
            prof = locator.LocateStructure(profileUriWithFrag, new Code("Profile"));
            Assert.IsNull(prof);
        }
Example #4
0
        public void TestExpandChild()
        {
            var loader     = new StructureLoader(ArtifactResolver.CreateDefault());
            var profStruct = loader.LocateStructure(new Uri("http://hl7.org/fhir/Profile/Profile"), new Code("Profile"));

            var nav = new ElementNavigator(profStruct.Snapshot);

            nav.JumpToFirst("Profile.telecom");
            Assert.IsTrue(nav.ExpandElement(loader));
            Assert.IsTrue(nav.MoveToChild("period"));

            nav.JumpToFirst("Profile.structure.differential");
            Assert.IsTrue(nav.ExpandElement(loader));
            Assert.IsTrue(nav.MoveToChild("element"));
        }
        public void TestExpandChild()
        {
            var loader     = new StructureLoader(ArtifactResolver.CreateDefault());
            var profStruct = loader.Locate(new Uri("http://hl7.org/fhir/Profile/Profile"), new Code("Profile"));

            var nav = new ElementNavigator(profStruct);

            nav.JumpToFirst("Profile.telecom");
            Assert.IsTrue(nav.ExpandElement(loader));
            Assert.IsTrue(nav.MoveToChild("period"));

            nav.JumpToFirst("Profile.extensionDefn.definition");
            Assert.IsTrue(nav.ExpandElement(loader));
            Assert.IsTrue(nav.MoveToChild("max"));
        }
Example #6
0
 internal ProfileKnowledgeProvider(string baseUrl)
 {
     _loader  = new StructureLoader(ArtifactResolver.CreateCachedDefault());
     _baseUrl = baseUrl;
 }
 internal ProfileKnowledgeProvider(string baseName, string imageOutputDirectory)
 {
     this.baseName        = baseName;
     _loader              = new StructureLoader(ArtifactResolver.CreateCachedDefault());
     ImageOutputDirectory = imageOutputDirectory;
 }
Example #8
0
 public ProfileExpander(IArtifactSource source)
 {
     _loader = new StructureLoader(source);
 }
Example #9
0
 public ProfileExpander()
 {
     _loader = new StructureLoader(new CachedArtifactSource(ArtifactResolver.CreateDefault()));
 }
 public StructureExpander(StructureLoader loader)
 {
     _loader = loader;
 }
        public void TestExpandChild()
        {
            var loader = new StructureLoader(ArtifactResolver.CreateDefault());
            var profStruct = loader.LocateStructure(new Uri("http://hl7.org/fhir/Profile/Profile"), new Code("Profile"));

            var nav = new ElementNavigator(profStruct.Snapshot);
            
            nav.JumpToFirst("Profile.telecom");
            Assert.IsTrue(nav.ExpandElement(loader));
            Assert.IsTrue(nav.MoveToChild("period"));

            nav.JumpToFirst("Profile.structure.differential");
            Assert.IsTrue(nav.ExpandElement(loader));
            Assert.IsTrue(nav.MoveToChild("element"));
        }
        public void LocateStructure()
        {
            var locator = new StructureLoader(ArtifactResolver.CreateDefault());
            var profileUri = new Uri("http://hl7.org/fhir/Profile/Profile");

            var prof = locator.LocateStructure(profileUri, new Code("Profile"));
            Assert.IsNotNull(prof);
            Assert.AreEqual("Profile", prof.Type);
            //Assert.AreEqual(profileUri.ToString(), prof.GetProfileLocation());

            // Try to locate a structure that cannot be found in the given profile
            prof = locator.LocateStructure(profileUri, new Code("Patient"));
            Assert.IsNull(prof);

            profileUri = new Uri("http://take.from.disk/Profile/example-lipid-profile");
            var profileUriWithFrag = new Uri(profileUri.ToString() + "#lipidResultMessage");
            prof = locator.LocateStructure(profileUriWithFrag, new Code("MessageHeader"));
            Assert.IsNotNull(prof);
            Assert.AreEqual("MessageHeader", prof.Type);
            Assert.AreEqual("lipidResultMessage", prof.Name);
            //Assert.AreEqual(profileUri.ToString(), prof.GetProfileLocation());

            // Try to locate a structure that cannot be found in the profile by name
            profileUriWithFrag = new Uri(profileUri.ToString() + "#XXX");
            prof = locator.LocateStructure(profileUriWithFrag, new Code("Profile"));
            Assert.IsNull(prof);
        }
Example #13
0
 public SpecificationProvider(IArtifactSource source)
 {
     this.source    = source;
     this.loader    = new StructureLoader(source);
     this.harvester = new SpecificationHarvester();
 }