mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0027266: Coding, TKOpenGl - drop unused files OpenGl_telem_util.hxx and OpenGl_tgl_funcs.hxx
This commit is contained in:
parent
45d8465ea2
commit
185a35a7ae
@ -58,11 +58,8 @@ OpenGl_Texture.cxx
|
|||||||
OpenGl_Texture.hxx
|
OpenGl_Texture.hxx
|
||||||
OpenGl_Resource.hxx
|
OpenGl_Resource.hxx
|
||||||
OpenGl_Resource.cxx
|
OpenGl_Resource.cxx
|
||||||
OpenGl_telem_util.hxx
|
|
||||||
OpenGl_telem_util.cxx
|
|
||||||
OpenGl_Font.hxx
|
OpenGl_Font.hxx
|
||||||
OpenGl_Font.cxx
|
OpenGl_Font.cxx
|
||||||
OpenGl_tgl_funcs.hxx
|
|
||||||
OpenGl_BackgroundArray.cxx
|
OpenGl_BackgroundArray.cxx
|
||||||
OpenGl_BackgroundArray.hxx
|
OpenGl_BackgroundArray.hxx
|
||||||
OpenGl_BVHClipPrimitiveSet.cxx
|
OpenGl_BVHClipPrimitiveSet.cxx
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <OpenGl_ShaderManager.hxx>
|
#include <OpenGl_ShaderManager.hxx>
|
||||||
#include <OpenGl_ShaderProgram.hxx>
|
#include <OpenGl_ShaderProgram.hxx>
|
||||||
#include <OpenGl_StructureShadow.hxx>
|
#include <OpenGl_StructureShadow.hxx>
|
||||||
#include <OpenGl_telem_util.hxx>
|
|
||||||
#include <OpenGl_Vec.hxx>
|
#include <OpenGl_Vec.hxx>
|
||||||
#include <OpenGl_View.hxx>
|
#include <OpenGl_View.hxx>
|
||||||
#include <OpenGl_Workspace.hxx>
|
#include <OpenGl_Workspace.hxx>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <OpenGl_FrameBuffer.hxx>
|
#include <OpenGl_FrameBuffer.hxx>
|
||||||
#include <TColStd_Array2OfReal.hxx>
|
#include <TColStd_Array2OfReal.hxx>
|
||||||
#include <OpenGl_telem_util.hxx>
|
|
||||||
#include <Graphic3d_GraphicDriver.hxx>
|
#include <Graphic3d_GraphicDriver.hxx>
|
||||||
|
|
||||||
#include <OpenGl_PrinterContext.hxx>
|
#include <OpenGl_PrinterContext.hxx>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <OpenGl_GlCore11.hxx>
|
#include <OpenGl_GlCore11.hxx>
|
||||||
#include <OpenGl_tgl_funcs.hxx>
|
|
||||||
|
|
||||||
#include <Graphic3d_GraphicDriver.hxx>
|
#include <Graphic3d_GraphicDriver.hxx>
|
||||||
#include <Graphic3d_TextureParams.hxx>
|
#include <Graphic3d_TextureParams.hxx>
|
||||||
|
@ -1,151 +0,0 @@
|
|||||||
// Copyright (c) 1995-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.
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
|
|
||||||
FONCTION :
|
|
||||||
----------
|
|
||||||
File OpenGl_telem_util :
|
|
||||||
|
|
||||||
|
|
||||||
REMARQUES:
|
|
||||||
----------
|
|
||||||
|
|
||||||
|
|
||||||
HISTORIQUE DES MODIFICATIONS :
|
|
||||||
--------------------------------
|
|
||||||
xx-xx-xx : xxx ; Creation.
|
|
||||||
07-02-96 : FMN ; - Ajout trace
|
|
||||||
- Suppression code inutile
|
|
||||||
08-03-96 : FMN ; - Ajout include manquant
|
|
||||||
01-04-96 : CAL ; Integration MINSK portage WNT
|
|
||||||
15-04-96 : CAL ; Integration travail PIXMAP de Jim ROTH
|
|
||||||
22-04-96 : FMN ; Ajout TelReadImage TelDrawImage
|
|
||||||
10-05-96 : CAL ; Ajout d'un nouveau delta dans les copies
|
|
||||||
de pixels (voir CALL_DEF_DELTA)
|
|
||||||
25-06-96 : FMN ; Suppression utilisation de glScissor.
|
|
||||||
02-07-96 : FMN ; Suppression WSWSHeight et WSWSWidth
|
|
||||||
Suppression glViewport inutile.
|
|
||||||
18-07-96 : FMN ; Suppression TelFlush inutile.
|
|
||||||
08-07-96 : FMN ; Suppression de OPENGL_DEBUG inutile avec la nouvelle
|
|
||||||
version de ogldebug.
|
|
||||||
24-10-96 : CAL ; Portage WNT
|
|
||||||
23-01-97 : CAL ; Suppression de TelClearViews dans TelCopyBuffers
|
|
||||||
30-01-97 : FMN ; Ajout commentaires + WNT.
|
|
||||||
12-02-97 : FMN ; Suppression TelEnquireFacilities()
|
|
||||||
22-04-97 : FMN ; Ajout affichage du cadre pour la copie de buffer
|
|
||||||
30-06-97 : FMN ; Suppression OpenGl_telem_light.h
|
|
||||||
18-07-97 : FMN ; Utilisation de la toolkit sur les lights
|
|
||||||
07-10-97 : FMN ; Simplification WNT + correction Transient
|
|
||||||
05-12-97 : FMN ; PRO11168: Suppression TglActiveWs pour project/unproject
|
|
||||||
23-12-97 : FMN ; Suppression TelSetFrontFaceAttri et TelSetBackFaceAttri
|
|
||||||
30-12-97 : FMN ; CTS18312: Correction back material
|
|
||||||
04-05-98 : CAL ; Contournement bug SGI octane bavure de pixels (PRO12899)
|
|
||||||
30-09-98 : CAL ; Optimisation pour eviter de charger inutilement
|
|
||||||
les matrices de la vue.
|
|
||||||
19-10-98 : FMN ; Suppression de glPixelTransferi dans TelEnable() car cela
|
|
||||||
rentre en conflit avec l'utilisation d'une image de fond.
|
|
||||||
02.14.100 : JR : Warnings on WNT truncations from double to float
|
|
||||||
08-03-01 : GG ; BUC60823 Avoid crash in the normal computation method
|
|
||||||
when a face has confused or aligned points.
|
|
||||||
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <OpenGl_GlCore11.hxx>
|
|
||||||
|
|
||||||
#include <OpenGl_telem_util.hxx>
|
|
||||||
#include <InterfaceGraphic_Graphic3d.hxx>
|
|
||||||
|
|
||||||
#define GPRECIS 0.000001
|
|
||||||
Tint TelGetPolygonNormal(tel_point pnts, Tint* indexs, Tint npnt, Tfloat *norm ) {
|
|
||||||
Tint status=0;
|
|
||||||
|
|
||||||
norm[0] = norm[1] = norm[2] = 0.;
|
|
||||||
if( npnt > 2 ) {
|
|
||||||
Tfloat a[3], b[3], c[3];
|
|
||||||
Tint i,j,i0,ii=0,jj;
|
|
||||||
|
|
||||||
i0 = 0; if( indexs ) i0 = indexs[0];
|
|
||||||
for( i=1 ; i<npnt ; i++ ) {
|
|
||||||
ii = i; if( indexs ) ii = indexs[i];
|
|
||||||
vecsub( a, pnts[ii].xyz, pnts[i0].xyz );
|
|
||||||
if( vecmg2(a) > GPRECIS ) break;
|
|
||||||
}
|
|
||||||
if( i < npnt-1 ) {
|
|
||||||
for( j=i+1 ; j<npnt ; j++ ) {
|
|
||||||
jj = j; if( indexs ) jj = indexs[j];
|
|
||||||
vecsub( b, pnts[jj].xyz, pnts[i0].xyz );
|
|
||||||
vecsub( c, pnts[jj].xyz, pnts[ii].xyz );
|
|
||||||
if( (vecmg2(b) > GPRECIS) && (vecmg2(c) > GPRECIS) ) break;
|
|
||||||
}
|
|
||||||
if( j < npnt ) {
|
|
||||||
Tfloat d;
|
|
||||||
veccrs( norm, a, b );
|
|
||||||
d = vecnrmd( norm, d );
|
|
||||||
status = (d > 0.) ? 1 : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef OCCT_DEBUG
|
|
||||||
if( !status )
|
|
||||||
printf(" *** OpenGl_TelGetPolygonNormal.has found confused or aligned points\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
Tint TelGetNormal(Tfloat *data1, Tfloat *data2, Tfloat *data3, Tfloat *norm ) {
|
|
||||||
Tfloat a[3], b[3];
|
|
||||||
Tint status=0;
|
|
||||||
|
|
||||||
norm[0] = norm[1] = norm[2] = 0.;
|
|
||||||
vecsub( a, data2, data1 );
|
|
||||||
vecsub( b, data3, data2 );
|
|
||||||
if( (vecmg2(a) > GPRECIS) && (vecmg2(b) > GPRECIS) ) {
|
|
||||||
Tfloat d;
|
|
||||||
veccrs( norm, a, b );
|
|
||||||
d = vecnrmd( norm, d );
|
|
||||||
status = (d > 0.) ? 1 : 0;
|
|
||||||
}
|
|
||||||
#ifdef OCCT_DEBUG
|
|
||||||
if( !status )
|
|
||||||
printf(" *** OpenGl_TelGetNormal.has found confused or aligned points\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TelMultiplymat3 (Tmatrix3 c, Tmatrix3 a, Tmatrix3 b)
|
|
||||||
{
|
|
||||||
Tint row, col, i;
|
|
||||||
Tmatrix3 res;
|
|
||||||
Tint dim = 4;
|
|
||||||
|
|
||||||
/* on multiplie d'abord les 2 matrices dim x dim */
|
|
||||||
for (row = 0; row < dim; row++) {
|
|
||||||
for (col = 0; col < dim; col++) {
|
|
||||||
Tfloat sum = ( float )0.0;
|
|
||||||
for (i = 0; i < dim; i++)
|
|
||||||
sum += a[row][i] * b[i][col];
|
|
||||||
res[row][col] = sum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* on copie ensuite le resultat */
|
|
||||||
matcpy (c, res);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
@ -1,132 +0,0 @@
|
|||||||
// Copyright (c) 1995-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.
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
|
|
||||||
FONCTION :
|
|
||||||
----------
|
|
||||||
File Include OpenGl_telem_util :
|
|
||||||
|
|
||||||
|
|
||||||
REMARQUES:
|
|
||||||
----------
|
|
||||||
|
|
||||||
|
|
||||||
HISTORIQUE DES MODIFICATIONS :
|
|
||||||
--------------------------------
|
|
||||||
xx-xx-xx : xxx ; Creation.
|
|
||||||
22-04-96 : FMN ; Ajout TelReadImage TelDrawImage
|
|
||||||
23-12-96 : CAL ; Probleme dans la macro vecmag
|
|
||||||
12-02-97 : FMN ; Suppression TelEnquireFacilities()
|
|
||||||
07-10-97 : FMN ; Simplification WNT
|
|
||||||
23-12-97 : FMN ; Suppression TelBackInteriorStyle, TelBackInteriorStyleIndex
|
|
||||||
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifndef OPENGL_TELEM_UTIL_H
|
|
||||||
#define OPENGL_TELEM_UTIL_H
|
|
||||||
|
|
||||||
#include <InterfaceGraphic_telem.hxx>
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ShortRealLast () = 3.40282346638528860e+38
|
|
||||||
* ShortRealFirst () = 3.40282346638528860e+38
|
|
||||||
*/
|
|
||||||
#define shortreallast() (3.e+38)
|
|
||||||
#define shortrealfirst() (-3.e+38)
|
|
||||||
|
|
||||||
/* vector manipulation macros */
|
|
||||||
#define square(a) ((a)*(a))
|
|
||||||
|
|
||||||
/* add */
|
|
||||||
#define vecadd(a,b,c) { (a)[0]=(b)[0]+(c)[0]; \
|
|
||||||
(a)[1]=(b)[1]+(c)[1]; \
|
|
||||||
(a)[2]=(b)[2]+(c)[2]; }
|
|
||||||
|
|
||||||
/* subtract */
|
|
||||||
#define vecsub(a,b,c) { (a)[0]=(b)[0]-(c)[0]; \
|
|
||||||
(a)[1]=(b)[1]-(c)[1]; \
|
|
||||||
(a)[2]=(b)[2]-(c)[2]; }
|
|
||||||
|
|
||||||
/* dot product */
|
|
||||||
#define vecdot(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])
|
|
||||||
|
|
||||||
/* cross product */
|
|
||||||
#define veccrs(a,b,c) { Tfloat x, y, z; \
|
|
||||||
x = (b)[1]*(c)[2] - (b)[2]*(c)[1]; \
|
|
||||||
y = (b)[2]*(c)[0] - (b)[0]*(c)[2]; \
|
|
||||||
z = (b)[0]*(c)[1] - (b)[1]*(c)[0]; \
|
|
||||||
(a)[0] = x; \
|
|
||||||
(a)[1] = y; \
|
|
||||||
(a)[2] = z; }
|
|
||||||
/* scale */
|
|
||||||
#define vecscl(a,b) { (b)[0] *= (a); (b)[1] *= (a); (b)[2] *= (a); }
|
|
||||||
|
|
||||||
/* magnitude square */
|
|
||||||
#define vecmg2(a) (square((a)[0])+square((a)[1])+square((a)[2]))
|
|
||||||
|
|
||||||
/* magnitude */
|
|
||||||
#define vecmag(a) (std::sqrt((double)vecmg2(a)))
|
|
||||||
|
|
||||||
/* normalize */
|
|
||||||
#define vecnrmd(a,d) ( d = (Tfloat)vecmag(a), \
|
|
||||||
( d > 1e-10 ? (a[0] /= d, a[1] /= d, a[2] /= d, d) : (Tfloat)0. ) )
|
|
||||||
#define vecnrm(a) { Tfloat d; vecnrmd(a,d); }
|
|
||||||
|
|
||||||
/* angle between two vectors */
|
|
||||||
#define vecang(a,b,d) { d = (Tfloat)(vecmag(a)*vecmag(b)); \
|
|
||||||
d = vecdot(a,b)/d; \
|
|
||||||
d = d < -1.0F ? -1.0F : d > 1.0F ? 1.0F : d; \
|
|
||||||
d = ( Tfloat )acos(d); }
|
|
||||||
|
|
||||||
/* point along a vector at a distance */
|
|
||||||
#define vecgnd(a,b,c,d) { Tfloat w; w = d/vecmag(c); \
|
|
||||||
(a)[0] = (b)[0]+(c)[0]*w; \
|
|
||||||
(a)[1] = (b)[1]+(c)[1]*w; \
|
|
||||||
(a)[2] = (b)[2]+(c)[2]*w; }
|
|
||||||
/* copy */
|
|
||||||
#define veccpy(a,b) ((a)[0]=(b)[0],(a)[1]=(b)[1],(a)[2]=(b)[2])
|
|
||||||
|
|
||||||
/* end vector macros */
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Tmatrix3 mat;
|
|
||||||
}
|
|
||||||
Tmatrix3Struct;
|
|
||||||
|
|
||||||
#define matcpy(d,s) { *((Tmatrix3Struct*)(d)) = *((Tmatrix3Struct*)(s)); }
|
|
||||||
/*
|
|
||||||
(d)[0][0]=(s)[0][0],(d)[0][1]=(s)[0][1],(d)[0][2]=(s)[0][2],(d)[0][3]=(s)[0][3],
|
|
||||||
(d)[1][0]=(s)[1][0],(d)[1][1]=(s)[1][1],(d)[1][2]=(s)[1][2],(d)[1][3]=(s)[1][3],
|
|
||||||
(d)[2][0]=(s)[2][0],(d)[2][1]=(s)[2][1],(d)[2][2]=(s)[2][2],(d)[2][3]=(s)[2][3],
|
|
||||||
(d)[3][0]=(s)[3][0],(d)[3][1]=(s)[3][1],(d)[3][2]=(s)[3][2],(d)[3][3]=(s)[3][3]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define matdump(m) { \
|
|
||||||
int i, j; \
|
|
||||||
for (i=0; i<4; i++) {\
|
|
||||||
printf ("\t"); \
|
|
||||||
for (j=0; j<4; j++) \
|
|
||||||
printf ("%f ", m[i][j]); \
|
|
||||||
printf ("\n"); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
extern int TelGetPolygonNormal( tel_point, Tint*, Tint, Tfloat* );
|
|
||||||
extern int TelGetNormal( Tfloat*, Tfloat*, Tfloat*, Tfloat* );
|
|
||||||
extern void TelMultiplymat3( Tmatrix3, Tmatrix3, Tmatrix3 );
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,77 +0,0 @@
|
|||||||
// Created by: PCT
|
|
||||||
// Copyright (c) 1995-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 OPENGL_TGL_FUNCS_H
|
|
||||||
#define OPENGL_TGL_FUNCS_H
|
|
||||||
|
|
||||||
typedef float matrix3[4][4];
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
TYPE_PARAL,
|
|
||||||
TYPE_PERSPECT
|
|
||||||
} projtype;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
IND_NO_CLIP,
|
|
||||||
IND_CLIP
|
|
||||||
} clip_ind;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
float x; /* x coordinate */
|
|
||||||
float y; /* y coordinate */
|
|
||||||
float z; /* z coordinate */
|
|
||||||
} point3;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
float delta_x; /* x magnitude */
|
|
||||||
float delta_y; /* y magnitude */
|
|
||||||
float delta_z; /* z magnitude */
|
|
||||||
} vec3;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
float x_min; /* x min */
|
|
||||||
float x_max; /* x max */
|
|
||||||
float y_min; /* y min */
|
|
||||||
float y_max; /* y max */
|
|
||||||
float z_min; /* z min */
|
|
||||||
float z_max; /* z max */
|
|
||||||
} limit3;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
float x_min; /* x min */
|
|
||||||
float x_max; /* x max */
|
|
||||||
float y_min; /* y min */
|
|
||||||
float y_max; /* y max */
|
|
||||||
} limit;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
limit win; /* window limits */
|
|
||||||
limit3 proj_vp; /* viewport limits */
|
|
||||||
projtype proj_type; /* projection type */
|
|
||||||
point3 proj_ref_point; /* projection reference point */
|
|
||||||
float view_plane; /* view plane distance */
|
|
||||||
float back_plane; /* back plane distance */
|
|
||||||
float front_plane; /* front plane distance */
|
|
||||||
} view_map3;
|
|
||||||
|
|
||||||
extern void call_func_eval_ori_matrix3 (const point3* vrp,
|
|
||||||
const vec3* vpn,
|
|
||||||
const vec3* vup,
|
|
||||||
int* err_ind,
|
|
||||||
float mout[4][4]);
|
|
||||||
|
|
||||||
extern void call_func_eval_map_matrix3(view_map3 *Map, int *err_ind, matrix3 mat);
|
|
||||||
|
|
||||||
#endif // OPENGL_TGL_FUNCS_H
|
|
Loading…
x
Reference in New Issue
Block a user