1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects

Graphic3d_AspectFillArea3d, Graphic3d_AspectLine3d, Graphic3d_AspectMarker3d
and Graphic3d_AspectText3d have been merged into new class Graphic3d_Aspects.
The old classes are preserved as dummy sub-classes of Graphic3d_Aspects
preserving different per-aspect defaults.

Methods IsGroupPrimitivesAspectSet(), GroupPrimitivesAspect(), FillAreaAspect(),
LineAspect() and MarkerAspect() have been removed from Graphic3d_Group.
Instead, a new method Graphic3d_Group::ReplaceAspects() has been introduced
for replacing existing group aspects.

AIS_Shape now uses new method AIS_InteractiveObject::replaceAspects()
for updating computed groups with new aspects without presentation recomputation
in places where SynchronizeAspects() is not applicable.

OpenGl_AspectFace, OpenGl_AspectLine, OpenGl_AspectMarker
and OpenGl_AspectText have been merged into new class OpenGl_Aspects.

ViewerTest::parseColor() - fix uninitialized alpha component.
Graphic3d_AspectText3d/Prs3d_TextAspect - removed unused properties Space, ExpansionFactor, Angle.
Remove getters Values() deprecated since OCCT 7.1.0.
This commit is contained in:
kgv
2019-03-03 21:07:55 +03:00
committed by apn
parent e08a9b0302
commit bf5f0ca20a
86 changed files with 2275 additions and 3412 deletions

View File

@@ -15,55 +15,43 @@
#include <Graphic3d_AspectText3d.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectText3d, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectText3d, Graphic3d_Aspects)
// =======================================================================
// function : Graphic3d_AspectText3d
// purpose :
// =======================================================================
Graphic3d_AspectText3d::Graphic3d_AspectText3d()
: myFont (Font_NOF_ASCII_MONO),
myColor (Quantity_NOC_YELLOW),
myFactor (1.0),
mySpace (0.0),
myStyle (Aspect_TOST_NORMAL),
myDisplayType (Aspect_TODT_NORMAL),
myColorSubTitle (Quantity_NOC_WHITE),
myTextZoomable (false),
myTextAngle (0.0),
myTextFontAspect(Font_FA_Regular)
{
//
// actually this should be a special state Graphic3d_AlphaMode_MaskBlend
// since text is drawn in usual order with normal opaque objects (thanks to alpha test),
// but blending is also enabled to smoothen boundaries
SetAlphaMode (Graphic3d_AlphaMode_Mask, 0.285f);
myShadingModel = Graphic3d_TOSM_UNLIT;
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
myEdgeColor.SetRGB (Quantity_NOC_WHITE);
}
// =======================================================================
// function : Graphic3d_AspectText3d
// purpose :
// =======================================================================
Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color& theColor,
const Standard_CString theFont,
const Standard_Real theExpansionFactor,
const Standard_Real theSpace,
const Aspect_TypeOfStyleText theStyle,
const Aspect_TypeOfDisplayText theDisplayType)
: myFont (theFont),
myColor (theColor),
myFactor (theExpansionFactor),
mySpace (theSpace),
myStyle (theStyle),
myDisplayType (theDisplayType),
myColorSubTitle (Quantity_NOC_WHITE),
myTextZoomable (false),
myTextAngle (0.0),
myTextFontAspect(Font_FA_Regular)
Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color& theColor,
Standard_CString theFont,
Standard_Real ,
Standard_Real ,
Aspect_TypeOfStyleText theStyle,
Aspect_TypeOfDisplayText theDisplayType)
{
if (myFont.IsEmpty())
SetAlphaMode (Graphic3d_AlphaMode_Mask, 0.285f);
myShadingModel = Graphic3d_TOSM_UNLIT;
myTextStyle = theStyle;
myTextDisplayType = theDisplayType;
myInteriorColor.SetRGB (theColor);
myEdgeColor.SetRGB (Quantity_NOC_WHITE);
if (theFont != NULL
&& *theFont != '\0')
{
myFont = Font_NOF_ASCII_MONO;
}
if (theExpansionFactor <= 0.0)
{
throw Graphic3d_AspectTextDefinitionError("Bad value for TextScaleFactor");
myTextFont = new TCollection_HAsciiString (theFont);
}
}