I found this interesting info about object occlusion using mesh.renderorder and material.colorwrite.
three.js transparent object occlusion
I couldn't find a way to set these directly with a-frame or the inspector. Is there a way?
Yes, I know how to set them directly with javascript. Doing this declaratively would be appreciated.
other than colorWrite, it MUST need renderOrder for the hidden object and the hider object.
three.js transparent object occlusion
There is no declarative way built into A-Frame: the only properties provided by the material component are documented here, and do not include colorWrite.
Since you already know how to set them declaratively with JavaScript (per the answer in the linked question), you could certainly write an A-Frame component creating a declarative syntax for what you want to do, and reuse that as needed.
Related
I need help on the selecting right control in the QT for animation.
i need to show the animation in my QT application. The animation is in real time. i will get data from my hardware for every 5msec, every 100msec i need to update the animation.
The animation nothing but drawing the line based on the my hardware input, and also i need to implement zooming and Click Event in the animation.
please suggest which is the best control to use this? and please give some rough idea to implement this.
For the graphics part QGraphicsView is the best solution. Have a look at the graphics view framework overview for more information. Animation can be achieved in different ways. Either by redrawing the view every 100 msec, and keep track of the properties of the animating parts yourself, or use the infrastructure provided by Qt's animation framework, which will probably be the easiest approach. In particular, have a look at QGraphicsItemAnimation.
I want a widget like the properties window in Visual Studio or NetBeans. It basically has two columns: the name of the property on the left, and the value on the right. The value needs to be able to be restricted to certain types, like 'bool' or 'float' (with valid ranges), but should also support more complex types (perhaps requiring a popup dialog when clicked, and then it can just display a toString() version in the window. I'm sure I can add most of those features myself, but what's the best base widget to start with?
Oh... grouping of properties is good too (like a tree I guess). And property editing should invoke a callback (send a signal).
Qt designer has properties exactly like you want. They are most likely implemented with QTreeView. You can always look at the source code.
QTreeView or QTableView. Do all (ok, most) of the heavy lifting with a specialized model that handles all of your type restrictions and what-not. Check out delegates as well.
Here's a link led to github, it might be useful.
another userful link
I am extending VBox to make a Calendar component. What method should I override to add the code to draw itself? What is the difference between all these methods? Is there something I should be putting in each one, or is there a specific method I can just override, add my drawing code, and have it work?
Thanks!
This white-paper is perhaps the best source of information I have seen on the subject.
Deepa's MAX 2008 talk was easily the best and most easily understanding presentation on the topic. It shows exactly how to write components properly in Flex 3.
I also recommend this article:
http://maohao.wordpress.com/2009/02/02/6-steps-in-creating-custom-uicomponent-in-flex-halo-framework/
Briefly, if you're doing graphics operations to draw, you'll want to use override updateDisplayList() and call invalidateDisplayList() as necessary; if you're using subcomponents, you'll use commitProperties()/invalidateProperties(). If you're dynamically sized, you'll need measure() and invalidateSize().
Override updateDisplayList method of UIComponent and do your drawing in it. Use the component's unscaledWidth and unscaledHeight as the bounds for drawing.
From Adobe Flex 3 Live Docs Advanced Visual Components in ActionScript - great source.
I'd like to develop a network graph application for Flex - imagine placing nodes on a Canvas and connecting them with links. The nodes should have editable text and other UI components.
I'm trying to find examples of creating an entirely new UI component from scratch, but all I've been able to find are trivial examples that extend existing components: a RedButton that extends Button, for example, or a ComboBox that has states to choose from.
My main question is, what ActionScript method defines the drawing of a component? What is the ActionScript equivalent of Java's paint() method?
You want to create a component that overrides the updateDisplayList method, and do your drawing in there:
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList( unscaledWidth, unscaledHeight );
// The drawing API is found on the components "graphics" property
graphics.clear();
graphics.lineTo( 0, unscaledWidth );
// etc
}
More information can be found here: http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_3.html
I would suggest looking at the flexlib project if you need examples of custom components.
There's good general info in the livedocs here
Although you can create custom components in MXML and in ActionScript, I would recommend implementing them in ActionScript.
In short this is what you need to do:
When you create a custom component in ActionScript, you have to override the methods of the UIComponent class. You implement the basic component structure, the constructor, and the createChildren(), commitProperties(), measure(), layoutChrome(), and updateDisplayList() methods.
I recommend reading the 5-part tutorial series by Peter Ent on creating custom components.
Here is the link to Part 1.
Also recommended, tutorial series on ItemRenderers and ItemEditors.
Chapter 19 of Programming Flex 2 by Kazoun and Lott show the construction event model as well as the refresh event model.
In short, the Flex component structure assumes that you have properties of the object that affect its appearance. Instead of applying changes immediately, it allows property mutators to invalidate the component's "content" (e.g. text) via the inherited invalidateProperties() method. One also calls invalidateSize() when a property change will, ummm, change the size of the component, and invalidateDisplayList() when things need to be re-drawn (as opposed to just having different text).
This invalidation model optimizes the work of the component. It does not measure itself unless it knows it changed size; it does not place and draw itself unless something called invalidateDisplayList() since the last time it updated its layout; and it does not move its properties' values into its subcomponents unless it knows those values have changed.
Cheers
The typical behavior is to subclass an existing component, mainly because so much of the work of implementing the functionality of so many of the most typical kinds of components is already done for you -- you just have to know which component most resembles the one you want to create. (A challenge in its own right, given how many there are.)
If you like, though, you can create a pretty bare-bones UIComponent "from scratch" simply by extending UIComponent (which'll give you all the baseline stuff), or I suppose, if you're really going for minimalism, and you're up for a challenge, you can just implement IUIComponent, and define each interface method manually. If you do choose to go that second route, do yourself a favor and listen to this talk first -- it's an in-depth discussion of the Flex component architecture, given by one of the engineers on the Flex team. I recommend it often, and highly; it's excellent, and it clarifies a number of component-development details that still aren't all that well documented. Extremely valuable stuff if you're going to be building non-trivial custom components of the kind you're describing.
Hope it helps. Good luck!
We are trying to create some tests that reference an vendors custom grid. Unfortunatly QTP only recognises it as a WinObject which is quite useless. We need to be able to navigate the grid and change cell values, double click on a cell(without using X,Y co-ordinates) etc.
Ideally we want to get QTP to understand that this object is a grid and treat it as one.
Any help would be greatly appreciated.
Thanks
Jon
What vendor?
I have a few suggestions:
Use key strokes to navigate the grid, rather than mouse clicks. Ctrl-Home to set focus to the top-left cell, then use up, down, left, right to move around. Use Enter keystroke to simulate double clicking. Often you can use Ctrl-A, Ctrl-C to copy the contents of the grid to the system clipboard, and use the clipboard API to retrieve the data.
You may be able to programmatically get/set the grid properties using the .Object property. .Object provides access to the underlying native properties and methods of the object, as opposed to the QTP methods and properties. You could do something like the following pseudo-code to set focus to a cell and change the value. Your code would differ depending on the vendor implementation. Consult the vendor's documentation to find out what methods and properties you would be able to use.
WinObject("mygrid").Object.CurRow = 1
WinObject("mygrid").Object.CurCol = 1
WinObject("mygrid").Object.Value = "my new value"
If the grid in question happens to be a Stingray Objective Grid, QTP has plugins specifically for that.
Same thing for Infragistics. They have a plug-in for QTP for the UltraWinGrid etc.
http://www.infragistics.com/dotnet/testadvantage.aspx#Overview
It is resonable to send the request to Support Center. If they will get a big number of requests - they will add support for your grid-vendor.
May be you forgot to load (install) AddIn for your grid-vendor.