1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0025399: Visualization - XCAFPrs_AISObject ignores global aspect settings

Copying of the default drawer's parameters added.
This commit is contained in:
san 2014-10-20 20:36:42 +04:00 committed by bugmaster
parent 3415763e74
commit e21b2bc603

View File

@ -19,6 +19,7 @@
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <Graphic3d_AspectFillArea3d.hxx> #include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Handle_AIS_Drawer.hxx> #include <Handle_AIS_Drawer.hxx>
#include <Prs3d_DimensionAspect.hxx> #include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_IsoAspect.hxx> #include <Prs3d_IsoAspect.hxx>
@ -184,30 +185,39 @@ void XCAFPrs_AISObject::SetColors (const Handle(AIS_Drawer)& theDrawer,
if (!theDrawer->HasShadingAspect()) if (!theDrawer->HasShadingAspect())
{ {
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect()); theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
} }
if (!theDrawer->HasLineAspect()) if (!theDrawer->HasLineAspect())
{ {
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0)); theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
} }
if (!theDrawer->HasWireAspect()) if (!theDrawer->HasWireAspect())
{ {
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0)); theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
} }
if (!theDrawer->HasUIsoAspect()) if (!theDrawer->HasUIsoAspect())
{ {
theDrawer->SetUIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1)); theDrawer->SetUIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1));
*theDrawer->UIsoAspect()->Aspect() = *theDrawer->Link()->UIsoAspect()->Aspect();
theDrawer->UIsoAspect()->SetNumber (theDrawer->Link()->UIsoAspect()->Number());
} }
if (!theDrawer->HasVIsoAspect()) if (!theDrawer->HasVIsoAspect())
{ {
theDrawer->SetVIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1)); theDrawer->SetVIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1));
*theDrawer->VIsoAspect()->Aspect() = *theDrawer->Link()->VIsoAspect()->Aspect();
theDrawer->VIsoAspect()->SetNumber (theDrawer->Link()->VIsoAspect()->Number());
} }
if (!theDrawer->HasFreeBoundaryAspect()) if (!theDrawer->HasFreeBoundaryAspect())
{ {
theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0)); theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
*theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
} }
if (!theDrawer->HasUnFreeBoundaryAspect()) if (!theDrawer->HasUnFreeBoundaryAspect())
{ {
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0)); theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
*theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
} }
theDrawer->UnFreeBoundaryAspect()->SetColor (theColorCurv); theDrawer->UnFreeBoundaryAspect()->SetColor (theColorCurv);