digit / ToolTipDialog : Modify orientation for a fixed coordinate ToolTipdialog - dojo

There are two ways of opening a ToolTipDialog. One is by giving 'around' attribute which is a DOM node and other is by giving x and y coordinates. If we give 'around' attribute, we can also give 'orient' attribute to define the positioning of ToolTipDialog with respect to the DOM Node.
However, I have to open ToolTipDialog adjacent a certain gfx shape. Since this shape is not a Dom node I have to use x, y coordinate to position the ToolTipDialog. But in this case, I always get a default orientation (the pointer/notch) always points upwards.
Is there a way I can change the orientation by giving x, y coordinate such that I can ensure that ToolTipDialog now opens with the notch on its left side or on bottom side ? Also can I modify the point where this notch will be created ? It could be possible that ToolTipDialog is opened a bit shifted upwords and I may need the notch at the center of one of its side.
Finally, am I right in using the ToolTipDialog for my purpose, or should I use some alternative ?

Related

How to stop resizing the graph axis in tableau?

I want to stop resizing the graph axis (x,y), if any filter on the data is used in tableau. Can anyone helpe with this?
Double click on the axis to edit its characteristics (or right click on it and choose edit axis)
By default, the axis upper and lower bounds are set automatically based on the range of data that appears. If you wish to fix one or both ends to a constant value, just change that setting in the axis editing dialog.
You’ll see a push-pin icon on the axis to remind you that the axis bounds are pinned. That reminder is useful because if there is data that is beyond the bounds of the axis, it will be clipped and not shown.
BTW, this is the exactly the same thing that happens when you zoom in on a map or chart, you’re pinning the axes to display only part of the region.

Is there an alternative to View.GetOutline() which DOES include Temporary Axes?

Note: This is not answered by the suggested question - it is practically the opposite of it. Besides, it is me who asked that question too and I also linked to it below.
I am fixing someone else's VBA code for SolidWorks which places drawing views next to each other based on their size.
Size of a view is taken from bounding box returned by View.GetOutline() and view's position is set by changing View.Position property.
The code processes multibody parts, creating one drawing sheet per body.
The problem is that View.Position property corresponds to center of bounding box that includes Temporary Axes while View.GetOutline() does not include them - it returns a bit more than the selection outline shown by SolidWorks GUI.
This is the multibody part and one of the offending drawing views with temporary axes turned on in the SW GUI:
In the drawing you can see:
selection outline shown by SW GUI (light blue dotted rectangle)
diagonal of the outline returned by View.GetOutline() (red line)
center of the view as in View.Position property (red X)
temporary axes (blue crosses and lines)
Is there a way to get drawing view's real size, the one that correspond to the bounding box whose center is the View.Position property?
Apparently, the drawing view includes temporary axes from other bodies in this multibody part.
That points to the alternative question: Is there a way to prevent temporary axes from other bodies in a multibody part from being included in drawing view of a single body?
For reference, the problem is the same no matter which method is used to create the view (e.g. CreateDrawViewFromModelView3(), CreateUnfoldedViewAt3(), CreateRelativeView(), etc.).
Note: I asked another question that stems from this same problem which I changed because I wrongly assumed that View.GetOutline() does not include Temporary Axes.
I found an easy way to do that.
Yesterday I had the same problem and I've fixed the issue.
As you correctly have stated there is an offset between the Bouding Box center on the drawing and the View center (whose coordinate are given by the View.Position property in VBA).
Actually you want to place the your view according the Bounding Box (BB) center (let's call this position DesiredBBPos)...but we have to set the position through View.Position property.
So what you have to do is just to get this offset before moving the view.
The offset is the difference between the View center point (View.Position(0) ; View.Position(1)) and the BB center ((Xmax+Xmin)/2 ; (Ymax+Ymin)/2 )
I have defined an array Offset(1) in which I've put the Horizontal Offset and Vertical Offset (as above)
Now you can set the view position by a formula that will look like:
View.Position (0) = DesiredBBPos(0) + Offset(0)
View.Position (1) = DesiredBBPos(1) + Offset(1)
It works ;)
Aldo

Psychtoolbox scale slider

I'm trying to make a slider for a simple scale where the user can see mouse movement ONLY in the horizontal axis (fixed y location on the horizontal scale).
In more detail: When the scale appears, I want the cursor to appear as a short vertical line (aka slider) in the center of the horizontal scale.
When the user moves the mouse, the slider should move accordingly on the horizontal axis (without reflecting any changes in the vertical axis, i.e. it should stay on the scale)
I'm stuck on both changing the appearance of the cursor to a vertical line slider and on limiting the cursor's movement to the horizontal axis.
Here's what I've tried:
I can successfully place the cursor with SetMouse.
I tried ShowCursor to change the appearance of the cursor, but this only has a few named options and the numbered ones are not portable across OSs ("mapping of numbers to shapes is operating system dependent"), which I need. Any other ideas on how to change the cursor to a vertical line slider?
As for limiting the movement to horizontal, I couldn't find any PTB functions that seem to do this. I did find some workarounds in Matlab to make user GUIs, but it seems these can't be used with PTB's screen. Any ideas would be great!
I'm a still very new to PTB so thank you so much for your help!
I wrote a function for exactly that called slideScale. If you want to see how it works see the test script.
The crucial thing for you is to create a loop, which runs until a click has been made and record the position of the cursor for instance with the function GetMouse(), which gives you the x- and y-coordinates of the cursor. Then, the only thing you basically need is to update the position of your vertical line using the x-coordinate you recorded with GetMouse() without changing the y-coordinates, for which you can just use a fixed value.

Itext Sharp: adding a textbox to a correct position in the rotated PDF

I would like to add a textbox to the rotated pdf (270 degrees). When I use a function of GetPageSizeWithRotation(pageNum), it returns a rectangle with an incorrect position. Thus, the added textbox is also in the incorrect position.
My problems are shown in the following figure:
Please suggest me some solutions to get the PDF position exactly. Thanks!
According to your comments you identified that the issue occurs only for page which have a crop box differing from your media box. Thus, you should base your calculation on the crop box instead of your media box
GetPageSizeWithRotation essentially is implemented like this:
virtual public Rectangle GetPageSizeWithRotation(PdfDictionary page) {
Rectangle rect = GetPageSize(page);
int rotation = GetPageRotation(page);
while (rotation > 0) {
rect = rect.Rotate();
rotation -= 90;
}
return rect;
}
GetPageSize(page) called from here essentially returns the media box.
Thus, you should have analog code based upon the crop box.
EDIT According to your new results it becomes clear that the problem is not coupled with the presence of a CropBox entry but more likely with the lower left corner of the box not being the origin of the coordinate system.
In this case the rotation of the box is executed differently by iText(Sharp) and Adobe Acrobat:
iText(Sharp) rotates the box dimensions and keeps the lower left offsets.
Adobe Acrobat rotates the lower left offsets, too.
That cause for the difference: The PDF specification describes the Rotate entry like this:
The number of degrees by which the page shall be rotated clockwise when displayed or printed.
I.e. the Rotate entry is not at all specified as something changing coordinate systems but merely as something changing the output orientation. Thus, those result are equally correct.
To emulate the Adobe Acrobat coordinate transition, therefore, one needs to program an explicit method. With those example result it should be easy to implement.

How to display both points and edges in MeshLab?

I'm new to MeshLab, but can anyone tell me how to display BOTH points AND edges? Now, I can only choose either one, not both. I'm using a .ply file to load the mesh. Thanks in advance!
Show edges using the usual toolbar button and then activate the Show Vertex Dots decoration (in the menu Render->Show Vertex Dots).
Optionally, activate the layer side dialog and in its lower part you will see the options for this decoration where you can change the dot size.