1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027670: Visualization - avoid duplication of structures defining primitive array presentation aspects

Quantity_ColorRGBA has been introduced as convenient structure holding Vec4 for OpenGL.
Graphic3d_PolygonOffset has been added as replacement for TEL_POFFSET_PARAM.

Duplicating definition of Hatch Styles TEL_HS_*** has been removed;
Aspect_HatchStyle enum now follows values of TEL_HS_*** for compatibility.
TelCullMode enum has been removed.

Aspect_AspectLine has been merged into Graphic3d_AspectLine3d.
Aspect_AspectMarker has been merged into Graphic3d_AspectMarker3d.
Aspect_AspectFillArea has been merged into Graphic3d_AspectFillArea3d.
Graphic3d_CAspectFillArea have been removed.

OpenGl_AspectLine now stores Graphic3d_AspectLine3d as class field.
OpenGl_AspectMarker now stores Graphic3d_AspectMarker3d as class field.
OpenGl_AspectText now stores Graphic3d_AspectText3d as class field.
OpenGl_AspectFace now stores Graphic3d_AspectFillArea3d as class field.

Graphic3d_AspectFillArea3d - back face culling is now enabled by default.
TKOpenGl now relies on Graphic3d_Group::IsClosed() flag to disable face culling.
StdPrs_ShadedShape now does not modify aspect for different culling modes.

Headers InterfaceGraphic_Graphic3d.hxx, InterfaceGraphic_telem.hxx, InterfaceGraphic_tgl_all.hxx
defining obsolete structures CALL_DEF_COLOR, CALL_DEF_POINT,
CALL_DEF_MATERIAL, CALL_DEF_TRANSFORM_PERSISTENCE, TEL_POINT, TEL_COLOUR
have been removed.

Useless and broken test case bugs/vis/buc60821 has been removed.

OpenGl_Workspace::myAspectFaceApplied and myAspectMarkerApplied have been replaced
from OpenGl_AspectFace*/OpenGl_AspectMarker*
to Handle(Graphic3d_AspectFillArea3d)/Handle(Graphic3d_AspectMarker3d).
This eliminates reading from freed memory
(e.g. when OpenGl_AspectFace is allocated on stack like in OpenGl_Trihedron).

OpenGl_PrimitiveArray::drawEdges() - fix drawing non-indexed array from VBO (access violation due to NULL handle).

AIS_Dimension::DrawArrow() - added missing initialization of 3D arrow aspect.
AIS_Manipulator::Compute() now creates dedicated Face Aspect for each axis.
V3d_CircularGrid, V3d_RectangularGrid now create dedicated line aspects with different color.
AIS_InteractiveObject::SetMaterial() - do not modify global ShadingAspect.
This commit is contained in:
kgv
2016-07-13 19:36:20 +03:00
committed by bugmaster
parent 28cab3768f
commit b647266461
117 changed files with 1865 additions and 4534 deletions

View File

@@ -572,11 +572,9 @@ static Handle(Prs3d_IsoAspect) CopyIsoAspect
(const Handle(Prs3d_IsoAspect) &theIsoAspect,
const Standard_Integer theNbIsos)
{
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Standard_Real aWidth;
theIsoAspect->Aspect()->Values(aColor, aType, aWidth);
Quantity_Color aColor = theIsoAspect->Aspect()->Color();
Aspect_TypeOfLine aType = theIsoAspect->Aspect()->Type();
Standard_Real aWidth = theIsoAspect->Aspect()->Width();
Handle(Prs3d_IsoAspect) aResult =
new Prs3d_IsoAspect(aColor, aType, aWidth, theNbIsos);
@@ -2946,9 +2944,7 @@ inline void bndPresentation (Draw_Interpretor& theDI,
case BndAction_Show:
{
Handle(Graphic3d_Structure) aPrs (thePrs->Presentation());
aPrs->CStructure()->HighlightColor.r = 0.988235f;
aPrs->CStructure()->HighlightColor.g = 0.988235f;
aPrs->CStructure()->HighlightColor.b = 0.988235f;
aPrs->CStructure()->HighlightColor = Quantity_NOC_GRAY99;
aPrs->CStructure()->HighlightWithBndBox (aPrs, Standard_True);
break;
}

View File

@@ -160,15 +160,15 @@ void VUserDrawObj::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
// To test linking against OpenGl_Workspace and all aspect classes
const OpenGl_AspectMarker* aMA = theWorkspace->AspectMarker();
aMA->Type();
aMA->Aspect()->Type();
const OpenGl_AspectText* aTA = theWorkspace->AspectText();
aTA->FontName();
TEL_COLOUR aColor = theWorkspace->LineColor();
aTA->Aspect()->Font();
OpenGl_Vec4 aColor = theWorkspace->LineColor();
// Finally draw something to make sure UserDraw really works
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glColor4fv(aColor.rgb);
glColor4fv(aColor.GetData());
glBegin(GL_LINE_LOOP);
glVertex3f(myCoords[0], myCoords[1], myCoords[2]);
glVertex3f(myCoords[3], myCoords[4], myCoords[2]);