Methods SetDrawFirstAndSecondAxis() and SetDrawThirdAxis() of the class Prs3d_DatumAspect are corrected to ensure that myAxis may be set only to valid values of the enum, and avoid unsafe operations.
{
if (theToDraw)
{
- myAxes = Prs3d_DatumAxes(myAxes | Prs3d_DA_XAxis | Prs3d_DA_YAxis);
+ myAxes = ((myAxes & Prs3d_DA_ZAxis) != 0 ? Prs3d_DA_XYZAxis : Prs3d_DA_XYAxis);
}
else
{
- myAxes = Prs3d_DatumAxes(myAxes & !Prs3d_DA_XAxis & !Prs3d_DA_YAxis);
+ myAxes = Prs3d_DA_ZAxis;
}
}
{
if (theToDraw)
{
- myAxes = Prs3d_DatumAxes(myAxes | Prs3d_DA_ZAxis);
+ myAxes = ((myAxes & Prs3d_DA_XYAxis) != 0 ? Prs3d_DA_XYZAxis : Prs3d_DA_ZAxis);
}
else
{
- myAxes = Prs3d_DatumAxes(myAxes & !Prs3d_DA_ZAxis);
+ myAxes = Prs3d_DA_XYAxis;
}
}