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

0025546: Visualization - remove unused methods and classes from package Aspect

Remove global methods Aspect::ToCString(), Aspect::ValuesOfFOSP(), Aspect::Inverse().
Remove class Aspect_Edge, Aspect_Array1OfEdge and Aspect_EdgeDefinitionError.
Remove enumerations Aspect_TypeOfFont, Aspect_TypeOfText, Aspect_CardinalPoints,
Aspect_TypeOfRenderingMode, Aspect_TypeOfColorSpace, Aspect_FormatOfSheetPaper.

update MFC samples
This commit is contained in:
kgv
2014-12-11 16:29:53 +03:00
committed by bugmaster
parent db005e48df
commit f4fa7f0c16
24 changed files with 3 additions and 686 deletions

View File

@@ -13,32 +13,6 @@
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-- Package: Aspect
-- Updated: Vendredi 2 Octobre 1992
-- Mercredi 31 mars 1993
-- Lundi 16 janvier 1995
-- Reason : Traitement des Markers (G400)
-- Purpose: Specifications definitives
-- Modified: 15/01/98 ; FMN : Ajout Hidden Line
-- Modified: 24/08/98 ; CAL : S3892. Ajout grilles 3d.
-- Modified: 16-09-98 by BGN (S3989)
--- Adding TypeOfTriedronEcho, TypeOfTriedronPosition.
-- Modified: 30-11-98 ; FMN : S4069. Textes always visible.
-- Modified: 17-NOV-99 : GG GER61351
-- Add TypeOfFacingModel enum
-- Modified: 20-JAN-00 : GG
-- Add GDM_None in enum GridDrawMode.
-- Modified: 25-JAN-00 : VKH
-- Add class PixMap
-- Modified: 23-FEB-00 : GG
-- Returns format name in ValuesOfFOSP() internal method.
-- Modified: 27-03-02 RIC120302 GG Add imported class
-- Display, Drawable, RenderingContext, GraphicCallbackProc
-- Modified: 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
-- Modified: 21-06-04 STV Added Aspect_ColorScale class
------------------------------------------------------------------------
package Aspect
---Version:
@@ -106,9 +80,6 @@ is
exception BadAccess inherits DomainError;
---Category: Exceptions
exception EdgeDefinitionError inherits OutOfRange;
---Category: Exceptions
exception IdentDefinitionError inherits OutOfRange;
---Category: Exceptions
@@ -150,9 +121,6 @@ is
class GradientBackground;
---Category: Classes
class Edge;
---Category: Classes
class GenId;
---Category: Classes
@@ -292,29 +260,6 @@ is
-- WOL_USERDEFINED defined by Users
---Category: Enumerations
enumeration TypeOfFont is TOF_DEFAULT,
TOF_COURIER,
TOF_HELVETICA,
TOF_TIMES,
TOF_USERDEFINED
end TypeOfFont;
---Purpose: Definition of line types
--
-- TOF_DEFAULT Default system font
-- TOF_COURIER
-- TOF_HELVETICA
-- TOF_USERDEFINED defined by Users
---Category: Enumerations
enumeration TypeOfText is TOT_SOLID,
TOT_OUTLINE
end TypeOfText;
---Purpose: Definition of Text types
--
-- TOF_SOLID Default text
-- TOF_OUTLINE
---Category: Enumerations
enumeration TypeOfStyleText is TOST_NORMAL,
TOST_ANNOTATION
end TypeOfStyleText;
@@ -407,54 +352,6 @@ is
---Purpose: Defines the type of Resize Window method applied
-- by the user.
enumeration CardinalPoints is CP_North,
CP_NorthEast,
CP_East,
CP_SouthEast,
CP_South,
CP_SouthWest,
CP_West,
CP_NorthWest,
CP_Center
end CardinalPoints;
enumeration TypeOfRenderingMode is TORM_IMMEDIAT,
TORM_RETAIN,
TORM_CLEAR_AND_RETAIN
end TypeOfRenderingMode;
---Purpose: Definition of the rendering modes
enumeration TypeOfColorSpace is TOCS_BlackAndWhite,
TOCS_GreyScale,
TOCS_RGB
end TypeOfColorSpace;
---Purpose:
enumeration FormatOfSheetPaper is
FOSP_A0, -- 0.841 x 1.189 (M)
FOSP_A1, -- 0.594 x 0.841 (M)
FOSP_A2, -- 0.420 x 0.594 (M)
FOSP_A3, -- 0.297 x 0.420 (M)
FOSP_A4, -- 0.210 x 0.297 (M)
FOSP_A5, -- 0.1485 x 0.210 (M)
FOSP_K_LONG, -- 1.016 x 3.6322 (M)
FOSP_K_SHORT, -- 1.016 x 1.397 (M)
FOSP_J_LONG, -- 0.8636 x 4.4704 (M)
FOSP_J_SHORT, -- 0.8636 x 1.397 (M)
FOSP_H_LONG, -- 0.7112 x 3.6322 (M)
FOSP_H_SHORT, -- 0.7112 x 1.1176 (M)
FOSP_G_LONG, -- 0.2794 x 2.286 (M)
FOSP_G_SHORT, -- 0.2794 x 0.5715 (M)
FOSP_F, -- 0.7112 x 1.016 (M)
FOSP_E, -- 0.8636 x 1.1176 (M)
FOSP_D, -- 0.5588 x 0.8636 (M)
FOSP_C, -- 0.4318 x 0.5588 (M)
FOSP_B, -- 0.2794 x 0.4318 (M)
FOSP_A, -- 0.2159 x 0.2794 (M)
FOSP_UNKNOWN -- User defined
end FormatOfSheetPaper;
---Purpose:
enumeration TypeOfPrimitive is
TOP_UNKNOWN,
TOP_POLYLINE,
@@ -629,37 +526,7 @@ is
-- Category: Instantiated classes
---------------------------------
class Array1OfEdge instantiates
Array1 from TCollection (Edge from Aspect);
---Category: Instantiated classes
class SequenceOfColor instantiates
Sequence from TCollection(Color from Quantity);
----------------------------
-- Category: Package methods
----------------------------
ValuesOfFOSP (aFOSP : FormatOfSheetPaper from Aspect;
aWidth, aHeight : out Length from Quantity)
returns CString from Standard;
---Level: Internal
---Purpose: Returns the format size according to the default
-- LENGTH unit of the required format <aFOSP>.
-- Returns more the normalized format name.
---Category: Package methods
ToCString (aString: ExtendedString from TCollection)
returns CString from Standard;
---Level: Internal
---Purpose: Translates an ExtendedString to a CString
-- depending of the local format.
---Category: Package methods
Inverse ( aMat : Array2OfReal from TColStd;
Inv : out Array2OfReal from TColStd )
returns Boolean from Standard;
---Level: Internal
---Purpose: Inverses <aMat> a 4x4 matrix.
end Aspect;

View File

@@ -1,288 +0,0 @@
// Created by: CAL
// Copyright (c) 1996-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.
#define XTRACE
#define UNICOD //GG_041196
// Conformite UNICODE
// Modified 22/12/97 : FMN ; Remplacement getenv par OSD_Environment
// 27/12/98 : FMN ; PERF: OPTIMISATION LOADER (LOPTIM)
// JR 02.01.100 : Implicit conversions
//-Design Implementation des methodes de package
#include <Aspect.hxx>
#include <Aspect_Units.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#ifdef UNICOD
#include <Resource_Unicode.hxx>
#include <stdlib.h>
#endif
#include <TColStd_Array2OfReal.hxx>
#include <OSD_Environment.hxx>
# include <stdio.h>
// Valeurs en cms !
static Quantity_Length Widths[20] = {
84.1, 59.4, 42.0, 29.7, 21.0,
14.85, 101.6, 101.6, 86.36, 86.36,
71.12, 71.12, 27.94, 27.94, 71.12,
86.36, 55.88, 43.18, 27.94, 21.59
};
static Quantity_Length Heights[20] = {
118.9, 84.1, 59.4, 42.0, 29.7,
21.0, 363.22, 139.7, 447.04, 139.7,
363.22, 111.76, 228.6, 57.15, 101.6,
111.76, 86.36, 55.88, 43.18, 27.94
};
static Standard_CString Fnames[] = {
"A0","A1","A2","A3","A4","A5","KL","KS","JL","JS","HL","HS","GL","GS","F","E","D","C","B","A"
};
#define LOPTIM
#ifndef LOPTIM
static TCollection_AsciiString astring;
static TCollection_ExtendedString estring;
#else
static TCollection_AsciiString& _astring() {
static TCollection_AsciiString astring;
return astring;
}
#define astring _astring()
static TCollection_ExtendedString& _estring() {
static TCollection_ExtendedString estring;
return estring;
}
#define estring _estring()
#endif // LOPTIM
// Returns size in meters
Standard_CString Aspect::ValuesOfFOSP (
const Aspect_FormatOfSheetPaper aFOSP,
Quantity_Length& Width,
Quantity_Length& Height) {
Standard_Integer Index = Standard_Integer (aFOSP);
Width = Quantity_Length (Widths[Index]) CENTIMETER;
Height = Quantity_Length (Heights[Index]) CENTIMETER;
return Fnames[Index];
}
//=========================================================================
Standard_CString Aspect::ToCString(const TCollection_ExtendedString &aString) {
Standard_PCharacter pstring;
#ifdef UNICOD
Standard_Integer max_string = 2*aString.Length() + 2;
astring = TCollection_AsciiString(max_string,' ');
pstring = (Standard_PCharacter)astring.ToCString();
estring = aString;
Resource_FormatType aType = Resource_Unicode::GetFormat();
if( (aType == Resource_EUC) || (aType == Resource_SJIS) ) {
Standard_Integer i;
Standard_ExtCharacter c;
for( i=1 ; i<=aString.Length() ; i++ ) {
c = estring.Value(i);
if( (c >= 0) && (c <= Standard_ExtCharacter(0x0020)) ) {
c = Standard_ExtCharacter(0x3000);
estring.SetValue(i,c);
} else if( (c > Standard_ExtCharacter(0x0020)) &&
(c <= Standard_ExtCharacter(0x007F)) ) {
c += Standard_ExtCharacter((unsigned short)0xFEE0);
estring.SetValue(i,c);
}
}
}
// char *jf = getenv("CSF_JIS_Font");
// if (((aType == Resource_EUC) || (aType == Resource_SJIS)) && (jf!=((char *)0))) {
OSD_Environment aVariable("CSF_JIS_Font");
TCollection_AsciiString jf(aVariable.Value());
if (((aType == Resource_EUC) || (aType == Resource_SJIS)) && (jf.Length() != 0)) {
Standard_PCharacter p;
Resource_Unicode::ConvertUnicodeToEUC(estring,
pstring,
max_string);
p=(Standard_PCharacter)pstring;
while ((*p)!='\0') {
*p &= 0x7F ;
p++;
}
}
else if( !Resource_Unicode::ConvertUnicodeToFormat(estring,
pstring,
max_string) )
printf(" Aspect::ToCString.BAD string length %d\n",max_string);
#else
if( aString.IsAscii() ) {
astring = aString; pstring = astring.ToCString();
} else {
pstring = (Standard_CString) aString.ToExtString();
}
#endif
return pstring;
}
Standard_Boolean Aspect::Inverse (const TColStd_Array2OfReal& aMat, TColStd_Array2OfReal& Result) {
Standard_Integer lr, ur, lc, uc;
Standard_Integer i, j, k, l;
Standard_Boolean BResult = Standard_False;
lr = aMat.LowerRow ();
ur = aMat.UpperRow ();
lc = aMat.LowerCol ();
uc = aMat.UpperCol ();
if ( (ur - lr + 1 != 4) || (uc - lc + 1 != 4) ) {
#ifdef TRACE
cout << "Inverse () : aMat not a 4x4 matrix" << endl << flush;
cout << "Inverse returns False => Error\n" << flush;
#endif
return BResult;
}
lr = Result.LowerRow ();
ur = Result.UpperRow ();
lc = Result.LowerCol ();
uc = Result.UpperCol ();
if ( (ur - lr + 1 != 4) || (uc - lc + 1 != 4) ) {
#ifdef TRACE
cout << "Inverse () : Result not a 4x4 matrix" << endl << flush;
cout << "Inverse returns False => Error\n" << flush;
#endif
return BResult;
}
Standard_Integer ip1;
float a [5][9];
float amax, p;
int tperm [5][3];
int perm = 0;
for (i=1; i<=4; i++)
for (j=1; j<=4; j++) {
// a [i][j] = aMat (lr + i - 1, lc + j - 1);
a [i][j] = (float ) aMat (lr + i - 1, lc + j - 1);
if (i == j) Result (lr + i - 1, lc + j - 1) = 1.;
else Result (lr + i - 1, lc + j - 1) = 0.;
}
for (i=1; i<=4; i++)
for (j=5; j<=8; j++)
if (i == j-4) a [i][j] = 1.;
else a [i][j] = 0.;
#ifdef TRACE
cout << "Matrice :\n";
for (i=1; i<=4; i++) {
for (j=1; j<=4; j++)
cout << a [i][j] << " ";
cout << endl;
}
cout << flush;
#endif
for (i=1; i<=4; i++) {
ip1 = i + 1;
if (ip1 <= 4) {
/* Recherche pivot maximal */
l = i;
// amax = fabs (a [i][i]);
amax = (float ) fabs (a [i][i]);
for (k=ip1; k<=4; k++) {
if (amax < fabs (a [k][i])) {
l = k;
// amax = fabs (a [k][i]);
amax = (float ) fabs (a [k][i]);
} /* if (amax < abs (a [k][i])) */
}
/* Permutation eventuelle */
if (l != i) {
#ifdef TRACE
cout << "permutation des lignes "
<< l << " et " << i << "\n" << flush;
#endif
perm ++;
tperm [perm][1] = l;
tperm [perm][2] = i;
for (j=1; j<=4; j++) {
p = a [i][j];
a [i][j] = a [l][j];
a [l][j] = p;
}
} /* if (l != i) */
} /* if (ip1 <= 4) */
p = a [i][i];
if (p == 0.) {
#ifdef TRACE
cout << "p == 0.\n" << flush;
cout << "Inverse returns False => Error\n" << flush;
#endif
return BResult;
}
/* Substitution */
for (j=1; j<=4; j++)
a [i][j] = a [i][j]/p;
for (k=1; k<=4; k++)
if (k != i)
for (j=1; j<=4; j++)
if (j != i) a [k][j] = a [k][j] - a [k][i]*a [i][j];
for (k=1; k<=4; k++)
a [k][i] = - a [k][i]/p;
a [i][i] = - a [i][i];
} /* for (i=1; i<=4; i++) */
/* Remise en ordre */
for (k=perm; k>0; k--) {
#ifdef TRACE
cout << "permutation des colonnes "
<< tperm[k][1] << " et " << tperm[k][2] << "\n" << flush;
#endif
for (i=1; i<=4; i++) {
p = a [i][tperm[k][1]];
a [i][tperm[k][1]] = a [i][tperm[k][2]];
a [i][tperm[k][2]] = p;
}
}
for (i=1; i<=4; i++)
for (j=1; j<=4; j++)
Result (lr + i - 1, lc + j - 1) = a [i][j];
#ifdef TRACE
cout << "Inverse :\n";
for (i=lr; i<=ur; i++) {
for (j=lc; j<=uc; j++)
cout << Result (i, j) << " ";
cout << endl;
}
cout << "Inverse returns True => Ok\n" << flush;
#endif
return Standard_True;
}

View File

@@ -1,116 +0,0 @@
-- Created on: 1991-11-04
-- Created by: NW,JPB,CAL
-- 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.
class Edge from Aspect
---Version:
---Purpose: This class allows the definition of an edge.
---Keywords: Edge, Visible, Invisible, Border, Line, Face
---Warning:
---References:
uses
TypeOfEdge from Aspect
raises
EdgeDefinitionError from Aspect
is
Create
returns Edge from Aspect;
---Level: Public
---Purpose: Creates an edge.
Create ( AIndex1, AIndex2 : Integer from Standard;
AType : TypeOfEdge from Aspect )
returns Edge from Aspect
---Level: Public
---Purpose: Creates an edge from an index of vertices
-- in a table of vertices.
-- <AType> indicates if this edge is seen or not.
-- Warning: Raises EdgeDefinitionError if AIndex1 == AIndex2.
raises EdgeDefinitionError from Aspect;
---------------------------------------------------
-- Category: Methods to modify the class definition
---------------------------------------------------
SetValues ( me : in out;
AIndex1, AIndex2 : Integer from Standard;
AType : TypeOfEdge from Aspect )
---Level: Public
---Purpose: Updates the values of an edge <me>.
-- Warning: Raises EdgeDefinitionError if AIndex1 == AIndex2.
raises EdgeDefinitionError from Aspect;
----------------------------
-- Category: Inquire methods
----------------------------
Values ( me;
AIndex1, AIndex2 : out Integer from Standard;
AType : out TypeOfEdge from Aspect );
---Level: Public
---Purpose: Returns the index of the vertices and the
-- type of edge <me>.
---Category: Inquire methods
FirstIndex ( me )
returns Integer from Standard;
---Level: Public
---Purpose: Returns the index of the begin of the edge <me>.
---Category: Inquire methods
LastIndex ( me )
returns Integer from Standard;
---Level: Public
---Purpose: Returns the index of the end of the edge <me>.
---Category: Inquire methods
Type ( me)
returns TypeOfEdge from Aspect;
---Level: Public
---Purpose: Returns the type of the edge <me>.
---Category: Inquire methods
--
fields
--
-- Class : Aspect_Edge
--
-- Purpose : Declaration of variables specific to edges
--
-- Reminder : An edge is defined by :
-- - two vertices referenced by indices
-- - its visibility
--
-- indices of the vertices
MyBegin : Integer from Standard;
MyEnd : Integer from Standard;
-- the visibility
MyVisibility : TypeOfEdge from Aspect;
end Edge;

View File

@@ -1,104 +0,0 @@
// Created by: NW,JPB,CAL
// 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.
//-Version
//-Design Declaration des variables specifiques aux aretes
//-Warning Une arete est definie par :
// - les 2 sommets references par des indices
// - la visibilite
//-References
//-Language C++ 2.0
//-Declarations
// for the class
#include <Aspect_Edge.ixx>
//-Aliases
//-Global data definitions
// -- les indices des sommets extremite
// MyBegin : Standard_Integer;
// MyEnd : Standard_Integer;
// -- la visibilite
// MyVisibility : TypeOfEdge;
//-Constructors
//-Destructors
//-Methods, in order
Aspect_Edge::Aspect_Edge () {
MyBegin = 0;
MyEnd = 0;
MyVisibility = Aspect_TOE_INVISIBLE;
}
Aspect_Edge::Aspect_Edge (const Standard_Integer AIndex1, const Standard_Integer AIndex2, const Aspect_TypeOfEdge AType) {
if (AIndex1 == AIndex2)
Aspect_EdgeDefinitionError::Raise ("Bad index for the edge");
MyBegin = AIndex1;
MyEnd = AIndex2;
MyVisibility = AType;
}
void Aspect_Edge::SetValues (const Standard_Integer AIndex1, const Standard_Integer AIndex2, const Aspect_TypeOfEdge AType) {
if (AIndex1 == AIndex2)
Aspect_EdgeDefinitionError::Raise ("Bad index for the edge");
MyBegin = AIndex1;
MyEnd = AIndex2;
MyVisibility = AType;
}
void Aspect_Edge::Values (Standard_Integer& AIndex1, Standard_Integer& AIndex2, Aspect_TypeOfEdge& AType) const {
AIndex1 = MyBegin;
AIndex2 = MyEnd;
AType = MyVisibility;
}
Standard_Integer Aspect_Edge::FirstIndex () const {
return (MyBegin);
}
Standard_Integer Aspect_Edge::LastIndex () const {
return (MyEnd);
}
Aspect_TypeOfEdge Aspect_Edge::Type () const {
return (MyVisibility);
}

View File

@@ -42,7 +42,6 @@ uses
PixMap from Image,
Array1OfEdge from Aspect,
CLayer2d from Aspect,
TypeOfTriedronEcho from Aspect,
TypeOfTriedronPosition from Aspect,

View File

@@ -59,10 +59,7 @@ deferred class Group from Graphic3d inherits TShared
ExtendedString from TCollection,
PlaneAngle from Quantity,
Array1OfEdge from Aspect,
Edge from Aspect,
GroupAspect from Graphic3d,
AspectLine3d from Graphic3d,
AspectMarker3d from Graphic3d,

View File

@@ -64,7 +64,6 @@ class TColStd_HArray1OfByte;
class Graphic3d_Vector;
class Quantity_Color;
class Graphic3d_Vertex;
class Aspect_Array1OfEdge;
class TCollection_ExtendedString;
class Image_PixMap;
class TColStd_HArray1OfReal;

View File

@@ -17,8 +17,6 @@
#include <gp_Dir2d.hxx>
#include <Aspect.hxx>
#include <V3d_RectangularGrid.hxx>
#include <V3d_CircularGrid.hxx>

View File

@@ -59,7 +59,6 @@
#include <Standard_ErrorHandler.hxx>
#include <Aspect.hxx>
#include <Aspect_IdentDefinitionError.hxx>
#include <Graphic3d_GraphicDriver.hxx>