Cancel
Showing results for 
Search instead for 
Did you mean: 

Origin of a JtkPMINote

Legend
Legend

Hello,

 

i try to assign a JtkPMINote to a sphere model. Unfortunately the note does not point to the sphere, but obviously to the origin.

In the picture you can see the sphere at the red arrow. The blue note is the result of my code.

The green line shows what I want to achieve.

How can i achieve this?

JtkPMINote.png

Here is my code snippet - mostly is taken from the example PMI_New

				//Convert float values x, y, z of the sphere to double
				double x = (double)point->OriginX;
				double y = (double)point->OriginY;
				double z = (double)point->OriginZ;

				// Note
				JtkEntityPtr<JtkPMINote> note = (JtkPMINote*)JtkEntityFactory::createPMI(JtkEntity::JtkPMINOTE, root);
				double noteOrigin[3] = { x, y, z };
				double noteBottomRight[3] = { -1, 10, 0 };
				double noteTopLeft[3] = { 0, 10, 1 };
				note->setVisualFrame(noteOrigin, noteBottomRight, noteTopLeft);
				double arTxtBox[] = { -10, -1, 10, 0, 0, 1 };
				note->addVisualTextData(sphereName, arTxtBox, 1, 0, 0);
				note->setName(sphereName);
2 REPLIES

Re: Origin of a JtkPMINote

Valued Contributor
Valued Contributor
You pass the root to the createPMI method. Try passing the sphere instead, casting it to a JtkUnitHierarchy*

Nicolas

Re: Origin of a JtkPMINote

Legend
Legend
Thank you very much for the answer. Unfortunately I cannot try your solution because the evaluation period expired by the end of May.
:-(