Error while rendering volume data with x3dom - x3dom

I tried to set up the same volume renderer as in the official demo. Unfortunately, I always get the error Cannot read property 'textures' of null. I created a simple JSFiddle to demonstrate the problem.
How do I make the volume show up?

Simple problem: You have been using the XHTML syntax. JSFiddle needs the HTML syntax. I have fixed this here:
<X3D xmlns='http://www.web3d.org/specifications/x3d-namespace' showStat='true' showLog='false' width='500px' height='500px'>
<Scene>
<Background skyColor='0.0 0.0 0.0'>
</Background>
<VolumeData id='volume' dimensions='4.0 4.0 4.0'>
<ImageTextureAtlas containerField='voxels' url='https://examples.x3dom.org/volren/aorta4096.png' numberOfSlices='96' slicesOverX='10' slicesOverY='10'>
</ImageTextureAtlas>
<OpacityMapVolumeStyle lightFactor='1.2' opacityFactor='6.0'>
<ImageTexture containerField='transferFunction' url='https://examples.x3dom.org/volren/transfer.png'></ImageTexture>
</OpacityMapVolumeStyle>
</VolumeData>
</Scene>
</X3D>
I think it was documented in the past, but nowadays I only found the simple examples where there are different examples for HTML and XHTML respectively.
A similar answer can be found at https://stackoverflow.com/a/32201556/698496

Related

how to change prefix position in q-input in quasar framework

I'm new to this so maybe its obvious but i cant find a way to change the position of prefix in quasar q-input and i mean only prefix position.
I have this
<q-input outlined v-model="number" prefix="$"> </q-input>
it shows : 34 $
i want it to be: $ 34
i look the documentation in https://quasar.dev/vue-components/input#custom-label
but i cant find a way to change the position of prefix.
i changed the direction but it didn't work, i should mention i have rtl= true in quasar config.
thank you in advance...
Try the following code.
<q-input outlined v-model="number" prefix="$">
</q-input>
<q-input outlined v-model="number" suffix="$">
</q-input>
Codepen - https://codepen.io/Pratik__007/pen/vYzBpyw

Allow Line-Breaks in Vaadin Flow Tooltips

Line-Breaks and Vaadin Flow Tooltips are discussed publicly, still a recommended solution is missing (e.g. https://vaadin.com/forum/thread/17952864/tooltip-with-line-break-in-vaadin; concluding in "this does not work")
The official documentation on the tooltip component does not contain any hint.
Are there any suggestions or known workarounds?
Cheers for any help on that requirement,
Daniel
I also experimented a bit with vaadin 23 on tooltips.
enter image description here
None of the promising approaches did work.
enter image description here
It's semi supported by adding the following to your styles.css and using \n as new line character.
vaadin-tooltip-overlay::part(content) {
white-space: pre;
}

obtaining a reference to IHTMLCanvasElement

How Can I get a DOM reference to the canvas Handle. I'm using Delphi, IE11 and the corresponding MSMHTML Type library,I suspected it's along the lines of
canvasHandle := (HTMLDoc3.getElementById('canvas') as IHTMLCanvasElement);
the Html:
<canvas id="canvas">
....
</canvas>
however this throws an exception 'Interface not supported'
TWebBrowser control, by default uses IE7 standards/rendering mode.
You need to tell the control to use latest standards.
There are a few ways of doing this.
Here are two of the ways known to me:
Either you specify FEATURE_<some feature> for your application in the registry (.e.g. FEATURE_BROWSER_EMULATION also a nice article here).
Add a "meta http-equiv-'X-UA-Compatible' content= edge" to the <head> block of a webpage to force Windows IE to use the latest standards.
This will enable your HTML5 functionality working without the need for registry tweaks.

Create TYPO3 Fluid link for typolink fields generated by a link wizard

I regularly use the link wizard in my TCA.
Its horrible to find out with conditions which kind of link I have to render in Fluid (page/email/external). Is there a solution for this or do I have to create my own ViewHelper?
It seems to be undocumented, but you can pass it to <f:link.page> and it will be rendered correctly, even if it is external, email, or file link. This is because internally, <f:link.page> uses UriBuilder to build the URL, and that UriBuilder uses Typolink.
<f:link.page pageUid="{myLinkFieldValue}">My link</f:link.page>
This is the ViewHelper i´m using for this (+a helper Class):
https://gist.github.com/BenjaminBeck/7220623
I think the link.typolink ViewHelper is what you are looking for, at least for TYPO3 7.0 and above.
<f:link.typolink parameter="{link}">
Linktext
</f:link.typolink>
See Changelog Feature #59396 - TypolinkViewHelper (TYPO3 7.0)
see link.typolink in ViewHelper Reference
External Link --
<f:link.external uri="http://www.typo3.org" target="_blank">external link</f:link.external>
Email --
<f:link.email additionalAttributes="{foo: 'bar'}" email="NULL" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" name="NULL" rel="NULL" rev="NULL" target="NULL">
<!-- tag content - may be ignored! -->
</f:link.email>
Internal Link --
<f:link.page pageUid="1" additionalParams="{extension_key: {foo: 'bar'}}">page link</f:link.page>
In Fluid, there are different link view helpers:
<f:link.action action="show">action link</f:link.action>
<f:link.email email="foo#bar.tld" />
<f:link.external uri="http://www.typo3.org" target="_blank">external link</f:link.external>
<f:link.page>page link</f:link.page>
The Code (and some examples) can be found at: typo3/sysext/fluid/Classes/ViewHelpers/Link

Change defined states via Actionscript

I use states in a Flex application to switch from normal to fullscreen view. These states are defined in mxml and in a specific tag:
<local:RSVideo
id="video"
width.normal="534"
height.normal="300"
width.fullScreen="100%"
height.fullScreen="100%"
/>
How can i change the width.fullscreen & height.fullscreen in the AS Sourcecode? I need the dimension of the display that are computed at runtime.
Thanks in advance
i think, i found the solution:
<local:RSVideo
id="video"
width.normal="534"
height.normal="300"
width.fullScreen="{Capabilities.screenResolutionX}"
height.fullScreen="{Capabilities.screenResolutionY}"
/>
Thanks for reading my question.
If you got another solution. Please, let me know.

Resources