What could be the UML symbol of a Smart Watch? - uml

I am developing a prototype and so making UML Diagrams, for my USE CASE, I need to show the data being sent and received from a smart watch, I was wondering if there is a standard symbol for it or I should just draw one myself?
I have been using the attached.

UML gives you the freedom to attach any shape to a stereotype. You can show it pure or as adornment in a corner of the rectangular element representation.
There is no standard other than rectangles (most UML elements), ovals (Use Cases), stickmen (Actors), rounded rects (Activities, Actions) and circles (mostly for state elements). (If there are more, they are quite uncommon and slipped my mind.)
For your watch you can take whatever you want. This one looks okay (although to me it looks more like a satellite).

Definitely not, UML is not that much specific, "portable computing device" is as specific as you'll get. So pick something here

Related

glTF: how can we store basic geometry primitives?

I'm new to glTF and I would have a very basic, and maybe naive, question. Sorry, and thanks for your understanding and your help.
We have a C++ application where we handle geometry primitive entities, like boxes, cones, cylinders, and so forth.
For visualizing the geometry entities we currently use Coin3D, which have corresponding geometry shapes: Box, Cone, ...
We now would like to add a glTF exporter too, and I have started to explore the glTF specs.
I must say, in the official documentation, and on the web, I could not find any support in glTF for basic geometry shapes.
Therefore, my questions are:
is that true, that glTF has no notion of, let's say, a Box, or a Cone? Or did I missed something obvious?
If the answer to 1) is "NO", are there tested/supported/suggested implementations for basic shapes? I have only found some "example" shapes, like the Box here; but I could not find any collection of implementations of basic shapes. Again, did I miss something?
Are there any best practices, or documentation, on how to implement basic geometry shapes in glTF?
The short answer is you're correct, glTF does not currently store basic geometric shapes directly as a box, cone, cylinder, etc. The format is intended to be a runtime delivery format, not an asset interchange format.
As such, the internal data structures within glTF are designed to mimic the raw data that would typically be fed into a GPU using a graphics API such as OpenGL, WebGL, etc. Entire blocks of glTF data can often be pulled off a disk or network and handed over directly to a graphics API for rendering, with minimal pre-processing.
This means that all of your basic shapes must arrive as the GPU expects to find them: triangulated. Even a simple box is made up of twelve triangles, and because the sides don't share normal vectors, the normal "vertex attributes" are different, hence triangles from different sides of the box don't share vertices (again, because the GPU wouldn't accept that as a raw input). The benefit is that a WebGL client doesn't have to think very hard about what to do when it receives a glTF, it can just start cramming data into the graphics pipeline to get things moving.
For a broader overview, the ever-popular glTF - What the Duck diagram is widely considered an excellent starting point, and the glTF Tutorials are a good follow-up to that.

With the Haskell graphics library Gloss, is it possible to mask a picture to only display in a certain extent (ie within a rectangle)

I have been using the Gloss Library for some game programming, and have got to the point where I am having the most difficulty laying out different elements on the screen. I was wondering whether it was possible to limit a Picture type to display only a certain rectangular area of the screen. The library already has the concept of a rectangular area with the Extent type, but there does not appear to be any way to 'subtract' from pictures.
If there was a way of doing this then it seems like creating a View type or similar that takes over responsibility for a certain area of the screen — which can also contain additional views, and with suitable coordinate substitutions between them etc — would be an achievable and sensible goal. But without a way to limit drawing areas it doesn't seem like this would be possible within the Gloss framework.
It seems that clipping is not supported in Gloss.
Nevertheless the recursive drawing of views each with their own relative coordinate system does still seem to be a viable and useful goal, and I am part way through writing code for this now.

Tessellation transition

I want to implement tessellation transition from fine to coarse geometry and vice versa for terrain rendering which doesn't introduce discontinuities (cracks).
Real-time performance is not required i.e. it can be view-independent.
What do you think about the following proposal:
alt text http://www.shrani.si/f/A/qD/2UJlczki/tessellation.png?
Is it even possible?
Have you implemented something similar?
What are the drawbacks?
Do you have any simpler suggestions?
Yes, this has been done many times. See for instance Hierarchical 4-K Meshes. There are probably references that are specific to terrain modeling and rendering but I don't have one handy.

Drawing component diagrams in TinyUML

I am working on extending a small application that uses the 'dot' tool to draw UML class and state diagrams, to implement component diagrams (I am running into a lot of problems accommodating the UML 2.x notation for the same).
I intend to display the interfaces that a particular component requires and provides through the use of lollipop notations. Now while trying to do so, I am not able to display the edges between two nodes as a straight line. Even if I am able to display one edge as a straight edge, I am unable to maintain that state for all the edges.
Just wanted to know is there any particular way apart from the usual attributes like weight, len (for neato), k, etc.? (or indeed any other tools that u may suggest ?) Appreciate your help.
Best,
Arun
Sorry I never used TinyUML, but as you asked for any other tool suggestion let me tell you that I'm very comfortable using StarUML (Open Source).

Polygon Triangulation with Holes

I am looking for an algorithm or library (better) to break down a polygon into triangles. I will be using these triangles in a Direct3D application. What are the best available options?
Here is what I have found so far:
Ben Discoe's notes
FIST: Fast Industrial-Strength Triangulation of Polygons
I know that CGAL provides triangulation but am not sure if it supports holes.
I would really appreciate some opinions from people with prior experience in this area.
Edit: This is a 2D polygon.
To give you some more choices of libraries out there:
Polyboolean. I never tried this one, but it looks promising: http://www.complex-a5.ru/polyboolean/index.html
General Polygon Clipper. This one works very well in practice and does triangulation as well as clipping and holes holes: http://www.cs.man.ac.uk/~toby/alan/software/
My personal recommendation: Use the tesselation from the GLU (OpenGL Utility Library). The code is rock solid, faster than GPC and generates less triangles. You don't need an initialized OpenGL-Handle or anything like this to use the lib.
If you don't like the idea to include OpenGL system libs in a DirectX application there is a solution as well: Just download the SGI OpenGL reference implementation code and lift the triangulator from it. It just uses the OpenGL-Typedef names and a hand full of enums. That's it. You can extract the code and make a stand alone lib in an hour or two.
In general my advice would be to use something that alreay works and don't start to write your own triangulation.
It is tempting to roll your own if you have read about the ear-clipping or sweep-line algorithm, but fact is that computational geometry algorithms are incredible hard to write in a way that they work stable, never crash and always return a meaningful result. Numerical roundoff errors will accumulate and kill you in the end.
I wrote a triangulation algorithm in C for the company I work with. Getting the core algorithm working took two days. Getting it working with all kinds of degenerated inputs took another two years (I wasn't working fulltime on it, but trust me - I spent more time on it than I should have).
Jonathan Shewchuk's Triangle library is phenomenal; I've used it for automating triangulation in the past. You can ask it to attempt to avoid small/narrow triangles, etc., so you come up with "good" triangulations instead of just any triangulation.
CGAL has the tool you need:
Constrained Triangulations
You can simply provide boundaries of your polygon (incuding the boundaries of the holes) as constraints (the best would be that you insert all vertices, and then specify the constraints as pairs of Vertex_handles).
You can then tag the triangles of the triangulation by any traversal algorithm: start with a triangle incident to the infinite vertex and tag it as being outside, and each time you cross a constraint, switch to the opposite tag (inside if you were previously tagging the triangles as outsider, outside if you were tagging triangles as insider before).
I have found the poly2tri library to be exactly what I needed for triangulation. It produces a much cleaner mesh than other libraries I've tried (including libtess), and it does support holes as well. It's been converted to a bunch of languages. The license is New BSD, so you can use it in any project.
Poly2tri library on Google Code
try libtess2
https://code.google.com/p/libtess2/downloads/list
based on the original SGI GLU tesselator (with liberal licensing). Solves some memory management issues around lots of small mallocs.
You can add the holes relatively easily yourself. Basically triangulate to the convex hull of the input points, as per CGAL, and then delete any triangle whose incentre lies inside any of the hole polygons (or outside any of the external boundaries). When dealing with lots of holes in a large dataset, masking techniques may be used to significantly speed this process up.
edit: A common extension to this technique is to weed weak triangles on the hull, where the longest edge or smallest internal angle exceeds a given value. This will form a better concave hull.
I have implemented a 3D polygon triangulator in C# using the ear clipping method. It is easy to use, supports holes, is numerically robust, and supports aribtrary (not self-intersecting) convex/non-convex polygons.
This is a common problem in finite element analysis. It's called "automatic mesh generation". Google found this site with links to commercial and open source software. They usually presume some kind of CAD representation of the geometry to start.
Another option (with a very flexible license) is to port the algorithm from VTK:
vtkDelaunay2D
This algorithm works fairly well. Using it directly is possible, but requires links to VTK, which may have more overhead than you want (although it has many other nice features, as well).
It supports constraints (holes/boundaries/etc), as well as triangulating a surface that isn't necessarily in the XY plane. It also supports some features I haven't seen elsewhere (see the notes on Alpha values).

Resources