mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +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:
@@ -73,7 +73,7 @@ public:
|
||||
glDisable (GL_LIGHTING);
|
||||
|
||||
// Use highlight colors
|
||||
theWorkspace->GetGlContext()->core11->glColor3fv (theWorkspace->LineColor().rgb);
|
||||
theWorkspace->GetGlContext()->core11->glColor3fv (theWorkspace->LineColor().GetData());
|
||||
|
||||
glEnableClientState (GL_VERTEX_ARRAY);
|
||||
glVertexPointer (3, GL_FLOAT, 0, (GLfloat* )&myVerts);
|
||||
@@ -209,12 +209,7 @@ void OpenGl_Structure::HighlightWithBndBox (const Handle(Graphic3d_Structure)& t
|
||||
myHighlightBox = new OpenGl_Group (theStruct);
|
||||
}
|
||||
|
||||
CALL_DEF_CONTEXTLINE& aContextLine = myHighlightBox->ChangeContextLine();
|
||||
aContextLine.IsDef = 1;
|
||||
aContextLine.Color = HighlightColor;
|
||||
aContextLine.LineType = Aspect_TOL_SOLID;
|
||||
aContextLine.Width = 1.0f;
|
||||
myHighlightBox->UpdateAspectLine (Standard_True);
|
||||
myHighlightBox->SetGroupPrimitivesAspect (new Graphic3d_AspectLine3d (HighlightColor, Aspect_TOL_SOLID, 1.0));
|
||||
|
||||
OpenGl_BndBoxPrs* aBndBoxPrs = new OpenGl_BndBoxPrs (myBndBox);
|
||||
myHighlightBox->AddElement (aBndBoxPrs);
|
||||
@@ -230,13 +225,12 @@ void OpenGl_Structure::setHighlightColor (const Handle(OpenGl_Context)& theGlCtx
|
||||
clearHighlightBox (theGlCtx);
|
||||
if (myHighlightColor == NULL)
|
||||
{
|
||||
myHighlightColor = new TEL_COLOUR();
|
||||
myHighlightColor = new OpenGl_Vec4 (theColor, 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
myHighlightColor->xyz() = theColor;
|
||||
}
|
||||
|
||||
myHighlightColor->rgb[0] = theColor.r();
|
||||
myHighlightColor->rgb[1] = theColor.g();
|
||||
myHighlightColor->rgb[2] = theColor.b();
|
||||
myHighlightColor->rgb[3] = 1.F;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -529,7 +523,7 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
}
|
||||
|
||||
// Apply highlight color
|
||||
const TEL_COLOUR *aHighlightColor = theWorkspace->HighlightColor;
|
||||
const OpenGl_Vec4* aHighlightColor = theWorkspace->HighlightColor;
|
||||
if (myHighlightColor)
|
||||
theWorkspace->HighlightColor = myHighlightColor;
|
||||
|
||||
|
Reference in New Issue
Block a user