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

@@ -12,8 +12,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs.hxx>
@@ -60,10 +58,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
{
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Standard_Real aWidth;
LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
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());

View File

@@ -13,12 +13,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs.hxx>
#include <DsgPrs_AnglePresentation.hxx>
#include <DsgPrs.hxx>
#include <ElCLib.hxx>
#include <GC_MakeCircle.hxx>
#include <gce_MakePln.hxx>
@@ -35,7 +32,6 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Precision.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
@@ -43,7 +39,6 @@
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <UnitsAPI.hxx>

View File

@@ -31,11 +31,6 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
Handle(Prs3d_DatumAspect) aDatumAspect = theDrawer->DatumAspect();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePresentation);
Quantity_Color aColor;
Aspect_TypeOfLine aTypeOfLine;
Standard_Real aWidth;
aDatumAspect->FirstAxisAspect()->Aspect()->Values(aColor, aTypeOfLine, aWidth);
gp_Ax2 anAxis(theDatum);
gp_Pnt anOrigin = anAxis.Location();
gp_Dir aXDir = anAxis.XDirection();

View File

@@ -14,15 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// modified 12-january-98
// Sergey ZARITCHNY
// szy
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs.hxx>
#include <DsgPrs_DiameterPresentation.hxx>
#include <DsgPrs.hxx>
#include <ElCLib.hxx>
#include <gp_Circ.hxx>
#include <gp_Dir.hxx>
@@ -32,7 +26,6 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
@@ -40,7 +33,6 @@
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_ExtendedString.hxx>
//==========================================================================

View File

@@ -14,12 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs.hxx>
#include <DsgPrs_EllipseRadiusPresentation.hxx>
#include <DsgPrs.hxx>
#include <ElCLib.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx>
@@ -35,7 +32,6 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Precision.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
@@ -43,7 +39,6 @@
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>

View File

@@ -14,12 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs.hxx>
#include <DsgPrs_FilletRadiusPresentation.hxx>
#include <DsgPrs.hxx>
#include <ElCLib.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Line.hxx>
@@ -33,7 +30,6 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Precision.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
@@ -41,7 +37,6 @@
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>

View File

@@ -14,11 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs_FixPresentation.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
@@ -28,12 +25,10 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Quantity_Color.hxx>
//=======================================================================
//function : Add
@@ -97,13 +92,9 @@ void DsgPrs_FixPresentation::Add(
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// On ajoute un rond au point d'attache
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Standard_Real aWidth;
LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
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);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);

View File

@@ -50,13 +50,9 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
aPrims->AddVertex(aPntOffset);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// On ajoute un rond au point d'attache
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Standard_Real aWidth;
LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
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);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);

View File

@@ -12,12 +12,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs.hxx>
#include <DsgPrs_LengthPresentation.hxx>
#include <DsgPrs.hxx>
#include <ElCLib.hxx>
#include <gce_MakeLin.hxx>
#include <Geom_Curve.hxx>
@@ -31,7 +28,6 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Precision.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
@@ -40,7 +36,6 @@
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>

View File

@@ -14,11 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs_OffsetPresentation.hxx>
#include <ElCLib.hxx>
#include <gce_MakeLin.hxx>
#include <gp_Dir.hxx>
@@ -29,7 +26,6 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Precision.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
@@ -37,7 +33,6 @@
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -121,10 +116,7 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
// ball 1 : 3eme groupe
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Standard_Real aWidth;
LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
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);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
@@ -167,10 +159,9 @@ void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPres
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2);
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
Quantity_Color acolor;
Aspect_TypeOfLine atype;
Standard_Real awidth;
LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
Quantity_Color acolor = LA->LineAspect()->Aspect()->Color();
Aspect_TypeOfLine atype = LA->LineAspect()->Aspect()->Type();
Standard_Real awidth = LA->LineAspect()->Aspect()->Width();
Handle(Graphic3d_AspectLine3d) AxeAsp = new Graphic3d_AspectLine3d (acolor, atype, awidth);
AxeAsp->SetType( Aspect_TOL_DOTDASH);

View File

@@ -14,14 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//modified 20-feb-98 by <SZY>
// Sergei Zaritchny
#include <Aspect_AspectMarker.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <DsgPrs.hxx>
#include <DsgPrs_RadiusPresentation.hxx>
#include <DsgPrs.hxx>
#include <ElCLib.hxx>
#include <gce_MakeDir.hxx>
#include <gce_MakeLin.hxx>
@@ -33,7 +28,6 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Precision.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
@@ -41,7 +35,6 @@
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_ExtendedString.hxx>
static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,

View File

@@ -689,10 +689,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
// SYMMETRY WHEN THE REFERENCE POINT IS ON THE AXIS OF SYM.:
//==============================================================
//Marker of localisation of the face
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Standard_Real aWidth;
LA->LineAspect()->Aspect()->Values(aColor, aType, aWidth);
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);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
@@ -810,10 +807,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Standard_Real aWidth;
LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
Quantity_Color aColor = LA->LineAspect()->Aspect()->Color();
Handle(Graphic3d_AspectMarker3d) aMarkerAspAtt = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAspAtt);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints1 = new Graphic3d_ArrayOfPoints (1);