mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -127,7 +127,7 @@ Standard_Integer ViewerTest::parseColor (Standard_Integer theArgNb,
|
||||
}
|
||||
else if (theArgNb >= 3)
|
||||
{
|
||||
Graphic3d_Vec4 anRgba;
|
||||
Graphic3d_Vec4 anRgba (0.0f, 0.0f, 0.0f, 1.0f);
|
||||
Standard_Integer aNbComps = Min (theArgNb, theToParseAlpha ? 4 : 3);
|
||||
for (int aCompIter = 0; aCompIter < aNbComps; ++aCompIter)
|
||||
{
|
||||
|
@@ -3352,8 +3352,10 @@ void MyPArrayObject::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPre
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (myMarkerAspect);
|
||||
}
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
else
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
}
|
||||
aGroup->AddPrimitiveArray (myPArray);
|
||||
}
|
||||
|
||||
@@ -4780,7 +4782,13 @@ static Standard_Integer VTriangle (Draw_Interpretor& /*di*/,
|
||||
aPrims->AddVertex (aPnts[aPntIter]);
|
||||
}
|
||||
|
||||
ViewerTest::Display (argv[1], new MyPArrayObject (aPrims));
|
||||
Handle(AIS_InteractiveObject) aPrs = new MyPArrayObject (aPrims);
|
||||
if (!isTri)
|
||||
{
|
||||
aPrs->Attributes()->SetupOwnShadingAspect();
|
||||
aPrs->Attributes()->ShadingAspect()->Aspect()->SetColor (aPrs->Attributes()->LineAspect()->Aspect()->Color());
|
||||
}
|
||||
ViewerTest::Display (argv[1], aPrs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -22,10 +22,7 @@
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_ShaderObject.hxx>
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <OpenGl_AspectFace.hxx>
|
||||
#include <OpenGl_AspectLine.hxx>
|
||||
#include <OpenGl_AspectMarker.hxx>
|
||||
#include <OpenGl_AspectText.hxx>
|
||||
#include <OpenGl_Aspects.hxx>
|
||||
#include <OpenGl_Context.hxx>
|
||||
#include <OpenGl_Element.hxx>
|
||||
#include <OpenGl_GlCore20.hxx>
|
||||
@@ -158,11 +155,9 @@ void VUserDrawObj::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
|
||||
|
||||
// To test linking against OpenGl_Workspace and all aspect classes
|
||||
const OpenGl_AspectMarker* aMA = theWorkspace->AspectMarker();
|
||||
aMA->Aspect()->Type();
|
||||
const OpenGl_AspectText* aTA = theWorkspace->AspectText();
|
||||
aTA->Aspect()->Font();
|
||||
OpenGl_Vec4 aColor = theWorkspace->LineColor();
|
||||
const OpenGl_Aspects* aMA = theWorkspace->Aspects();
|
||||
aMA->Aspect()->MarkerType();
|
||||
OpenGl_Vec4 aColor = theWorkspace->InteriorColor();
|
||||
|
||||
aCtx->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), Aspect_TOL_SOLID,
|
||||
Graphic3d_TOSM_UNLIT, Graphic3d_AlphaMode_Opaque, false,
|
||||
|
Reference in New Issue
Block a user