Sat, 03/16/2024 - 22:58
In 7.5 I had a derived class from AIS_ColorScale which had a constructor like this:
AIS_TrajectoryColorScale::AIS_TrajectoryColorScale(NODE_UUID iChannelUUID, bool bSmooth, int NumSegments)
{
......
SetLabelType(Aspect_TOCSD_AUTO);
SetZLayer(Graphic3d_ZLayerId_TopOSD);
SetPosition(0, 0); // lower left corner
SetTransformPersistence(Graphic3d_TMF_2d, gp_Pnt(-1, -1, 0));//Displayed in the third phenomenon
}
When going to 7.8, the instruction SetTransformPersistence is no longer valid (it places the colorscale in the right bottom of the screen).
I tried this:
AIS_TrajectoryColorScale::AIS_TrajectoryColorScale(NODE_UUID iChannelUUID, bool bSmooth, int NumSegments)
{
...
SetZLayer(Graphic3d_ZLayerId_TopOSD);
SetPosition(0, 0); // lower left corner
Handle(Graphic3d_TransformPers) transformPers = new Graphic3d_TransformPers(
Graphic3d_TMF_2d, gp_Pnt(-1, -1, 0));
SetTransformPersistence(transformPers);//Displayed in the third phenomenon
}
But this throws an exception: Graphic3d_TransformPers::SetPersistence(), wrong persistence mode .
So what can i do?
Mon, 03/18/2024 - 08:21
For setting
Graphic3d_TMF_2d
mode you need using the second constructor takingAspect_TypeOfTriedronPosition
on input.P.S.: please use code tags to post code fragments formatted.
Mon, 03/18/2024 - 12:08
That worked! Thanks.
I did look for the code tags, but did not find them right away, maybe not a bad idea to place this right at the top of the explanation page.