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

0024776: Visualization - inherit OpenGl_View from Graphic3d_CView

Expose interface of OpenGl_View (OpenGL graphics rendering methods) to client code
and collecting all high-level API methods of application views in V3d_View class.

1) Exposing interface of OpenGl_View:

The OpenGl_View inherits from new class Graphic3d_CView.
Graphic3d_CView is an interface class that declares abstract methods for managing displayed structures,
display properties and a base layer code that implements computation
and management of HLR (or more broadly speaking view-depended) structures.

In new implementation it takes place of eliminated Visual3d_View.
As before the instance of Graphic3d_CView is still completely managed by V3d_View classes.
It can be accessed through V3d_View interface but normally this should not be required as all its methods are completely wrapped.

In more details, a concrete specialization of Graphic3d_CView is created and returned by graphical driver on request.
Right after creation the views is directly used for setting rendering properties and adding graphical structures to be displayed.

The rendering of graphics is possible after mapping a window and activating the view.
The direct setting of properties makes obsolete usage of intermediate structures with display parameter
like Visual3d_ContextView and etc (the whole package of Visual3d become redundant).

2) Collecting all high-level API methods of application views in V3d package:

The patch includes elimination of Visual3d layer.
All of its methods that could be previously used by application are now exposed and should be accessed on the level of V3d entities.
- Introduced new class Graphic3d_CView.
  This is a base class for render views.
  Made possible to specialize concrete instances of the class by graphical driver.
- Moved all methods managing rendering views into interface of Graphic3d_CView.
  The corresponding methods were removed from interface of graphical driver.

3) Eliminated Visual3d package:

- Logic of managing display of structures was put from Visual3d_ViewManager into Graphic3d_StructureManager.
- Removed Visual3d_View class. Logic of managing computed structures was put into base layer of Graphi3d_CView.
- Removed all intermediate structures for storing view parameters e.g. Visual3d_ContextView.
  All settings are kept by instances of Graphic3d_CView
- Removed Visual3d_Light intermediate class.
  All light properties are still stored in Graphic3d_CLight structure.
  The structure is directly access by instance of V3d_Light classes.
- Moved all needed enumerations into Graphic3d package.

4) Update package D3DHost to new changes.

5) Update code of OCCT samples to new changes.
This commit is contained in:
apl
2015-09-22 11:49:33 +03:00
committed by kgv
parent 97d87ffa94
commit c357e42610
159 changed files with 9998 additions and 14088 deletions

View File

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

View File

@@ -1,58 +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_AspectHeader
#define InterfaceGraphic_AspectHeader
#include <Aspect_Drawable.hxx>
#include <Aspect_RenderingContext.hxx>
/* WINDOW */
typedef struct {
int IsDefined;
Aspect_Drawable XWindow;
Aspect_Drawable XParentWindow;
int dx, dy;
int left, top;
struct {
float r, g, b;
} Background;
} CALL_DEF_WINDOW;
typedef struct {
int listIndex;
void* layerData;
} CALL_DEF_PTRLAYER, *call_def_ptrLayer;
/* LAYER */
typedef struct {
CALL_DEF_PTRLAYER* ptrLayer;
int layerType;
int attach;
int sizeDependent;
float ortho[4];
float viewport[2];
} CALL_DEF_LAYER;
#endif /* InterfaceGraphic_AspectHeader */

View File

@@ -1,74 +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_Visual3dHeader
#define InterfaceGraphic_Visual3dHeader
#include <InterfaceGraphic_Aspect.hxx>
#include <InterfaceGraphic_Graphic3d.hxx>
#include <Aspect_RenderingContext.hxx>
#include <Aspect_GraphicCallbackProc.hxx>
#include <Standard_Transient.hxx>
typedef float CALL_DEF_MATRIX4X4[4][4];
/* SOMMET */
typedef struct {
float x, y, z;
} CALL_DEF_VERTEX;
/* ORIENTATION */
typedef struct {
CALL_DEF_VERTEX ViewReferencePoint;
CALL_DEF_VERTEX ViewReferencePlane;
CALL_DEF_VERTEX ViewReferenceUp;
float ViewScaleX;
float ViewScaleY;
float ViewScaleZ;
float ModelViewMatrix[4][4];
unsigned IsCustomMatrix;
} CALL_DEF_VIEWORIENTATION;
/* MAPPING */
typedef struct {
int Projection;
CALL_DEF_VERTEX ProjectionReferencePoint;
float ViewPlaneDistance;
float BackPlaneDistance;
float FrontPlaneDistance;
struct {
float um, vm, uM, vM;
} WindowLimit;
float ProjectionMatrix[4][4];
unsigned IsCustomMatrix;
} CALL_DEF_VIEWMAPPING;
#endif /* InterfaceGraphic_Visual3dHeader */