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

@@ -1,4 +1 @@
InterfaceGraphic.hxx
InterfaceGraphic_Graphic3d.hxx
InterfaceGraphic_telem.hxx
InterfaceGraphic_tgl_all.hxx

View File

@@ -1,87 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef InterfaceGraphic_Graphic3dHeader
#define InterfaceGraphic_Graphic3dHeader
#include <InterfaceGraphic_telem.hxx>
#include <Graphic3d_BndBox4f.hxx>
#include <Graphic3d_BSDF.hxx>
#include <Standard_Transient.hxx>
/* COULEUR */
typedef struct {
Standard_ShortReal r;
Standard_ShortReal g;
Standard_ShortReal b;
} CALL_DEF_COLOR;
/* POINT */
typedef struct {
Standard_ShortReal x;
Standard_ShortReal y;
Standard_ShortReal z;
} CALL_DEF_POINT;
/* MATERIAL */
typedef struct {
Standard_ShortReal Ambient;
Standard_Integer IsAmbient;
Standard_ShortReal Diffuse;
Standard_Integer IsDiffuse;
Standard_ShortReal Specular;
Standard_Integer IsSpecular;
Standard_ShortReal Emission;
Standard_Integer IsEmission;
Graphic3d_BSDF BSDF;
Standard_ShortReal Shininess;
Standard_ShortReal Transparency;
Standard_ShortReal RefractionIndex;
Standard_ShortReal EnvReflexion;
Standard_Integer IsPhysic;
/* Color attributes */
CALL_DEF_COLOR ColorAmb;
CALL_DEF_COLOR ColorDif;
CALL_DEF_COLOR ColorSpec;
CALL_DEF_COLOR ColorEms;
CALL_DEF_COLOR Color;
} CALL_DEF_MATERIAL;
/* Transform persistence struct */
typedef struct
{
Standard_Integer IsSet;
Standard_Integer IsDef;
Standard_Integer Flag;
CALL_DEF_POINT Point;
} CALL_DEF_TRANSFORM_PERSISTENCE;
#endif /* InterfaceGraphic_Graphic3dHeader */

View File

@@ -1,88 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef INTERFACEGRAPHIC_TELEM_H
#define INTERFACEGRAPHIC_TELEM_H
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <InterfaceGraphic_tgl_all.hxx>
#include <stdlib.h>
struct TEL_TEXTURE_COORD
{
float xy[2];
DEFINE_STANDARD_ALLOC
};
typedef TEL_TEXTURE_COORD* tel_texture_coord;
class TEL_POINT
{
public:
float xyz[3];
DEFINE_STANDARD_ALLOC
};
typedef TEL_POINT* tel_point;
struct TEL_COLOUR
{
/* OCC8854: san -- number of color components increased to include alpha value */
float rgb[4];
DEFINE_STANDARD_ALLOC
};
typedef TEL_COLOUR* tel_colour;
typedef enum
{
TelCullUndefined = -1,
TelCullNone = 0,
TelCullFront,
TelCullBack
} TelCullMode;
/* Standard Hatch Styles */
#define TEL_HS_SOLID 0
#define TEL_HS_CROSS 1
#define TEL_HS_CROSS_SPARSE 2
#define TEL_HS_GRID 3
#define TEL_HS_GRID_SPARSE 4
#define TEL_HS_DIAG_45 5
#define TEL_HS_DIAG_135 6
#define TEL_HS_HORIZONTAL 7
#define TEL_HS_VERTICAL 8
#define TEL_HS_DIAG_45_SPARSE 9
#define TEL_HS_DIAG_135_SPARSE 10
#define TEL_HS_HORIZONTAL_SPARSE 11
#define TEL_HS_VERTICAL_SPARSE 12
#define TEL_HS_USER_DEF_START 15
/* Standard Lighting Models */
#define TEL_FRONT_BACK_LM 1
/* Standard Materials */
#define TEL_FRONT_MATERIAL 1
#define TEL_BACK_MATERIAL 2
struct TEL_POFFSET_PARAM
{
int mode;
float factor;
float units;
DEFINE_STANDARD_ALLOC
};
typedef TEL_POFFSET_PARAM* tel_poffset_param;
#endif /* INTERFACEGRAPHIC_TELEM_H */

View File

@@ -1,35 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef INTERFACEGRAPHIC_TGL_ALL_H
#define INTERFACEGRAPHIC_TGL_ALL_H
typedef int Tint;
typedef float Tfloat;
typedef double Tdouble;
/* Tchar is treated as a signed char in visualization code,
therefore it should be made signed explicitly, as on Linux
-funsigned-char option is specified when building OCCT */
typedef signed char Tchar;
typedef char Tbool;
typedef unsigned int Tuint;
/* szv: Techar is an Extended character */
typedef unsigned short Techar;
#define TOn 1
#define TOff 0
typedef Tfloat Tmatrix3[4][4];
#endif /* INTERFACEGRAPHIC_TGL_ALL_H */