1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -55,12 +55,11 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
const DsgPrs_ArrowSide ArrowSide,
const Standard_Boolean drawFromCenter)
{
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_Group) aGroup = aPresentation->NewGroup();
Quantity_Color aColor = LA->LineAspect()->Aspect()->Color();
Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
aGroup->SetGroupPrimitivesAspect (LA->LineAspect()->Aspect());
switch(ArrowSide) {
case DsgPrs_AS_NONE:
@@ -69,7 +68,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
}
case DsgPrs_AS_FIRSTAR:
{
Prs3d_Arrow::Draw(Prs3d_Root::CurrentGroup (aPresentation),
Prs3d_Arrow::Draw (aGroup,
pt1,
dir1,
LA->ArrowAspect()->Angle(),
@@ -79,7 +78,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
case DsgPrs_AS_LASTAR:
{
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
Prs3d_Arrow::Draw (aGroup,
pt2,
dir2,
LA->ArrowAspect()->Angle(),
@@ -89,12 +88,12 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
case DsgPrs_AS_BOTHAR:
{
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
Prs3d_Arrow::Draw (aGroup,
pt1,
dir1,
LA->ArrowAspect()->Angle(),
LA->ArrowAspect()->Length());
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
Prs3d_Arrow::Draw (aGroup,
pt2,
dir2,
LA->ArrowAspect()->Angle(),
@@ -127,15 +126,11 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
{
if(drawFromCenter)
{
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints1 = new Graphic3d_ArrayOfPoints (1);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints1 = new Graphic3d_ArrayOfPoints (2);
anArrayOfPoints1->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints1);
}
if(drawFromCenter)
{
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints2 = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints2->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints2);
anArrayOfPoints1->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
aGroup->SetGroupPrimitivesAspect (aMarkerAsp);
aGroup->AddPrimitiveArray (anArrayOfPoints1);
}
break;
}
@@ -143,7 +138,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
case DsgPrs_AS_FIRSTAR_LASTPT:
{
// an Arrow
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
Prs3d_Arrow::Draw (aGroup,
pt1,
dir1,
LA->ArrowAspect()->Angle(),
@@ -151,25 +146,28 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
// a Round
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
aGroup->SetPrimitivesAspect (aMarkerAsp);
aGroup->AddPrimitiveArray (anArrayOfPoints);
break;
}
case DsgPrs_AS_FIRSTPT_LASTAR:
{
// a Round
if(drawFromCenter)
{
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
// an Arrow
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
Prs3d_Arrow::Draw (aGroup,
pt2,
dir2,
LA->ArrowAspect()->Angle(),
LA->ArrowAspect()->Length());
// a Round
if (drawFromCenter)
{
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
aGroup->SetPrimitivesAspect (aMarkerAsp);
aGroup->AddPrimitiveArray (anArrayOfPoints);
}
break;
}
}