mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0025038: Visualization - remove unused classes from package Aspect
This commit is contained in:
parent
57ad5cbd5d
commit
89e5391a31
@ -78,9 +78,6 @@ is
|
||||
|
||||
---Category: Imported types
|
||||
|
||||
imported RGBPixel;
|
||||
---Purpose:
|
||||
|
||||
primitive Handle;
|
||||
primitive Drawable;
|
||||
|
||||
@ -93,15 +90,6 @@ is
|
||||
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
|
||||
imported PolygonOffsetMode;
|
||||
|
||||
---------------------
|
||||
-- Category: Pointers
|
||||
---------------------
|
||||
|
||||
pointer DriverPtr to Driver from Aspect;
|
||||
pointer WindowDriverPtr to WindowDriver from Aspect;
|
||||
|
||||
---Category: Pointers
|
||||
|
||||
-----------------------
|
||||
-- Category: Exceptions
|
||||
-----------------------
|
||||
@ -118,101 +106,27 @@ is
|
||||
exception BadAccess inherits DomainError;
|
||||
---Category: Exceptions
|
||||
|
||||
exception ColorMapDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception EdgeDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception IdentDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception TypeMapDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception WidthMapDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception FontMapDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception MarkMapDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception WindowDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception WindowError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception PixmapDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception PixmapError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception DriverDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception DriverError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception GraphicDeviceDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception DisplayConnectionDefinitionError inherits OutOfRange;
|
||||
---Category: The exceptions
|
||||
|
||||
exception LineStyleDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception LineWidthDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception PolyStyleDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception FontStyleDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception MarkerStyleDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception UndefinedMap inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
------------------------------
|
||||
-- Category: Classes Color map
|
||||
------------------------------
|
||||
|
||||
deferred class ColorMap;
|
||||
---Category: Classes Color map
|
||||
|
||||
class ColorCubeColorMap;
|
||||
---Category: Classes Color map
|
||||
|
||||
class ColorRampColorMap;
|
||||
---Category: Classes Color map
|
||||
|
||||
class GenericColorMap;
|
||||
---Category: Classes Color map
|
||||
|
||||
class ColorMapEntry;
|
||||
---Category: Classes Color map
|
||||
|
||||
------------------------------
|
||||
-- Category: Classes Pixel
|
||||
------------------------------
|
||||
|
||||
deferred class Pixel;
|
||||
---Category: Classes Pixel
|
||||
|
||||
class IndexPixel;
|
||||
---Category: Classes Pixel
|
||||
|
||||
class ColorPixel;
|
||||
---Category: Classes Pixel
|
||||
|
||||
---------------------------
|
||||
-- Category: Classes Aspect
|
||||
---------------------------
|
||||
@ -242,48 +156,9 @@ is
|
||||
class GenId;
|
||||
---Category: Classes
|
||||
|
||||
class FontStyle;
|
||||
---Category: The classes
|
||||
|
||||
class FontMapEntry;
|
||||
---Category: Classes Font map
|
||||
|
||||
class FontMap;
|
||||
---Category: The classes
|
||||
|
||||
class WidthMapEntry;
|
||||
---Category: Classes Width map
|
||||
|
||||
class WidthMap;
|
||||
---Category: The classes
|
||||
|
||||
class LineStyle;
|
||||
---Category: The classes
|
||||
|
||||
class TypeMap;
|
||||
---Category: The classes
|
||||
|
||||
class TypeMapEntry;
|
||||
---Category: Classes Type map
|
||||
|
||||
class MarkerStyle;
|
||||
---Category: The classes
|
||||
|
||||
class MarkMap;
|
||||
---Category: The classes
|
||||
|
||||
class MarkMapEntry;
|
||||
---Category: Classes Mark map
|
||||
|
||||
deferred class Window;
|
||||
---Category: Classes
|
||||
|
||||
deferred class Driver;
|
||||
---Category: Classes
|
||||
|
||||
deferred class WindowDriver;
|
||||
---Category: Classes
|
||||
|
||||
deferred class Grid;
|
||||
class RectangularGrid;
|
||||
class CircularGrid;
|
||||
@ -347,14 +222,6 @@ is
|
||||
--
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfColorMap is TOC_Generic,
|
||||
TOC_ColorCube,
|
||||
TOC_ColorRamp
|
||||
end TypeOfColorMap;
|
||||
---Purpose: Definition of the color map types
|
||||
--
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfConstraint is TOC_BOTTOM_LEFT,
|
||||
TOC_BOTTOM_RIGHT,
|
||||
TOC_TOP_LEFT,
|
||||
@ -766,26 +633,6 @@ is
|
||||
Array1 from TCollection (Edge from Aspect);
|
||||
---Category: Instantiated classes
|
||||
|
||||
class SequenceOfColorMapEntry instantiates
|
||||
Sequence from TCollection (ColorMapEntry from Aspect);
|
||||
---Category: Instantiated classes
|
||||
|
||||
class SequenceOfTypeMapEntry instantiates
|
||||
Sequence from TCollection (TypeMapEntry from Aspect);
|
||||
---Category: Instantiated classes
|
||||
|
||||
class SequenceOfWidthMapEntry instantiates
|
||||
Sequence from TCollection (WidthMapEntry from Aspect);
|
||||
---Category: Instantiated classes
|
||||
|
||||
class SequenceOfFontMapEntry instantiates
|
||||
Sequence from TCollection (FontMapEntry from Aspect);
|
||||
---Category: Instantiated classes
|
||||
|
||||
class SequenceOfMarkMapEntry instantiates
|
||||
Sequence from TCollection (MarkMapEntry from Aspect);
|
||||
---Category: Instantiated classes
|
||||
|
||||
class SequenceOfColor instantiates
|
||||
Sequence from TCollection(Color from Quantity);
|
||||
|
||||
|
@ -1,95 +0,0 @@
|
||||
-- Created on: 1993-03-23
|
||||
-- Created by: BBL
|
||||
-- Copyright (c) 1993-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 ColorCubeColorMap from Aspect inherits ColorMap from Aspect
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a ColorCube ColorMap object.
|
||||
-- Associates a index and a color in the "ColorCube" space.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
Color from Quantity,
|
||||
ColorMapEntry from Aspect
|
||||
|
||||
raises
|
||||
BadAccess from Aspect,
|
||||
RangeError from Standard
|
||||
|
||||
is
|
||||
Create( base_pixel, redmax, redmult,
|
||||
greenmax, greenmult,
|
||||
bluemax, bluemult : in Integer from Standard )
|
||||
returns ColorCubeColorMap from Aspect
|
||||
raises RangeError from Standard ;
|
||||
---Level: Public
|
||||
---Purpose : Create a ColorCube ColorMap.
|
||||
|
||||
ColorCubeDefinition( me : in ;
|
||||
base_pixel,
|
||||
redmax, redmult,
|
||||
greenmax, greenmult,
|
||||
bluemax, bluemult : out Integer from Standard );
|
||||
|
||||
FindColorMapIndex ( me ;
|
||||
AColorMapEntryIndex : Integer from Standard )
|
||||
returns Integer from Standard
|
||||
raises BadAccess from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the
|
||||
-- ColorMapEntry.Index() equal to <AnEntryIndex>.
|
||||
-- Warning: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
|
||||
FindEntry ( me ; AColorMapEntryIndex : Integer from Standard )
|
||||
returns ColorMapEntry from Aspect
|
||||
raises BadAccess from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index()
|
||||
-- equal to <AnEntryIndex>.
|
||||
-- Warning: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
---C++: return const &
|
||||
|
||||
NearestColorMapIndex( me ; aColor : Color from Quantity )
|
||||
returns Integer from Standard ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the nearest
|
||||
-- matching ColorMapEntry
|
||||
|
||||
NearestEntry( me ; aColor : Color from Quantity )
|
||||
returns ColorMapEntry from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the nearest ColorMapEntry that match aColor .
|
||||
---C++: return const &
|
||||
|
||||
AddEntry (me : mutable; aColor : Color from Quantity)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical color entry in the color map <me>
|
||||
-- or returns the nearest ColorMapEntry Index.
|
||||
|
||||
fields
|
||||
mybasepixel : Integer from Standard ;
|
||||
mygreenmax , mygreenmult : Integer from Standard ;
|
||||
myredmax , myredmult : Integer from Standard ;
|
||||
mybluemax , mybluemult : Integer from Standard ;
|
||||
-- ColorCube definition for a ColorCube ColorMap.
|
||||
|
||||
end ColorCubeColorMap ;
|
@ -1,156 +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.
|
||||
|
||||
// Modified : GG ; 14/09/01 Implements the new AddEntry method
|
||||
|
||||
#include <Aspect_ColorCubeColorMap.ixx>
|
||||
#include <Aspect_ColorMapEntry.hxx>
|
||||
|
||||
#ifdef TRACE
|
||||
static int Tlevel = 0 ;
|
||||
#endif
|
||||
|
||||
Aspect_ColorCubeColorMap::Aspect_ColorCubeColorMap(
|
||||
const Standard_Integer basepixel ,
|
||||
const Standard_Integer red_max ,
|
||||
const Standard_Integer red_mult ,
|
||||
const Standard_Integer green_max ,
|
||||
const Standard_Integer green_mult ,
|
||||
const Standard_Integer blue_max ,
|
||||
const Standard_Integer blue_mult )
|
||||
:Aspect_ColorMap( Aspect_TOC_ColorCube )
|
||||
|
||||
{ Standard_Integer r,g,b,i ;
|
||||
Aspect_ColorMapEntry value ;
|
||||
Quantity_Color rgb ;
|
||||
Standard_Integer max[3], mult[3], ti[3];
|
||||
|
||||
mybasepixel = basepixel ;
|
||||
myredmax = red_max ;
|
||||
myredmult = red_mult ;
|
||||
mygreenmax = green_max ;
|
||||
mygreenmult = green_mult ;
|
||||
mybluemax = blue_max ;
|
||||
mybluemult = blue_mult ;
|
||||
|
||||
r = 0 ; g = 1 ; b = 2 ;
|
||||
|
||||
if ( ( myredmult < mygreenmult ) && ( myredmult < mybluemult ) ) {
|
||||
r = 0 ;
|
||||
if ( mygreenmult < mybluemult ) { g = 1 ; b = 2 ; }
|
||||
else { b = 1 ; g = 2 ; }
|
||||
}
|
||||
if ( ( mygreenmult < myredmult ) && ( mygreenmult < mybluemult ) ) {
|
||||
g = 0 ;
|
||||
if ( myredmult < mybluemult ) { r = 1 ; b = 2 ; }
|
||||
else { b = 1 ; r = 2 ; }
|
||||
}
|
||||
if ( ( mybluemult < myredmult ) && ( mybluemult < mygreenmult ) ) {
|
||||
b = 0 ;
|
||||
if ( myredmult < mygreenmult ) { r = 1 ; g = 2 ; }
|
||||
else { g = 1 ; r = 2 ; }
|
||||
}
|
||||
|
||||
#ifdef TRACE
|
||||
if ( Tlevel )
|
||||
cout << "ColorCubeColorMap constructor (r,g,b) :"
|
||||
<< r << "," << g << "," << b << endl << flush ;
|
||||
#endif
|
||||
|
||||
mult[r] = myredmult ; max[r] = myredmax ;
|
||||
mult[g] = mygreenmult ; max[g] = mygreenmax ;
|
||||
mult[b] = mybluemult ; max[b] = mybluemax ;
|
||||
|
||||
for( ti[2] = 0 ; ti[2] <= max[2] ; ti[2]++ ) {
|
||||
for( ti[1] = 0 ; ti[1] <= max[1] ; ti[1]++ ) {
|
||||
for( ti[0] = 0 ; ti[0] <= max[0] ; ti[0]++ ) {
|
||||
rgb.SetValues( (Standard_Real) ti[r] / (Standard_Real) max[r],
|
||||
(Standard_Real) ti[g] / (Standard_Real) max[g],
|
||||
(Standard_Real) ti[b] / (Standard_Real) max[b],
|
||||
Quantity_TOC_RGB ) ;
|
||||
|
||||
i = ti[r] * mult[r] + ti[g] * mult[g] + ti[b] * mult[b] ;
|
||||
|
||||
value.SetValue( mybasepixel+i, rgb ) ;
|
||||
#ifdef TRACE
|
||||
if ( Tlevel )
|
||||
value.Dump() ;
|
||||
#endif
|
||||
mydata.Append( value ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const Aspect_ColorMapEntry& Aspect_ColorCubeColorMap::NearestEntry(
|
||||
const Quantity_Color& color ) const
|
||||
|
||||
{
|
||||
return( Entry( NearestColorMapIndex( color ) ) ) ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorCubeColorMap::NearestColorMapIndex(
|
||||
const Quantity_Color& color ) const
|
||||
|
||||
{ Standard_Integer r,g,b ;
|
||||
|
||||
r = (Standard_Integer ) ( color.Red() * myredmax + 0.5) ;
|
||||
g = (Standard_Integer ) ( color.Green() * mygreenmax + 0.5) ;
|
||||
b = (Standard_Integer ) ( color.Blue() * mybluemax + 0.5) ;
|
||||
|
||||
return( r*myredmult+g*mygreenmult+b*mybluemult + 1 ) ;
|
||||
}
|
||||
|
||||
const Aspect_ColorMapEntry& Aspect_ColorCubeColorMap::FindEntry(
|
||||
const Standard_Integer index ) const
|
||||
|
||||
{
|
||||
return( Entry( FindColorMapIndex( index ) ) ) ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorCubeColorMap::FindColorMapIndex(
|
||||
const Standard_Integer index ) const
|
||||
{
|
||||
|
||||
if ( index < mybasepixel ||
|
||||
index >= ( mybasepixel+Size() ) ){
|
||||
Aspect_BadAccess::Raise ("FindEntryIndex() index not found.");
|
||||
}
|
||||
|
||||
return( index - mybasepixel + 1 ) ;
|
||||
}
|
||||
|
||||
void Aspect_ColorCubeColorMap::ColorCubeDefinition(
|
||||
Standard_Integer& basepixel ,
|
||||
Standard_Integer& red_max ,
|
||||
Standard_Integer& red_mult ,
|
||||
Standard_Integer& green_max ,
|
||||
Standard_Integer& green_mult ,
|
||||
Standard_Integer& blue_max ,
|
||||
Standard_Integer& blue_mult ) const
|
||||
|
||||
{
|
||||
basepixel = mybasepixel ;
|
||||
red_max = myredmax ;
|
||||
red_mult = myredmult ;
|
||||
green_max = mygreenmax ;
|
||||
green_mult = mygreenmult ;
|
||||
blue_max = mybluemax ;
|
||||
blue_mult = mybluemult ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorCubeColorMap::AddEntry (const Quantity_Color &aColor) {
|
||||
|
||||
return mybasepixel + NearestColorMapIndex(aColor) - 1;
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
-- Created on: 1993-03-23
|
||||
-- Created by: BBL
|
||||
-- Copyright (c) 1993-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.
|
||||
|
||||
deferred class ColorMap from Aspect inherits TShared from MMgt
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a ColorMap object.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
uses
|
||||
Color from Quantity,
|
||||
TypeOfColorMap from Aspect,
|
||||
ColorMapEntry from Aspect,
|
||||
SequenceOfColorMapEntry from Aspect
|
||||
|
||||
raises
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
|
||||
Initialize( type : TypeOfColorMap from Aspect );
|
||||
|
||||
Type( me )
|
||||
returns TypeOfColorMap from Aspect is static;
|
||||
---Level: Public
|
||||
|
||||
Size( me ) returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Allocated colormap Size
|
||||
|
||||
Index( me ; aColormapIndex : Integer ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the ColorMapEntry.Index of the ColorMap
|
||||
-- at rank <aColormapIndex> .
|
||||
raises BadAccess from Aspect is static;
|
||||
---Trigger: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
|
||||
Dump( me ) ;
|
||||
---Level: Internal
|
||||
|
||||
Entry ( me ; AColorMapIndex : Integer from Standard )
|
||||
returns ColorMapEntry from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Return the value of the <Index>th element of
|
||||
-- the ColorMap
|
||||
raises BadAccess from Aspect is static;
|
||||
---Trigger: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
---C++: return const &
|
||||
|
||||
FindColorMapIndex ( me ;
|
||||
AColorMapEntryIndex : Integer from Standard )
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the
|
||||
-- ColorMapEntry.Index() equal to <AnEntryIndex>.
|
||||
raises BadAccess from Aspect is deferred ;
|
||||
---Trigger: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
|
||||
FindEntry ( me ; AColorMapEntryIndex : Integer from Standard )
|
||||
returns ColorMapEntry from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index()
|
||||
-- equal to <AnEntryIndex>.
|
||||
raises BadAccess from Aspect is deferred ;
|
||||
---Trigger: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
---C++: return const &
|
||||
|
||||
NearestColorMapIndex( me ; aColor : Color from Quantity )
|
||||
returns Integer from Standard is deferred ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the
|
||||
-- nearest matching ColorMapEntry
|
||||
|
||||
NearestEntry( me ; aColor : Color from Quantity )
|
||||
returns ColorMapEntry from Aspect is deferred ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the nearest ColorMapEntry that match aColor .
|
||||
---C++: return const &
|
||||
|
||||
AddEntry (me : mutable; aColor : Color from Quantity)
|
||||
returns Integer from Standard is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical color entry in the color map <me>
|
||||
-- and returns the ColorMapEntry Index if exist.
|
||||
-- Or add a new entry and returns the computed ColorMapEntry index used.
|
||||
|
||||
fields
|
||||
|
||||
mytype : TypeOfColorMap from Aspect;
|
||||
mydata : SequenceOfColorMapEntry from Aspect is protected;
|
||||
|
||||
end ColorMap ;
|
@ -1,57 +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.
|
||||
|
||||
#include <Aspect_ColorMap.ixx>
|
||||
|
||||
Aspect_ColorMap::Aspect_ColorMap( const Aspect_TypeOfColorMap type ) {
|
||||
|
||||
mytype = type;
|
||||
}
|
||||
|
||||
Aspect_TypeOfColorMap Aspect_ColorMap::Type() const {
|
||||
|
||||
return mytype ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorMap::Size() const {
|
||||
|
||||
return mydata.Length() ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorMap::Index(const Standard_Integer anIndex) const {
|
||||
|
||||
if( anIndex < 1 || anIndex > Size() ) {
|
||||
Aspect_BadAccess::Raise ("Undefined colormap Index");
|
||||
}
|
||||
|
||||
Aspect_ColorMapEntry theEntry = mydata.Value(anIndex) ;
|
||||
|
||||
return theEntry.Index() ;
|
||||
}
|
||||
|
||||
const Aspect_ColorMapEntry& Aspect_ColorMap::Entry (const Standard_Integer AnIndex) const {
|
||||
|
||||
return mydata.Value(AnIndex);
|
||||
}
|
||||
|
||||
void Aspect_ColorMap::Dump () const {
|
||||
|
||||
Standard_Integer i ;
|
||||
|
||||
cout << "Colormap Dump-->\n" ;
|
||||
|
||||
for ( i = 1 ; i <= Size() ; i++ ) (Entry(i)).Dump() ;
|
||||
|
||||
cout << "<--End Colormap Dump\n" ;
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
-- Created on: 1993-03-23
|
||||
-- Created by: BBL
|
||||
-- Copyright (c) 1993-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 ColorMapEntry from Aspect inherits Storable from Standard
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a colormap entry.
|
||||
-- A colormap entry is an association between
|
||||
-- a RGB object and a index in the colormap.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
Color from Quantity
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create
|
||||
returns ColorMapEntry from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates an unallocated colormap entry
|
||||
|
||||
Create ( index : in Integer from Standard;
|
||||
rgb : in Color from Quantity)
|
||||
returns ColorMapEntry;
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated colormap entry
|
||||
|
||||
Create ( entry : in ColorMapEntry from Aspect )
|
||||
returns ColorMapEntry
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated colormap entry.
|
||||
-- Warning: Raises error if the colormap entry <entry>
|
||||
-- is unallocated.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
SetValue ( me: in out; index : in Integer from Standard;
|
||||
rgb : in Color from Quantity );
|
||||
---Level: Public
|
||||
---Purpose: Sets colormap entry value and allocates it.
|
||||
|
||||
SetValue ( me: in out; entry : in ColorMapEntry from Aspect);
|
||||
---Level: Public
|
||||
---Purpose: Sets colormap entry value and allocates it.
|
||||
---C++: alias operator =
|
||||
|
||||
SetColor ( me: in out; rgb : in Color from Quantity );
|
||||
---Level: Public
|
||||
---Purpose: Sets color <rgb> of colormap entry.
|
||||
|
||||
Color ( me : in ) returns Color from Quantity
|
||||
---Warning: Raises error if the colormap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
---C++: return const &
|
||||
|
||||
SetIndex ( me: in out; index : in Integer from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets index value of a colormap entry.
|
||||
|
||||
Index ( me : in ) returns Integer from Standard
|
||||
---Warning: Raises error if the colormap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
Free ( me : in out );
|
||||
---Level: Public
|
||||
---Purpose: Unallocates the colormap entry.
|
||||
|
||||
IsAllocated ( me : in )
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns True if the colormap entry is allocated.
|
||||
-- Warning: A colormap entry is allocated when the color and
|
||||
-- the index is defined.
|
||||
|
||||
Dump( me : in ) ;
|
||||
---Level: Internal
|
||||
|
||||
fields
|
||||
allocated : Boolean from Standard;
|
||||
mycolor : Color from Quantity;
|
||||
myindex : Integer from Standard;
|
||||
myColorIsDef : Boolean from Standard;
|
||||
myIndexIsDef : Boolean from Standard;
|
||||
|
||||
end ColorMapEntry from Aspect;
|
@ -1,141 +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.
|
||||
|
||||
#include <Aspect_ColorMapEntry.ixx>
|
||||
|
||||
Aspect_ColorMapEntry::Aspect_ColorMapEntry() {
|
||||
|
||||
myColorIsDef = Standard_True;
|
||||
myIndexIsDef = Standard_True;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
myindex = 0;
|
||||
mycolor.SetValues (0., 0., 0., Quantity_TOC_RGB);
|
||||
|
||||
}
|
||||
|
||||
Aspect_ColorMapEntry::Aspect_ColorMapEntry (const Standard_Integer index, const Quantity_Color &color) {
|
||||
|
||||
myColorIsDef = Standard_True;
|
||||
myIndexIsDef = Standard_True;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
myindex = index;
|
||||
mycolor = color;
|
||||
|
||||
}
|
||||
|
||||
Aspect_ColorMapEntry::Aspect_ColorMapEntry (const Aspect_ColorMapEntry& entry) {
|
||||
|
||||
if (entry.allocated == Standard_False) {
|
||||
Aspect_BadAccess::Raise
|
||||
("Aspect_ColorMapEntry::Aspect_ColorMapEntry Unallocated ColorMapEntry");
|
||||
}
|
||||
else {
|
||||
myColorIsDef = Standard_True;
|
||||
myIndexIsDef = Standard_True;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
myindex = entry.myindex;
|
||||
mycolor = entry.mycolor;
|
||||
}
|
||||
}
|
||||
|
||||
void Aspect_ColorMapEntry::SetValue (const Standard_Integer index, const Quantity_Color &color) {
|
||||
|
||||
myColorIsDef = Standard_True;
|
||||
myIndexIsDef = Standard_True;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
myindex = index;
|
||||
mycolor = color;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_ColorMapEntry::SetValue (const Aspect_ColorMapEntry& entry) {
|
||||
|
||||
if (entry.allocated == Standard_False) {
|
||||
Aspect_BadAccess::Raise
|
||||
("Aspect_ColorMapEntry::Aspect_ColorMapEntry Unallocated ColorMapEntry");
|
||||
}
|
||||
else {
|
||||
myColorIsDef = Standard_True;
|
||||
myIndexIsDef = Standard_True;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
myindex = entry.myindex;
|
||||
mycolor = entry.mycolor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Aspect_ColorMapEntry::SetColor (const Quantity_Color &color) {
|
||||
|
||||
myColorIsDef = Standard_True;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
mycolor = color;
|
||||
|
||||
}
|
||||
|
||||
const Quantity_Color& Aspect_ColorMapEntry::Color () const {
|
||||
|
||||
if (allocated == Standard_False)
|
||||
Aspect_BadAccess::Raise
|
||||
("Aspect_ColorMapEntry::Color Unallocated ColorMapEntry");
|
||||
|
||||
return mycolor;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_ColorMapEntry::SetIndex (const Standard_Integer index) {
|
||||
|
||||
myColorIsDef = Standard_True;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
myindex = index;
|
||||
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorMapEntry::Index () const {
|
||||
|
||||
if (allocated == Standard_False)
|
||||
Aspect_BadAccess::Raise
|
||||
("Aspect_ColorMapEntry::Index Unallocated ColorMapEntry");
|
||||
|
||||
return myindex;
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_ColorMapEntry::IsAllocated () const {
|
||||
|
||||
return allocated;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_ColorMapEntry::Free () {
|
||||
|
||||
myColorIsDef = Standard_False;
|
||||
myIndexIsDef = Standard_False;
|
||||
allocated = myColorIsDef && myIndexIsDef;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_ColorMapEntry::Dump () const {
|
||||
|
||||
Standard_Real r,g,b ;
|
||||
|
||||
mycolor.Values( r,g,b, Quantity_TOC_RGB ) ;
|
||||
|
||||
cout << flush;
|
||||
cout << "myColorIsDef : " << (myColorIsDef ? "True " : "False") << " , "
|
||||
<< "myIndexIsDef : " << (myIndexIsDef ? "True " : "False") << " , "
|
||||
<< "allocated : " << (allocated ? "True " : "False") << "\n";
|
||||
cout << "myindex : " << myindex << " myColor : ( "
|
||||
<< r << ", " << g << ", " << g << " )\n";
|
||||
cout << flush;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
-- Created on: 1993-07-23
|
||||
-- Created by: Jean Louis FRENKEL
|
||||
-- Copyright (c) 1993-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 ColorPixel from Aspect inherits Pixel from Aspect
|
||||
|
||||
uses
|
||||
Color from Quantity
|
||||
is
|
||||
|
||||
Create returns ColorPixel from Aspect;
|
||||
---Level: Public
|
||||
|
||||
Create(aColor: Color from Quantity) returns ColorPixel from Aspect;
|
||||
---Level: Public
|
||||
|
||||
Value (me) returns Color from Quantity is static ;
|
||||
---Level: Public
|
||||
---C++: return const &
|
||||
|
||||
SetValue(me: in out; aColor: Color from Quantity) is static ;
|
||||
---Level: Public
|
||||
|
||||
Print( me ; s : in out OStream from Standard ) is redefined static ;
|
||||
---Level: Public
|
||||
---Purpose : Prints the contents of <me> on the stream <s>
|
||||
|
||||
HashCode (me; Upper : Integer ) returns Integer is redefined static ;
|
||||
---Level: Public
|
||||
---Purpose: Returns a hashed value denoting <me>. This value is in
|
||||
-- the range 1..<Upper>.
|
||||
---C++: function call
|
||||
|
||||
IsEqual(me; Other : ColorPixel from Aspect) returns Boolean;
|
||||
---C++: alias operator==
|
||||
|
||||
IsNotEqual(me; Other : ColorPixel from Aspect) returns Boolean;
|
||||
---C++: alias operator!=
|
||||
|
||||
|
||||
|
||||
fields
|
||||
myColor: Color from Quantity;
|
||||
|
||||
end ColorPixel from Aspect;
|
@ -1,74 +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.
|
||||
|
||||
#include <Aspect_ColorPixel.ixx>
|
||||
|
||||
Aspect_ColorPixel::Aspect_ColorPixel () {
|
||||
|
||||
myColor.SetValues( 0.,0.,0. , Quantity_TOC_RGB ) ;
|
||||
|
||||
}
|
||||
|
||||
Aspect_ColorPixel::Aspect_ColorPixel (const Quantity_Color& aColor) {
|
||||
|
||||
myColor = aColor;
|
||||
|
||||
}
|
||||
|
||||
const Quantity_Color& Aspect_ColorPixel::Value() const {
|
||||
|
||||
return myColor;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Aspect_ColorPixel::SetValue(const Quantity_Color& aColor) {
|
||||
|
||||
myColor = aColor;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_ColorPixel::Print(Standard_OStream& s) const
|
||||
|
||||
{ Standard_Real r,g,b ;
|
||||
|
||||
myColor.Values( r,g,b, Quantity_TOC_RGB ) ;
|
||||
|
||||
s << "( " << r << ", " << g << ", " << b << " )" << flush;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Hascode : Computes a hascoding value for a given Aspect_ColorPixel
|
||||
// ------------------------------------------------------------------
|
||||
Standard_Integer Aspect_ColorPixel::HashCode(const Standard_Integer Upper) const
|
||||
{ Standard_Real r,g,b ;
|
||||
Standard_Integer ret ;
|
||||
|
||||
myColor.Values( r,g,b, Quantity_TOC_RGB ) ;
|
||||
|
||||
ret = ( Standard_Integer ) ( ( r + g + b ) * Upper ) ;
|
||||
|
||||
return ( ret % Upper ) + 1 ;
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean Aspect_ColorPixel::IsEqual(const Aspect_ColorPixel& Other) const
|
||||
{
|
||||
return (myColor == Other.myColor);
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_ColorPixel::IsNotEqual(const Aspect_ColorPixel& Other) const
|
||||
{
|
||||
return !IsEqual(Other);
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
-- Created on: 1993-03-23
|
||||
-- Created by: BBL
|
||||
-- Copyright (c) 1993-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 ColorRampColorMap from Aspect inherits ColorMap from Aspect
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a ColorRampColorMap object.
|
||||
-- Associates a index and a color in the linear "ColorRamp" space.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
Color from Quantity,
|
||||
NameOfColor from Quantity,
|
||||
ColorMapEntry from Aspect
|
||||
|
||||
raises
|
||||
RangeError from Standard,
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create( basepixel,dimension : in Integer from Standard ;
|
||||
color : in Color from Quantity )
|
||||
returns ColorRampColorMap from Aspect
|
||||
raises RangeError from Standard ;
|
||||
---Level: Public
|
||||
---Purpose : Create a Color Ramp Colormap starting from Black at
|
||||
-- basepixel to color at basepixel+dimension-1.
|
||||
|
||||
Create( basepixel,dimension : in Integer from Standard ;
|
||||
colorName : in NameOfColor from Quantity )
|
||||
returns ColorRampColorMap from Aspect
|
||||
raises RangeError from Standard ;
|
||||
---Level: Public
|
||||
---Purpose : Create a Color Ramp Colormap starting from Black at
|
||||
-- basepixel to color at basepixel+dimension-1.
|
||||
|
||||
ColorRampDefinition( me : in ;
|
||||
basepixel,dimension : out Integer from Standard ;
|
||||
color : out Color from Quantity ) ;
|
||||
---Level: Public
|
||||
---Purpose : Get Color Ramp Colormap definition .
|
||||
|
||||
ComputeEntry( me : in out mutable ;
|
||||
basepixel,dimension : in Integer from Standard ;
|
||||
color : in Color from Quantity )
|
||||
raises RangeError from Standard is private ;
|
||||
---Level: Public
|
||||
---Purpose : Create a Color Ramp Colormap starting from Black at
|
||||
-- basepixel to color at basepixel+dimension-1.
|
||||
|
||||
FindColorMapIndex ( me ;
|
||||
ColorMapEntryIndex : Integer from Standard )
|
||||
returns Integer from Standard
|
||||
raises BadAccess from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the
|
||||
-- ColorMapEntry.Index() equal to <AnEntryIndex>.
|
||||
-- Warning: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
|
||||
FindEntry ( me ; AColorMapEntryIndex : Integer from Standard )
|
||||
returns ColorMapEntry from Aspect
|
||||
raises BadAccess from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index()
|
||||
-- equal to <AnEntryIndex>.
|
||||
-- Warning: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
---C++: return const &
|
||||
|
||||
NearestColorMapIndex( me ; aColor : Color from Quantity )
|
||||
returns Integer from Standard ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the
|
||||
-- nearest matching ColorMapEntry
|
||||
|
||||
NearestEntry( me ; aColor : Color from Quantity )
|
||||
returns ColorMapEntry from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the nearest ColorMapEntry that match aColor .
|
||||
---C++: return const &
|
||||
|
||||
AddEntry (me : mutable; aColor : Color from Quantity)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical color entry in the color map <me>
|
||||
-- or returns the nearest ColorMapEntry Index.
|
||||
|
||||
fields
|
||||
mycolor : Color from Quantity ;
|
||||
mybasepixel : Integer from Standard ;
|
||||
mydimension : Integer from Standard ;
|
||||
|
||||
end ColorRampColorMap ;
|
@ -1,126 +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.
|
||||
|
||||
// Modified : GG ; 14/09/01 Implements the new AddEntry method
|
||||
|
||||
#define IMP140901 // GG Compute correctly the color ramp
|
||||
// accordingly to the requested color.
|
||||
|
||||
#include <Aspect_ColorRampColorMap.ixx>
|
||||
#include <Aspect_ColorMapEntry.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
|
||||
|
||||
Aspect_ColorRampColorMap::Aspect_ColorRampColorMap(
|
||||
const Standard_Integer basepixel ,
|
||||
const Standard_Integer dimension ,
|
||||
const Quantity_NameOfColor color )
|
||||
:Aspect_ColorMap(Aspect_TOC_ColorRamp )
|
||||
|
||||
{ ComputeEntry( basepixel, dimension,
|
||||
Quantity_Color( color ) ) ; }
|
||||
|
||||
Aspect_ColorRampColorMap::Aspect_ColorRampColorMap(
|
||||
const Standard_Integer basepixel ,
|
||||
const Standard_Integer dimension ,
|
||||
const Quantity_Color& color )
|
||||
:Aspect_ColorMap(Aspect_TOC_ColorRamp )
|
||||
|
||||
{ ComputeEntry( basepixel, dimension, color ) ; }
|
||||
|
||||
void Aspect_ColorRampColorMap::ComputeEntry(
|
||||
const Standard_Integer basepixel ,
|
||||
const Standard_Integer dimension ,
|
||||
const Quantity_Color& color )
|
||||
|
||||
{ Standard_Integer i ;
|
||||
Aspect_ColorMapEntry value ;
|
||||
Quantity_Color rgb ;
|
||||
Standard_Real v ;
|
||||
#ifdef IMP140901
|
||||
Standard_Real r,g,b;
|
||||
#endif
|
||||
|
||||
mycolor = color ;
|
||||
mybasepixel = basepixel ;
|
||||
mydimension = dimension ;
|
||||
#ifdef IMP140901
|
||||
mycolor.Values(r,g,b,Quantity_TOC_RGB);
|
||||
#endif
|
||||
|
||||
for( i = 0 ; i < dimension ; i++ ) {
|
||||
v = ( Standard_Real ) i /
|
||||
( Standard_Real )(dimension-1) ;
|
||||
|
||||
#ifdef IMP140901
|
||||
rgb.SetValues( r*v, g*v, b*v, Quantity_TOC_RGB ) ;
|
||||
#else
|
||||
rgb.SetValues( v, v, v, Quantity_TOC_RGB ) ;
|
||||
#endif
|
||||
|
||||
value.SetValue( basepixel+i, rgb ) ;
|
||||
|
||||
mydata.Append( value ) ;
|
||||
}
|
||||
}
|
||||
|
||||
const Aspect_ColorMapEntry& Aspect_ColorRampColorMap::NearestEntry(
|
||||
const Quantity_Color& color ) const
|
||||
|
||||
{
|
||||
return( Entry( NearestColorMapIndex( color ) ) ) ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorRampColorMap::NearestColorMapIndex(
|
||||
const Quantity_Color& color ) const
|
||||
|
||||
{
|
||||
return( (Standard_Integer ) ( ( color.Light() * (mydimension-1) ) + 1 )) ;
|
||||
}
|
||||
|
||||
|
||||
const Aspect_ColorMapEntry& Aspect_ColorRampColorMap::FindEntry(
|
||||
const Standard_Integer index ) const
|
||||
|
||||
{
|
||||
return( Entry( FindColorMapIndex( index ) ) ) ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorRampColorMap::FindColorMapIndex(
|
||||
const Standard_Integer index ) const
|
||||
{
|
||||
|
||||
if ( index < mybasepixel ||
|
||||
index >= ( mybasepixel+mydimension ) ){
|
||||
Aspect_BadAccess::Raise ("FindEntryIndex() index not found.");
|
||||
}
|
||||
|
||||
return( index - mybasepixel + 1 ) ;
|
||||
}
|
||||
|
||||
void Aspect_ColorRampColorMap::ColorRampDefinition(
|
||||
Standard_Integer& basepixel,
|
||||
Standard_Integer& size,
|
||||
Quantity_Color& color ) const
|
||||
|
||||
{ basepixel = mybasepixel ;
|
||||
size = mydimension ;
|
||||
color = mycolor ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_ColorRampColorMap::AddEntry (const Quantity_Color &aColor) {
|
||||
|
||||
return mybasepixel + NearestColorMapIndex(aColor) - 1;
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ uses
|
||||
|
||||
TypeOfColorScaleData from Aspect,
|
||||
TypeOfColorScalePosition from Aspect,
|
||||
ColorMap from Aspect,
|
||||
SequenceOfColor from Aspect,
|
||||
Color from Quantity,
|
||||
AsciiString from TCollection,
|
||||
@ -150,9 +149,6 @@ is
|
||||
SetLabels(me : mutable; aSeq : SequenceOfExtendedString from TColStd);
|
||||
---Purpose: Sets the color scale labels.
|
||||
|
||||
SetColors(me : mutable; aMap : ColorMap from Aspect);
|
||||
---Purpose: Sets the color scale colors.
|
||||
|
||||
SetColors(me : mutable; aSeq : SequenceOfColor from Aspect);
|
||||
---Purpose: Sets the color scale colors.
|
||||
|
||||
|
@ -15,8 +15,6 @@
|
||||
|
||||
#include <Aspect_ColorScale.ixx>
|
||||
|
||||
#include <Aspect_ColorMap.hxx>
|
||||
#include <Aspect_ColorMapEntry.hxx>
|
||||
#include <Aspect_SequenceOfColor.hxx>
|
||||
#include <Aspect_TypeOfColorScaleData.hxx>
|
||||
#include <Aspect_TypeOfColorScalePosition.hxx>
|
||||
@ -252,14 +250,6 @@ void Aspect_ColorScale::SetLabels( const TColStd_SequenceOfExtendedString& aSeq
|
||||
myLabels.Append( aSeq.Value( i ) );
|
||||
}
|
||||
|
||||
void Aspect_ColorScale::SetColors( const Handle(Aspect_ColorMap)& aMap )
|
||||
{
|
||||
myColors.Clear();
|
||||
if ( !aMap.IsNull() )
|
||||
for ( Standard_Integer i = 1; i <= aMap->Size(); i++ )
|
||||
myColors.Append( aMap->Entry( i ).Color() );
|
||||
}
|
||||
|
||||
void Aspect_ColorScale::SetColors( const Aspect_SequenceOfColor& aSeq )
|
||||
{
|
||||
myColors.Clear();
|
||||
|
@ -1,427 +0,0 @@
|
||||
-- Created on: 1993-07-01
|
||||
-- Created by: Jean Louis FRENKEL,Gerard GRAS
|
||||
-- Copyright (c) 1993-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.
|
||||
|
||||
-- Update: Fri Jan 30 16:05:00 1998
|
||||
-- Adds <useMFT> parameter in the SetFontMap() method
|
||||
-- and adds the new method UseMFT()
|
||||
-- for using MDTV fonts instead system fonts.
|
||||
|
||||
deferred class Driver from Aspect inherits TShared from MMgt
|
||||
|
||||
---Purpose: Defines the common behaviour of the output driver.
|
||||
-- Warning: Permits to defines polyline,polygon,marker and text attributes in relation
|
||||
-- with the SINGLE primitives DrawPolyline(),DrawPolygon(),....
|
||||
-- or the INCREMENTAL primitives BeginPolyline(),BeginPolygon(),...
|
||||
-- or the SET of primitives BeginArcs(),BeginMarkers(),...
|
||||
--
|
||||
-- NOTE that :
|
||||
-- The incremental primitives are interesting to used because
|
||||
-- no more arrays are necessary to fill it.
|
||||
-- The set of primitives are interesting to used because this
|
||||
-- increase the drawing performances.
|
||||
|
||||
uses
|
||||
|
||||
ExtendedString from TCollection,
|
||||
Array1OfShortReal from TShort,
|
||||
ColorMap from Aspect,
|
||||
TypeMap from Aspect,
|
||||
WidthMap from Aspect,
|
||||
FontMap from Aspect,
|
||||
MarkMap from Aspect,
|
||||
TypeOfText from Aspect,
|
||||
PlaneAngle from Quantity,
|
||||
Length from Quantity,
|
||||
Factor from Quantity,
|
||||
Ratio from Quantity,
|
||||
Color from Quantity
|
||||
|
||||
raises
|
||||
|
||||
DriverDefinitionError from Aspect,
|
||||
DriverError from Aspect,
|
||||
UndefinedMap from Aspect
|
||||
is
|
||||
|
||||
Initialize;
|
||||
|
||||
EndDraw (me: mutable; Synchronize: Boolean = Standard_False) is deferred;
|
||||
---Purpose: Flush all graphics and Wait after up to date
|
||||
--display when Synchronize is TRUE.
|
||||
|
||||
---------------------------------------------
|
||||
-- Category: Methods to define the attributes
|
||||
---------------------------------------------
|
||||
|
||||
SetColorMap(me: mutable;
|
||||
aColorMap: ColorMap from Aspect)
|
||||
raises DriverError from Aspect is static;
|
||||
---Category: Methods to define the ColorIndexs
|
||||
|
||||
SetTypeMap(me: mutable;
|
||||
aTypeMap: TypeMap from Aspect)
|
||||
raises DriverError from Aspect is static;
|
||||
---Category: Methods to define the TypeIndexs
|
||||
|
||||
SetWidthMap(me: mutable;
|
||||
aWidthMap: WidthMap from Aspect)
|
||||
raises DriverError from Aspect is static;
|
||||
---Category: Methods to define the WidthIndexs
|
||||
|
||||
SetFontMap(me: mutable;
|
||||
aFontMap: FontMap from Aspect)
|
||||
raises DriverError from Aspect is static;
|
||||
---Category: Methods to define the FontIndexs
|
||||
---Purpose:
|
||||
-- Sets the current font map to this driver and Enable/Disable
|
||||
-- this driver to use MDTV fonts instead system fonts.
|
||||
|
||||
SetMarkMap(me: mutable;
|
||||
aMarkMap: MarkMap from Aspect)
|
||||
raises DriverError from Aspect is static;
|
||||
---Category: Methods to define the MarkerIndexs
|
||||
|
||||
SetLineAttrib (me: mutable;
|
||||
ColorIndex: Integer from Standard;
|
||||
TypeIndex: Integer from Standard;
|
||||
WidthIndex: Integer from Standard)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to define the Current Line Attibutes
|
||||
|
||||
SetTextAttrib (me: mutable;
|
||||
ColorIndex: Integer from Standard;
|
||||
FontIndex: Integer from Standard)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to define the Current Text Attributes
|
||||
|
||||
SetTextAttrib (me: mutable;
|
||||
ColorIndex: Integer from Standard;
|
||||
FontIndex: Integer from Standard;
|
||||
aSlant: PlaneAngle from Quantity;
|
||||
aHScale: Factor from Quantity;
|
||||
aWScale: Factor from Quantity;
|
||||
isUnderlined: Boolean from Standard = Standard_False)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to define the Current Extended Text Attributes
|
||||
|
||||
SetPolyAttrib (me: mutable;
|
||||
ColorIndex: Integer from Standard;
|
||||
TileIndex: Integer from Standard;
|
||||
DrawEdge: Boolean from Standard = Standard_False)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to set the poly attributes
|
||||
|
||||
SetMarkerAttrib (me: mutable;
|
||||
ColorIndex: Integer from Standard;
|
||||
WidthIndex: Integer from Standard;
|
||||
FillMarker: Boolean from Standard = Standard_False)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to define the Current Marker Attributes
|
||||
|
||||
---Category: Images methods:
|
||||
|
||||
IsKnownImage(me: mutable; anImage: Transient from Standard)
|
||||
returns Boolean from Standard
|
||||
is deferred;
|
||||
|
||||
SizeOfImageFile(me; anImageFile: CString from Standard;
|
||||
aWidth,aHeight: out Integer from Standard)
|
||||
returns Boolean from Standard
|
||||
is deferred;
|
||||
|
||||
ClearImage (me: mutable; anImageId: Transient from Standard)
|
||||
raises DriverError from Aspect is deferred;
|
||||
|
||||
ClearImageFile (me: mutable; anImageFile: CString from Standard)
|
||||
raises DriverError from Aspect is deferred;
|
||||
|
||||
DrawImage (me: mutable; anImageId: Transient from Standard;
|
||||
aX, aY: ShortReal from Standard)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawImageFile (me: mutable; anImageFile: CString from Standard;
|
||||
aX, aY: ShortReal from Standard;
|
||||
aScale: Factor from Quantity = 1.0)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
FillAndDrawImage (me: mutable; anImageId: Transient from Standard;
|
||||
aX, aY: ShortReal from Standard;
|
||||
aWidth, aHeight: Integer from Standard;
|
||||
anArrayOfPixels: Address from Standard)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Fills a complete Image .
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
FillAndDrawImage (me: mutable; anImageId: Transient from Standard;
|
||||
aX, aY: ShortReal from Standard;
|
||||
anIndexOfLine, aWidth, aHeight: Integer from Standard;
|
||||
anArrayOfPixels: Address from Standard)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Fills a line of the Image .
|
||||
-- Warning: 0 <= anIndexOfLine < aHeight
|
||||
-- anIndexOfLine = 0 must be the first call
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawPolyline (me : mutable;
|
||||
aListX, aListY: Array1OfShortReal from TShort)
|
||||
---Level: Public
|
||||
---Purpose: Draw a polyline depending of the SetLineAttrib() attributes.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if <aListX,aListY> have not the same size.
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawPolygon (me : mutable;
|
||||
aListX, aListY: Array1OfShortReal from TShort)
|
||||
---Level: Public
|
||||
---Purpose: Draw a polygon depending of the SetPolyAttrib() attributes.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if <aListX,aListY> have not the same size.
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawSegment (me : mutable;
|
||||
X1, Y1: ShortReal from Standard;
|
||||
X2, Y2: ShortReal from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Draw a segment depending of the SetLineAttrib() attributes.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawText (me : mutable;
|
||||
aText: ExtendedString from TCollection;
|
||||
Xpos: ShortReal from Standard;
|
||||
Ypos: ShortReal from Standard;
|
||||
anAngle: ShortReal from Standard = 0.0;
|
||||
aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
|
||||
---Level: Public
|
||||
---Purpose: Draws a text depending of the SetTextAttrib() attributes.
|
||||
---Warning: Coordinates must be defined in DWU space.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if Text has too many chars (> 1024)
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawPolyText (me : mutable;
|
||||
aText: ExtendedString from TCollection;
|
||||
Xpos: ShortReal from Standard;
|
||||
Ypos: ShortReal from Standard;
|
||||
aMarge: Ratio from Quantity = 0.1;
|
||||
anAngle: ShortReal from Standard = 0.0;
|
||||
aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
|
||||
---Level: Public
|
||||
---Purpose: Draws an framed text depending of the
|
||||
-- SetTextAttrib() and SetPolyAttrib() attributes.
|
||||
-- Warning: Coordinates must be defined in DWU space.
|
||||
-- <aMarge> defines the ratio of the space between the
|
||||
-- polygon borders and the bounding box of the text and
|
||||
-- depending of the height of the text.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if Text has too many chars (> 1024)
|
||||
-- or <aMarge is < 0 or > 1.
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawPoint (me : mutable; X, Y: ShortReal from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Draws a 1 PIXEL point depending of the SetMarkerAttrib()
|
||||
--color attribute or add a point depending of the incremental BeginXxxxxx()
|
||||
--primitive used.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawMarker (me : mutable;
|
||||
aMarker: Integer from Standard;
|
||||
Xpos: ShortReal from Standard;
|
||||
Ypos: ShortReal from Standard;
|
||||
Width: ShortReal from Standard;
|
||||
Height: ShortReal from Standard;
|
||||
Angle: ShortReal from Standard = 0.0)
|
||||
---Level: Public
|
||||
---Purpose: Draws the prevously defined marker <aMarker>
|
||||
--depending of the SetMarkerAttrib() attributes.
|
||||
-- Warning: Coordinates and sizes must be defined in DWU space.
|
||||
-- Angle must be defined in RADIAN.
|
||||
-- A one pixel marker is drawn when aMarker index is undefined.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawArc (me : mutable; X,Y : ShortReal from Standard;
|
||||
anXradius,anYradius : ShortReal from Standard;
|
||||
aStartAngle: ShortReal from Standard = 0.0;
|
||||
anOpenAngle: ShortReal from Standard = 6.283185)
|
||||
returns Boolean
|
||||
---Level: Public
|
||||
---Purpose: Draws an Ellipsoid arc of center <X,Y> and Radius
|
||||
--<anXradius,anYradius> of relative angle <anOpenAngle> from
|
||||
--the base angle <aStartAngle> and depending of the SetLineAttrib() attributes.
|
||||
-- Warning: Returns FALSE if the hardware can't drawing this
|
||||
--primitive properly,application must to simulate it.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if one of <aXradius,aYradius> is <= 0.
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
DrawPolyArc (me : mutable; X,Y : ShortReal from Standard;
|
||||
anXradius,anYradius : ShortReal from Standard;
|
||||
aStartAngle: ShortReal from Standard = 0.0;
|
||||
anOpenAngle: ShortReal from Standard = 6.283185)
|
||||
returns Boolean
|
||||
---Level: Public
|
||||
---Purpose: Draws an filled Ellipsoid arc of center <X,Y> and Radius
|
||||
--<anXradius,anYradius> of relative angle <anOpenAngle> from
|
||||
--the base angle <aStartAngle> and depending of the SetPolyAttrib() attributes.
|
||||
-- Warning: Returns FALSE if the hardware can't drawing this
|
||||
--primitive properly,application must to simulate it.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if one of <aXradius,aYradius> is <= 0.
|
||||
---Category: Methods to draw primitives
|
||||
|
||||
BeginPolyline (me : mutable; aNumber : Integer) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Begin an incremental polyline primitive of <aNumber> of points .
|
||||
-- Warning: Points must be added by the the DrawPoint() method.
|
||||
|
||||
BeginPolygon (me : mutable; aNumber : Integer) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Begin an incremental polygon primitive of <aNumber> of points .
|
||||
-- Warning: Points must be added by the the DrawPoint() method.
|
||||
|
||||
BeginSegments (me : mutable) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Begin a set of segments .
|
||||
-- Warning: Segments must be added by the DrawSegment() method.
|
||||
|
||||
BeginArcs (me : mutable) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Begin a set of circles or ellips .
|
||||
-- Warning: Arcs must be added by the DrawArc() methods.
|
||||
|
||||
BeginPolyArcs (me : mutable) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Begin a set of polygon circles or ellips .
|
||||
-- Warning: Arcs must be added by the DrawPolyArc() methods.
|
||||
|
||||
BeginMarkers (me : mutable) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Begin a set of markers .
|
||||
-- Warning: Markers must be added by the DrawMarker() method.
|
||||
|
||||
BeginPoints (me : mutable) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Begin a set of points .
|
||||
-- Warning: Points must be added by the DrawPoint() method.
|
||||
|
||||
ClosePrimitive (me : mutable)
|
||||
---Level: Public
|
||||
---Purpose: Close the last Begining primitive
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if no primitive have been opened by BeginXxxxxx().
|
||||
|
||||
InitializeColorMap(me: mutable;
|
||||
aColorMap: ColorMap from Aspect)
|
||||
raises DriverError from Aspect is deferred protected;
|
||||
---Category: Methods to define the ColorIndexs
|
||||
|
||||
InitializeTypeMap(me: mutable;
|
||||
aTypeMap: TypeMap from Aspect)
|
||||
raises DriverError from Aspect is deferred protected;
|
||||
---Category: Methods to define the TypeIndexs
|
||||
|
||||
InitializeWidthMap(me: mutable;
|
||||
aWidthMap: WidthMap from Aspect)
|
||||
raises DriverError from Aspect is deferred protected;
|
||||
---Category: Methods to define the WidthIndexs
|
||||
|
||||
InitializeFontMap(me: mutable;
|
||||
aFontMap: FontMap from Aspect)
|
||||
raises DriverError from Aspect is deferred protected;
|
||||
---Category: Methods to define the FontIndexs
|
||||
|
||||
InitializeMarkMap(me: mutable;
|
||||
aMarkMap: MarkMap from Aspect)
|
||||
raises DriverError from Aspect is deferred protected;
|
||||
---Category: Methods to define the MarkerIndexs
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
ColorMap(me) returns ColorMap from Aspect
|
||||
raises UndefinedMap from Aspect is static;
|
||||
|
||||
TypeMap(me) returns TypeMap from Aspect
|
||||
raises UndefinedMap from Aspect is static;
|
||||
|
||||
WidthMap(me) returns WidthMap from Aspect
|
||||
raises UndefinedMap from Aspect is static;
|
||||
|
||||
FontMap(me) returns FontMap from Aspect
|
||||
raises UndefinedMap from Aspect is static;
|
||||
|
||||
MarkMap(me) returns MarkMap from Aspect
|
||||
raises UndefinedMap from Aspect is static;
|
||||
|
||||
WorkSpace ( me ; Width,Heigth : out Length from Quantity )
|
||||
is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Available WorkSpace in DWU coordinates
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ; PV : Integer from Standard )
|
||||
returns Length from Quantity is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Returns the DWU value depending of
|
||||
-- the PIXEL value.
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ; DV : Length from Quantity )
|
||||
returns Integer from Standard is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Returns the PIXEL value depending of
|
||||
-- the DWU value.
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ; PX, PY : Integer from Standard ;
|
||||
DX, DY : out Length from Quantity ) is deferred ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the DWU position depending of
|
||||
-- the PIXEL position .
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ; DX, DY : Length from Quantity ;
|
||||
PX, PY : out Integer from Standard ) is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Returns the PIXEL position depending of
|
||||
-- the DWU position .
|
||||
---Category: Inquire methods
|
||||
|
||||
---Level: Advanced
|
||||
---Purpose: Returns TRUE when the driver must use MDTV fonts
|
||||
-- instead system fonts.
|
||||
|
||||
fields
|
||||
myColorMap: ColorMap from Aspect;
|
||||
myTypeMap: TypeMap from Aspect;
|
||||
myWidthMap: WidthMap from Aspect;
|
||||
myFontMap: FontMap from Aspect;
|
||||
myMarkMap: MarkMap from Aspect;
|
||||
myColorMapIsDefined: Boolean from Standard;
|
||||
myWidthMapIsDefined: Boolean from Standard;
|
||||
myTypeMapIsDefined: Boolean from Standard;
|
||||
myFontMapIsDefined: Boolean from Standard;
|
||||
myMarkMapIsDefined: Boolean from Standard;
|
||||
|
||||
end Driver from Aspect;
|
@ -1,112 +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.
|
||||
|
||||
/***********************************************************************
|
||||
|
||||
FUNCTION :
|
||||
----------
|
||||
Class Aspect_Driver :
|
||||
|
||||
HISTORY OF MODIFICATIONS :
|
||||
--------------------------------
|
||||
|
||||
14-05-98 : GG ; Disable using MFT when the symbol
|
||||
CSF_MDTVFontDirectory is not defined.
|
||||
See dirMFTisDefined changes.
|
||||
|
||||
30-01-98 : GG ; SPEC_MFT
|
||||
Use of polices MFT becomes parameterized.
|
||||
The driver should use method UseMFT() to
|
||||
know if it is necessary or not to use MDTV policies
|
||||
instead of system policies.
|
||||
|
||||
-> Modifications in SetFontMap()
|
||||
-> New method UseMFT()
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include <Aspect_Driver.ixx>
|
||||
#include <OSD_Environment.hxx>
|
||||
|
||||
|
||||
Aspect_Driver::Aspect_Driver () {
|
||||
|
||||
myColorMapIsDefined = Standard_False;
|
||||
myWidthMapIsDefined = Standard_False;
|
||||
myTypeMapIsDefined = Standard_False;
|
||||
myFontMapIsDefined = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
void Aspect_Driver::SetColorMap (const Handle(Aspect_ColorMap)& aColorMap)
|
||||
{
|
||||
myColorMap = aColorMap;
|
||||
this->InitializeColorMap(aColorMap);
|
||||
myColorMapIsDefined = Standard_True;
|
||||
}
|
||||
Handle(Aspect_ColorMap) Aspect_Driver::ColorMap () const {
|
||||
|
||||
Aspect_UndefinedMap_Raise_if(!myColorMapIsDefined,"ColorMap");
|
||||
return myColorMap;
|
||||
}
|
||||
|
||||
|
||||
void Aspect_Driver::SetTypeMap (const Handle(Aspect_TypeMap)& aTypeMap)
|
||||
{
|
||||
myTypeMap = aTypeMap;
|
||||
this->InitializeTypeMap(aTypeMap);
|
||||
myTypeMapIsDefined = Standard_True;
|
||||
}
|
||||
Handle(Aspect_TypeMap) Aspect_Driver::TypeMap () const {
|
||||
|
||||
Aspect_UndefinedMap_Raise_if(!myTypeMapIsDefined,"TypeMap");
|
||||
return myTypeMap;
|
||||
}
|
||||
|
||||
void Aspect_Driver::SetWidthMap (const Handle(Aspect_WidthMap)& aWidthMap)
|
||||
{
|
||||
myWidthMap = aWidthMap;
|
||||
this->InitializeWidthMap(aWidthMap);
|
||||
myWidthMapIsDefined = Standard_True;
|
||||
}
|
||||
Handle(Aspect_WidthMap) Aspect_Driver::WidthMap () const {
|
||||
|
||||
Aspect_UndefinedMap_Raise_if(!myWidthMapIsDefined,"WidthMap");
|
||||
return myWidthMap;
|
||||
}
|
||||
|
||||
void Aspect_Driver::SetFontMap (const Handle(Aspect_FontMap)& aFontMap)
|
||||
{
|
||||
myFontMap = aFontMap;
|
||||
this->InitializeFontMap(aFontMap);
|
||||
myFontMapIsDefined = Standard_True;
|
||||
}
|
||||
Handle(Aspect_FontMap) Aspect_Driver::FontMap () const {
|
||||
|
||||
Aspect_UndefinedMap_Raise_if(!myFontMapIsDefined,"FontMap");
|
||||
return myFontMap;
|
||||
}
|
||||
|
||||
void Aspect_Driver::SetMarkMap (const Handle(Aspect_MarkMap)& aMarkMap)
|
||||
{
|
||||
myMarkMap = aMarkMap;
|
||||
this->InitializeMarkMap(aMarkMap);
|
||||
myMarkMapIsDefined = Standard_True;
|
||||
}
|
||||
Handle(Aspect_MarkMap) Aspect_Driver::MarkMap () const {
|
||||
|
||||
Aspect_UndefinedMap_Raise_if(!myMarkMapIsDefined,"MarkMap");
|
||||
return myMarkMap;
|
||||
}
|
||||
|
@ -1,22 +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.
|
||||
|
||||
#ifndef _Aspect_FStream_HeaderFile
|
||||
#define _Aspect_FStream_HeaderFile
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
typedef ofstream* Aspect_FStream;
|
||||
|
||||
#endif
|
@ -1,78 +0,0 @@
|
||||
-- Created on: 1993-09-07
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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 FontMap from Aspect inherits TShared from MMgt
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a FontMap object.
|
||||
-- Associates an index and a text Font entry.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
uses
|
||||
FontStyle from Aspect,
|
||||
FontMapEntry from Aspect,
|
||||
SequenceOfFontMapEntry from Aspect
|
||||
|
||||
raises
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
|
||||
Create returns FontMap from Aspect;
|
||||
|
||||
AddEntry (me : mutable; AnEntry : FontMapEntry from Aspect)
|
||||
---Level: Public
|
||||
---Purpose: Adds an entry in the font map <me>.
|
||||
-- Warning: Raises BadAccess if FontMap size is exceeded.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
AddEntry (me : mutable; aStyle : FontStyle from Aspect)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical font style entry in the font map <me>
|
||||
-- and returns the FontMapEntry Index if exist.
|
||||
-- Or add a new entry and returns the computed FontMapEntry index used.
|
||||
|
||||
Size( me ) returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Allocated fontmap Size
|
||||
|
||||
Index( me ; aFontmapIndex : Integer ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the FontMapEntry.Index of the FontMap
|
||||
-- at rank <aFontmapIndex> .
|
||||
raises BadAccess from Aspect is static;
|
||||
---Trigger: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
|
||||
Dump( me ) ;
|
||||
|
||||
Entry ( me ;
|
||||
AnIndex : Integer from Standard )
|
||||
returns FontMapEntry from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Returns the Font map entry with the index <AnIndex>.
|
||||
-- Warning: Raises BadAccess if the index less than 1
|
||||
-- or greater than Size.
|
||||
raises BadAccess from Aspect is static;
|
||||
|
||||
fields
|
||||
|
||||
mydata : SequenceOfFontMapEntry from Aspect is protected;
|
||||
|
||||
end FontMap ;
|
@ -1,116 +0,0 @@
|
||||
// Created on: 1993-09-14
|
||||
// Created by: GG
|
||||
// Copyright (c) 1993-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 Ensembles
|
||||
// de Fontures de texts
|
||||
|
||||
//-Warning Une FontMap est definie par un ensemble de FontMapEntries
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_FontMap.ixx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// mydata : SequenceOfFontMapEntry from Aspect is protected
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_FontMap::Aspect_FontMap( ) {
|
||||
Aspect_FontMapEntry theDefaultEntry;
|
||||
|
||||
AddEntry(theDefaultEntry);
|
||||
}
|
||||
|
||||
void Aspect_FontMap::AddEntry (const Aspect_FontMapEntry& AnEntry) {
|
||||
Standard_Integer i,index = AnEntry.Index();
|
||||
Aspect_FontMapEntry theEntry;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i);
|
||||
if( index == theEntry.Index() ) break;
|
||||
}
|
||||
|
||||
if( i > mydata.Length() ) {
|
||||
mydata.Append( AnEntry );
|
||||
} else {
|
||||
mydata.SetValue(i,AnEntry);
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_FontMap::AddEntry (const Aspect_FontStyle &aStyle) {
|
||||
Aspect_FontMapEntry theEntry ;
|
||||
Standard_Integer i,maxindex = 0 ;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i) ;
|
||||
maxindex = Max(maxindex,theEntry.Index()) ;
|
||||
if( theEntry.Type() == aStyle ) return theEntry.Index() ;
|
||||
}
|
||||
|
||||
maxindex++ ;
|
||||
theEntry.SetValue(maxindex,aStyle) ;
|
||||
mydata.Append( theEntry ) ;
|
||||
return maxindex ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_FontMap::Size() const {
|
||||
|
||||
return mydata.Length() ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_FontMap::Index(const Standard_Integer anIndex) const {
|
||||
|
||||
if( anIndex < 1 || anIndex > Size() ) {
|
||||
Aspect_BadAccess::Raise ("Undefined fontmap Index");
|
||||
}
|
||||
|
||||
Aspect_FontMapEntry theEntry = mydata.Value(anIndex) ;
|
||||
|
||||
return theEntry.Index() ;
|
||||
}
|
||||
|
||||
Aspect_FontMapEntry Aspect_FontMap::Entry (const Standard_Integer AnIndex) const {
|
||||
|
||||
if( AnIndex < 1 || AnIndex > mydata.Length() )
|
||||
Aspect_BadAccess::Raise ("Aspect_FontMap::Entry Bad Index");
|
||||
|
||||
return mydata.Value(AnIndex);
|
||||
}
|
||||
|
||||
void Aspect_FontMap::Dump () const {
|
||||
|
||||
Standard_Integer i ;
|
||||
|
||||
cout << "Fontmap Dump-->\n" ;
|
||||
|
||||
for ( i = 1 ; i <= Size() ; i++ ) (Entry(i)).Dump() ;
|
||||
|
||||
cout << "<--End Fontmap Dump\n" ;
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
-- Created on: 1993-09-07
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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 FontMapEntry from Aspect
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a fontmap entry.
|
||||
-- A fontmap entry is an association beetwen
|
||||
-- a FontStyle object and an index in the fontmap.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
FontStyle from Aspect
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns FontMapEntry from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates an unallocated fontmap entry
|
||||
|
||||
Create ( index : Integer from Standard;
|
||||
style : FontStyle from Aspect)
|
||||
returns FontMapEntry;
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated fontmap entry
|
||||
|
||||
Create ( entry : FontMapEntry from Aspect )
|
||||
returns FontMapEntry
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated fontmap entry.
|
||||
-- Warning: Raises error if the fontmap entry <entry> is unallocated.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
SetValue ( me: in out; index : Integer from Standard;
|
||||
style : FontStyle from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets fontmap entry value and allocates it.
|
||||
|
||||
SetValue ( me: in out; entry : FontMapEntry from Aspect);
|
||||
---Level: Public
|
||||
---Purpose: Sets fontmap entry value and allocates it.
|
||||
---C++: alias operator =
|
||||
|
||||
SetType ( me: in out; Style : FontStyle from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets the line style of fontmap entry.
|
||||
|
||||
Type ( me ) returns FontStyle from Aspect
|
||||
---Warning: Raises error if the fontmap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
---C++: return const &
|
||||
|
||||
SetIndex ( me: in out; index : Integer from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets index value of a fontmap entry.
|
||||
|
||||
Index ( me ) returns Integer from Standard
|
||||
---Warning: Raises error if the fontmap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
Free ( me : in out );
|
||||
---Level: Public
|
||||
---Purpose: Unallocates the fontmap entry.
|
||||
|
||||
IsAllocated ( me ) returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns True if the fontmap entry is allocated.
|
||||
-- Warning: A fontmap entry is allocated when the font and
|
||||
-- the index is defined.
|
||||
|
||||
Dump( me ) ;
|
||||
fields
|
||||
|
||||
MyType : FontStyle from Aspect;
|
||||
MyIndex : Integer from Standard;
|
||||
MyTypeIsDef : Boolean from Standard;
|
||||
MyIndexIsDef : Boolean from Standard;
|
||||
|
||||
end FontMapEntry from Aspect;
|
@ -1,167 +0,0 @@
|
||||
// Created on: 1993-09-14
|
||||
// Created by: GG
|
||||
// Copyright (c) 1993-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 Entries de
|
||||
// Fontures de texts
|
||||
|
||||
//-Warning Une entry est definie par un index associee a une Font style
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_FontMapEntry.ixx>
|
||||
#include <Aspect_Units.hxx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// MyType : FontStyle from Aspect
|
||||
// MyIndex : Integer from Standard
|
||||
// MyTypeIsDef : Boolean from Standard
|
||||
// MyIndexIsDef : Boolean from Standard
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_FontMapEntry::Aspect_FontMapEntry() {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = 0;
|
||||
MyType.SetValues (Aspect_TOF_DEFAULT,3.0 MILLIMETER);
|
||||
|
||||
}
|
||||
|
||||
Aspect_FontMapEntry::Aspect_FontMapEntry (const Standard_Integer index, const Aspect_FontStyle &style) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
MyType = style;
|
||||
|
||||
}
|
||||
|
||||
Aspect_FontMapEntry::Aspect_FontMapEntry (const Aspect_FontMapEntry& entry) {
|
||||
|
||||
if ( !entry.MyTypeIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated FontMapEntry") ;
|
||||
}
|
||||
else {
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = entry.MyIndex;
|
||||
MyType = entry.MyType;
|
||||
}
|
||||
}
|
||||
|
||||
void Aspect_FontMapEntry::SetValue (const Standard_Integer index, const Aspect_FontStyle &style) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
MyType = style;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_FontMapEntry::SetValue (const Aspect_FontMapEntry& entry) {
|
||||
|
||||
if ( !entry.MyTypeIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated FontMapEntry") ;
|
||||
}
|
||||
else {
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = entry.MyIndex;
|
||||
MyType = entry.MyType;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Aspect_FontMapEntry::SetType (const Aspect_FontStyle &style) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyType = style;
|
||||
|
||||
}
|
||||
|
||||
const Aspect_FontStyle& Aspect_FontMapEntry::Type () const {
|
||||
|
||||
if ( !MyTypeIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated FontMapEntry") ;
|
||||
|
||||
return MyType;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_FontMapEntry::SetIndex (const Standard_Integer index) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_FontMapEntry::Index () const {
|
||||
|
||||
if ( !MyTypeIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated FontMapEntry");
|
||||
|
||||
return MyIndex;
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_FontMapEntry::IsAllocated () const {
|
||||
|
||||
return ( MyTypeIsDef && MyIndexIsDef ) ;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_FontMapEntry::Free () {
|
||||
|
||||
MyTypeIsDef = Standard_False;
|
||||
MyIndexIsDef = Standard_False;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_FontMapEntry::Dump () const
|
||||
{
|
||||
Aspect_TypeOfFont style = MyType.Style();
|
||||
Standard_CString string = MyType.Value();
|
||||
Standard_Real size = MyType.Size();
|
||||
Standard_Real slant = MyType.Slant();
|
||||
Standard_Integer length = MyType.Length();
|
||||
Standard_Boolean capsheight = MyType.CapsHeight();
|
||||
|
||||
cout << " Aspect_FontMapEntry::Dump ()\n";
|
||||
cout << " MyTypeIsDef : " << (MyTypeIsDef ? "True\n" : "False\n");
|
||||
cout << " MyIndexIsDef : " << (MyIndexIsDef ? "True\n" : "False\n");
|
||||
cout << " FontStyle : " << (Standard_Integer) style << " Size : " << size
|
||||
<< " Slant : " << slant << endl;
|
||||
cout << " CapsHeight : " << (capsheight ? "True\n" : "False\n");
|
||||
cout << " FontStyle length : " << length << "\n";
|
||||
if( length ) cout << " FontString : " << string << "\n";
|
||||
MyType.Dump ();
|
||||
cout << " ------------------------------" << endl << flush;
|
||||
}
|
@ -1,371 +0,0 @@
|
||||
-- Created on: 1993-09-07
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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 FontStyle from Aspect
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class defines a Font Style.
|
||||
-- The Style can be Predefined or defined by the user
|
||||
|
||||
---Keywords: FontStyle
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
Length from Quantity,
|
||||
PlaneAngle from Quantity,
|
||||
TypeOfFont from Aspect,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises
|
||||
|
||||
FontStyleDefinitionError from Aspect
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns FontStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates a font style with the default values of
|
||||
-- FontStyle type : DEFAULT
|
||||
--
|
||||
raises FontStyleDefinitionError from Aspect;
|
||||
-- if the maximum number of font style is exceeded
|
||||
|
||||
Create ( Type : TypeOfFont from Aspect;
|
||||
Size : Length from Quantity;
|
||||
Slant : PlaneAngle from Quantity = 0.0;
|
||||
CapsHeight : Boolean from Standard = Standard_False)
|
||||
returns FontStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates the font style <Type> depending of
|
||||
-- Size given in the basic LENGTH unit and Slant in
|
||||
-- the basic PLANE ANGLE unit.
|
||||
-- When CapsHeight is TRUE the size defines the
|
||||
-- ascent height of the font;if FALSE,the size
|
||||
-- defines the ascent+descent part of the font.
|
||||
raises FontStyleDefinitionError from Aspect;
|
||||
-- if the Size is <= 0.
|
||||
|
||||
Create ( Style : CString from Standard;
|
||||
Size : Length from Quantity;
|
||||
Slant : PlaneAngle from Quantity = 0.0;
|
||||
CapsHeight : Boolean from Standard = Standard_False)
|
||||
returns FontStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates a font style from Adobe font style descriptor
|
||||
-- depending of Size given in MM and Slant in RADIAN.
|
||||
-- When CapsHeight is TRUE the size defines the
|
||||
-- ascent height of the font;if FALSE,the size
|
||||
-- defines the ascent+descent part of the font.
|
||||
-- Font Style Descriptor must be :
|
||||
-- Simple form is "family" Ex: "helvetica"
|
||||
-- More complex form is "family-weight" Ex: "helvetica-bold"
|
||||
-- Full form is :
|
||||
-- "-foundry-family-weight-slant-swdth-adstyl-pixelsize"
|
||||
-- "-pointsize-resx-resy-spacing-avgWidth-registry-encoding"
|
||||
-- where each field must be replaced by an "*"
|
||||
-- Warning: create the smalest font size if the foundry height
|
||||
--and the <Size> are null.
|
||||
raises FontStyleDefinitionError from Aspect;
|
||||
-- if <Style> is empty or don't have an normalized X format
|
||||
|
||||
Create ( Style : CString from Standard)
|
||||
returns FontStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates a transformable font with the full font name <Style>
|
||||
-- given in the XLFD descriptor :
|
||||
-- "-foundry-family-weight-slant-swidth-adstyl-pixelsize-pointsize-
|
||||
-- resx-resy-spacing-avdWidth-registry-encoding".
|
||||
-- The fields pixelsize ,pointsize,resx,resy are sets to 0
|
||||
-- and all unknown fields sets to '*'.
|
||||
-- Example: "adobe-helvetica-bold-*-*-*-0-0-0-0-*-*-iso8859-*"
|
||||
-- Warning: the height and slant of the font is supposed to be NULL
|
||||
-- and computed dynamically at the drawing text time.
|
||||
raises FontStyleDefinitionError from Aspect;
|
||||
---Trigger: If <Style> is empty or dont't have an XLFD font descriptor.
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
Assign ( me : in out ;
|
||||
Other : FontStyle from Aspect )
|
||||
returns FontStyle from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Updates the font style <me> from the definition of the
|
||||
-- font style <Other>.
|
||||
---Category: Methods to modify the class definition
|
||||
---C++: alias operator =
|
||||
---C++: return &
|
||||
|
||||
SetValues ( me : in out ;
|
||||
Type : TypeOfFont from Aspect;
|
||||
Size : Length from Quantity;
|
||||
Slant : PlaneAngle from Quantity = 0.0;
|
||||
CapsHeight : Boolean from Standard = Standard_False)
|
||||
---Level: Public
|
||||
---Purpose: Updates the font style <me> from the definition of the
|
||||
-- font style <Type>.
|
||||
raises FontStyleDefinitionError from Aspect;
|
||||
-- if the Size is <= 0.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetValues ( me : in out ;
|
||||
Style : CString from Standard;
|
||||
Size : Length from Quantity;
|
||||
Slant : PlaneAngle from Quantity = 0.0;
|
||||
CapsHeight : Boolean from Standard = Standard_False)
|
||||
---Level: Public
|
||||
---Purpose: Updates a font style with the new Abode font descriptor
|
||||
-- Warning: create the smalest font size if the foundry height
|
||||
--and the <Size> are null.
|
||||
raises FontStyleDefinitionError from Aspect;
|
||||
---Trigger: If <Style> is empty or dont't have an normalized X format.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetValues ( me : in out ;
|
||||
Style : CString from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Updates a font style with the new XLFD font descriptor
|
||||
raises FontStyleDefinitionError from Aspect;
|
||||
---Trigger: If <Style> is empty or dont't have an XLFD font descriptor.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetFamily (me : in out;
|
||||
aName: CString from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets the family of the font.
|
||||
|
||||
SetWeight (me : in out;
|
||||
aName: CString from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets the weight of the font.
|
||||
|
||||
SetRegistry (me : in out;
|
||||
aName: CString from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets the registry of the font.
|
||||
|
||||
SetEncoding (me : in out;
|
||||
aName: CString from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets the encoding of the font.
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
Style ( me )
|
||||
returns TypeOfFont from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Returns the type of the font style <me>
|
||||
---Category: Inquire methods
|
||||
|
||||
Length ( me )
|
||||
returns Integer from Standard ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the string components length of the
|
||||
-- font style descriptor
|
||||
---Category: Inquire methods
|
||||
|
||||
Value ( me )
|
||||
returns CString from Standard ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the String component of a font style
|
||||
---Category: Inquire methods
|
||||
|
||||
Size ( me )
|
||||
returns Length from Quantity ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Size component of a font style
|
||||
---Category: Inquire methods
|
||||
|
||||
Slant ( me )
|
||||
returns PlaneAngle from Quantity ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Slant component of a font style
|
||||
---Category: Inquire methods
|
||||
|
||||
CapsHeight( me )
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the CapsHeight component of a font style
|
||||
---Category: Inquire methods
|
||||
|
||||
AliasName (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns a shorter font name which identify the
|
||||
-- main characteristics of the fonts.
|
||||
---Example: "helvetica-bold"
|
||||
|
||||
FullName (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the full normalized font name
|
||||
|
||||
Foundry (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the foundry of the font.
|
||||
---Example: "adobe"
|
||||
|
||||
Family (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the family of the font.
|
||||
---Example: "helvetica"
|
||||
|
||||
Weight (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the weight of the font.
|
||||
---Example: "bold"
|
||||
|
||||
Registry (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the char set registry of the font.
|
||||
---Example: "iso8859"
|
||||
|
||||
Encoding (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the char set encoding of the font.
|
||||
---Example: "1"
|
||||
|
||||
SSlant (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the slant of the font.
|
||||
---Example: "i"
|
||||
|
||||
SWidth (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the width name of the font.
|
||||
---Example: "normal"
|
||||
|
||||
SStyle (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the style name of the font.
|
||||
---Example: "serif"
|
||||
|
||||
SPixelSize (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the pixel size of the font.
|
||||
|
||||
SPointSize (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the point size of the font.
|
||||
|
||||
SResolutionX (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the resolution X of the font.
|
||||
|
||||
SResolutionY (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the resolution Y of the font.
|
||||
|
||||
SSpacing (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the spacing of the font.
|
||||
---Example: "p"
|
||||
|
||||
SAverageWidth (me)
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the average width of the font.
|
||||
---Example: "90"
|
||||
|
||||
Dump (me);
|
||||
---Level: Public
|
||||
---Purpose: Dumps the font attributes.
|
||||
|
||||
|
||||
IsEqual(me; Other : FontStyle from Aspect) returns Boolean;
|
||||
---C++: alias operator==
|
||||
|
||||
IsNotEqual(me; Other : FontStyle from Aspect) returns Boolean;
|
||||
---C++: alias operator!=
|
||||
|
||||
----------------------------
|
||||
-- Category: Private methods
|
||||
----------------------------
|
||||
|
||||
SetPredefinedStyle ( me : in out ;
|
||||
Type : TypeOfFont from Aspect;
|
||||
Size : Length from Quantity;
|
||||
Slant : PlaneAngle from Quantity;
|
||||
CapsHeight : Boolean from Standard)
|
||||
---Level: Internal
|
||||
---Purpose: Set MyFontString with the predefined style value
|
||||
-- and size according of type
|
||||
---Category: Private methods
|
||||
raises FontStyleDefinitionError from Aspect is private;
|
||||
-- if the Type is USERDEFINED !
|
||||
|
||||
Normalize (myclass;
|
||||
aFontName: CString from Standard;
|
||||
aSize: in out Real from Standard)
|
||||
returns CString from Standard is private;
|
||||
---Purpose: Returns a normalized descriptor from the font name
|
||||
-- <aFontName>
|
||||
|
||||
Field (myclass;
|
||||
aFontName: AsciiString from TCollection;
|
||||
aRank: Integer from Standard)
|
||||
returns CString from Standard is private;
|
||||
---Purpose: Returns the field at position <aRank>
|
||||
-- from the font name <aFontName>.
|
||||
|
||||
SetField (myclass;
|
||||
aFontName: AsciiString from TCollection;
|
||||
aField: CString from Standard;
|
||||
aRank: Integer from Standard)
|
||||
returns CString from Standard is private;
|
||||
---Purpose: Sets the field at position <aRank>
|
||||
-- of the fontname <aFontName>
|
||||
-- from the field name <aField>.
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Aspect_FontStyle
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to font styles
|
||||
--
|
||||
|
||||
MyFontType : TypeOfFont from Aspect is protected;
|
||||
MyStyle : AsciiString from TCollection is protected;
|
||||
MyFontName : AsciiString from TCollection is protected;
|
||||
MyFontSize : Real from Standard is protected;
|
||||
MyFontSlant : Real from Standard is protected;
|
||||
MyCapsHeight : Boolean from Standard is protected;
|
||||
|
||||
end FontStyle;
|
@ -1,636 +0,0 @@
|
||||
// Created on: 1993-09-14
|
||||
// Created by: GG
|
||||
// Copyright (c) 1993-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.
|
||||
|
||||
//GG_040298 eliminer les variables statiques globales.
|
||||
|
||||
#define PRO5676 //GG_020197
|
||||
// Donner la possibillite d'exprimer la taille
|
||||
// par rapport a la hauteur totale du caractere ou par
|
||||
// rapport a la hauteur "ascent" situee au dessus de la
|
||||
// ligne de base.
|
||||
// (CapsHeight flag)
|
||||
|
||||
//GG_160498 etude G1343 gerer les polices transformables pour
|
||||
// l'utilisation de MFT_FontManager.
|
||||
|
||||
// =====================================================================
|
||||
// DCB_120598 study S3553. Platform specific code has been deleted
|
||||
// ("#ifdef WNT") to be able to use on WNT the same font descriptor
|
||||
// string like on UNIX.
|
||||
// =====================================================================
|
||||
|
||||
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Declaration des variables specifiques aux Fontures de textes
|
||||
|
||||
//-Warning Un style est definie, soit par son type predefini TOF_...
|
||||
// soit par sa description (Font string de type ADOBE)
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
#define MAXFIELDS 14
|
||||
#define PITCHSIZE (0.00028 METER);
|
||||
|
||||
// for the class
|
||||
#include <Aspect_FontStyle.ixx>
|
||||
#include <Aspect_Units.hxx>
|
||||
#include <stdio.h>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// MyFontType : TypeOfFont from Aspect;
|
||||
// MyStyle : AsciiString from TCollection
|
||||
// MyFontName : AsciiCString from TCollection
|
||||
// MyFontSize : Real from Standard
|
||||
// MyFontSlant : Real from Standard
|
||||
// MyCapsHeight : Boolean from Standard
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_FontStyle::Aspect_FontStyle () {
|
||||
|
||||
SetPredefinedStyle(Aspect_TOF_DEFAULT,0.003 METER,0.,Standard_False) ;
|
||||
}
|
||||
|
||||
Aspect_FontStyle::Aspect_FontStyle (const Aspect_TypeOfFont Type, const Quantity_Length Size, const Quantity_PlaneAngle Slant, const Standard_Boolean CapsHeight) {
|
||||
|
||||
SetPredefinedStyle(Type,Size,Slant,CapsHeight) ;
|
||||
}
|
||||
|
||||
Aspect_FontStyle::Aspect_FontStyle (const Standard_CString style, const Quantity_Length Size, const Quantity_PlaneAngle Slant, const Standard_Boolean CapsHeight) {
|
||||
|
||||
MyFontType = Aspect_TOF_USERDEFINED ;
|
||||
MyFontSize = Size;
|
||||
MyFontSlant = Slant;
|
||||
MyCapsHeight = CapsHeight;
|
||||
MyStyle = style;
|
||||
MyFontName = Normalize(style,MyFontSize) ;
|
||||
}
|
||||
|
||||
Aspect_FontStyle::Aspect_FontStyle (const Standard_CString style) {
|
||||
|
||||
MyFontType = Aspect_TOF_USERDEFINED ;
|
||||
MyFontSize = 0. ;
|
||||
MyFontSlant = 0. ;
|
||||
MyCapsHeight = Standard_False;
|
||||
MyStyle = style;
|
||||
MyFontName = Normalize(style,MyFontSize) ;
|
||||
}
|
||||
|
||||
Aspect_FontStyle& Aspect_FontStyle::Assign (const Aspect_FontStyle& Other) {
|
||||
|
||||
MyFontType = Other.Style() ;
|
||||
MyFontSize = Other.Size() ;
|
||||
MyFontSlant = Other.Slant() ;
|
||||
MyStyle = Other.Value();
|
||||
MyFontName = Other.FullName() ;
|
||||
MyCapsHeight = Other.CapsHeight() ;
|
||||
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void Aspect_FontStyle::SetValues ( const Aspect_TypeOfFont Type, const Quantity_Length Size, const Quantity_PlaneAngle Slant, const Standard_Boolean CapsHeight) {
|
||||
|
||||
SetPredefinedStyle (Type,Size,Slant,CapsHeight);
|
||||
}
|
||||
|
||||
void Aspect_FontStyle::SetValues ( const Standard_CString style, const Quantity_Length Size, const Quantity_PlaneAngle Slant, const Standard_Boolean CapsHeight) {
|
||||
MyFontType = Aspect_TOF_USERDEFINED ;
|
||||
MyFontSize = Size;
|
||||
MyFontSlant = Slant;
|
||||
MyCapsHeight = CapsHeight;
|
||||
MyStyle = style;
|
||||
MyFontName = Normalize(style,MyFontSize) ;
|
||||
}
|
||||
|
||||
void Aspect_FontStyle::SetValues ( const Standard_CString style) {
|
||||
MyFontType = Aspect_TOF_USERDEFINED ;
|
||||
MyFontSize = 0. ;
|
||||
MyFontSlant = 0. ;
|
||||
MyCapsHeight = Standard_False;
|
||||
MyStyle = style;
|
||||
MyFontName = Normalize(style,MyFontSize) ;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Sets the family of the font.
|
||||
// ============================================================================
|
||||
|
||||
void Aspect_FontStyle::SetFamily(const Standard_CString aName) {
|
||||
MyFontName = SetField(MyFontName,aName,2);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Sets the weight of the font.
|
||||
// ============================================================================
|
||||
|
||||
void Aspect_FontStyle::SetWeight(const Standard_CString aName) {
|
||||
MyFontName = SetField(MyFontName,aName,3);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Sets the Registry of the font.
|
||||
// ============================================================================
|
||||
|
||||
void Aspect_FontStyle::SetRegistry(const Standard_CString aName) {
|
||||
MyFontName = SetField(MyFontName,aName,13);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Sets the Encoding of the font.
|
||||
// ============================================================================
|
||||
|
||||
void Aspect_FontStyle::SetEncoding(const Standard_CString aName) {
|
||||
MyFontName = SetField(MyFontName,aName,14);
|
||||
}
|
||||
|
||||
Aspect_TypeOfFont Aspect_FontStyle::Style () const {
|
||||
|
||||
return (MyFontType);
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_FontStyle::Length () const {
|
||||
|
||||
return MyStyle.Length();
|
||||
}
|
||||
|
||||
Standard_CString Aspect_FontStyle::Value () const
|
||||
{
|
||||
return MyStyle.ToCString();
|
||||
}
|
||||
|
||||
Quantity_Length Aspect_FontStyle::Size () const {
|
||||
return (MyFontSize);
|
||||
}
|
||||
|
||||
Quantity_PlaneAngle Aspect_FontStyle::Slant () const {
|
||||
|
||||
return (MyFontSlant);
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_FontStyle::CapsHeight () const {
|
||||
|
||||
return (MyCapsHeight);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the alias font name.
|
||||
// -- this is a shorter font name which identify the
|
||||
// -- main characteristics of the fonts.
|
||||
// ---Example: "helvetica-bold"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::AliasName() const
|
||||
{
|
||||
static TCollection_AsciiString aliasname;
|
||||
aliasname.Clear();
|
||||
TCollection_AsciiString family(Family());
|
||||
if( family.Length() > 0 && family != "*" ) {
|
||||
TCollection_AsciiString FAMILY = family; FAMILY.UpperCase();
|
||||
family.SetValue(1,FAMILY.Value(1));
|
||||
aliasname = family;
|
||||
}
|
||||
TCollection_AsciiString weight(Weight());
|
||||
if( weight.Length() > 0 && weight != "*" ) {
|
||||
TCollection_AsciiString WEIGHT = weight; WEIGHT.UpperCase();
|
||||
if( WEIGHT == "NORMAL" ) {
|
||||
weight.Clear();
|
||||
} else {
|
||||
weight.SetValue(1,WEIGHT.Value(1));
|
||||
}
|
||||
} else weight.Clear();
|
||||
TCollection_AsciiString sslant(SSlant());
|
||||
if( sslant.Length() > 0 && sslant != "*" ) {
|
||||
if( sslant == "r" ) {
|
||||
sslant.Clear();
|
||||
} else if( sslant == "i" ) {
|
||||
weight += "Italic";
|
||||
sslant.Clear();
|
||||
} else if( sslant == "o" ) {
|
||||
weight += "Oblique";
|
||||
sslant.Clear();
|
||||
}
|
||||
} else sslant.Clear();
|
||||
if( weight.Length() > 0 ) {
|
||||
aliasname += '-'; aliasname += weight;
|
||||
}
|
||||
if( sslant.Length() > 0 ) {
|
||||
aliasname += '-'; aliasname += sslant;
|
||||
}
|
||||
TCollection_AsciiString swidth(SWidth());
|
||||
if( swidth.Length() > 0 && swidth != "*" ) {
|
||||
TCollection_AsciiString SWIDTH = swidth; SWIDTH.UpperCase();
|
||||
if( SWIDTH == "NORMAL" ) {
|
||||
} else {
|
||||
if( !weight.Length() ) aliasname += '-';
|
||||
aliasname += '-'; aliasname += swidth;
|
||||
}
|
||||
}
|
||||
return aliasname.ToCString();
|
||||
}
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the full normalized font name
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::FullName () const {
|
||||
|
||||
return (MyFontName.ToCString());
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the foundry of the font.
|
||||
// ---Example: "adobe"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::Foundry() const
|
||||
{
|
||||
return Field(MyFontName,1);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the family of the font.
|
||||
// ---Example: "helvetica"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::Family() const
|
||||
{
|
||||
return Field(MyFontName,2);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the weight of the font.
|
||||
// ---Example: "bold"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::Weight() const
|
||||
{
|
||||
return Field(MyFontName,3);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the char set registry of the font.
|
||||
// ---Example: "iso8859"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::Registry() const
|
||||
{
|
||||
return Field(MyFontName,13);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the char set encoding of the font.
|
||||
// ---Example: "1"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::Encoding() const
|
||||
{
|
||||
return Field(MyFontName,14);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the slant of the font.
|
||||
// ---Example: "i"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SSlant() const
|
||||
{
|
||||
return Field(MyFontName,4);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the width name of the font.
|
||||
// ---Example: "normal"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SWidth() const
|
||||
{
|
||||
return Field(MyFontName,5);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the style name of the font.
|
||||
// ---Example: "serif"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SStyle() const
|
||||
{
|
||||
return Field(MyFontName,6);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the pixel size of the font.
|
||||
// ---Example: "14"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SPixelSize() const
|
||||
{
|
||||
return Field(MyFontName,7);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the point size of the font.
|
||||
// ---Example: "140"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SPointSize() const
|
||||
{
|
||||
return Field(MyFontName,8);
|
||||
}
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the resolution X of the font.
|
||||
// ---Example: "75"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SResolutionX() const
|
||||
{
|
||||
return Field(MyFontName,9);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the resolution Y of the font.
|
||||
// ---Example: "75"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SResolutionY() const
|
||||
{
|
||||
return Field(MyFontName,10);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the spacing of the font.
|
||||
// ---Example: "p"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SSpacing() const
|
||||
{
|
||||
return Field(MyFontName,11);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the average width of the font.
|
||||
// ---Example: "90"
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SAverageWidth() const
|
||||
{
|
||||
return Field(MyFontName,12);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Dumps the font attributes.
|
||||
// ============================================================================
|
||||
|
||||
void Aspect_FontStyle::Dump() const
|
||||
{
|
||||
cout << ".Aspect_FontStyle::Dump() :" << endl;
|
||||
cout << "-----------------" << endl << endl;
|
||||
cout << " style name is : '" << this->Value() << "'" << endl;
|
||||
cout << " Normalized font name is : '" << this->FullName() << "'" << endl;
|
||||
cout << " Alias font name is : '" << this->AliasName() << "'" << endl;
|
||||
cout << " Foundry is : '" << this->Foundry() << "'" << endl;
|
||||
cout << " Family is : '" << this->Family() << "'" << endl;
|
||||
cout << " Weight is : '" << this->Weight() << "'" << endl;
|
||||
cout << " Slant is : '" << this->SSlant() << "'" << endl;
|
||||
cout << " Width is : '" << this->SWidth() << "'" << endl;
|
||||
cout << " Style is : '" << this->SStyle() << "'" << endl;
|
||||
cout << " PixelSize is : '" << this->SPixelSize() << "'" << endl;
|
||||
cout << " PointSize is : '" << this->SPointSize() << "'" << endl;
|
||||
cout << " ResolutionX is : '" << this->SResolutionX() << "'" << endl;
|
||||
cout << " ResolutionY is : '" << this->SResolutionY() << "'" << endl;
|
||||
cout << " Spacing is : '" << this->SSpacing() << "'" << endl;
|
||||
cout << " AverageWidth is : '" << this->SAverageWidth() << "'" << endl;
|
||||
cout << " Registry is : '" << this->Registry() << "'" << endl;
|
||||
cout << " Encoding is : '" << this->Encoding() << "'" << endl << endl;
|
||||
}
|
||||
|
||||
void Aspect_FontStyle::SetPredefinedStyle( const Aspect_TypeOfFont Type, const Quantity_Length Size, const Quantity_PlaneAngle Slant, const Standard_Boolean CapsHeight) {
|
||||
|
||||
if( Size <= 0. )
|
||||
Aspect_FontStyleDefinitionError::Raise ("Bad font Size");
|
||||
|
||||
MyFontType = Type ;
|
||||
MyFontSize = Size;
|
||||
MyFontSlant = Slant ;
|
||||
MyCapsHeight = CapsHeight;
|
||||
Standard_CString pstyle = "" ;
|
||||
switch ( Type ) {
|
||||
case Aspect_TOF_USERDEFINED :
|
||||
Aspect_FontStyleDefinitionError::Raise ("Bad Font Type Style");
|
||||
case Aspect_TOF_DEFAULT :
|
||||
pstyle = "Defaultfont" ;
|
||||
break ;
|
||||
case Aspect_TOF_COURIER :
|
||||
pstyle = "Courier" ;
|
||||
break ;
|
||||
case Aspect_TOF_HELVETICA :
|
||||
pstyle = "Helvetica" ;
|
||||
break ;
|
||||
case Aspect_TOF_TIMES :
|
||||
pstyle = "Times" ;
|
||||
break ;
|
||||
}
|
||||
MyStyle = pstyle;
|
||||
MyFontName = Normalize(pstyle,MyFontSize);
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_FontStyle::IsEqual(const Aspect_FontStyle& Other) const
|
||||
{
|
||||
return (
|
||||
(MyFontType == Other.MyFontType) &&
|
||||
(MyFontName.Length() == Other.MyFontName.Length()) &&
|
||||
(MyFontName == Other.MyFontName) &&
|
||||
(MyFontSize == Other.MyFontSize) &&
|
||||
(MyFontSlant == Other.MyFontSlant) &&
|
||||
(MyCapsHeight == Other.MyCapsHeight)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_FontStyle::IsNotEqual(const Aspect_FontStyle& Other) const
|
||||
{
|
||||
return !IsEqual(Other);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns a normalized XLFD descriptor from the font name
|
||||
// -- <aFontName>
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::Normalize(const Standard_CString aFontName,Standard_Real& aSize)
|
||||
{
|
||||
Aspect_FontStyleDefinitionError_Raise_if(
|
||||
!aFontName ,"NULL font descriptor");
|
||||
|
||||
static TCollection_AsciiString afontstring;
|
||||
static TCollection_AsciiString astar("*");
|
||||
static TCollection_AsciiString azero("0");
|
||||
TCollection_AsciiString afield,afontname(aFontName);
|
||||
Standard_CString pfontname = NULL;
|
||||
Standard_Boolean xlfd = Standard_False;
|
||||
Standard_Integer i,len = afontname.Length();
|
||||
|
||||
afontstring = "";
|
||||
|
||||
if( len <= 0 ) return pfontname;
|
||||
|
||||
if( afontname.Value(1) != '-' ) afontname.Prepend("-adobe-");
|
||||
for( i=1 ; i<=MAXFIELDS ; i++ ) {
|
||||
Standard_CString pfield = Field(afontname,i);
|
||||
switch (i) {
|
||||
case 1:
|
||||
if( pfield ) {
|
||||
afield = pfield; afield.LowerCase();
|
||||
{afontstring += '-'; afontstring += afield;}
|
||||
} else {
|
||||
afontstring += "-adobe";
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if( pfield ) {
|
||||
afield = pfield; afield.LowerCase();
|
||||
if( afield == astar ) {
|
||||
if( aSize > 0. ) afontstring += "-*";
|
||||
else {afontstring += "-0"; xlfd = Standard_True;}
|
||||
} else if( afield == azero ) { afontstring += "-0"; xlfd = Standard_True;}
|
||||
else {afontstring += '-'; afontstring += afield;}
|
||||
} else {
|
||||
if( aSize > 0. ) afontstring += "-*";
|
||||
else { afontstring += "-0"; xlfd = Standard_True;}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
if( xlfd ) {
|
||||
afontstring += "-0";
|
||||
} else if( pfield ) {
|
||||
afield = pfield; afield.LowerCase();
|
||||
afontstring += '-'; afontstring += afield;
|
||||
} else {
|
||||
afontstring += "-*";
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
if( pfield ) {
|
||||
afield = pfield; afield.LowerCase();
|
||||
afontstring += '-'; afontstring += afield;
|
||||
} else {
|
||||
afontstring += "-*";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if( pfield ) {
|
||||
afield = pfield;
|
||||
afontstring += '-'; afontstring += afield;
|
||||
} else {
|
||||
afontstring += "-*";
|
||||
}
|
||||
}
|
||||
}
|
||||
pfontname = afontstring.ToCString();
|
||||
if( aSize == 0. ) {
|
||||
Standard_CString psize = Field(pfontname,7);
|
||||
Standard_Integer isize;
|
||||
if( sscanf(psize,"%d",&isize) == 1 ) {
|
||||
aSize = isize*PITCHSIZE;
|
||||
} else {
|
||||
aSize = 2. MILLIMETER;
|
||||
}
|
||||
}
|
||||
|
||||
return pfontname;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Returns the field at position <aRank>
|
||||
// -- from the font name <aFontName>.
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::Field(const TCollection_AsciiString& aFontName,const Standard_Integer aRank)
|
||||
{
|
||||
static TCollection_AsciiString afieldstring;
|
||||
Standard_Integer length = aFontName.Length();
|
||||
Standard_CString pfield = NULL;
|
||||
|
||||
if( length > 0 && aRank >= 1 && aRank <= MAXFIELDS ) {
|
||||
Standard_Integer start = 1,end = 0;
|
||||
start = aFontName.Location(aRank,'-',1,length);
|
||||
end = aFontName.Location(aRank+1,'-',1,length);
|
||||
afieldstring = "";
|
||||
if( start > 0 && end > 0 ) {
|
||||
start++ ;
|
||||
end--;
|
||||
if( end >= start ) afieldstring = aFontName.SubString(start,end);
|
||||
else afieldstring = "";
|
||||
} else if( start > 0 ) {
|
||||
start++ ;
|
||||
end = length;
|
||||
if( end >= start ) afieldstring = aFontName.SubString(start,end);
|
||||
else afieldstring = "";
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
pfield = afieldstring.ToCString();
|
||||
|
||||
return pfield;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ---Purpose: Sets the field at position <aRank>
|
||||
// -- of the font <aFontName>
|
||||
// -- from the field <aField>.
|
||||
// ============================================================================
|
||||
|
||||
Standard_CString Aspect_FontStyle::SetField(const TCollection_AsciiString& aFontName,const Standard_CString aField,const Standard_Integer aRank)
|
||||
{
|
||||
static TCollection_AsciiString afontstring;
|
||||
Standard_Integer length = aFontName.Length();
|
||||
Standard_CString pfontname = NULL;
|
||||
|
||||
if( length > 0 && aRank >= 1 && aRank <= MAXFIELDS ) {
|
||||
Standard_Integer start = 1,end = 0;
|
||||
start = aFontName.Location(aRank,'-',1,length);
|
||||
end = aFontName.Location(aRank+1,'-',1,length);
|
||||
TCollection_AsciiString lowername(""),uppername("");
|
||||
if( start > 0 && end > 0 ) {
|
||||
if( end > start ) {
|
||||
if( start > 1 ) lowername = aFontName.SubString(1,start);
|
||||
uppername = aFontName.SubString(end,length);
|
||||
}
|
||||
} else if( start > 1 ) {
|
||||
lowername = aFontName.SubString(1,start);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
afontstring = lowername;
|
||||
afontstring += aField; afontstring += uppername;
|
||||
pfontname = afontstring.ToCString();
|
||||
}
|
||||
|
||||
return pfontname;
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
-- Created on: 1993-03-23
|
||||
-- Created by: BBL
|
||||
-- Copyright (c) 1993-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 GenericColorMap from Aspect inherits ColorMap from Aspect
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Level: Public
|
||||
---Purpose: This class defines a GenericColorMap object.
|
||||
-- Associates an index and a color.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
Color from Quantity,
|
||||
TypeOfColorMap from Aspect,
|
||||
ColorMapEntry from Aspect,
|
||||
DataMapOfIntegerInteger from TColStd
|
||||
|
||||
raises
|
||||
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns GenericColorMap from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates a generic ColorMap .
|
||||
|
||||
AddEntry (me : mutable; AnEntry : ColorMapEntry from Aspect)
|
||||
---Level: Public
|
||||
---Purpose: Adds an entry in the color map <me>.
|
||||
-- Warning: Raises BadAccess if the ColorMapEntry index is alreadry
|
||||
-- defined.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
AddEntry (me : mutable; aColor : Color from Quantity)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical color entry in the color map <me>
|
||||
-- and returns the ColorMapEntry Index if exist.
|
||||
-- Or add a new entry and returns the computed ColorMapEntry index used.
|
||||
RemoveEntry ( me: mutable;
|
||||
AColorMapEntryIndex : Integer from Standard )
|
||||
raises BadAccess from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Remove the ColorMapEntry at position index in the ColorMap
|
||||
-- Warning: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
|
||||
FindColorMapIndex ( me ; AColorMapEntryIndex : Integer from Standard )
|
||||
returns Integer from Standard
|
||||
raises BadAccess from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the
|
||||
-- ColorMapEntry.Index() equal to <AnEntryIndex>.
|
||||
-- Warning: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
|
||||
FindEntry ( me ; AColorMapEntryIndex : Integer from Standard )
|
||||
returns ColorMapEntry from Aspect
|
||||
raises BadAccess from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index()
|
||||
-- equal to <AnEntryIndex>.
|
||||
-- Warning: Raises BadAccess if the index is not defined in the
|
||||
-- ColorMap.
|
||||
---C++: return const &
|
||||
|
||||
NearestColorMapIndex( me ; aColor : Color from Quantity )
|
||||
returns Integer from Standard ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the index in the ColorMap of the
|
||||
-- nearest matching ColorMapEntry
|
||||
|
||||
NearestEntry( me ; aColor : Color from Quantity )
|
||||
returns ColorMapEntry from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Returns the nearest ColorMapEntry that match aColor .
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
|
||||
myDataMap : DataMapOfIntegerInteger from TColStd is protected;
|
||||
|
||||
end GenericColorMap;
|
@ -1,138 +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.
|
||||
|
||||
#define IMP080300 //GG Add protection on FindColorMapIndex()
|
||||
|
||||
#define IMP060400 //GG Take in account the Hue of the color
|
||||
// for computing the nearest color index.
|
||||
|
||||
#include <Aspect_GenericColorMap.ixx>
|
||||
#include <Aspect_ColorMapEntry.hxx>
|
||||
|
||||
Aspect_GenericColorMap::Aspect_GenericColorMap ():Aspect_ColorMap (Aspect_TOC_Generic) {
|
||||
Aspect_ColorMapEntry theDefaultEntry;
|
||||
|
||||
AddEntry(theDefaultEntry);
|
||||
}
|
||||
|
||||
void Aspect_GenericColorMap::AddEntry (const Aspect_ColorMapEntry& AnEntry) {
|
||||
Standard_Integer index = AnEntry.Index();
|
||||
|
||||
if ( myDataMap.IsBound( index ) ) {
|
||||
Standard_Integer i = myDataMap( index ) ;
|
||||
mydata.SetValue( i , AnEntry ) ;
|
||||
} else {
|
||||
mydata.Append( AnEntry ) ;
|
||||
myDataMap.Bind( index , mydata.Length() ) ;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_GenericColorMap::AddEntry (const Quantity_Color &aColor) {
|
||||
Aspect_ColorMapEntry theEntry ;
|
||||
Standard_Integer i,maxindex = 0 ;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i) ;
|
||||
maxindex = Max(maxindex,theEntry.Index()) ;
|
||||
if( theEntry.Color() == aColor ) return theEntry.Index() ;
|
||||
}
|
||||
|
||||
maxindex++ ;
|
||||
theEntry.SetValue(maxindex,aColor) ;
|
||||
mydata.Append( theEntry ) ;
|
||||
myDataMap.Bind( maxindex , mydata.Length() ) ;
|
||||
return maxindex ;
|
||||
}
|
||||
|
||||
void Aspect_GenericColorMap::RemoveEntry (const Standard_Integer index) {
|
||||
|
||||
mydata.Remove( index ) ;
|
||||
}
|
||||
|
||||
const Aspect_ColorMapEntry& Aspect_GenericColorMap::NearestEntry(
|
||||
const Quantity_Color& color ) const
|
||||
|
||||
{
|
||||
return( Entry( NearestColorMapIndex( color ) ) ) ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_GenericColorMap::NearestColorMapIndex(
|
||||
const Quantity_Color& color ) const
|
||||
|
||||
{
|
||||
|
||||
Standard_Real dist ;
|
||||
struct {
|
||||
Standard_Real dist ;
|
||||
Standard_Integer index ;
|
||||
} nearest;
|
||||
|
||||
nearest.dist = 0. ;
|
||||
nearest.index = 0 ;
|
||||
|
||||
#ifdef IMP060400
|
||||
Standard_Integer ehue,hue = (color.Hue() < 0.) ? -1 :
|
||||
Standard_Integer(color.Hue())/60;
|
||||
#endif
|
||||
|
||||
Quantity_Color ecolor;
|
||||
|
||||
if ( Size() == 0 )
|
||||
Aspect_BadAccess::Raise ("NearestColorMapIndex() ColorMap is empty.");
|
||||
|
||||
for ( Standard_Integer i = 1 ; i <= Size() ; i++ ) {
|
||||
if ( Entry(i).IsAllocated() ) {
|
||||
ecolor = Entry(i).Color();
|
||||
dist = color.SquareDistance( ecolor ) ;
|
||||
#ifdef IMP060400
|
||||
ehue = (ecolor.Hue() < 0.) ? -1 : Standard_Integer(ecolor.Hue())/60;
|
||||
if ( (nearest.index == 0) ||
|
||||
((dist < nearest.dist) && (hue == ehue)) ) {
|
||||
#else
|
||||
if ( nearest.index == 0 || dist < nearest.dist ) {
|
||||
#endif
|
||||
nearest.index = i ;
|
||||
nearest.dist = dist ;
|
||||
#ifdef IMP060400
|
||||
if( dist == 0.0 ) break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( nearest.index == 0 )
|
||||
Aspect_BadAccess::Raise ("NearestEntryIndex() ColorMap is empty.");
|
||||
|
||||
return( nearest.index ) ;
|
||||
}
|
||||
|
||||
const Aspect_ColorMapEntry& Aspect_GenericColorMap::FindEntry(
|
||||
const Standard_Integer ColorEntryIndex ) const
|
||||
|
||||
{
|
||||
return( Entry( FindColorMapIndex( ColorEntryIndex ) ) ) ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_GenericColorMap::FindColorMapIndex(
|
||||
const Standard_Integer ColorEntryIndex ) const
|
||||
{
|
||||
Standard_Integer index = 0;
|
||||
#ifdef IMP080300
|
||||
if( myDataMap.IsBound( ColorEntryIndex ) )
|
||||
index = myDataMap.Find( ColorEntryIndex );
|
||||
#else
|
||||
index = myDataMap ( ColorEntryIndex );
|
||||
#endif
|
||||
return index;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
// Created on: 2001-01-26
|
||||
// Created by: SPK
|
||||
// Copyright (c) 2001-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 _Aspect_IFStream_HeaderFile
|
||||
#define _Aspect_IFStream_HeaderFile
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
typedef std::ifstream* Aspect_IFStream;
|
||||
|
||||
#endif
|
@ -1,54 +0,0 @@
|
||||
-- Created on: 1993-07-23
|
||||
-- Created by: Jean Louis FRENKEL
|
||||
-- Copyright (c) 1993-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 IndexPixel from Aspect inherits Pixel from Aspect
|
||||
|
||||
is
|
||||
Create
|
||||
returns IndexPixel from Aspect;
|
||||
|
||||
Create (anIndex: Integer from Standard)
|
||||
returns IndexPixel from Aspect;
|
||||
|
||||
Value(me)
|
||||
returns Integer from Standard
|
||||
is static ;
|
||||
|
||||
SetValue(me: in out; anIndex: Integer from Standard) is static ;
|
||||
|
||||
HashCode (me; Upper : Integer )
|
||||
returns Integer
|
||||
is redefined static ;
|
||||
---Level: Public
|
||||
---Purpose: Returns a hashed value denoting <me>. This value is in
|
||||
-- the range 1..<Upper>.
|
||||
---C++: function call
|
||||
|
||||
Print( me ; s : in out OStream )
|
||||
is redefined static ;
|
||||
---Level: Public
|
||||
---Purpose : Prints the contents of <me> on the stream <s>
|
||||
|
||||
IsEqual(me; Other : IndexPixel from Aspect) returns Boolean;
|
||||
---C++: alias operator==
|
||||
|
||||
IsNotEqual(me; Other : IndexPixel from Aspect) returns Boolean;
|
||||
---C++: alias operator!=
|
||||
|
||||
fields
|
||||
myIndex: Integer from Standard;
|
||||
|
||||
end IndexPixel from Aspect;
|
@ -1,68 +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.
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
#include <Aspect_IndexPixel.ixx>
|
||||
|
||||
Aspect_IndexPixel::Aspect_IndexPixel () {
|
||||
|
||||
myIndex = 0;
|
||||
|
||||
}
|
||||
|
||||
Aspect_IndexPixel::Aspect_IndexPixel (const Standard_Integer anIndex) {
|
||||
|
||||
myIndex = anIndex;
|
||||
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_IndexPixel::Value() const {
|
||||
|
||||
return myIndex;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Aspect_IndexPixel::SetValue(const Standard_Integer anIndex) {
|
||||
|
||||
myIndex = anIndex;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_IndexPixel::Print(Standard_OStream& s) const
|
||||
|
||||
{
|
||||
s << dec << setw(4) << myIndex;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Hascode : Computes a hascoding value for a given Aspect_IndexPixel
|
||||
// ------------------------------------------------------------------
|
||||
Standard_Integer Aspect_IndexPixel::HashCode(const Standard_Integer Upper) const
|
||||
{
|
||||
return ( myIndex % Upper ) + 1 ;
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean Aspect_IndexPixel::IsEqual(const Aspect_IndexPixel& Other) const
|
||||
{
|
||||
return (myIndex == Other.myIndex);
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_IndexPixel::IsNotEqual(const Aspect_IndexPixel& Other) const
|
||||
{
|
||||
return !IsEqual(Other);
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
-- Created on: 1993-09-07
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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.
|
||||
|
||||
-- Updated: JLF (Reason LineStyle MUST be given in METER ) 2 Mars 94
|
||||
|
||||
class LineStyle from Aspect
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class allows the definition of a Line Style.
|
||||
-- The Style can be Predefined or defined by the user
|
||||
|
||||
---Keywords: LineStyle
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
TypeOfLine from Aspect,
|
||||
Array1OfLength from TColQuantity,
|
||||
HArray1OfLength from TColQuantity
|
||||
|
||||
raises
|
||||
LineStyleDefinitionError from Aspect
|
||||
|
||||
is
|
||||
Create
|
||||
returns LineStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates a line style with the default value of
|
||||
-- LineStyle type : SOLID
|
||||
--
|
||||
raises LineStyleDefinitionError from Aspect;
|
||||
-- if the maximum number of line style is exceeded
|
||||
|
||||
Create ( Type : TypeOfLine from Aspect )
|
||||
returns LineStyle from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Creates the line style <Type>.
|
||||
|
||||
Create ( Style : Array1OfLength from TColQuantity )
|
||||
returns LineStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates a line style from METER Float style descriptor .
|
||||
-- Style Descriptor is :
|
||||
-- Each Odd float described the Drawn part of the style .
|
||||
-- Each Even float described the Hidden part of the style .
|
||||
-- (e.g) [0.010,0.002,0.005,0.004]
|
||||
-- Draw 10 MM ,Move 2 MM,Draw 5 MM ..
|
||||
raises LineStyleDefinitionError from Aspect;
|
||||
-- if the METER float values are <= 0.
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
Assign ( me : in out ;
|
||||
Other : LineStyle from Aspect )
|
||||
returns LineStyle from Aspect is static;
|
||||
---Level: Public
|
||||
---Purpose: Updates the line style <me> from the definition of the
|
||||
-- line style <Other>.
|
||||
---Category: Methods to modify the class definition
|
||||
---C++: alias operator =
|
||||
---C++: return &
|
||||
|
||||
SetValues ( me : in out ;
|
||||
Type : TypeOfLine from Aspect ) is static;
|
||||
---Level: Public
|
||||
---Purpose: Updates the line style <me> from the definition of the
|
||||
-- line style <Type>.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetValues ( me : in out ;
|
||||
Style : Array1OfLength from TColQuantity )
|
||||
---Level: Public
|
||||
---Purpose: Updates a line style with the new Float descriptor
|
||||
raises LineStyleDefinitionError from Aspect is static;
|
||||
-- if the METER float values are <= 0.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
Style ( me )
|
||||
returns TypeOfLine from Aspect is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the type of the line style <me>
|
||||
---Category: Inquire methods
|
||||
|
||||
Length ( me )
|
||||
returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the components length of the line style
|
||||
---Category: Inquire methods
|
||||
|
||||
Values ( me )
|
||||
returns Array1OfLength from TColQuantity is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the components of a line style
|
||||
---Category: Inquire methods
|
||||
---C++: return const &
|
||||
|
||||
IsEqual(me; Other : LineStyle from Aspect) returns Boolean;
|
||||
---C++: alias operator==
|
||||
|
||||
IsNotEqual(me; Other : LineStyle from Aspect) returns Boolean;
|
||||
---C++: alias operator!=
|
||||
|
||||
----------------------------
|
||||
-- Category: Private methods
|
||||
----------------------------
|
||||
|
||||
PredefinedStyle ( me : in out ;
|
||||
Type : TypeOfLine from Aspect )
|
||||
---Level: Internal
|
||||
---Purpose: Set MyLineDescriptor with the predefined style values
|
||||
-- according of type
|
||||
---Category: Private methods
|
||||
returns HArray1OfLength from TColQuantity is static private;
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Aspect_LineStyle
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to line styles
|
||||
--
|
||||
|
||||
MyLineType : TypeOfLine from Aspect;
|
||||
MyLineDescriptor : HArray1OfLength from TColQuantity;
|
||||
|
||||
end LineStyle;
|
@ -1,174 +0,0 @@
|
||||
// Created on: 1992-09-14
|
||||
// Created by: GG
|
||||
// Copyright (c) 1992-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 Type de traits
|
||||
|
||||
//-Warning Un style est definie, soit par son type predefini TOL_...
|
||||
// soit par sa description en METRE
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_LineStyle.ixx>
|
||||
#include <Aspect_Units.hxx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// MyLineType : TypeOfLine from Aspect;
|
||||
// MyLineDescriptor : HArray1OfReal from TColStd;
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_LineStyle::Aspect_LineStyle () : MyLineDescriptor(PredefinedStyle(Aspect_TOL_SOLID)) {
|
||||
}
|
||||
|
||||
Aspect_LineStyle::Aspect_LineStyle (const Aspect_TypeOfLine Type) : MyLineDescriptor(PredefinedStyle(Type)) {
|
||||
}
|
||||
|
||||
Aspect_LineStyle::Aspect_LineStyle (const TColQuantity_Array1OfLength& UserDefinedStyle) {
|
||||
Standard_Integer i ;
|
||||
|
||||
MyLineType = Aspect_TOL_USERDEFINED ;
|
||||
// Modif CAL 8/2/95
|
||||
MyLineDescriptor = new TColQuantity_HArray1OfLength
|
||||
(UserDefinedStyle.Lower(), UserDefinedStyle.Upper()) ;
|
||||
|
||||
for( i=UserDefinedStyle.Lower() ; i<=UserDefinedStyle.Upper() ; i++ ) {
|
||||
// Modif CAL 8/2/95
|
||||
MyLineDescriptor->SetValue(i, UserDefinedStyle(i)) ;
|
||||
if( UserDefinedStyle(i) <= 0. )
|
||||
Aspect_LineStyleDefinitionError::Raise ("Bad Descriptor") ;
|
||||
}
|
||||
}
|
||||
|
||||
Aspect_LineStyle& Aspect_LineStyle::Assign (const Aspect_LineStyle& Other) {
|
||||
Standard_Integer i ;
|
||||
|
||||
// Modif CAL 8/2/95
|
||||
MyLineDescriptor = new TColQuantity_HArray1OfLength
|
||||
((Other.Values()).Lower(), (Other.Values()).Upper()) ;
|
||||
MyLineType = Other.MyLineType ;
|
||||
|
||||
if( MyLineType != Aspect_TOL_SOLID ) {
|
||||
for( i=MyLineDescriptor->Lower() ;
|
||||
i<=MyLineDescriptor->Upper() ; i++ ){
|
||||
// Modif CAL 8/2/95
|
||||
MyLineDescriptor->SetValue(i, (Other.Values())(i)) ;
|
||||
if( (Other.Values())(i) <= 0. )
|
||||
Aspect_LineStyleDefinitionError::Raise ("Bad Descriptor") ;
|
||||
}
|
||||
}
|
||||
|
||||
return (*this);
|
||||
|
||||
}
|
||||
|
||||
void Aspect_LineStyle::SetValues (const Aspect_TypeOfLine Type) {
|
||||
|
||||
MyLineDescriptor = PredefinedStyle(Type) ;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_LineStyle::SetValues (const TColQuantity_Array1OfLength& UserDefinedStyle) {
|
||||
Standard_Integer i ;
|
||||
|
||||
// Modif CAL 8/2/95
|
||||
MyLineDescriptor = new TColQuantity_HArray1OfLength
|
||||
(UserDefinedStyle.Lower(), UserDefinedStyle.Upper()) ;
|
||||
MyLineType = Aspect_TOL_USERDEFINED ;
|
||||
|
||||
for( i=UserDefinedStyle.Lower() ; i<=UserDefinedStyle.Upper() ; i++ ) {
|
||||
// Modif CAL 8/2/95
|
||||
MyLineDescriptor->SetValue(i, UserDefinedStyle(i)) ;
|
||||
if( UserDefinedStyle(i) <= 0. )
|
||||
Aspect_LineStyleDefinitionError::Raise ("Bad Descriptor") ;
|
||||
}
|
||||
}
|
||||
|
||||
Aspect_TypeOfLine Aspect_LineStyle::Style () const {
|
||||
|
||||
return (MyLineType);
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_LineStyle::Length () const {
|
||||
|
||||
if( MyLineDescriptor.IsNull() ) return (0) ;
|
||||
else return (MyLineDescriptor->Length());
|
||||
}
|
||||
|
||||
const TColQuantity_Array1OfLength& Aspect_LineStyle::Values () const {
|
||||
|
||||
return (MyLineDescriptor->Array1());
|
||||
}
|
||||
|
||||
Handle(TColQuantity_HArray1OfLength) Aspect_LineStyle::PredefinedStyle(const Aspect_TypeOfLine Type) {
|
||||
Handle(TColQuantity_HArray1OfLength) descriptor ;
|
||||
|
||||
MyLineType = Type ;
|
||||
switch ( Type ) {
|
||||
case Aspect_TOL_USERDEFINED :
|
||||
Aspect_LineStyleDefinitionError::Raise ("Bad Line Type Style");
|
||||
case Aspect_TOL_SOLID :
|
||||
descriptor = new TColQuantity_HArray1OfLength(1,1) ;
|
||||
descriptor->SetValue(1,0.) ;
|
||||
break ;
|
||||
case Aspect_TOL_DASH :
|
||||
descriptor = new TColQuantity_HArray1OfLength(1,2) ;
|
||||
descriptor->SetValue(1,2.0 MILLIMETER) ;
|
||||
descriptor->SetValue(2,1.0 MILLIMETER) ;
|
||||
break ;
|
||||
case Aspect_TOL_DOT :
|
||||
descriptor = new TColQuantity_HArray1OfLength(1,2) ;
|
||||
descriptor->SetValue(1,0.2 MILLIMETER) ;
|
||||
descriptor->SetValue(2,0.5 MILLIMETER) ;
|
||||
break ;
|
||||
case Aspect_TOL_DOTDASH :
|
||||
descriptor = new TColQuantity_HArray1OfLength(1,4) ;
|
||||
descriptor->SetValue(1,10.0 MILLIMETER) ;
|
||||
descriptor->SetValue(2,1.0 MILLIMETER) ;
|
||||
descriptor->SetValue(3,2.0 MILLIMETER) ;
|
||||
descriptor->SetValue(4,1.0 MILLIMETER) ;
|
||||
break ;
|
||||
default :
|
||||
descriptor.Nullify() ;
|
||||
}
|
||||
|
||||
return (descriptor) ;
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_LineStyle::IsEqual(const Aspect_LineStyle& Other) const
|
||||
{
|
||||
return (
|
||||
(MyLineType == Other.MyLineType) &&
|
||||
(MyLineDescriptor == Other.MyLineDescriptor));
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_LineStyle::IsNotEqual(const Aspect_LineStyle& Other) const
|
||||
{
|
||||
return !IsEqual(Other);
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
-- Created on: 1995-01-13
|
||||
-- Created by: GG
|
||||
-- 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.
|
||||
|
||||
class MarkMap from Aspect inherits TShared from MMgt
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a MarkMap object.
|
||||
-- Associates an index and a Marker entry.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
uses
|
||||
MarkerStyle from Aspect,
|
||||
MarkMapEntry from Aspect,
|
||||
SequenceOfMarkMapEntry from Aspect
|
||||
|
||||
raises
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create returns MarkMap from Aspect;
|
||||
|
||||
AddEntry (me : mutable; AnEntry : MarkMapEntry from Aspect)
|
||||
---Level: Public
|
||||
---Purpose: Adds an entry in the mark map <me>.
|
||||
-- Warning: Raises BadAccess if MarkMap size is exceeded.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
AddEntry (me : mutable; aStyle : MarkerStyle from Aspect)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical marker style entry in the mark map <me>
|
||||
-- and returns the MarkMapEntry Index if exist.
|
||||
-- Or add a new entry and returns the computed MarkMapEntry index used.
|
||||
|
||||
Size( me ) returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Allocated markmap Size
|
||||
|
||||
Index( me ; aMarkmapIndex : Integer ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the MarkMapEntry.Index of the MarkMap
|
||||
-- at rank <aMarkmapIndex> .
|
||||
raises BadAccess from Aspect is static;
|
||||
---Trigger: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
|
||||
Dump( me ) ;
|
||||
|
||||
Entry ( me ;
|
||||
AnIndex : Integer from Standard )
|
||||
returns MarkMapEntry from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Returns the Mark map entry with the index <AnIndex>.
|
||||
-- Warning: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
raises BadAccess from Aspect is static;
|
||||
|
||||
fields
|
||||
|
||||
mydata : SequenceOfMarkMapEntry from Aspect is protected;
|
||||
|
||||
end MarkMap ;
|
@ -1,116 +0,0 @@
|
||||
// Created on: 1995-01-14
|
||||
// Created by: GG
|
||||
// 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.
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Declaration des variables specifiques aux Ensembles
|
||||
// de Markers
|
||||
|
||||
//-Warning Une MarkMap est definie par un ensemble de MarkMapEntries
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_MarkMap.ixx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// mydata : SequenceOfMarkMapEntry from Aspect is protected
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_MarkMap::Aspect_MarkMap( ) {
|
||||
Aspect_MarkMapEntry theDefaultEntry;
|
||||
|
||||
AddEntry(theDefaultEntry);
|
||||
}
|
||||
|
||||
void Aspect_MarkMap::AddEntry (const Aspect_MarkMapEntry& AnEntry) {
|
||||
Standard_Integer i,index = AnEntry.Index();
|
||||
Aspect_MarkMapEntry theEntry;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i);
|
||||
if( index == theEntry.Index() ) break;
|
||||
}
|
||||
|
||||
if( i > mydata.Length() ) {
|
||||
mydata.Append( AnEntry );
|
||||
} else {
|
||||
mydata.SetValue(i,AnEntry);
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_MarkMap::AddEntry (const Aspect_MarkerStyle &aStyle) {
|
||||
Aspect_MarkMapEntry theEntry ;
|
||||
Standard_Integer i,maxindex = 0 ;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i) ;
|
||||
maxindex = Max(maxindex,theEntry.Index()) ;
|
||||
if( theEntry.Style() == aStyle ) return theEntry.Index() ;
|
||||
}
|
||||
|
||||
maxindex++ ;
|
||||
theEntry.SetValue(maxindex,aStyle) ;
|
||||
mydata.Append( theEntry ) ;
|
||||
return maxindex ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_MarkMap::Size() const {
|
||||
|
||||
return mydata.Length() ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_MarkMap::Index(const Standard_Integer anIndex) const {
|
||||
|
||||
if( anIndex < 1 || anIndex > Size() ) {
|
||||
Aspect_BadAccess::Raise ("Undefined markmap Index");
|
||||
}
|
||||
|
||||
Aspect_MarkMapEntry theEntry = mydata.Value(anIndex) ;
|
||||
|
||||
return theEntry.Index() ;
|
||||
}
|
||||
|
||||
Aspect_MarkMapEntry Aspect_MarkMap::Entry (const Standard_Integer AnIndex) const {
|
||||
|
||||
if( AnIndex < 1 || AnIndex > mydata.Length() )
|
||||
Aspect_BadAccess::Raise ("Aspect_MarkMap::Entry Bad Index");
|
||||
|
||||
return mydata.Value(AnIndex);
|
||||
}
|
||||
|
||||
void Aspect_MarkMap::Dump () const {
|
||||
|
||||
Standard_Integer i ;
|
||||
|
||||
cout << "Markmap Dump-->\n" ;
|
||||
|
||||
for ( i = 1 ; i <= Size() ; i++ ) (Entry(i)).Dump() ;
|
||||
|
||||
cout << "<--End Markmap Dump\n" ;
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
-- Created on: 1995-01-13
|
||||
-- Created by: GG
|
||||
-- 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.
|
||||
|
||||
class MarkMapEntry from Aspect
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a markmap entrys.
|
||||
-- A markmap entry is an association between
|
||||
-- a MarkerStyle object and an index in the markmap.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
MarkerStyle from Aspect
|
||||
|
||||
raises
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create
|
||||
returns MarkMapEntry from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates an unallocated markmap entry
|
||||
|
||||
Create ( index : Integer from Standard;
|
||||
style : MarkerStyle from Aspect)
|
||||
returns MarkMapEntry;
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated markmap entry
|
||||
|
||||
Create ( entry : MarkMapEntry from Aspect )
|
||||
returns MarkMapEntry
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated markmap entry.
|
||||
-- Warning: Raises error if the markmap entry <entry>
|
||||
-- is unallocated.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
SetValue ( me: in out; index : Integer from Standard;
|
||||
style : MarkerStyle from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets markmap entry value and allocates it.
|
||||
|
||||
SetValue ( me: in out; entry : MarkMapEntry from Aspect);
|
||||
---Level: Public
|
||||
---Purpose: Sets markmap entry value and allocates it.
|
||||
---C++: alias operator =
|
||||
|
||||
SetStyle ( me: in out; Style : MarkerStyle from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets the marker style of markmap entry.
|
||||
|
||||
Style ( me ) returns MarkerStyle from Aspect
|
||||
---Warning: Raises error if the markmap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
---C++: return const &
|
||||
|
||||
SetIndex ( me: in out; index : Integer from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets index value of a markmap entry.
|
||||
|
||||
Index ( me ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns index value of a markmap entry.
|
||||
-- Warning: Raises error if the markmap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
Free ( me : in out );
|
||||
---Level: Public
|
||||
---Purpose: Unallocates the markmap entry.
|
||||
|
||||
IsAllocated ( me ) returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns True if the markmap entry is allocated.
|
||||
-- Warning: A markmap entry is allocated when the marker and
|
||||
-- the index is defined.
|
||||
|
||||
Dump( me ) ;
|
||||
---Level: Internal
|
||||
|
||||
fields
|
||||
MyStyle : MarkerStyle from Aspect;
|
||||
MyIndex : Integer from Standard;
|
||||
MyStyleIsDef : Boolean from Standard;
|
||||
MyIndexIsDef : Boolean from Standard;
|
||||
|
||||
end MarkMapEntry from Aspect;
|
@ -1,149 +0,0 @@
|
||||
// Created on: 1995-01-14
|
||||
// Created by: GG
|
||||
// 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.
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Declaration des variables specifiques aux Entries de
|
||||
// Markers
|
||||
|
||||
//-Warning Une entry est definie par un index associee a un Marker style
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_MarkMapEntry.ixx>
|
||||
#include <TColQuantity_Array1OfLength.hxx>
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// MyStyle : MarkerStyle from Aspect
|
||||
// MyIndex : Integer from Standard
|
||||
// MyStyleIsDef : Boolean from Standard
|
||||
// MyIndexIsDef : Boolean from Standard
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_MarkMapEntry::Aspect_MarkMapEntry() :
|
||||
MyStyle(),MyIndex(0),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
|
||||
}
|
||||
|
||||
Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Standard_Integer index, const Aspect_MarkerStyle &style) :
|
||||
MyStyle(style),MyIndex(index),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
|
||||
}
|
||||
|
||||
Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Aspect_MarkMapEntry& entry) :
|
||||
MyStyle(entry.MyStyle),MyIndex(entry.MyIndex),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
|
||||
|
||||
if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
|
||||
}
|
||||
}
|
||||
|
||||
void Aspect_MarkMapEntry::SetValue (const Standard_Integer index, const Aspect_MarkerStyle &style) {
|
||||
|
||||
MyStyleIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
MyStyle = style;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_MarkMapEntry::SetValue (const Aspect_MarkMapEntry& entry) {
|
||||
|
||||
if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
|
||||
}
|
||||
else {
|
||||
MyStyleIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = entry.MyIndex;
|
||||
MyStyle = entry.MyStyle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Aspect_MarkMapEntry::SetStyle (const Aspect_MarkerStyle &style) {
|
||||
|
||||
MyStyleIsDef = Standard_True;
|
||||
MyStyle = style;
|
||||
|
||||
}
|
||||
|
||||
const Aspect_MarkerStyle& Aspect_MarkMapEntry::Style () const {
|
||||
|
||||
if ( !MyStyleIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
|
||||
|
||||
return MyStyle;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_MarkMapEntry::SetIndex (const Standard_Integer index) {
|
||||
|
||||
MyStyleIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_MarkMapEntry::Index () const {
|
||||
|
||||
if ( !MyStyleIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated MarkMapEntry");
|
||||
|
||||
return MyIndex;
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_MarkMapEntry::IsAllocated () const {
|
||||
|
||||
return ( MyStyleIsDef && MyIndexIsDef ) ;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_MarkMapEntry::Free () {
|
||||
|
||||
MyStyleIsDef = Standard_False;
|
||||
MyIndexIsDef = Standard_False;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_MarkMapEntry::Dump () const {
|
||||
|
||||
Aspect_TypeOfMarker type = MyStyle.Type() ;
|
||||
Standard_Integer i,length = MyStyle.Length() ;
|
||||
Standard_Boolean draw = Standard_False ;
|
||||
Standard_Real X(0),Y(0);
|
||||
|
||||
cout << " Aspect_MarkMapEntry::Dump ()\n";
|
||||
cout << " MyStyleIsDef : " << (MyStyleIsDef ? "True\n" : "False\n");
|
||||
cout << " MyIndexIsDef : " << (MyIndexIsDef ? "True\n" : "False\n");
|
||||
cout << " MarkerStyle : " << (Standard_Integer) type << " Length : " << length << "\n";//WNT
|
||||
if( length ) {
|
||||
for( i=1 ; i<=length ; i++ )
|
||||
draw = MyStyle.Values(i,X,Y);
|
||||
cout << " value("<< i << ") : " << X << "," << Y << "," << draw << "\n";
|
||||
}
|
||||
cout << flush;
|
||||
}
|
@ -1,167 +0,0 @@
|
||||
-- Created on: 1995-01-13
|
||||
-- Created by: GG
|
||||
-- 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.
|
||||
|
||||
class MarkerStyle from Aspect
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class defines a Marker Style.
|
||||
-- The Style can be Predefined or defined by the user
|
||||
-- A user defined style must be described in the space <-1,+1>
|
||||
|
||||
---Keywords: MarkerStyle
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
TypeOfMarker from Aspect,
|
||||
Array1OfReal from TColStd,
|
||||
Array1OfBoolean from TColStd,
|
||||
HArray1OfBoolean from TColStd,
|
||||
Array1OfShortReal from TShort,
|
||||
HArray1OfShortReal from TShort
|
||||
|
||||
raises
|
||||
MarkerStyleDefinitionError from Aspect
|
||||
|
||||
is
|
||||
Create returns MarkerStyle from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates a marker style with the default value of
|
||||
-- MarkerStyle type : POINT
|
||||
--
|
||||
|
||||
Create ( aType : TypeOfMarker ) returns MarkerStyle from Aspect ;
|
||||
---Level: Public
|
||||
---Purpose: Creates the marker style <aType>.
|
||||
|
||||
Create ( aXpoint : Array1OfReal ;
|
||||
aYpoint : Array1OfReal )
|
||||
returns MarkerStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates a marker style from a implicit draw point
|
||||
--descriptor .
|
||||
-- Each coordinate <aXpoint(i),aYpoint(i)> must be defined
|
||||
--in the space -1,+1.
|
||||
raises MarkerStyleDefinitionError;
|
||||
---Trigger:
|
||||
-- if <aXpoint>,<aYpoint> have different length.
|
||||
-- if one coordinate is <-1 or >+1.
|
||||
|
||||
Create ( aXpoint : Array1OfReal ;
|
||||
aYpoint : Array1OfReal ;
|
||||
aSpoint : Array1OfBoolean )
|
||||
returns MarkerStyle from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Creates a marker style from a move-draw point descriptor .
|
||||
-- Each coordinate <aXpoint(i),aYpoint(i)> must be defined
|
||||
--in the space -1,+1.
|
||||
-- Each status point <aSpoint(i)> must be TRUE for drawing
|
||||
--or FALSE for moving to the last at this point .
|
||||
raises MarkerStyleDefinitionError;
|
||||
---Trigger:
|
||||
-- if <aXpoint>,<aYpoint>,<aSpoint> have different length.
|
||||
-- if one coordinate is <-1 or >+1
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
Assign ( me : in out ;
|
||||
Other : MarkerStyle from Aspect )
|
||||
returns MarkerStyle from Aspect is static;
|
||||
---Level: Public
|
||||
---Purpose: Updates the marker style <me> from the definition of the
|
||||
-- marker style <Other>.
|
||||
---Category: Methods to modify the class definition
|
||||
---C++: alias operator =
|
||||
---C++: return &
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
Type ( me ) returns TypeOfMarker is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the type of the marker style <me>
|
||||
---Category: Inquire methods
|
||||
|
||||
Length ( me ) returns Integer is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the components length of the marker descriptors
|
||||
---Category: Inquire methods
|
||||
|
||||
Values ( me ; aRank : Integer ;
|
||||
aX,aY : out Real ) returns Boolean
|
||||
---Level: Public
|
||||
---Purpose: Returns the point and status of a marker style
|
||||
--descriptor of rank <aRank>.
|
||||
raises MarkerStyleDefinitionError is static;
|
||||
---Trigger:
|
||||
-- If aRank is < 1 or > Length()
|
||||
---Category: Inquire methods
|
||||
|
||||
XValues ( me ) returns Array1OfShortReal is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the X vector of a marker style descriptor
|
||||
---Category: Inquire methods
|
||||
---C++: return const &
|
||||
|
||||
YValues ( me ) returns Array1OfShortReal is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Y vector of a marker style descriptor
|
||||
---Category: Inquire methods
|
||||
---C++: return const &
|
||||
|
||||
SValues ( me ) returns Array1OfBoolean is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the State vector of a marker style descriptor
|
||||
---Category: Inquire methods
|
||||
---C++: return const &
|
||||
|
||||
IsEqual(me; Other : MarkerStyle from Aspect) returns Boolean;
|
||||
---C++: alias operator==
|
||||
|
||||
IsNotEqual(me; Other : MarkerStyle from Aspect) returns Boolean;
|
||||
---C++: alias operator!=
|
||||
|
||||
----------------------------
|
||||
-- Category: Private methods
|
||||
----------------------------
|
||||
|
||||
SetPredefinedStyle ( me : in out ) is static private;
|
||||
---Level: Internal
|
||||
---Purpose: Set MyMarkerDescriptor with the predefined style values
|
||||
-- according of current type
|
||||
---Category: Private methods
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Aspect_MarkerStyle
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to marker styles
|
||||
--
|
||||
|
||||
MyMarkerType : TypeOfMarker;
|
||||
MyXpoint : HArray1OfShortReal;
|
||||
MyYpoint : HArray1OfShortReal;
|
||||
MySpoint : HArray1OfBoolean;
|
||||
|
||||
end MarkerStyle;
|
@ -1,551 +0,0 @@
|
||||
// Created on: 1995-01-14
|
||||
// Created by: GG
|
||||
// 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.
|
||||
|
||||
// Modified 23/02/98 : FMN ; Remplacement PI par Standard_PI
|
||||
// JR 02.01.100 : Implicit conversions
|
||||
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Declaration des variables specifiques aux Type de markers
|
||||
|
||||
//-Warning Un style est definie, soit par son type predefini TOM_...
|
||||
// soit par sa description dans l'espace -1,+1
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_MarkerStyle.ixx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// MyMarkerType : TypeOfMarker from Aspect;
|
||||
// MyXpoint : Array1OfShortReal from TShort;
|
||||
// MyYpoint : Array1OfShortReal from TShort;
|
||||
// MySpoint : Array1OfBoolean from TColStd;
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_MarkerStyle::Aspect_MarkerStyle () : MyMarkerType(Aspect_TOM_POINT) {
|
||||
SetPredefinedStyle();
|
||||
}
|
||||
|
||||
Aspect_MarkerStyle::Aspect_MarkerStyle (
|
||||
const Aspect_TypeOfMarker aType) : MyMarkerType(aType) {
|
||||
SetPredefinedStyle();
|
||||
}
|
||||
|
||||
Aspect_MarkerStyle::Aspect_MarkerStyle (const TColStd_Array1OfReal& aXpoint,
|
||||
const TColStd_Array1OfReal& aYpoint)
|
||||
: MyMarkerType(Aspect_TOM_USERDEFINED) {
|
||||
Standard_Integer i,j=1;
|
||||
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,aXpoint.Length());
|
||||
|
||||
if( aXpoint.Length() != aYpoint.Length() ) {
|
||||
Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor length") ;
|
||||
}
|
||||
|
||||
for( i=aXpoint.Lower() ; i<=aXpoint.Upper() ; i++,j++ ) {
|
||||
Standard_ShortReal X = (Standard_ShortReal ) aXpoint(i);
|
||||
Standard_ShortReal Y = (Standard_ShortReal ) aYpoint(i);
|
||||
if( X < -1. || X > 1. || Y < -1. || Y > 1. ) {
|
||||
Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor value") ;
|
||||
}
|
||||
MyXpoint->SetValue(j,X);
|
||||
MyYpoint->SetValue(j,Y);
|
||||
MySpoint->SetValue(j,(j > 1) ? Standard_True : Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
Aspect_MarkerStyle::Aspect_MarkerStyle (const TColStd_Array1OfReal& aXpoint,
|
||||
const TColStd_Array1OfReal& aYpoint,
|
||||
const TColStd_Array1OfBoolean& aSpoint)
|
||||
: MyMarkerType(Aspect_TOM_USERDEFINED) {
|
||||
Standard_Integer i,j=1;
|
||||
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,aXpoint.Length());
|
||||
|
||||
if( (aXpoint.Length() != aYpoint.Length()) ||
|
||||
(aXpoint.Length() != aSpoint.Length()) ) {
|
||||
Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor length") ;
|
||||
}
|
||||
|
||||
for( i=aXpoint.Lower() ; i<=aXpoint.Upper() ; i++,j++ ) {
|
||||
Standard_ShortReal X = (Standard_ShortReal ) aXpoint(i);
|
||||
Standard_ShortReal Y = (Standard_ShortReal ) aYpoint(i);
|
||||
Standard_Boolean S = aSpoint(i);
|
||||
if( X < -1. || X > 1. || Y < -1. || Y > 1. ) {
|
||||
Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor value") ;
|
||||
}
|
||||
MyXpoint->SetValue(j,X);
|
||||
MyYpoint->SetValue(j,Y);
|
||||
MySpoint->SetValue(j,S);
|
||||
MySpoint->SetValue(j,(j > 1) ? S : Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
Aspect_MarkerStyle& Aspect_MarkerStyle::Assign (const Aspect_MarkerStyle& Other) {
|
||||
|
||||
MyMarkerType = Other.MyMarkerType ;
|
||||
MyXpoint = Other.MyXpoint ;
|
||||
MyYpoint = Other.MyYpoint ;
|
||||
MySpoint = Other.MySpoint ;
|
||||
|
||||
return (*this);
|
||||
|
||||
}
|
||||
|
||||
Aspect_TypeOfMarker Aspect_MarkerStyle::Type () const {
|
||||
|
||||
return MyMarkerType;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_MarkerStyle::Length () const {
|
||||
|
||||
return MyXpoint->Length();
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_MarkerStyle::Values (const Standard_Integer aRank,
|
||||
Standard_Real &X,Standard_Real &Y) const {
|
||||
|
||||
if( aRank < 1 || aRank > Length() ) {
|
||||
Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor rank") ;
|
||||
}
|
||||
|
||||
X = MyXpoint->Value(aRank);
|
||||
Y = MyYpoint->Value(aRank);
|
||||
return MySpoint->Value(aRank);
|
||||
}
|
||||
|
||||
const TShort_Array1OfShortReal& Aspect_MarkerStyle::XValues () const {
|
||||
|
||||
return MyXpoint->Array1();
|
||||
}
|
||||
|
||||
const TShort_Array1OfShortReal& Aspect_MarkerStyle::YValues () const {
|
||||
|
||||
return MyYpoint->Array1();
|
||||
}
|
||||
|
||||
const TColStd_Array1OfBoolean& Aspect_MarkerStyle::SValues () const {
|
||||
|
||||
return MySpoint->Array1();
|
||||
}
|
||||
|
||||
#define MAX_O_POINT 12
|
||||
#define MAX_BALL_LINE 12
|
||||
#ifndef AIX
|
||||
#define FALSE Standard_False
|
||||
#define TRUE Standard_True
|
||||
#endif
|
||||
|
||||
void Aspect_MarkerStyle::SetPredefinedStyle() {
|
||||
|
||||
switch ( MyMarkerType ) {
|
||||
case Aspect_TOM_USERDEFINED :
|
||||
Aspect_MarkerStyleDefinitionError::Raise
|
||||
("Bad Marker Type Style");
|
||||
break;
|
||||
case Aspect_TOM_POINT :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,5) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,5) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,5) ;
|
||||
|
||||
MyXpoint->SetValue(1,-1.);
|
||||
MyYpoint->SetValue(1,-1.);
|
||||
MySpoint->SetValue(1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(2,-1.);
|
||||
MyYpoint->SetValue(2,1.);
|
||||
MySpoint->SetValue(2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(3,1.);
|
||||
MyYpoint->SetValue(3,1.);
|
||||
MySpoint->SetValue(3,TRUE);
|
||||
|
||||
MyXpoint->SetValue(4,1.);
|
||||
MyYpoint->SetValue(4,-1.);
|
||||
MySpoint->SetValue(4,TRUE);
|
||||
|
||||
MyXpoint->SetValue(5,-1.);
|
||||
MyYpoint->SetValue(5,-1.);
|
||||
MySpoint->SetValue(5,TRUE);
|
||||
break ;
|
||||
case Aspect_TOM_PLUS :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,4) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,4) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,4) ;
|
||||
|
||||
MyXpoint->SetValue(1, 0.);
|
||||
MyYpoint->SetValue(1,-1.);
|
||||
MySpoint->SetValue(1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(2, 0.);
|
||||
MyYpoint->SetValue(2, 1.);
|
||||
MySpoint->SetValue(2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(3,-1.);
|
||||
MyYpoint->SetValue(3, 0.);
|
||||
MySpoint->SetValue(3,FALSE);
|
||||
|
||||
MyXpoint->SetValue(4, 1.);
|
||||
MyYpoint->SetValue(4, 0.);
|
||||
MySpoint->SetValue(4,TRUE);
|
||||
break ;
|
||||
case Aspect_TOM_STAR :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,8) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,8) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,8) ;
|
||||
|
||||
MyXpoint->SetValue(1, 0.);
|
||||
MyYpoint->SetValue(1,-1.);
|
||||
MySpoint->SetValue(1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(2, 0.);
|
||||
MyYpoint->SetValue(2, 1.);
|
||||
MySpoint->SetValue(2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(3,-1.);
|
||||
MyYpoint->SetValue(3, 0.);
|
||||
MySpoint->SetValue(3,FALSE);
|
||||
|
||||
MyXpoint->SetValue(4, 1.);
|
||||
MyYpoint->SetValue(4, 0.);
|
||||
MySpoint->SetValue(4,TRUE);
|
||||
|
||||
MyXpoint->SetValue(5,(float ) -0.7);
|
||||
MyYpoint->SetValue(5,(float ) -0.7);
|
||||
MySpoint->SetValue(5,FALSE);
|
||||
|
||||
MyXpoint->SetValue(6,(float ) 0.7);
|
||||
MyYpoint->SetValue(6,(float ) 0.7);
|
||||
MySpoint->SetValue(6,TRUE);
|
||||
|
||||
MyXpoint->SetValue(7,(float ) 0.7);
|
||||
MyYpoint->SetValue(7,(float ) -0.7);
|
||||
MySpoint->SetValue(7,FALSE);
|
||||
|
||||
MyXpoint->SetValue(8,(float ) -0.7);
|
||||
MyYpoint->SetValue(8,(float ) 0.7);
|
||||
MySpoint->SetValue(8,TRUE);
|
||||
break ;
|
||||
case Aspect_TOM_O :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+1) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+1) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+1) ;
|
||||
|
||||
{ Standard_Integer i;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real a = 0.;
|
||||
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
|
||||
MyXpoint->SetValue(i,(float ) Cos(a));
|
||||
MyYpoint->SetValue(i,(float ) Sin(a));
|
||||
MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
|
||||
}
|
||||
i = MAX_O_POINT+1;
|
||||
MyXpoint->SetValue(i,1.);
|
||||
MyYpoint->SetValue(i,0.);
|
||||
}
|
||||
break ;
|
||||
case Aspect_TOM_X :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,4) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,4) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,4) ;
|
||||
|
||||
MyXpoint->SetValue(1,(float ) -0.7);
|
||||
MyYpoint->SetValue(1,(float ) -0.7);
|
||||
MySpoint->SetValue(1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(2,(float ) 0.7);
|
||||
MyYpoint->SetValue(2,(float ) 0.7);
|
||||
MySpoint->SetValue(2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(3,(float ) 0.7);
|
||||
MyYpoint->SetValue(3,(float ) -0.7);
|
||||
MySpoint->SetValue(3,FALSE);
|
||||
|
||||
MyXpoint->SetValue(4,(float ) -0.7);
|
||||
MyYpoint->SetValue(4,(float ) 0.7);
|
||||
MySpoint->SetValue(4,TRUE);
|
||||
break ;
|
||||
case Aspect_TOM_O_POINT :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+6) ;
|
||||
{ Standard_Integer i;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real a = 0.;
|
||||
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
|
||||
MyXpoint->SetValue(i,(float ) Cos(a));
|
||||
MyYpoint->SetValue(i,(float ) Sin(a));
|
||||
MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
|
||||
}
|
||||
i = MAX_O_POINT+1;
|
||||
MyXpoint->SetValue(i,1.);
|
||||
MyYpoint->SetValue(i,0.);
|
||||
|
||||
MyXpoint->SetValue(i+1,-0.25);
|
||||
MyYpoint->SetValue(i+1,-0.25);
|
||||
MySpoint->SetValue(i+1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+2,-0.25);
|
||||
MyYpoint->SetValue(i+2,0.25);
|
||||
MySpoint->SetValue(i+2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+3,0.25);
|
||||
MyYpoint->SetValue(i+3,0.25);
|
||||
MySpoint->SetValue(i+3,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+4,0.25);
|
||||
MyYpoint->SetValue(i+4,-0.25);
|
||||
MySpoint->SetValue(i+4,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+5,-0.25);
|
||||
MyYpoint->SetValue(i+5,-0.25);
|
||||
MySpoint->SetValue(i+5,TRUE);
|
||||
}
|
||||
break ;
|
||||
case Aspect_TOM_O_PLUS :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
|
||||
|
||||
{ Standard_Integer i;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real a = 0.;
|
||||
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
|
||||
MyXpoint->SetValue(i,(float ) Cos(a));
|
||||
MyYpoint->SetValue(i,(float ) Sin(a));
|
||||
MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
|
||||
}
|
||||
i = MAX_O_POINT+1;
|
||||
MyXpoint->SetValue(i,1.);
|
||||
MyYpoint->SetValue(i,0.);
|
||||
|
||||
MyXpoint->SetValue(i+1,0.);
|
||||
MyYpoint->SetValue(i+1,-0.5);
|
||||
MySpoint->SetValue(i+1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+2,0.);
|
||||
MyYpoint->SetValue(i+2,0.5);
|
||||
MySpoint->SetValue(i+2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+3,-0.5);
|
||||
MyYpoint->SetValue(i+3,0.);
|
||||
MySpoint->SetValue(i+3,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+4,0.5);
|
||||
MyYpoint->SetValue(i+4,0.);
|
||||
MySpoint->SetValue(i+4,TRUE);
|
||||
}
|
||||
break ;
|
||||
case Aspect_TOM_O_STAR :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+9) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+9) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+9) ;
|
||||
|
||||
{ Standard_Integer i;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real a = 0.;
|
||||
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
|
||||
MyXpoint->SetValue(i,(float ) Cos(a));
|
||||
MyYpoint->SetValue(i,(float ) Sin(a));
|
||||
MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
|
||||
}
|
||||
i = MAX_O_POINT+1;
|
||||
MyXpoint->SetValue(i,1.);
|
||||
MyYpoint->SetValue(i,0.);
|
||||
|
||||
MyXpoint->SetValue(i+1, 0.);
|
||||
MyYpoint->SetValue(i+1,-0.5);
|
||||
MySpoint->SetValue(i+1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+2, 0.);
|
||||
MyYpoint->SetValue(i+2,0.5);
|
||||
MySpoint->SetValue(i+2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+3,-0.5);
|
||||
MyYpoint->SetValue(i+3, 0.);
|
||||
MySpoint->SetValue(i+3,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+4,0.5);
|
||||
MyYpoint->SetValue(i+4, 0.);
|
||||
MySpoint->SetValue(i+4,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+5,(float ) -0.35);
|
||||
MyYpoint->SetValue(i+5,(float ) -0.35);
|
||||
MySpoint->SetValue(i+5,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+6,(float ) 0.35);
|
||||
MyYpoint->SetValue(i+6,(float ) 0.35);
|
||||
MySpoint->SetValue(i+6,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+7,(float ) 0.35);
|
||||
MyYpoint->SetValue(i+7,(float ) -0.35);
|
||||
MySpoint->SetValue(i+7,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+8,(float ) -0.35);
|
||||
MyYpoint->SetValue(i+8,(float ) 0.35);
|
||||
MySpoint->SetValue(i+8,TRUE);
|
||||
}
|
||||
break ;
|
||||
case Aspect_TOM_O_X :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
|
||||
|
||||
{ Standard_Integer i;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real a = 0.;
|
||||
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
|
||||
MyXpoint->SetValue(i,(float ) Cos(a));
|
||||
MyYpoint->SetValue(i,(float ) Sin(a));
|
||||
MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
|
||||
}
|
||||
i = MAX_O_POINT+1;
|
||||
MyXpoint->SetValue(i,1.);
|
||||
MyYpoint->SetValue(i,0.);
|
||||
|
||||
MyXpoint->SetValue(i+1,(float ) -0.35);
|
||||
MyYpoint->SetValue(i+1,(float ) -0.35);
|
||||
MySpoint->SetValue(i+1,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+2,(float ) 0.35);
|
||||
MyYpoint->SetValue(i+2,(float ) 0.35);
|
||||
MySpoint->SetValue(i+2,TRUE);
|
||||
|
||||
MyXpoint->SetValue(i+3,(float ) 0.35);
|
||||
MyYpoint->SetValue(i+3,(float ) -0.35);
|
||||
MySpoint->SetValue(i+3,FALSE);
|
||||
|
||||
MyXpoint->SetValue(i+4,(float ) -0.35);
|
||||
MyYpoint->SetValue(i+4,(float ) 0.35);
|
||||
MySpoint->SetValue(i+4,TRUE);
|
||||
}
|
||||
break ;
|
||||
case Aspect_TOM_RING1 :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,
|
||||
(MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,
|
||||
(MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,
|
||||
(MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
|
||||
|
||||
{ Standard_Integer i,j,n = 0;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real dr = 1./MAX_BALL_LINE;
|
||||
Standard_Real a,r = 1.;
|
||||
|
||||
for( i=1 ; i<= MAX_BALL_LINE/4 ; i++ ) {
|
||||
a = 0.;
|
||||
for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
|
||||
n++;
|
||||
MyXpoint->SetValue(n,(float )( r*Cos(a)));
|
||||
MyYpoint->SetValue(n,(float )( r*Sin(a)));
|
||||
MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
|
||||
}
|
||||
MyXpoint->SetValue(n,(float ) r);
|
||||
MyYpoint->SetValue(n,0.);
|
||||
r -= dr;
|
||||
}
|
||||
}
|
||||
break ;
|
||||
case Aspect_TOM_RING2 :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,
|
||||
(MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,
|
||||
(MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,
|
||||
(MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
|
||||
|
||||
{ Standard_Integer i,j,n = 0;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real dr = 1./MAX_BALL_LINE;
|
||||
Standard_Real a,r = 1.;
|
||||
|
||||
for( i=1 ; i<= MAX_BALL_LINE/3 ; i++ ) {
|
||||
a = 0.;
|
||||
for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
|
||||
n++;
|
||||
MyXpoint->SetValue(n,(float )( r*Cos(a)));
|
||||
MyYpoint->SetValue(n,(float )( r*Sin(a)));
|
||||
MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
|
||||
}
|
||||
MyXpoint->SetValue(n,(float ) r);
|
||||
MyYpoint->SetValue(n,0.);
|
||||
r -= dr;
|
||||
}
|
||||
}
|
||||
break ;
|
||||
case Aspect_TOM_RING3 :
|
||||
MyXpoint = new TShort_HArray1OfShortReal(1,
|
||||
(MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
|
||||
MyYpoint = new TShort_HArray1OfShortReal(1,
|
||||
(MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
|
||||
MySpoint = new TColStd_HArray1OfBoolean(1,
|
||||
(MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
|
||||
|
||||
{ Standard_Integer i,j,n = 0;
|
||||
Standard_Real da = 2. * M_PI / MAX_O_POINT;
|
||||
Standard_Real dr = 1./MAX_BALL_LINE;
|
||||
Standard_Real a,r = 1.;
|
||||
|
||||
for( i=1 ; i<= MAX_BALL_LINE/2 ; i++ ) {
|
||||
a = 0.;
|
||||
for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
|
||||
n++;
|
||||
MyXpoint->SetValue(n,(float )( r*Cos(a)));
|
||||
MyYpoint->SetValue(n,(float )( r*Sin(a)));
|
||||
MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
|
||||
}
|
||||
MyXpoint->SetValue(n,(float ) r);
|
||||
MyYpoint->SetValue(n,0.);
|
||||
r -= dr;
|
||||
}
|
||||
}
|
||||
break ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_MarkerStyle::IsEqual(const Aspect_MarkerStyle& Other) const
|
||||
{
|
||||
return (
|
||||
(MyMarkerType == Other.MyMarkerType) &&
|
||||
(MyXpoint == Other.MyXpoint) &&
|
||||
(MyYpoint == Other.MyYpoint) &&
|
||||
(MySpoint == Other.MySpoint));
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_MarkerStyle::IsNotEqual(const Aspect_MarkerStyle& Other) const
|
||||
{
|
||||
return !IsEqual(Other);
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
-- Created on: 1993-03-23
|
||||
-- Created by: BBL
|
||||
-- Copyright (c) 1993-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.
|
||||
|
||||
deferred class Pixel from Aspect inherits Storable
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a Pixel.
|
||||
-- Defines a picture element.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
is
|
||||
|
||||
Initialize;
|
||||
---Level: Public
|
||||
|
||||
Print( me ; s : in out OStream ) is deferred ;
|
||||
---Level: Public
|
||||
---Purpose : Prints the contents of <me> on the stream <s>
|
||||
---C++: alias "friend Standard_EXPORT Standard_OStream& operator << (Standard_OStream&,const Aspect_Pixel& );"
|
||||
|
||||
end Pixel from Aspect;
|
@ -1,25 +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.
|
||||
|
||||
#include <Aspect_Pixel.ixx>
|
||||
#include <Standard_OStream.hxx>
|
||||
|
||||
Aspect_Pixel::Aspect_Pixel() {}
|
||||
|
||||
Standard_OStream& operator << (Standard_OStream& s, const Aspect_Pixel& aPixel)
|
||||
{
|
||||
aPixel.Print( s ) ;
|
||||
return s ;
|
||||
}
|
||||
|
@ -1,23 +0,0 @@
|
||||
// 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 _Aspect_RGBPixel_HeaderFile
|
||||
#define _Aspect_RGBPixel_HeaderFile
|
||||
|
||||
typedef struct {
|
||||
float red;
|
||||
float green;
|
||||
float blue;
|
||||
} Aspect_RGBPixel;
|
||||
|
||||
#endif
|
@ -1,78 +0,0 @@
|
||||
-- Created on: 1993-09-07
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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 TypeMap from Aspect inherits TShared from MMgt
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a TypeMap object.
|
||||
-- Associates an index and a line type entry.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
uses
|
||||
LineStyle from Aspect,
|
||||
TypeMapEntry from Aspect,
|
||||
SequenceOfTypeMapEntry from Aspect
|
||||
|
||||
raises
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create returns TypeMap from Aspect;
|
||||
|
||||
AddEntry (me : mutable; AnEntry : TypeMapEntry from Aspect)
|
||||
---Level: Public
|
||||
---Purpose: Adds an entry in the type map <me>.
|
||||
-- Warning: Raises BadAccess if TypeMap size is exceeded.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
AddEntry (me : mutable; aStyle : LineStyle from Aspect)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical type style entry in the type map <me>
|
||||
-- and returns the TypeMapEntry Index if exist.
|
||||
-- Or add a new entry and returns the computed TypeMapEntry index used.
|
||||
|
||||
Size( me ) returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Allocated typemap Size
|
||||
|
||||
Index( me ; aTypemapIndex : Integer ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the TypeMapEntry.Index of the TypeMap
|
||||
-- at rank <aTypemapIndex> .
|
||||
raises BadAccess from Aspect is static;
|
||||
---Trigger: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
|
||||
Dump( me ) ;
|
||||
|
||||
Entry ( me ;
|
||||
AnIndex : Integer from Standard )
|
||||
returns TypeMapEntry from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Returns the Type map entry with the index <AnIndex>.
|
||||
-- Warning: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
raises BadAccess from Aspect is static;
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
|
||||
mydata : SequenceOfTypeMapEntry from Aspect is protected;
|
||||
|
||||
end TypeMap ;
|
@ -1,116 +0,0 @@
|
||||
// Created on: 1993-09-14
|
||||
// Created by: GG
|
||||
// Copyright (c) 1993-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 Ensembles
|
||||
// de Type de traits
|
||||
|
||||
//-Warning Une TypeMap est definie par un ensemble de TypeMapEntries
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_TypeMap.ixx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// mydata : SequenceOfTypeMapEntry from Aspect is protected
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_TypeMap::Aspect_TypeMap( ) {
|
||||
Aspect_TypeMapEntry theDefaultEntry;
|
||||
|
||||
AddEntry(theDefaultEntry);
|
||||
}
|
||||
|
||||
void Aspect_TypeMap::AddEntry (const Aspect_TypeMapEntry& AnEntry) {
|
||||
Standard_Integer i,index = AnEntry.Index();
|
||||
Aspect_TypeMapEntry theEntry;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i);
|
||||
if( index == theEntry.Index() ) break;
|
||||
}
|
||||
|
||||
if( i > mydata.Length() ) {
|
||||
mydata.Append( AnEntry );
|
||||
} else {
|
||||
mydata.SetValue(i,AnEntry);
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_TypeMap::AddEntry (const Aspect_LineStyle &aStyle) {
|
||||
Aspect_TypeMapEntry theEntry ;
|
||||
Standard_Integer i,maxindex = 0 ;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i) ;
|
||||
maxindex = Max(maxindex,theEntry.Index()) ;
|
||||
if( theEntry.Type() == aStyle ) return theEntry.Index() ;
|
||||
}
|
||||
|
||||
maxindex++ ;
|
||||
theEntry.SetValue(maxindex,aStyle) ;
|
||||
mydata.Append( theEntry ) ;
|
||||
return maxindex ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_TypeMap::Size() const {
|
||||
|
||||
return mydata.Length() ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_TypeMap::Index(const Standard_Integer anIndex) const {
|
||||
|
||||
if( anIndex < 1 || anIndex > Size() ) {
|
||||
Aspect_BadAccess::Raise ("Undefined typemap Index");
|
||||
}
|
||||
|
||||
Aspect_TypeMapEntry theEntry = mydata.Value(anIndex) ;
|
||||
|
||||
return theEntry.Index() ;
|
||||
}
|
||||
|
||||
const Aspect_TypeMapEntry& Aspect_TypeMap::Entry (const Standard_Integer AnIndex) const {
|
||||
|
||||
if( AnIndex < 1 || AnIndex > mydata.Length() )
|
||||
Aspect_BadAccess::Raise ("Aspect_TypeMap::Entry Bad Index");
|
||||
|
||||
return mydata.Value(AnIndex);
|
||||
}
|
||||
|
||||
void Aspect_TypeMap::Dump () const {
|
||||
|
||||
Standard_Integer i ;
|
||||
|
||||
cout << "Typemap Dump-->\n" ;
|
||||
|
||||
for ( i = 1 ; i <= Size() ; i++ ) (Entry(i)).Dump() ;
|
||||
|
||||
cout << "<--End Typemap Dump\n" ;
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
-- Created on: 1993-09-07
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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 TypeMapEntry from Aspect
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a typemap entry.
|
||||
-- A typemap entry is an association between
|
||||
-- a LineStyle object and an index in the typemap.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
LineStyle from Aspect
|
||||
|
||||
raises
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create
|
||||
returns TypeMapEntry from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates an unallocated typemap entry
|
||||
|
||||
Create ( index : Integer from Standard;
|
||||
style : LineStyle from Aspect)
|
||||
returns TypeMapEntry;
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated typemap entry
|
||||
|
||||
Create ( entry : TypeMapEntry from Aspect )
|
||||
returns TypeMapEntry
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated typemap entry.
|
||||
-- Warning: Raises error if the typemap entry <entry>
|
||||
-- is unallocated.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
SetValue ( me: in out; index : Integer from Standard;
|
||||
style : LineStyle from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets typemap entry value and allocates it.
|
||||
|
||||
SetValue ( me: in out; entry : TypeMapEntry from Aspect);
|
||||
---Level: Public
|
||||
---Purpose: Sets typemap entry value and allocates it.
|
||||
---C++: alias operator =
|
||||
|
||||
SetType ( me: in out; Style : LineStyle from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets the line style of typemap entry.
|
||||
|
||||
Type ( me ) returns LineStyle from Aspect
|
||||
---Warning: Raises error if the typemap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
---C++: return const &
|
||||
|
||||
SetIndex ( me: in out; index : Integer from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets index value of a typemap entry.
|
||||
|
||||
Index ( me ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns index value of a typemap entry.
|
||||
-- Warning: Raises error if the typemap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
Free ( me : in out );
|
||||
---Level: Public
|
||||
---Purpose: Unallocates the typemap entry.
|
||||
|
||||
IsAllocated ( me ) returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns True if the typemap entry is allocated.
|
||||
-- Warning: A typemap entry is allocated when the type and
|
||||
-- the index is defined.
|
||||
|
||||
Dump( me ) ;
|
||||
---Level: Internal
|
||||
|
||||
fields
|
||||
MyType : LineStyle from Aspect;
|
||||
MyIndex : Integer from Standard;
|
||||
MyTypeIsDef : Boolean from Standard;
|
||||
MyIndexIsDef : Boolean from Standard;
|
||||
|
||||
end TypeMapEntry from Aspect;
|
@ -1,161 +0,0 @@
|
||||
// Created on: 1993-09-14
|
||||
// Created by: GG
|
||||
// Copyright (c) 1993-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 Entries de
|
||||
// Types de trait
|
||||
|
||||
//-Warning Une entry est definie par un index associee a un Line style
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Aspect_TypeMapEntry.ixx>
|
||||
#include <TColQuantity_Array1OfLength.hxx>
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// MyType : LineStyle from Aspect
|
||||
// MyIndex : Integer from Standard
|
||||
// MyTypeIsDef : Boolean from Standard
|
||||
// MyIndexIsDef : Boolean from Standard
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Aspect_TypeMapEntry::Aspect_TypeMapEntry() {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = 0;
|
||||
MyType.SetValues (Aspect_TOL_SOLID);
|
||||
|
||||
}
|
||||
|
||||
Aspect_TypeMapEntry::Aspect_TypeMapEntry (const Standard_Integer index, const Aspect_LineStyle &style) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
MyType = style;
|
||||
|
||||
}
|
||||
|
||||
Aspect_TypeMapEntry::Aspect_TypeMapEntry (const Aspect_TypeMapEntry& entry) {
|
||||
|
||||
if ( !entry.MyTypeIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated TypeMapEntry") ;
|
||||
}
|
||||
else {
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = entry.MyIndex;
|
||||
MyType = entry.MyType;
|
||||
}
|
||||
}
|
||||
|
||||
void Aspect_TypeMapEntry::SetValue (const Standard_Integer index, const Aspect_LineStyle &style) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
MyType = style;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_TypeMapEntry::SetValue (const Aspect_TypeMapEntry& entry) {
|
||||
|
||||
if ( !entry.MyTypeIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated TypeMapEntry") ;
|
||||
}
|
||||
else {
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = entry.MyIndex;
|
||||
MyType = entry.MyType;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Aspect_TypeMapEntry::SetType (const Aspect_LineStyle &style) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyType = style;
|
||||
|
||||
}
|
||||
|
||||
const Aspect_LineStyle& Aspect_TypeMapEntry::Type () const {
|
||||
|
||||
if ( !MyTypeIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated TypeMapEntry") ;
|
||||
|
||||
return MyType;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_TypeMapEntry::SetIndex (const Standard_Integer index) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_TypeMapEntry::Index () const {
|
||||
|
||||
if ( !MyTypeIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated TypeMapEntry");
|
||||
|
||||
return MyIndex;
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_TypeMapEntry::IsAllocated () const {
|
||||
|
||||
return ( MyTypeIsDef && MyIndexIsDef ) ;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_TypeMapEntry::Free () {
|
||||
|
||||
MyTypeIsDef = Standard_False;
|
||||
MyIndexIsDef = Standard_False;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_TypeMapEntry::Dump () const {
|
||||
|
||||
Aspect_TypeOfLine style = MyType.Style() ;
|
||||
Standard_Integer i,length = MyType.Length() ;
|
||||
|
||||
cout << " Aspect_TypeMapEntry::Dump ()\n";
|
||||
cout << " MyTypeIsDef : " << (MyTypeIsDef ? "True\n" : "False\n");
|
||||
cout << " MyIndexIsDef : " << (MyIndexIsDef ? "True\n" : "False\n");
|
||||
cout << " LineStyle : " << (Standard_Integer) style << " Length : " << length << "\n";//WNT
|
||||
if( length ) {
|
||||
for( i=(MyType.Values()).Lower() ; i<=(MyType.Values()).Upper() ; i++ )
|
||||
cout << "\t\tvalue(" << i << ") : " << MyType.Values().Value(i) << "\n";
|
||||
}
|
||||
cout << flush;
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
-- Created on: 1993-03-23
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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 WidthMap from Aspect inherits TShared from MMgt
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a WidthMap object.
|
||||
-- Associates an index and a line width entry.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
WidthOfLine from Aspect,
|
||||
WidthMapEntry from Aspect,
|
||||
SequenceOfWidthMapEntry from Aspect,
|
||||
Length from Quantity
|
||||
|
||||
raises
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create
|
||||
returns WidthMap from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates a width map.
|
||||
|
||||
AddEntry (me : mutable; AnEntry : WidthMapEntry from Aspect)
|
||||
---Level: Public
|
||||
---Purpose: Adds an entry in the Width map <me>.
|
||||
-- Warning: Raises BadAccess if WidthMap size is exceeded.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
AddEntry (me : mutable; aStyle : WidthOfLine from Aspect)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical line width entry in the width map <me>
|
||||
-- and returns the WidthMapEntry Index if exist.
|
||||
-- Or add a new entry and returns the computed WidthMapEntry index used.
|
||||
|
||||
AddEntry (me : mutable; aStyle : Length from Quantity)
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Search an identical line width entry in the width map <me>
|
||||
-- and returns the WidthMapEntry Index if exist.
|
||||
-- Or add a new entry and returns the computed WidthMapEntry index used.
|
||||
|
||||
Size( me ) returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Allocated widthmap Size
|
||||
|
||||
Index( me ; aWidthmapIndex : Integer ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the WidthMapEntry.Index of the WidthMap
|
||||
-- at rank <aWidthmapIndex> .
|
||||
raises BadAccess from Aspect is static;
|
||||
---Trigger: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
|
||||
Entry ( me ;
|
||||
AnIndex : Integer from Standard )
|
||||
returns WidthMapEntry from Aspect
|
||||
---Level: Public
|
||||
---Purpose: Returns the Width map entry with the index <AnIndex>.
|
||||
-- Warning: Raises BadAccess if the index less than 1 or
|
||||
-- greater than Size.
|
||||
raises BadAccess from Aspect is static;
|
||||
|
||||
Dump ( me ) ;
|
||||
---Level: Internal
|
||||
|
||||
fields
|
||||
mydata : SequenceOfWidthMapEntry from Aspect is protected;
|
||||
|
||||
end WidthMap ;
|
@ -1,104 +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.
|
||||
|
||||
#include <Aspect_WidthMap.ixx>
|
||||
|
||||
Aspect_WidthMap::Aspect_WidthMap( ) {
|
||||
Aspect_WidthMapEntry theDefaultEntry;
|
||||
|
||||
AddEntry(theDefaultEntry);
|
||||
}
|
||||
|
||||
void Aspect_WidthMap::AddEntry (const Aspect_WidthMapEntry& AnEntry) {
|
||||
Standard_Integer i,index = AnEntry.Index();
|
||||
Aspect_WidthMapEntry theEntry;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i);
|
||||
if( index == theEntry.Index() ) break;
|
||||
}
|
||||
|
||||
if( i > mydata.Length() ) {
|
||||
mydata.Append( AnEntry );
|
||||
} else {
|
||||
mydata.SetValue(i,AnEntry);
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_WidthMap::AddEntry (const Aspect_WidthOfLine aStyle) {
|
||||
Aspect_WidthMapEntry theEntry ;
|
||||
Standard_Integer i,maxindex = 0 ;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i) ;
|
||||
maxindex = Max(maxindex,theEntry.Index()) ;
|
||||
if( theEntry.Type() == aStyle ) return theEntry.Index() ;
|
||||
}
|
||||
|
||||
maxindex++ ;
|
||||
theEntry.SetValue(maxindex,aStyle) ;
|
||||
mydata.Append( theEntry ) ;
|
||||
return maxindex ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_WidthMap::AddEntry (const Quantity_Length aStyle) {
|
||||
Aspect_WidthMapEntry theEntry ;
|
||||
Standard_Integer i,maxindex = 0 ;
|
||||
|
||||
for( i=1 ; i<=mydata.Length() ; i++ ) {
|
||||
theEntry = mydata.Value(i) ;
|
||||
maxindex = Max(maxindex,theEntry.Index()) ;
|
||||
if( theEntry.Width() == aStyle ) return theEntry.Index() ;
|
||||
}
|
||||
|
||||
maxindex++ ;
|
||||
theEntry.SetValue(maxindex,aStyle) ;
|
||||
mydata.Append( theEntry ) ;
|
||||
return maxindex ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_WidthMap::Size() const {
|
||||
|
||||
return mydata.Length() ;
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_WidthMap::Index(const Standard_Integer anIndex) const {
|
||||
|
||||
if( anIndex < 1 || anIndex > Size() ) {
|
||||
Aspect_BadAccess::Raise ("Undefined widthmap Index");
|
||||
}
|
||||
|
||||
Aspect_WidthMapEntry theEntry = mydata.Value(anIndex) ;
|
||||
|
||||
return theEntry.Index() ;
|
||||
}
|
||||
|
||||
Aspect_WidthMapEntry Aspect_WidthMap::Entry (const Standard_Integer AnIndex) const {
|
||||
|
||||
if( AnIndex < 1 || AnIndex > mydata.Length() )
|
||||
Aspect_BadAccess::Raise ("Aspect_WidthMap::Entry Bad Index");
|
||||
|
||||
return mydata.Value(AnIndex);
|
||||
}
|
||||
|
||||
void Aspect_WidthMap::Dump () const {
|
||||
|
||||
Standard_Integer i ;
|
||||
|
||||
cout << "Widthmap Dump-->\n" ;
|
||||
|
||||
for ( i = 1 ; i <= Size() ; i++ ) (Entry(i)).Dump() ;
|
||||
|
||||
cout << "<--End Widthmap Dump\n" ;
|
||||
}
|
@ -1,143 +0,0 @@
|
||||
-- Created on: 1993-09-09
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1993-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.
|
||||
|
||||
-- Updated by JLF (Reason : Width MUST be given in METER 2 Mars 94)
|
||||
|
||||
class WidthMapEntry from Aspect
|
||||
|
||||
---Version: 0.0
|
||||
|
||||
---Purpose: This class defines a widthmap entry.
|
||||
-- A widthmap entry is an association between
|
||||
-- a LineStyle object and an index in the widthmap.
|
||||
---Keywords:
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
WidthOfLine from Aspect,
|
||||
Length from Quantity
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
Create
|
||||
returns WidthMapEntry from Aspect;
|
||||
---Level: Public
|
||||
---Purpose: Creates an unallocated widthmap entry
|
||||
|
||||
Create ( index : Integer from Standard;
|
||||
style : WidthOfLine from Aspect)
|
||||
returns WidthMapEntry;
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated widthmap entry from width style
|
||||
|
||||
Create ( index : Integer from Standard;
|
||||
width : Length from Quantity)
|
||||
returns WidthMapEntry;
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated widthmap entry from width value
|
||||
|
||||
Create ( entry : WidthMapEntry from Aspect )
|
||||
returns WidthMapEntry
|
||||
---Level: Public
|
||||
---Purpose: Creates an allocated widthmap entry.
|
||||
---Warning: Raises error if the widthmap entry <entry>
|
||||
-- is unallocated.
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
SetValue ( me: in out; index : Integer from Standard;
|
||||
style : WidthOfLine from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets widthmap entry value from width style
|
||||
-- and allocates it.
|
||||
|
||||
SetValue ( me: in out; index : Integer from Standard;
|
||||
width : Length from Quantity);
|
||||
---Level: Public
|
||||
---Purpose: Sets widthmap entry value from width value
|
||||
-- and allocates it.
|
||||
|
||||
SetValue ( me: in out; entry : WidthMapEntry from Aspect);
|
||||
---Level: Public
|
||||
---Purpose: Sets widthmap entry value and allocates it.
|
||||
---C++: alias operator =
|
||||
|
||||
SetIndex ( me: in out; index : Integer from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Sets index value of a widthmap entry.
|
||||
|
||||
SetType ( me: in out; Style : WidthOfLine from Aspect );
|
||||
---Level: Public
|
||||
---Purpose: Sets width style of widthmap entry.
|
||||
|
||||
SetWidth ( me: in out; Width : Length from Quantity);
|
||||
---Level: Public
|
||||
---Purpose: Sets width value of widthmap entry.
|
||||
|
||||
Type ( me ) returns WidthOfLine from Aspect
|
||||
---Level: Public
|
||||
---Warning: Raises error if the widthmap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
Width ( me ) returns Length from Quantity
|
||||
---Level: Public
|
||||
---Purpose: Returns width value of widthmap entry.
|
||||
-- Warning: Raises error if the widthmap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
Index ( me ) returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns index value of a widthmap entry.
|
||||
-- Warning: Raises error if the widthmap entry is unallocated .
|
||||
raises BadAccess from Aspect;
|
||||
|
||||
Free ( me : in out );
|
||||
---Level: Public
|
||||
---Purpose: Unallocates the widthmap entry.
|
||||
|
||||
IsAllocated ( me ) returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns True if the widthmap entry is allocated.
|
||||
-- Warning: A widthmap entry is allocated when the width and
|
||||
-- the index is defined.
|
||||
|
||||
Dump( me );
|
||||
---Level: Internal
|
||||
|
||||
----------------------------
|
||||
-- Category: Private methods
|
||||
----------------------------
|
||||
|
||||
SetPredefinedStyle ( me : in out;
|
||||
Type : WidthOfLine from Aspect )
|
||||
---Level: Internal
|
||||
---Purpose: Set Line Width with the predefined style values
|
||||
-- according of type
|
||||
-- Warning: Raises error if the Width style is USER_DEFINED
|
||||
raises BadAccess from Aspect is private;
|
||||
---Category: Private methods
|
||||
|
||||
fields
|
||||
MyType : WidthOfLine from Aspect;
|
||||
MyWidth : Real from Standard;
|
||||
MyIndex : Integer from Standard;
|
||||
MyTypeIsDef : Boolean from Standard;
|
||||
MyIndexIsDef : Boolean from Standard;
|
||||
|
||||
end WidthMapEntry from Aspect;
|
@ -1,191 +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.
|
||||
|
||||
#include <Aspect_WidthMapEntry.ixx>
|
||||
#include <Aspect_Units.hxx>
|
||||
|
||||
Aspect_WidthMapEntry::Aspect_WidthMapEntry() {
|
||||
|
||||
SetPredefinedStyle(Aspect_WOL_THIN);
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = 0;
|
||||
|
||||
}
|
||||
|
||||
Aspect_WidthMapEntry::Aspect_WidthMapEntry (const Standard_Integer index, const Aspect_WidthOfLine style) {
|
||||
|
||||
SetPredefinedStyle(style);
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
|
||||
}
|
||||
|
||||
Aspect_WidthMapEntry::Aspect_WidthMapEntry (const Standard_Integer index, const Quantity_Length width) {
|
||||
|
||||
if( width < 0. )
|
||||
Aspect_BadAccess::Raise("Bad Line Width") ;
|
||||
|
||||
MyType = Aspect_WOL_USERDEFINED ;
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
MyWidth = width;
|
||||
|
||||
}
|
||||
|
||||
Aspect_WidthMapEntry::Aspect_WidthMapEntry (const Aspect_WidthMapEntry& entry) {
|
||||
|
||||
if ( !entry.MyTypeIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated WidthMapEntry") ;
|
||||
}
|
||||
else {
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = entry.MyIndex;
|
||||
MyType = entry.MyType;
|
||||
MyWidth = entry.MyWidth;
|
||||
}
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::SetValue (const Standard_Integer index, const Aspect_WidthOfLine style) {
|
||||
|
||||
SetPredefinedStyle(style);
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::SetValue (const Standard_Integer index, const Quantity_Length width) {
|
||||
|
||||
if( width < 0. )
|
||||
Aspect_BadAccess::Raise("Bad Line Width") ;
|
||||
|
||||
MyType = Aspect_WOL_USERDEFINED ;
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyWidth = width ;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::SetValue (const Aspect_WidthMapEntry& entry) {
|
||||
|
||||
if ( !entry.MyTypeIsDef || !entry.MyIndexIsDef ) {
|
||||
Aspect_BadAccess::Raise("Unallocated WidthMapEntry") ;
|
||||
}
|
||||
else {
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndexIsDef = Standard_True;
|
||||
MyIndex = entry.MyIndex;
|
||||
MyType = entry.MyType;
|
||||
MyWidth = entry.MyWidth;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::SetType (const Aspect_WidthOfLine style) {
|
||||
|
||||
SetPredefinedStyle(style);
|
||||
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::SetWidth (const Quantity_Length width) {
|
||||
|
||||
if( width < 0. )
|
||||
Aspect_BadAccess::Raise("Bad Line Width") ;
|
||||
|
||||
MyType = Aspect_WOL_USERDEFINED ;
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyWidth = width ;
|
||||
|
||||
}
|
||||
|
||||
Aspect_WidthOfLine Aspect_WidthMapEntry::Type () const {
|
||||
|
||||
if ( !MyTypeIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated WidthMapEntry") ;
|
||||
|
||||
return MyType;
|
||||
|
||||
}
|
||||
|
||||
Standard_Real Aspect_WidthMapEntry::Width () const {
|
||||
|
||||
if ( !MyTypeIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated WidthMapEntry") ;
|
||||
|
||||
return MyWidth;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::SetIndex (const Standard_Integer index) {
|
||||
|
||||
MyTypeIsDef = Standard_True;
|
||||
MyIndex = index;
|
||||
|
||||
}
|
||||
|
||||
Standard_Integer Aspect_WidthMapEntry::Index () const {
|
||||
|
||||
if ( !MyTypeIsDef || !MyIndexIsDef )
|
||||
Aspect_BadAccess::Raise("Unallocated WidthMapEntry");
|
||||
|
||||
return MyIndex;
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Aspect_WidthMapEntry::IsAllocated () const {
|
||||
|
||||
return ( MyTypeIsDef && MyIndexIsDef ) ;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::Free () {
|
||||
|
||||
MyTypeIsDef = Standard_False;
|
||||
MyIndexIsDef = Standard_False;
|
||||
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::Dump () const {
|
||||
|
||||
cout << " Aspect_WidthMapEntry::Dump ()\n";
|
||||
cout << " MyTypeIsDef : " << (MyTypeIsDef ? "True\n" : "False\n");
|
||||
cout << " MyIndexIsDef : " << (MyIndexIsDef ? "True\n" : "False\n");
|
||||
cout << " TypeOfWidth : " << (Standard_Integer) MyType << "\n";//WNT
|
||||
cout << " LineWidth : " << MyWidth << "\n";
|
||||
cout << flush;
|
||||
}
|
||||
|
||||
void Aspect_WidthMapEntry::SetPredefinedStyle(const Aspect_WidthOfLine Style) {
|
||||
|
||||
MyType = Style ;
|
||||
MyTypeIsDef = Standard_True;
|
||||
switch ( Style ) {
|
||||
case Aspect_WOL_USERDEFINED :
|
||||
Aspect_BadAccess::Raise("Bad Predefined Line Width Style") ;
|
||||
case Aspect_WOL_THIN:
|
||||
MyWidth = 0.25 MILLIMETER ;
|
||||
break ;
|
||||
case Aspect_WOL_MEDIUM :
|
||||
MyWidth = 0.5 MILLIMETER ;
|
||||
break ;
|
||||
case Aspect_WOL_THICK :
|
||||
MyWidth = 0.7 MILLIMETER ;
|
||||
break ;
|
||||
case Aspect_WOL_VERYTHICK :
|
||||
MyWidth = 1.5 MILLIMETER ;
|
||||
break ;
|
||||
}
|
||||
}
|
@ -1,312 +0,0 @@
|
||||
-- Created on: 1993-12-08
|
||||
-- Created by: Jean Louis FRENKEL, Stephane CALLEGARI
|
||||
-- Copyright (c) 1993-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.
|
||||
|
||||
deferred class WindowDriver from Aspect inherits Driver from Aspect
|
||||
|
||||
---Purpose: defines the WINDOW oriented output driver.
|
||||
-- Warning: A limited number of mono attribute and translatable BUFFERS can be defined
|
||||
-- for retaining a lot of primitives for DRAGGING .
|
||||
--
|
||||
|
||||
uses
|
||||
TypeOfResize from Aspect,
|
||||
Window from Aspect,
|
||||
TypeOfDrawMode from Aspect,
|
||||
Factor from Quantity,
|
||||
PlaneAngle from Quantity,
|
||||
ExtendedString from TCollection
|
||||
|
||||
raises
|
||||
DriverError from Aspect
|
||||
|
||||
is
|
||||
Initialize(aWindow: Window from Aspect);
|
||||
|
||||
BeginDraw (me: mutable;
|
||||
DoubleBuffer: Boolean = Standard_True;
|
||||
aRetainBuffer: Integer = 0)
|
||||
---Purpose: Begin graphics and drawn directly to the Window or Pixmap if
|
||||
--<aRetainBuffer> is 0 or in the retain buffer if > 0.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not open.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
ResizeSpace(me : mutable)
|
||||
returns TypeOfResize from Aspect
|
||||
raises DriverError from Aspect
|
||||
is deferred;
|
||||
|
||||
Window(me) returns Window from Aspect;
|
||||
|
||||
SetDrawMode (me: mutable;
|
||||
aMode: TypeOfDrawMode from Aspect)
|
||||
is deferred;
|
||||
---Level: Public
|
||||
---Purpose: Change the current drawing mode of the Driver
|
||||
-- XW_REPLACE : the primitive is drawn with his defined color.
|
||||
-- XW_ERASE : the primitive is erased from the window.
|
||||
-- XW_XOR : the primitive is xored to the window.
|
||||
-- XW_XORLIGHT: the primitive is xored depending of the current
|
||||
-- highlight and background colors.
|
||||
|
||||
-------------------------------------------------------------
|
||||
-- Category: Methods to define or edit a buffer of primitives
|
||||
-------------------------------------------------------------
|
||||
|
||||
OpenBuffer (me: mutable; aRetainBuffer: Integer;
|
||||
aPivotX: ShortReal = 0.0;
|
||||
aPivotY: ShortReal = 0.0;
|
||||
aWidthIndex: Integer = 0;
|
||||
aColorIndex: Integer = 0;
|
||||
aFontIndex: Integer = 0;
|
||||
aDrawMode: TypeOfDrawMode = Aspect_TODM_REPLACE)
|
||||
returns Boolean is deferred;
|
||||
---Purpose: Allocate the retain buffer <aRetainBuffer> ,
|
||||
-- Defines the DWU coordinates of the pivot point for all primitives
|
||||
--contains inside.
|
||||
-- Defines the buffer color and font index :
|
||||
-- the default color is the highlight color of the colormap.
|
||||
-- the default font is the default system font of the fontmap.
|
||||
-- The other attributes are fixed :
|
||||
-- line type is Solid,
|
||||
-- line width is 1 Pixel,
|
||||
-- polygon fill mode is Solid,
|
||||
-- Warning: The number of allocated buffers is limited,it's
|
||||
--recommended to close unused buffers some time!
|
||||
-- The TypeOfDrawMode REPLACE is enabled only if the
|
||||
-- background drawing has been drawn with the DoubleBuffer
|
||||
-- flag set to ENABLE at the last BeginDraw time.
|
||||
-- The TypeOfDrawMode XOR is enabled in any case.
|
||||
-- The other TypeOfDrawMode are not authorized.
|
||||
-- Returns TRUE if the buffer is allocated and enabled for drawing.
|
||||
|
||||
CloseBuffer (me; aRetainBuffer: Integer)
|
||||
---Purpose: Clear & Deallocate the retain buffer <aRetainBuffer>.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
ClearBuffer (me; aRetainBuffer: Integer)
|
||||
---Purpose: Erase & Clear ALL primitives retains in the buffer <aRetainBuffer>.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
DrawBuffer (me; aRetainBuffer: Integer)
|
||||
---Purpose: Draw ALL primitives retains in the buffer <aRetainBuffer>.
|
||||
-- Warning: Note that the aspect of a retain buffer drawing is
|
||||
-- mono-colored with the current buffer Attributes and
|
||||
-- Depending of the DoubleBuffer state flag at the BeginDraw() buffer time,
|
||||
-- when DB is TRUE,an XOR method is use for drawing and erasing buffers in the
|
||||
-- same way.In this case,some color side effect can occurs depending of the
|
||||
-- traversal primitive colors and the supported hardware.
|
||||
-- when DB is FALSE and the background drawing has been generated with
|
||||
-- DB at TRUE,no color side effect occurs because the DB is used for restoring
|
||||
-- the drawing context at EraseBuffer() time,this is more powerfull for the
|
||||
-- drawing quality excepted for large buffers (flicking) .
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
EraseBuffer (me; aRetainBuffer: Integer)
|
||||
---Purpose: Erase ALL primitives retains in the buffer <aRetainBuffer>.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
MoveBuffer (me; aRetainBuffer: Integer;
|
||||
aPivotX: ShortReal = 0.0;
|
||||
aPivotY: ShortReal = 0.0)
|
||||
---Purpose: Erase , Translate and reDraw ALL primitives retains in the buffer
|
||||
--<aRetainBuffer>.
|
||||
--<aPivotX,aPivotY> are the new DWU attached point absolute coordinates
|
||||
--of the buffer pivot point.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
ScaleBuffer (me; aRetainBuffer: Integer; aScaleX: Factor = 1.0;
|
||||
aScaleY: Factor = 1.0)
|
||||
---Purpose: Erase , Scale the buffer from the Pivot point and reDraw ALL primitives
|
||||
--retains in the buffer <aRetainBuffer>.
|
||||
--<aScaleX,aScaleY> are the absolute scale factors apply on the two axis.
|
||||
-- Warning: Note that the scalling of some primitives can provided some bad
|
||||
--smoothing side effect (i.e: Circles,...)
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened or
|
||||
--one of <aScale> factor is <= 0.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
RotateBuffer (me; aRetainBuffer: Integer; anAngle: PlaneAngle = 0.0)
|
||||
---Purpose: Erase , Rotate the buffer from the Pivot point and reDraw ALL primitives
|
||||
--retains in the buffer <aRetainBuffer>.
|
||||
--<anAngle> is the absolute counter-clockwise rotation angle from the
|
||||
--Horizontal axis.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
BufferIsOpen(me; aRetainBuffer : Integer) returns Boolean is deferred;
|
||||
---Purpose: Returns TRUE if the retain buffer <aRetainBuffer> is enabled
|
||||
--for drawing.
|
||||
|
||||
BufferIsEmpty(me; aRetainBuffer : Integer) returns Boolean is deferred;
|
||||
---Purpose: Returns TRUE if the retain buffer has not been opened or empty.
|
||||
--- Returns FALSE if a lot of primitives have been stored inside
|
||||
-- because a BeginDraw(..,<aRetainBuffer>) has been done previously.
|
||||
|
||||
BufferIsDrawn(me; aRetainBuffer : Integer) returns Boolean is deferred;
|
||||
---Purpose: Returns TRUE if the retain buffer s actually displayed at screen.
|
||||
|
||||
AngleOfBuffer(me; aRetainBuffer : Integer; anAngle: out PlaneAngle)
|
||||
---Purpose: Returns the current buffer rotate angle from the X axis.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
ScaleOfBuffer(me; aRetainBuffer : Integer; aScaleX,aScaleY: out Factor)
|
||||
---Purpose: Returns the current buffer scale factors.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
PositionOfBuffer(me; aRetainBuffer : Integer; aPivotX,aPivotY: out ShortReal )
|
||||
---Purpose: Returns the current buffer position.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Trigger: Raises if the retain buffer is not opened.
|
||||
-- call BufferIsOpen() method before.
|
||||
|
||||
TextSize (me; aText: ExtendedString from TCollection;
|
||||
aWidth, aHeight: out ShortReal from Standard;
|
||||
aFontIndex: Integer from Standard = -1)
|
||||
---Level: Public
|
||||
---Purpose: Returns the TEXT size in DWU space depending
|
||||
-- of the required FontIndex if aFontIndex is >= 0
|
||||
-- or the current FontIndex if < 0 (default).
|
||||
---Trigger: Raises if font is not defined.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Inquire methods
|
||||
|
||||
TextSize (me; aText: ExtendedString from TCollection;
|
||||
aWidth, aHeight, anXoffset, anYoffset: out ShortReal from Standard;
|
||||
aFontIndex: Integer from Standard = -1)
|
||||
---Level: Public
|
||||
---Purpose: Returns the TEXT size and offsets
|
||||
-- in DWU space depending
|
||||
-- of the required FontIndex if aFontIndex is >= 0
|
||||
-- or the current FontIndex if < 0 (default).
|
||||
---Trigger: Raises if font is not defined.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Inquire methods
|
||||
|
||||
FontSize (me; aSlant: out PlaneAngle from Quantity;
|
||||
aSize,aBheight: out ShortReal from Standard;
|
||||
aFontIndex: Integer from Standard = -1)
|
||||
returns CString from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the font string,slant,size and
|
||||
--baseline height in DWU space depending
|
||||
-- of the required FontIndex if aFontIndex is >= 0
|
||||
-- or the current FontIndex if < 0 (default).
|
||||
---Trigger: Raises if font is not defined.
|
||||
raises DriverError from Aspect is deferred;
|
||||
---Category: Inquire methods
|
||||
|
||||
ColorBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
|
||||
is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the min and max driver virtual color indexs.
|
||||
---Category: Inquire methods
|
||||
|
||||
LocalColorIndex(me; anIndex : Integer from Standard)
|
||||
returns Integer from Standard is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the local colormap hardware index from a virtual driver color
|
||||
-- index or returns -1 if the index is not defined.
|
||||
---Category: Inquire methods
|
||||
|
||||
FontBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
|
||||
is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the min and max driver virtual font indexs.
|
||||
---Category: Inquire methods
|
||||
|
||||
LocalFontIndex(me; anIndex : Integer from Standard)
|
||||
returns Integer from Standard is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the associated fontmap hardware index from a virtual driver font
|
||||
-- index or returns -1 if the index is not defined.
|
||||
---Category: Inquire methods
|
||||
|
||||
TypeBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
|
||||
is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the min and max driver virtual type indexs.
|
||||
---Category: Inquire methods
|
||||
|
||||
LocalTypeIndex(me; anIndex : Integer from Standard)
|
||||
returns Integer from Standard is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the associated typemap hardware index from a virtual driver type
|
||||
-- index or returns -1 if the index is not defined.
|
||||
---Category: Inquire methods
|
||||
|
||||
WidthBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
|
||||
is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the min and max driver virtual width indexs.
|
||||
---Category: Inquire methods
|
||||
|
||||
LocalWidthIndex(me; anIndex : Integer from Standard)
|
||||
returns Integer from Standard is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the associated widthmap hardware index from a virtual driver width
|
||||
-- index or returns -1 if the index is not defined.
|
||||
---Category: Inquire methods
|
||||
|
||||
MarkBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
|
||||
is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the min and max driver virtual marker indexs.
|
||||
---Category: Inquire methods
|
||||
|
||||
LocalMarkIndex(me; anIndex : Integer from Standard)
|
||||
returns Integer from Standard is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose:
|
||||
-- Returns the local markmap hardware index from a virtual driver marker
|
||||
-- index or returns -1 if the index is not defined.
|
||||
---Category: Inquire methods
|
||||
|
||||
fields
|
||||
MyWindow : Window from Aspect is protected;
|
||||
MyDrawMode : TypeOfDrawMode from Aspect is protected;
|
||||
MyRetainBuffer : Integer from Standard is protected;
|
||||
|
||||
end WindowDriver from Aspect;
|
@ -1,23 +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.
|
||||
|
||||
#include <Aspect_WindowDriver.ixx>
|
||||
|
||||
Aspect_WindowDriver::Aspect_WindowDriver(const Handle(Aspect_Window)& aWindow) : MyWindow(aWindow) {}
|
||||
|
||||
Handle(Aspect_Window) Aspect_WindowDriver::Window() const {
|
||||
|
||||
return MyWindow;
|
||||
|
||||
}
|
@ -1,10 +1,7 @@
|
||||
EXTERNLIB
|
||||
Aspect_WOKSteps.edl
|
||||
Aspect_CMPLRS.edl
|
||||
Aspect_FStream.hxx
|
||||
Aspect_IFStream.hxx
|
||||
Aspect_CLayer2d.hxx
|
||||
Aspect_RGBPixel.hxx
|
||||
Aspect_Handle.hxx
|
||||
Aspect_XWD.hxx
|
||||
Aspect_Units.hxx
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include <Select3D_SensitivePoint.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
|
||||
#include <Aspect_MarkerStyle.hxx>
|
||||
#include <Aspect_LineStyle.hxx>
|
||||
#include <Aspect_InteriorStyle.hxx>
|
||||
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <Aspect_Window.hxx>
|
||||
#include <Aspect_WindowDriver.hxx>
|
||||
#include <Aspect_DisplayConnection.hxx>
|
||||
#include <Graphic3d.hxx>
|
||||
#include <DBRep.hxx>
|
||||
|
@ -23,8 +23,6 @@
|
||||
#include <Visual3d_ViewManager.hxx>
|
||||
|
||||
#include <Aspect_Window.hxx>
|
||||
#include <Aspect_ColorMap.hxx>
|
||||
#include <Aspect_ColorMapEntry.hxx>
|
||||
#include <Aspect_SequenceOfColor.hxx>
|
||||
#include <Aspect_TypeOfColorScaleData.hxx>
|
||||
#include <Aspect_TypeOfColorScalePosition.hxx>
|
||||
|
@ -142,14 +142,6 @@ To solve the problem (for lack of a better solution) I make 2 passes.
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
|
||||
// S3603
|
||||
#include <Aspect_GenericColorMap.hxx>
|
||||
#include <Aspect_TypeMap.hxx>
|
||||
#include <Aspect_WidthMap.hxx>
|
||||
#include <Aspect_MarkMap.hxx>
|
||||
#include <Aspect_FontMap.hxx>
|
||||
#include <Aspect.hxx>
|
||||
|
||||
#define V3d_FLAG_COMPUTATION 0x00000004
|
||||
|
||||
// Perspective
|
||||
|
Loading…
x
Reference in New Issue
Block a user