Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  SDK Support    Garbage output when using a 2D geomety to output text
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
Hello,

I'm using a 2D geometry object to output some text in a scene, and once in a while the text comes out garbage. Following is the code I'm using:

// the rollover's text.
CXPString rollText;

// calculate the position for the rollover.
const CXPPoint3d Dest = (m_LeftPoint.Position + m_RightPoint.Position) * 0.5f;


IMTS_Instance2d* const pGeom2D = m_pRollOver3d->GetGeometry2d();
if (pGeom2D == NULL)
{
return;
}

CXPVerify(pGeom2D->SetAlwaysVisible(false));

// Set text position (values > 1 make no difference)
CXPVerify(pGeom2D->SetCenter(CXPPoint3d(Dest.x + 1.0f, Dest.y + 1.0f, Dest.z)));

// Set end-point at center of measurement line
CXPVerify(pGeom2D->SetTrackPoint(CXPPoint3d(Dest.x, Dest.y, Dest.z)));

// Adjust "hook" point in callout line
CXPVerify(pGeom2D->SetRadius( 0.25f));

// Adjust end-point side-to-side (first value) and under text (second value)
pGeom2D->SetAnchor(-0.25f, 0.4f);

const CXPPoint3d LeftPosition = m_InversionMatrix.Revert(m_InversionMatrix2.Revert(m_LeftPoint.Position));
const CXPPoint3d RightPosition = m_InversionMatrix.Revert(m_InversionMatrix2.Revert(m_RightPoint.Position));

// set the text and redrawe the object.
CXPVerify(rollText.Format("%.3f in (W: %.3f, H: %.3f, D: %.3f)",
fabs((LeftPosition - RightPosition).Mag()),
fabs((LeftPosition.x - RightPosition.x)),
fabs((LeftPosition.y - RightPosition.y)),
fabs((LeftPosition.z - RightPosition.z))
));

if (!pGeom2D->SetText(rollText)) { ASSERT(false); }
if (!pGeom2D->RecomputeText()) { ASSERT(false); }

// make sure the object is visible... in this case I think doing the check may be a quick as just setting the value again.
m_pRollOver3d->SetVisible(true);


Is this a known bug or I'm doing something wrong.

Thanks
Peter
 
Posts: 12 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  SDK Support    Garbage output when using a 2D geomety to output text