How to manually set angle and length of a nodes handle - inkscape

When adjusting node handles, I have noticed that at the bottom of the screen it indicates what angle and what length the handle is in relation to the node. Is there a way to manually or directly inputting these values somewhere?
Clarification: I am looking a dialogue where I can key in values for the length and angle for the handle.

Related

Direct2D Drawing with DirectX11: Aligning rectangles on a display graph

I'm working on a graphical application in C++ using Direct2d (DirectX11). The application takes in sensor data and displays the input using rectangles that are placed side-by-side across the x-axis (which represents time). Each rectangle is filled with a linear gradient brush that represents multiple sensor readings at the discrete time interval displayed along the y-axis.
When a reading is acquired, the placement for the starting 'x' position of the next rectangle should be exactly where the last one finished i.e. rect1.right should be rect2.left. The start point for each rect is calculated using the pseudocode below:
//find the number of rectangles needed to represent the time scale (rects must be an integer, as we cannot display partial rectangles
int nNumXRects = fAxisLength/fTimeDivision;
//calculate the X-axis increment for each rectangle
float fXIncrement = fXAxisLineLength/(float)NumXRects;
//Get the next x position
rect2.left = rect1.right;
rect2.right = rect2.left + fXIncrement;
My problem is that the graph only appears correctly when the value of fXIncrement is exactly a whole number e.g. 3.0f. This obviously restricts the length of the X-Axis to figures that are multiples of the number of rectangles, times the length of each rectangle. This affects the area available to all the other elements of the application.
If the value of the increment is anything other that a whole number, small black lines appear between the rectangles which destroys the appearance and makes the data much harder to interpret. I realise why this is happening in principle - we cannot display a fraction of a pixel for instance, but how should this be done properly so that the rectangles will always match up exactly, regardless of the length of the axis? It would seem that Direct2D is perfect for this and should intrinsically cope with mapping fractional values to physical pixels exactly, but I don't know what the correct approach is beyond by current simplistic solution which is to keep the length of the x-axis fixed (meaning I cannot scale properly and other elements do not have enough space in the horizontal).
Any pointers in the right direction would be much appreciated!
Can't this be fixed by setting the appropriate anti alias mode when drawing the rectangles?
pRenderTarget->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED);

how to remove glyphs from vtk data?

I am wondering if there is a vtk filter that replaces glyps (cone source) with a single vertex?
Here is the problem i am trying to solve. I have bunch of vector field data displayed using cone glyps. I am trying to pick a vector glyph and display vector values. I am using vtkCellPicker to pick the vector glyph. The cell picker is picking the face on the glyph instead of picking the whole glyph. So, the vector values picked are values on the face, not for the entire glyph.
If i can run the vtkData through some filter which replaces these glyps with a single vertex, i can pick the point and pick the correct vector field values.
Any help is appreciated.
You can use a vtkPolyDataConnectivityFilter (http://www.vtk.org/doc/nightly/html/classvtkPolyDataConnectivityFilter.html#details) to pull out the whole glyph starting from the one cell that is picked.
You may be better off setting GeneratePointIdsOn on your vtkGlyph3D filter which will add to the cone data an extra array with input point IDs. You can then use this to look up the original data value for display. See http://www.vtk.org/doc/nightly/html/classvtkGlyph3D.html#a1d7bfd7779ca2e229423a33a2e36e741

ChartJS - adding scroll to horizontal legend in Line chart

I am creating project with ChartJs, and I am fetching real time data from the server. Each second, I add extra data point. After some time, there is just too many points on the graph, to the point that you cannot see anything. I would like to know, if there is a way to scroll through the x-variables, and always have set distance between the points? As of know, the distance between points is shrinking, making the graph not readable.
Thanks!
I would like to know, if there is a way to scroll through the
x-variables,
You can use .removeData( ) to remove the (current) first set of points. This would keep only the same number of (latest) points visible on the graph.
...and always have set distance between the points?
Unless you remove points maintain a set distance while adding points would cause the graph width to increase - which is usually not what you want to do.

Determine whether the mouse moved horizontally (C++)

I can detect a cursor movement over my window by capturing the WM_MOUSEMOVE message. This message contains x and y coordinates but what I need to figure out it whether the user tried to move the mouse horizontally or vertically. I want to ignore the vertical movement if the x-coordinate changed more significantly than y. Do I need to use some other message? Thanks!
David is right that you will likely need to keep track of the state. However, there is a function, GetMouseMovePointsEx that will give you up to 64 previous coordinates of the mouse. You will still have to have a map (or some other data structure) for storing the coordinates yourself, but that function should do a lot of the legwork for you. Then again, I'm not sure how that method will compare to a more manual method as far as deciding where the mouse started so you know what to compare to. *(see edit below)
Once you have the previous coordinates, you can compare the starting position with the latest position. If the difference is greater than some arbitrary amount (that you decide on) then execute your code.
*EDIT: Just read this in the GetMouseMovePointsEx documentation I linked above
The GetMouseMovePointsEx function searches for the point in the mouse
coordinates history. If the function finds the point, it returns the
last nBufPoints prior to and including the supplied point.
If your application supplies a time stamp, the GetMouseMovePointsEx
function will use it to differentiate between two equal points that
were recorded at different times.
An application should call this function using the mouse coordinates
received from the WM_MOUSEMOVE message and convert them to screen
coordinates.

moving a set of items that contains a clip-rect attribute

I have a set containing image objects. Each object is cropped using the 'clip-rect' attribute.
when I transform the entire set
allframes.transform("t50,0")
all the images move 50 pixels to the right, but the clip-rect stays in place.
how can I get the clip-rect attributes to transform with the entire set?
I am working on this for hours and I am drawing blanks.
I did come up with an inefficient solution:
When I first create the images and crop them, I create rectangles with the attributes of the crop, and push them into the set. when I transform the set, the rectangles move too, and then I reset the attributes on the clip-rect so it matches the getBBox of the corresponding rectangles. it worked for a while but now the code became too complicated for that.
Is there any way to move 'clip-rect' relative to their position?
Here is an illustration of my problem:
http://jsfiddle.net/28Fcn/
the yellow square is the same size as the other squares but it is cropped.
when I transform the entire set, all the elements move but the crop stays in place.
click on the rectangles and see.
this is my solution which is not ideal
http://jsfiddle.net/PgK6w/
any ideas?