For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

incorporating text into ais_shape

Kar Heng Chan's picture
Forums: 

hi

been trying to include text display into ais_shape. basically, took the sources of ais_shape, modified them and renamed the class.

i have some problems with it though. most obviously now, they are color change and selection.

i can change the color of the object, but not through ais_interactivecontext. i can select the object, but it doesn't get highlighted.

anybody able to help?

the constructors, compute methods and setcolor method was modified.

the Compute method now has these added:

if(myText.Length()>0) {

Standard_Real x,y,z;

// multiply (0,0,0) with myLocation to obtain required point

x=y=z=0;

if(HasTransformation())

{

Handle_Geom_Transformation trsf;

trsf = Transformation();

trsf->Transforms(x,y,z);

};

Prs3d_Text::Draw(aPrs,myDrawer,myText,gp_Pnt(x,y,z)); };

the ComputeSelection method now has these added:

if(flagEmptyText==0 && flagEmptyShape==1)

{

aSelection->Add(new Select3D_SensitiveBox(owner,0-0.05,0-0.05,0-0.05,0+0.05,0+0.05,0+0.05));

};

the SetColor method now has these added:

Handle_Prs3d_TextAspect myTextAspect=new Prs3d_TextAspect(); myTextAspect->SetColor(aCol.Name()); myDrawer->SetTextAspect(myTextAspect);

thanks in advance

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.