How to draw a line or select something in using qvtkwidget? - qt

I successfully made a program by using qvtkwidget, showing a few lines and points. And everything works perfectly. Next, I want to add an edit mode to my program, so that I can draw a line on it, or select some points or lines from it. Could anyone give me some guidelines for doing that? Do I need to use vtkRenderWindowInteractor? I tried to google but still can't find any clue.

you have to work with vtkinteraction, vtkobserver- callback, and vtkselection modules. and this example also useful http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex HTH
And here is set of examples you may find relavent to your goal
http://www.vtk.org/Wiki/VTK/Examples/Cxx#User_Interaction

Related

how to remove constant line from point line series?

I'm using constant lines to show a particular event for the graph and now I want to remove that particular event. I'm using constantline.dispose method but It's not working properly. lines are not getting removed after calling dispose function.
ConstantLine.dispose() should do the trick, and seems to work in the official interactive examples gallery (LCJS v.3.4.0).
If it is not working for you, please add some example code or pictures & description of desired and actual behaviours.

Label individual points in Sage plot

This seems like a straightforward problem, yet I can't find a solution. In Sage, I've got about 30 sorted points for a scatter_plot, and I want to add the order position as a label. I know this is easy if I were working with a graph object, since I could use the vertex_labels option in plot. Is there a simple fix to get this to work for a scatter_plot, or would I need to do something like make the points vertices and keep track of the exact location of each point
Currently, you may have to use matplotlib directly or mess around with that method inside of Sage to get this. See here or here for some related questions.
I've opened Trac 20583 for this.

Is there a way to replace the legend or axis without redrawing the whole plot?

Sometimes I will place a legend at a particular location on the plot, let's say topright, and then I see that it covers an important part of the plot. Is there a way I can switch it to topleft or some other place without having to run all the other commands first? Sometimes I have the same problem with the axes, I misspell a word and then I have to issue all the commands again.
I eventually place everything in an R script which means this becomes less of a problem, but sometimes I want to quickly test something in console. Please tell me I have overlooked a basic command that does this.
There is no such thing, but you're on the right track - a script is definitely the way to go. I would also recommend R Studio, a free R IDE, which gives you several displays, one for scripts, one for the console, one for your plots - it's great! It makes working with scripts as easy as interacting with the traditional R console.
As Gabriel told you, a script is the best way. However, the following link could help you:
Using Inkscape to Post-edit Labels in R Graphs

How to draw a directed graph with labels on edges using quickgraph and graph# libraries?

I'm trying to draw a directed graph with labels on edges. I'm using graph# (graphsharp) and quickgraph, and I saw an explanation in the forums about how to add labels (it is not supported by the library), but cannot manage to implement myself. If someone could provide a working example using these two libraries I would be very thankful.
Update:
I'm now looking for something a little more complicated: My edges behave like nodes, they have connections to other nodes and have a name-tag. So they are like any other node, and when I draw the graph these edge-nodes must appear exactly in the middle of a certain connections. Any ideas?
Although it's not documented, QuickGraph supports output to other formats, like DGML. VS 2010 includes a very basic DGML viewer. It may be possible to output DGML so that the resulting graph has edge labels. However you will likely need to add support yourself.
Download the QuickGraph sources and play around with it. I'm a committer on the project, so if you figure it out let me know and we'll get your changes into the project.

Flex Tree/Branch Diagramming/Graphics

I was wondering if anyone had access to source code that would allow me to draw lines between objects. I have examples of the standard one line between 2 objects.
What I'm looking for is an example of how to draw a branching line. I.e. Starts as a line coming from an object and then branches out to other objects. I don't want to draw multiple lines from the same object because I need the objects to be related and the lines to have a settable property.
The added issue is that I want the number of branches available to be settable by the user. But if I can find code that dooes the branching lines, it probably wouldnt be too hard to tweek.
Hopefully what I'm looking for makes sense. Any hints and tips would be much appreciated.
Check out the graphing libraries:
Birdeye's RaVis and Source
Flare and Source
Best,
Lance

Resources