1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023663: Removing 2D viewer library

Deleted TKV2d toolkit and CGM, MFT,FontMFT, PlotMgt, PS packages. Deleted 2d test cases.
Deleted WNT_WDriver and Xw_Driver, edited Aspect_Driver.
Deleted trailing spaces, removed WNT_FontMapEntry, WNT_FontTable, WNT_HFontTable
Deleting tests for 2D viewer
This commit is contained in:
aba 2013-01-25 18:11:16 +04:00
parent 474be6cde1
commit 128cc8df34
488 changed files with 119 additions and 99326 deletions

View File

@ -208,33 +208,23 @@ t TKTopAlgo
t TKXMesh
n InterfaceGraphic
p AIS
p AIS2D
p AlienImage
p Aspect
p CGM
p DsgPrs
p GGraphic2d
p Graphic2d
p Graphic3d
p Image
p ImageUtility
p MFT
p MeshVS
p NIS
p OpenGl
p PS
p PlotMgt
p Prs2d
p Prs3d
p PrsMgr
p Select2D
p Select3D
p SelectBasics
p SelectMgr
p StdPrs
p StdSelect
p TColQuantity
p V2d
p V3d
p Viewer
p Visual3d
@ -242,13 +232,11 @@ p Voxel
p WNT
p Xw
p Cocoa
r FontMFT
r Textures
t TKMeshVS
t TKNIS
t TKOpenGl
t TKService
t TKV2d
t TKV3d
t TKVoxel
n BinTObjDrivers
@ -475,7 +463,6 @@ p TObjDRAW
p TestTopOpe
p TestTopOpeDraw
p TestTopOpeTools
p Viewer2dTest
p ViewerTest
p XDEDRAW
p XSDRAW
@ -497,7 +484,6 @@ p QANCollection
p QANewBRepNaming
p QANewDBRepNaming
p QANewModTopOpe
p QAViewer2dTest
r QAResources
t TKQADraw
p QADNaming

View File

@ -141,7 +141,6 @@ uses
Geom,
Bnd,
Aspect,
Graphic2d,
Graphic3d,
V3d,
TopAbs,

View File

@ -39,9 +39,7 @@ uses Shape from TopoDS,
Line from Geom,
Ax1 from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
Plane from Geom,
Surface from Geom,
ExtendedString from TCollection,
@ -191,12 +189,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -472,19 +472,6 @@ void AIS_AngleDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : : to avoid warning
//=======================================================================
void AIS_AngleDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_AngleDimension::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_AngleDimension::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_AngleDimension::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -39,8 +39,6 @@ uses
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Pnt from gp,
Dir from gp,
LineAspect from Prs3d,
@ -134,13 +132,7 @@ is
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -248,16 +248,6 @@ void AIS_Axis::SetWidth(const Standard_Real aValue)
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
//=======================================================================
//function : Compute
//purpose : to avoid warning

View File

@ -39,8 +39,6 @@ uses
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfDimension from AIS
@ -94,12 +92,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -242,19 +242,6 @@ void AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_Chamf2dDimension::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_Chamf2dDimension::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -38,8 +38,6 @@ uses
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfDimension from AIS
@ -90,11 +88,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -217,19 +217,6 @@ void AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_Chamf3dDimension::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_Chamf3dDimension::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -36,8 +36,6 @@ uses
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Line from AIS,
KindOfInteractive from AIS
@ -68,12 +66,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -254,15 +254,6 @@ void AIS_Circle::ComputeArcSelection(const Handle(SelectMgr_Selection)& aSelecti
myComponent,myUStart,myUEnd);
aSelection->Add(seg);
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Circle::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
//=======================================================================
//function : Compute

View File

@ -40,8 +40,6 @@ uses
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d ,
Plane from Geom
is
@ -68,12 +66,6 @@ is
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -238,17 +238,6 @@ void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&,
{
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
//=======================================================================
//function : ComputeSelection
//purpose :

View File

@ -49,8 +49,6 @@ uses
Location from TopLoc,
Transformation from Geom,
PresentationManager3d from PrsMgr,
GraphicObject from Graphic2d,
PresentationManager2d from PrsMgr,
Presentation from Prs3d,
TypeOfPresentation3d from PrsMgr,
Selection from SelectMgr,
@ -145,18 +143,6 @@ is
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
---Level: Internal
---Purpose: this method should fill the presentation according to the
-- enumerated mode of the application and to the display parameter
-- of the application.
raises NotImplemented from Standard
is redefined;
ComputeSelection(me:mutable; aSelection :mutable Selection from SelectMgr;
aMode : Integer) is redefined virtual private;

View File

@ -152,12 +152,6 @@ void AIS_ConnectedInteractive::Compute(const Handle_Prs3d_Projector& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
void AIS_ConnectedInteractive::Compute(const Handle_PrsMgr_PresentationManager2d& aPresentationManager2d, const Handle_Graphic2d_GraphicObject& aGraphicObject, const int anInteger)
{
// Standard_NotImplemented::Raise("AIS_ConnectedInteractive::Compute(const Handle_PrsMgr_PresentationManager2d&, const Handle_Graphic2d_GraphicObject&, const int)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
//=======================================================================
//function : ComputeSelection
//purpose :

View File

@ -42,9 +42,7 @@ uses
Integer from Standard,
Shape from AIS,
TypeOfPresentation3d from PrsMgr,
GraphicObject from Graphic2d,
PresentationManager3d from PrsMgr,
PresentationManager2d from PrsMgr,
InteractiveObject from AIS,
KindOfInteractive from AIS,
Location from TopLoc,
@ -113,17 +111,6 @@ is
aPresentation : mutable Presentation from Prs3d)
is redefined virtual private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
raises NotImplemented from Standard
is redefined;
---Level: Internal
---Purpose: this method should fill the presentation according to the
-- enumerated mode of the application and to the display parameter
-- of the application.
ComputeSelection(me:mutable; aSelection :mutable Selection from SelectMgr;
aMode : Integer from Standard)
is redefined virtual private;

View File

@ -166,19 +166,6 @@ void AIS_ConnectedShape::Compute(const Handle(Prs3d_Projector)& aProjector,
}
}
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
void AIS_ConnectedShape::Compute(const Handle_PrsMgr_PresentationManager2d& aPresentationManager2d,
const Handle_Graphic2d_GraphicObject& aGraphicObject,
const int anInteger)
{
// Standard_NotImplemented::Raise("AIS_ConnectedShape::Compute(const Handle_PrsMgr_PresentationManager2d&, const Handle_Graphic2d_GraphicObject&, const int)");
AIS_ConnectedInteractive::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
//=======================================================================
//function : ComputeSelection
//purpose : Attention fragile...

View File

@ -46,9 +46,7 @@ uses
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfSurface from AIS,
@ -126,12 +124,6 @@ is
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -168,19 +168,6 @@ void AIS_DiameterDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_DiameterDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aPresentation,
const Standard_Integer aMode)
{
// Standard_NotImplemented::Raise("AIS_DiameterDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager, const Handle(Graphic2d_GraphicObject)& aPresentation, const Standard_Integer aMode)");
PrsMgr_PresentableObject::Compute( aPresentationManager ,aPresentation,aMode) ;
}
void AIS_DiameterDimension::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_DiameterDimension::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -35,8 +35,6 @@ uses
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Selection from SelectMgr,
Pnt from gp,
Drawer from AIS,
@ -102,13 +100,7 @@ is
Compute( me : mutable;
aProjector : Projector from Prs3d;
aPresentation : mutable Presentation from Prs3d )
is redefined static private;
Compute( me : mutable;
aPresentationManager : PresentationManager2d from PrsMgr;
aPresentation : mutable GraphicObject from Graphic2d;
aMode : Integer from Standard = 0 )
is redefined static private;
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -221,21 +221,6 @@ void AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )& aProje
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning at compilation (SUN)
//=======================================================================
void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManager2d )& aPresentationManager2d,
const Handle( Graphic2d_GraphicObject )& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManager2d )&,
// const Handle( Graphic2d_GraphicObject )&,const Standard_Integer )");
// PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning at compilation (SUN)

View File

@ -31,8 +31,6 @@ uses
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Selection from SelectMgr,
Pnt from gp
@ -56,13 +54,7 @@ is
Compute( me : mutable;
aProjector : Projector from Prs3d;
aPresentation : mutable Presentation from Prs3d )
is redefined static private;
Compute( me : mutable;
aPresentationManager : PresentationManager2d from PrsMgr;
aPresentation : mutable GraphicObject from Graphic2d;
aMode : Integer from Standard = 0 )
is redefined static private;
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -164,19 +164,6 @@ void AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )& /*aProje
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning at compilation (SUN)
//=======================================================================
void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager2d )& /*aPresentationManager2d*/,
const Handle( Graphic2d_GraphicObject )& /*aGraphicObject*/,
const Standard_Integer /*anInteger*/)
{
// Standard_NotImplemented::Raise("AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager2d )&,const Handle( Graphic2d_GraphicObject )&,const Standard_Integer )");
// PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
//=======================================================================
//function : Compute
//purpose :

View File

@ -45,8 +45,6 @@ uses
Pnt from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Plane from Geom
is
@ -109,14 +107,8 @@ is
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -235,19 +235,6 @@ void AIS_FixRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
//=======================================================================
//function : Compute
//purpose :

View File

@ -34,9 +34,7 @@ uses
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
Plane from Geom,
Curve from Geom,
Line from Geom,
@ -75,12 +73,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -379,18 +379,6 @@ void AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
void AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_IdenticRelation::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_IdenticRelation::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -34,9 +34,7 @@ uses Shape from TopoDS,
Dir from gp,
Pnt from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
ExtendedString from TCollection,
Plane from Geom,
TypeOfDist from AIS,
@ -150,12 +148,6 @@ is
aPresentation : mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -387,19 +387,6 @@ void AIS_LengthDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_LengthDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_LengthDimension::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_LengthDimension::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_LengthDimension::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -36,8 +36,6 @@ uses
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Line from AIS,
KindOfInteractive from AIS
@ -61,13 +59,7 @@ is
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -298,15 +298,6 @@ void AIS_Line::ComputeSegmentLineSelection(const Handle(SelectMgr_Selection)& aS
myEndPoint->Pnt());
aSelection->Add(seg);
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Line::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
//=======================================================================
//function : Compute

View File

@ -40,9 +40,7 @@ uses
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfSurface from AIS,
@ -85,13 +83,7 @@ is
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -146,19 +146,6 @@ void AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aPresentation,
const Standard_Integer aMode)
{
// Standard_NotImplemented::Raise("AIS_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager, const Handle(Graphic2d_GraphicObject)& aPresentation, const Standard_Integer aMode)");
PrsMgr_PresentableObject::Compute( aPresentationManager ,aPresentation,aMode) ;
}
//=======================================================================
//function : Compute
//purpose :

View File

@ -26,10 +26,8 @@ uses
ExtendedString from TCollection,
Projector from Prs3d,
Presentation from Prs3d,
PresentationManager2d from PrsMgr,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
GraphicObject from Graphic2d,
Dir from gp,
Pnt from gp,
Lin from gp,
@ -70,12 +68,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me: mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation : mutable GraphicObject from Graphic2d;
aMode : Integer from Standard = 0)
is redefined static private;
Compute(me: mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -155,18 +155,6 @@ void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*/
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning at compilation (SUN)
//=======================================================================
void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager2d)& /*aPresentationManager2d*/,
const Handle(Graphic2d_GraphicObject)& /*aGraphicObject*/,
const Standard_Integer /*anInteger*/)
{
// Standard_NotImplemented::Raise("AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
// PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_MidPointRelation::Compute(const Handle_Prs3d_Projector& aProjector,
const Handle_Geom_Transformation& aTransformation,
const Handle_Prs3d_Presentation& aPresentation)

View File

@ -39,9 +39,7 @@ uses
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfSurface from AIS,
@ -87,12 +85,6 @@ is
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -148,19 +148,6 @@ void AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aPresentation,
const Standard_Integer aMode)
{
// Standard_NotImplemented::Raise("AIS_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager, const Handle(Graphic2d_GraphicObject)& aPresentation, const Standard_Integer aMode)");
PrsMgr_PresentableObject::Compute( aPresentationManager ,aPresentation,aMode) ;
}
//=======================================================================
//function : Compute
//purpose :

View File

@ -38,8 +38,6 @@ uses
SequenceOfInteractive from AIS,
KindOfInteractive from AIS,
PresentationManager3d from PrsMgr,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
@ -97,12 +95,6 @@ is
-- a transformation if there's one stored.
is redefined virtual protected;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -176,19 +176,6 @@ void AIS_MultipleConnectedInteractive::Compute(const Handle_Prs3d_Projector& aPr
//purpose :
//=======================================================================
void AIS_MultipleConnectedInteractive::Compute(const Handle_PrsMgr_PresentationManager2d& aPresentationManager2d,
const Handle_Graphic2d_GraphicObject& aGraphicObject,
const int anInteger)
{
// Standard_NotImplemented::Raise("AIS_MultipleConnectedInteractive::Compute(const Handle_PrsMgr_PresentationManager2d&, const Handle_Graphic2d_GraphicObject&, const int)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
void AIS_MultipleConnectedInteractive::Compute(const Handle_Prs3d_Projector& aProjector,
const Handle_Geom_Transformation& aTransformation,
const Handle_Prs3d_Presentation& aPresentation)

View File

@ -33,8 +33,6 @@ class MultipleConnectedShape from AIS inherits MultipleConnectedInteractive from
uses
PresentationManager3d from PrsMgr,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Shape from TopoDS,
Projector from Prs3d,
Presentation from Prs3d,
@ -108,18 +106,6 @@ is
-- presentation of this last object, with
-- a transformation if there's one stored.
is redefined virtual private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
---Level: Internal
---Purpose: this method should fill the presentation according to the
-- enumerated mode of the application and to the display parameter
-- of the application.
raises NotImplemented from Standard
is redefined;
fields
myShape : Shape from TopoDS; -- celle qui sert au compute Hidden lines et selection

View File

@ -171,19 +171,6 @@ void AIS_MultipleConnectedShape::Compute(const Handle_PrsMgr_PresentationManager
AIS_MultipleConnectedInteractive::Compute( aPresentationManager3d , aPresentation , anint ) ;
}
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
void AIS_MultipleConnectedShape::Compute(const Handle_PrsMgr_PresentationManager2d& aPresentationManager2d,
const Handle_Graphic2d_GraphicObject& aGraphicObject,
const int anInteger)
{
// Standard_NotImplemented::Raise("AIS_MultipleConnectedShape::Compute(const Handle_PrsMgr_PresentationManager2d&, const Handle_Graphic2d_GraphicObject&, const int)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
//=======================================================================
//function : ComputeSelection
//purpose :

View File

@ -32,11 +32,9 @@ uses
Shape from TopoDS,
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
Transformation from Geom,
PresentationManager3d from PrsMgr,
PresentationManager2d from PrsMgr,
Selection from SelectMgr,
GraphicObject from Graphic2d,
Dir from gp,
Pnt from gp,
Trsf from gp,
@ -62,12 +60,6 @@ is
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -148,18 +148,6 @@ void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning at compilation (SUN)
//=======================================================================
void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& /*aPresentationManager2d*/,
const Handle(Graphic2d_GraphicObject)& /*aGraphicObject*/,
const Standard_Integer /*anInteger*/)
{
// Standard_NotImplemented::Raise("AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
// PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)

View File

@ -34,9 +34,7 @@ uses Shape from TopoDS,
Dir from gp,
Pnt from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
ArrowSide from DsgPrs
is
@ -79,13 +77,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -145,18 +145,6 @@ void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_ParallelRelation::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_ParallelRelation::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -30,9 +30,7 @@ uses Shape from TopoDS,
Pnt from gp,
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
Plane from Geom
is
@ -69,12 +67,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -129,19 +129,6 @@ void AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)& aProjecto
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)&
aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_PerpendicularRelation::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
{
// Standard_NotImplemented::Raise("AIS_PerpendicularRelation::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");

View File

@ -38,8 +38,6 @@ uses
Pnt from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
NameOfMaterial from Graphic3d,
TypeOfPlane from AIS,
Axis2Placement from Geom,
@ -200,13 +198,7 @@ is
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined virtual private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined virtual private;
is redefined virtual private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -535,16 +535,6 @@ void AIS_Plane::ComputeFrame()
}
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
//=======================================================================
//function : Compute
//purpose : to avoid warning

View File

@ -55,8 +55,6 @@ uses
Projector from Prs3d,
Transformation from Geom,
Drawer from Prs3d,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Line from AIS,
Point from AIS,
Plane from Geom,
@ -109,11 +107,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -291,15 +291,6 @@ void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
myDrawer->DatumAspect()->SecondAxisAspect()->SetColor(aCol);
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_PlaneTrihedron::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
void AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)&,
const Handle(Prs3d_Presentation)&)

View File

@ -36,8 +36,6 @@ uses
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Vertex from TopoDS,
KindOfInteractive from AIS
@ -75,13 +73,7 @@ is
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -168,15 +168,7 @@ TopoDS_Vertex AIS_Point::Vertex() const
return BRepBuilderAPI_MakeVertex(P);
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Point::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
//=======================================================================
//function : Compute
//purpose : to avoid warning

View File

@ -42,9 +42,7 @@ uses Shape from TopoDS,
Lin from gp,
Circ from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfDimension from AIS
@ -114,12 +112,6 @@ is
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -292,18 +292,6 @@ void AIS_RadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_RadiusDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aPresentation,
const Standard_Integer aMode)
{
// Standard_NotImplemented::Raise("AIS_RadiusDimension::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,const Handle(Graphic2d_GraphicObject)& aPresentation,const Standard_Integer aMode)");
PrsMgr_PresentableObject::Compute( aPresentationManager ,aPresentation,aMode) ;
}
//=======================================================================
//function : Compute
//purpose :

View File

@ -58,13 +58,11 @@ uses
Box from Bnd,
ShapeEnum from TopAbs,
Shape from TopoDS,
GraphicObject from Graphic2d,
NameOfMaterial from Graphic3d ,
---NameOfPhysicalMaterial from Graphic3d ,
MaterialAspect from Graphic3d,
Presentation from Prs3d,
Projector from Prs3d,
PresentationManager2d from PrsMgr,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
KindOfInteractive from AIS,
@ -174,11 +172,6 @@ uses
aMode : Integer from Standard = 0)
is redefined virtual protected;
Compute(me : mutable;
aPresentationManager : PresentationManager2d from PrsMgr;
aPresentation : mutable GraphicObject from Graphic2d;aMode:Integer from Standard = 0)
is redefined virtual protected;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aPresentation : mutable Presentation from Prs3d)

View File

@ -275,17 +275,6 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
aPrs->ReCompute(); // for hidden line recomputation if necessary...
}
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager2d)& /*aPresentationManager*/,
const Handle(Graphic2d_GraphicObject)& /*aGRO*/,
const Standard_Integer /*aMode*/)
{
}
//=======================================================================
//function : Compute
//purpose : Hidden Line Removal

View File

@ -34,9 +34,7 @@ uses Shape from TopoDS,
Dir from gp,
Pnt from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
ExtendedString from TCollection,
Plane from Geom
@ -87,12 +85,6 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;

View File

@ -141,19 +141,6 @@ void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning at compilation (SUN)
//=======================================================================
void AIS_SymmetricRelation::Compute
(const Handle(PrsMgr_PresentationManager2d)& /*aPresentationManager2d*/,
const Handle(Graphic2d_GraphicObject)& /*aGraphicObject*/,
const Standard_Integer /*anInteger*/)
{
// Standard_NotImplemented::Raise("AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
// PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_SymmetricRelation::Compute(const Handle_Prs3d_Projector& aProjector,
const Handle_Geom_Transformation& aTransformation,
const Handle_Prs3d_Presentation& aPresentation)

View File

@ -30,9 +30,7 @@ uses Shape from TopoDS,
Pnt from gp,
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Transformation from Geom,
Plane from Geom
is
@ -75,13 +73,7 @@ is
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -129,18 +129,6 @@ void AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d,
const Handle(Graphic2d_GraphicObject)& aGraphicObject,
const Standard_Integer anInteger)
{
// Standard_NotImplemented::Raise("AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
}
void AIS_TangentRelation::Compute(const Handle_Prs3d_Projector& aProjector,
const Handle_Geom_Transformation& aTransformation,
const Handle_Prs3d_Presentation& aPresentation)

View File

@ -58,8 +58,6 @@ uses
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
PresentationManager2d from PrsMgr,
GraphicObject from Graphic2d,
Axis from AIS,
Point from AIS,
Plane from AIS,
@ -141,11 +139,7 @@ is
aPresentation: mutable Presentation from Prs3d)
is redefined static private;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;
aPresentation: mutable GraphicObject from Graphic2d;
aMode: Integer from Standard = 0)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;

View File

@ -519,15 +519,6 @@ Quantity_NameOfColor AIS_Trihedron::ArrowColor() const {
}
#endif
//=======================================================================
//function : Compute
//purpose : to avoid warning
//=======================================================================
void AIS_Trihedron::Compute(const Handle(PrsMgr_PresentationManager2d)&,
const Handle(Graphic2d_GraphicObject)&,
const Standard_Integer)
{
}
//=======================================================================
//function : Compute

View File

@ -1,241 +0,0 @@
-- Created on: 2000-04-07
-- Created by: Tanya COOL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
package AIS2D
---Purpose: FOR APPLICATION INTERACTIVE SERVICES
--
-- This package provides the classes and methods
-- to the maintenance of the high level 2D visualization .
-- The central entity is Interactive Context for easily
-- piloting presentation and selection.
-- AIS2D package proposes the classes of standard Interactive Objects
-- and this one allows to implement users classes of interactive objects,
-- by respecting a certain rules of creating of Interactive Object.
uses
Aspect,
Quantity,
TColStd,
TCollection,
V2d,
Graphic2d,
GGraphic2d,
TopoDS,
TopTools,
HLRAlgo,
HLRBRep,
Prs2d
is
enumeration KindOfIO is
KOI_None,
KOI_DATUM,
KOI_DIMENSION,
KOI_SHAPE,
KOI_PROJSHAPE,
KOI_COMPOUND
end KindOfIO;
enumeration KindOfDimension is
KOD_NONE,
KOD_LENGTH,
KOD_ANGLE,
KOD_DIAMETER,
KOD_RADIUS
end KindOfDimension;
enumeration KindOfPrimitive is
KOP_NONE,
KOP_CIRCLE,
KOP_CIRCLEMARKER,
KOP_ELLIPS,
KOP_ELLIPSEMARKER,
KOP_FRAMEDTEXT,
KOP_HIDINGTEXT,
KOP_IMAGE,
KOP_IMAGEFILE,
KOP_INFINITELINE,
KOP_MARKER,
KOP_PARAGRAPH,
KOP_POLYLINE,
KOP_POLYLINEMARKER,
KOP_SEGMENT,
KOP_SETOFMARKERS,
KOP_SETOFPOLYLINES,
KOP_SETOFSEGMENTS,
KOP_TEXT,
KOP_CURVE,
KOP_SETOFCURVES,
KOP_ANGLE,
KOP_ANGULARITY,
KOP_ARROW,
KOP_AXIS,
KOP_CIRCULARITY,
KOP_CONCENTRIC,
KOP_CYLINDRIC,
KOP_DIAMETER,
KOP_FLATNESS,
KOP_LENGTH,
KOP_LINEPROFILE,
KOP_PARALLELISM,
KOP_PERPENDICULAR,
KOP_POINT,
KOP_RADIUS,
KOP_RADIUSINDEP,
KOP_REPERE,
KOP_STRAIGHTNESS,
KOP_SURFPROFILE,
KOP_SYMCIRCULAR,
KOP_SYMMETRY,
KOP_SYMTOTAL,
KOP_TAPER,
KOP_TOLERANCEFRAME
end KindOfPrimitive;
enumeration TypeOfAxis is
TOAX_Unknown,
TOAX_XAxis,
TOAX_YAxis
end TypeOfAxis;
enumeration DisplayStatus is
DS_Displayed, -- displayed in main viewer
DS_Erased, -- erased in the collector
DS_FullErased, -- erased but not in the collector
DS_Temporary, -- temporary displayed
DS_None -- nowhere
end DisplayStatus;
enumeration SelectStatus is
SS_Added,
SS_Removed,
SS_NotDone
end SelectStatus;
enumeration StatusOfPick is
SOP_Error,
SOP_NothingSelected,
SOP_Removed,
SOP_OneSelected,
SOP_SeveralSelected
end StatusOfPick;
enumeration StatusOfDetection is
SOD_Error,
SOD_Nothing,
SOD_AllBad,
SOD_Selected,
SOD_OnlyOneDetected,
SOD_OnlyOneGood,
SOD_SeveralGood
end StatusOfDetection;
enumeration TypeOfDetection is
TOD_OBJECT,
TOD_PRIMITIVE,
TOD_ELEMENT,
TOD_VERTEX,
TOD_NONE
end TypeOfDetection;
enumeration ClearMode is
CM_All,
CM_Interactive,
CM_StandardModes,
CM_TemporaryShapePrs
end ClearMode;
class InteractiveContext;
class InteractiveObject;
class ProjShape;
private class LocalStatus;
private class GlobalStatus;
private class LocalContext;
private class PrimitiveArchit;
private class SequenceOfIO instantiates Sequence from TCollection
( InteractiveObject from AIS2D );
private class HSequenceOfIO instantiates HSequence from TCollection
( InteractiveObject from AIS2D, SequenceOfIO from AIS2D );
private class SequenceOfPrimArchit instantiates Sequence from TCollection
( PrimitiveArchit from AIS2D );
private class HSequenceOfPrimArchit instantiates HSequence from TCollection
( PrimitiveArchit from AIS2D, SequenceOfPrimArchit from AIS2D );
private class DataMapOfIOStatus instantiates DataMap from TCollection
( InteractiveObject from AIS2D,
GlobalStatus from AIS2D,
MapTransientHasher from TColStd );
-- Management of interactiveObjects Status...
class ListOfIO instantiates List from TCollection
( InteractiveObject from AIS2D );
class DataMapOfPrimAspects instantiates DataMap from TCollection
( Primitive from Graphic2d,
AspectRoot from Prs2d,
MapTransientHasher from TColStd);
private class DataMapOfLC instantiates DataMap from TCollection
( Integer from Standard,
LocalContext from AIS2D,
MapIntegerHasher from TColStd );
private class DataMapOfLocStat instantiates DataMap from TCollection
( InteractiveObject from AIS2D,
LocalStatus from AIS2D,
MapTransientHasher from TColStd );
-- to tell if an object is sensitive to Standard Modes Of Selection....
pointer PToListOfInt to ListOfInteger from TColStd;
Save( aCntx: InteractiveContext from AIS2D; aFile: CString from Standard )
returns Boolean;
Retrieve( aCntx: InteractiveContext from AIS2D; aFile: CString from Standard )
returns InteractiveObject from AIS2D;
end AIS2D;

View File

@ -1,144 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <AIS2D.hxx>
#include <Graphic2d_Primitive.hxx>
#include <Graphic2d_DisplayList.hxx>
#include <Graphic2d_Circle.hxx>
#include <Graphic2d_CircleMarker.hxx>
#include <Graphic2d_Ellips.hxx>
#include <Graphic2d_EllipsMarker.hxx>
#include <Graphic2d_InfiniteLine.hxx>
#include <Graphic2d_Marker.hxx>
#include <Graphic2d_VectorialMarker.hxx>
#include <Graphic2d_PolylineMarker.hxx>
#include <Graphic2d_SetOfMarkers.hxx>
#include <Graphic2d_SetOfSegments.hxx>
#include <Graphic2d_Segment.hxx>
#include <Graphic2d_Polyline.hxx>
#include <Graphic2d_SetOfPolylines.hxx>
#include <Graphic2d_Image.hxx>
#include <Graphic2d_ImageFile.hxx>
#include <Graphic2d_Text.hxx>
#include <Graphic2d_FramedText.hxx>
#include <Graphic2d_HidingText.hxx>
#include <GGraphic2d_Curve.hxx>
#include <GGraphic2d_SetOfCurves.hxx>
#include <Graphic2d_View.hxx>
#include <Graphic2d_Paragraph.hxx>
#include <V2d_Viewer.hxx>
#include <Quantity_Color.hxx>
#include <Prs2d_AspectRoot.hxx>
#include <Prs2d_AspectLine.hxx>
#include <Prs2d_AspectText.hxx>
#include <Prs2d_Angle.hxx>
#include <AIS2D_InteractiveContext.hxx>
#include <AIS2D_InteractiveObject.hxx>
#include <AIS2D_KindOfPrimitive.hxx>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Standard_Stream.hxx>
Standard_Boolean AIS2D::Save( const Handle(AIS2D_InteractiveContext)& aCntx,
const Standard_CString aFile ) {
if ( !aCntx.IsNull() ) {
Handle( Graphic2d_DisplayList ) theDL = aCntx->CurrentViewer()->View()->DisplayList();
if ( !theDL->IsEmpty() ) {
Aspect_FStream ofs = new ofstream;
ofs->open( aFile, ios::out );
int LnOfDL = theDL->Length();
TCollection_AsciiString thestr;
for ( int i = 1; i <= LnOfDL; ++i )
{
Handle(AIS2D_InteractiveObject) theIO =
Handle(AIS2D_InteractiveObject)::DownCast( theDL->Value(i) );
theIO->Save( ofs );
/* int lnOfPr = theIO->Length();
for ( int j = 1; j <= lnOfPr; j++ ) {
Handle(Graphic2d_Primitive) thePrm = theIO->Primitive( j );
Handle( Prs2d_AspectRoot ) theAsp = theIO->GetAspect( thePrm );
if ( thePrm->IsKind( STANDARD_TYPE( Graphic2d_Line ) ) ) {
Handle(Prs2d_AspectLine) theAL = Handle(Prs2d_AspectLine)::DownCast( theAsp );
Quantity_Color theColor;
Aspect_TypeOfLine theTOL;
Aspect_WidthOfLine theWOL;
theAL->ValuesOfLine( theColor, theTOL, theWOL );
Standard_Real R1, R2, R3;
theColor.Values( R1, R2, R3, Quantity_TOC_RGB );
} else if ( thePrm->IsKind( STANDARD_TYPE( Graphic2d_Paragraph ) ) ) {
} else if ( thePrm->IsKind( STANDARD_TYPE( Graphic2d_Image ) ) ) {
} else if ( thePrm->IsKind( STANDARD_TYPE( Graphic2d_ImageFile ) ) ) {
} else if ( thePrm->IsKind( STANDARD_TYPE( Graphic2d_Text ) ) ) {
Handle(Prs2d_AspectText) theAT = Handle(Prs2d_AspectText)::DownCast( theAsp );
Quantity_Color aColor;
Aspect_FontStyle aFont;
Quantity_PlaneAngle aSlant;
Aspect_TypeOfText aType;
Standard_Boolean isUnderlined;
theAT->Values( aColor, aFont, aSlant, aType, isUnderlined );
}
}*/
}
ofs->close();
} //if sequence of displyed objects isn't empty
} // if context isn't NULL
return Standard_False;
}
Handle (AIS2D_InteractiveObject)
AIS2D::Retrieve( const Handle(AIS2D_InteractiveContext)& /*aCntx*/,
const Standard_CString aFile )
{
char buf[100];
Aspect_IFStream ifs = new ifstream;
Handle(AIS2D_InteractiveObject) theIO;
ifs->open(aFile, ios::in);
ifs->getline(buf, 100);
while (! ifs->eof())
{
if (! strcmp(buf, "AIS2D_InteractiveObject"))
{
theIO = new AIS2D_InteractiveObject();
theIO->Retrieve(ifs);
}
ifs->getline(buf, 100);
}
ifs->close();
return theIO;
}

View File

@ -1,159 +0,0 @@
-- Created by: Tanya COOL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
private class GlobalStatus from AIS2D inherits TShared from MMgt
---Purpose: Stores information about objects in graphic context:
-- - Status Of Display : in the main viewer
-- in the collector
-- fully Erased
-- - Displayed Modes
-- - Active Selection Modes
-- - is the Interactive Object Current ?
-- - Layer Index
uses
ListOfInteger from TColStd,
PToListOfInt from AIS2D,
DisplayStatus from AIS2D,
NameOfColor from Quantity
is
Create returns mutable GlobalStatus from AIS2D;
---Purpose: Initialize GlobalStatus the default properties
Create( aStat : DisplayStatus from AIS2D;
aDMode : Integer from Standard;
aSMode : Integer from Standard;
isHighlight : Boolean from Standard=Standard_False;
aHighlCol : NameOfColor from Quantity = Quantity_NOC_WHITE;
aLayerIndex : Integer from Standard = 0)
returns mutable GlobalStatus from AIS2D;
---Purpose: Initialize GlobalStatus the concrete properties
SetGraphicStatus( me: mutable; aStat : DisplayStatus from AIS2D );
---C++: inline
---Level: Internal
---Purpose: Sets the graphic status <aStat>
AddDisplayMode( me: mutable; aMode: Integer from Standard );
---Level: Internal
---Purpose: Adds the display mode <aMode> to the list of display modes
RemoveDisplayMode( me: mutable; aMode: Integer from Standard);
---Level: Internal
---Purpose: Removes the display mode <aMode> from the list of display modes
IsDModeIn( me; aMode: Integer from Standard ) returns Boolean from Standard;
---Level: Internal
---Purpose: Returns True if the list of display modes
-- contains the display mode <aMode>
AddSelectionMode( me: mutable; aMode: Integer from Standard );
---Level: Internal
---Purpose: Adds the selection mode <aMode> to the list of selection modes
RemoveSelectionMode( me: mutable; aMode: Integer from Standard );
---Level: Internal
---Purpose: Removes the selection mode <aMode> from the list of selection modes
ClearSelectionModes( me: mutable );
---Level: Internal
---Purpose: Removes all selection modes from the list of selection modes
IsSModeIn( me; aMode: Integer from Standard ) returns Boolean from Standard;
---Level: Internal
---Purpose: Returns True if the list of selection modes
-- contains the selection mode <aMode>
SetLayerIndex( me: mutable; anIndex: Integer from Standard );
---C++: inline
---Level: Internal
---Purpose: Sets the layer index <anIndex>
SetHighlightStatus( me: mutable; aStat: Boolean from Standard );
---C++: inline
---Level: Internal
---Purpose: Sets the highlight status
SetHighlightColor( me: mutable; aHiCol: NameOfColor from Quantity );
---C++: inline
---Level: Internal
---Purpose: Sets the color of highight
IsSubIntensityOn( me ) returns Boolean from Standard;
---C++: inline
---Level: Internal
---Purpose: Return True if SubIntensity is on
SubIntensityOn( me: mutable );
---C++: inline
---Level: Internal
---Purpose: Sets the SubIntensity
SubIntensityOff( me: mutable );
---C++: inline
---Level: Internal
---Purpose: Unsets the SubIntensity
GraphicStatus( me ) returns DisplayStatus from AIS2D;
---C++: inline
---Level: Internal
---Purpose: Indicates the display status
DisplayedModes( me: mutable ) returns PToListOfInt from AIS2D;
---C++: inline
---Level: Internal
---Purpose: keeps the information of displayed modes in the
-- main viewer.
-- (The convention is that the object is displayed
-- with the mode 0 in the collector...)
SelectionModes( me: mutable ) returns PToListOfInt from AIS2D;
---C++: inline
---Level: Internal
---Purpose: keeps the active selection modes of the object
-- in the main viewer.
-- (The convention is that the active selection mode
-- for an object in the collector is the mode 0).
IsHighlight(me) returns Boolean from Standard;
---C++: inline
---Level: Internal
---Purpose: Returns True if highlight is on
HighlightColor( me ) returns NameOfColor from Quantity;
---C++: inline
---Level: Internal
---Purpose: Returns the color of highlight
fields
myStatus : DisplayStatus from AIS2D;
myDispModes : ListOfInteger from TColStd;
mySelModes : ListOfInteger from TColStd;
myLayerIndex : Integer from Standard;
myIsHighl : Boolean from Standard;
myHiCol : NameOfColor from Quantity;
mySubInt : Boolean from Standard;
end GlobalStatus;

View File

@ -1,97 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <AIS2D_GlobalStatus.ixx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
static TColStd_ListIteratorOfListOfInteger It;
AIS2D_GlobalStatus::AIS2D_GlobalStatus():
myStatus( AIS2D_DS_None ),
myDispModes(),
mySelModes(),
myLayerIndex( 0 ),
myIsHighl( Standard_False ),
myHiCol( Quantity_NOC_WHITE ),
mySubInt( Standard_False )
{
}
AIS2D_GlobalStatus::AIS2D_GlobalStatus(
const AIS2D_DisplayStatus DS,
const Standard_Integer DMode,
const Standard_Integer SMode,
const Standard_Boolean /*isHighlight*/,
const Quantity_NameOfColor aHighlCol,
const Standard_Integer aLayerIndex ):
myStatus( DS ),
myLayerIndex( aLayerIndex ),
myIsHighl( Standard_False ),
myHiCol( aHighlCol ),
mySubInt( Standard_False )
{
myDispModes.Append( DMode );
mySelModes.Append( SMode );
}
void AIS2D_GlobalStatus::RemoveDisplayMode( const Standard_Integer aMode ) {
for ( It.Initialize( myDispModes ); It.More(); It.Next() )
if ( It.Value() == aMode ) {
myDispModes.Remove( It );
return;
}
}
void AIS2D_GlobalStatus::RemoveSelectionMode( const Standard_Integer aMode) {
for ( It.Initialize( mySelModes ); It.More(); It.Next() )
if ( It.Value() == aMode ) {
mySelModes.Remove( It );
return;
}
}
void AIS2D_GlobalStatus::ClearSelectionModes() {
mySelModes.Clear();
}
void AIS2D_GlobalStatus::AddSelectionMode( const Standard_Integer aMode ) {
if ( !IsSModeIn( aMode ) )
mySelModes.Append( aMode );
}
Standard_Boolean AIS2D_GlobalStatus::IsDModeIn( const Standard_Integer aMode) const {
for ( It.Initialize( myDispModes ); It.More(); It.Next() )
if ( It.Value() == aMode ) return Standard_True;
return Standard_False;
}
Standard_Boolean AIS2D_GlobalStatus::IsSModeIn( const Standard_Integer aMode) const {
for ( It.Initialize( mySelModes ); It.More(); It.Next() )
if ( It.Value() == aMode ) return Standard_True;
return Standard_False;
}
void AIS2D_GlobalStatus::AddDisplayMode( const Standard_Integer aMode ) {
if ( !IsDModeIn( aMode ) )
myDispModes.Append( aMode );
}

View File

@ -1,64 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
inline void AIS2D_GlobalStatus::SetGraphicStatus( const AIS2D_DisplayStatus aStat ) {
myStatus = aStat;
}
inline void AIS2D_GlobalStatus::SetLayerIndex( const Standard_Integer AnIndex ) {
myLayerIndex=AnIndex;
}
inline void AIS2D_GlobalStatus::SetHighlightStatus( const Standard_Boolean aStat ) {
myIsHighl = aStat;
}
inline void AIS2D_GlobalStatus::SetHighlightColor( const Quantity_NameOfColor aCol ) {
myHiCol = aCol;
}
inline Standard_Boolean AIS2D_GlobalStatus::IsSubIntensityOn() const {
return mySubInt;
}
inline void AIS2D_GlobalStatus::SubIntensityOn() {
mySubInt = Standard_True;
}
inline void AIS2D_GlobalStatus::SubIntensityOff() {
mySubInt = Standard_False;
}
inline AIS2D_DisplayStatus AIS2D_GlobalStatus::GraphicStatus() const {
return myStatus;
}
inline AIS2D_PToListOfInt AIS2D_GlobalStatus::DisplayedModes() {
return & myDispModes;
}
inline AIS2D_PToListOfInt AIS2D_GlobalStatus::SelectionModes() {
return & mySelModes;
}
inline Standard_Boolean AIS2D_GlobalStatus::IsHighlight() const {
return myIsHighl;
}
inline Quantity_NameOfColor AIS2D_GlobalStatus::HighlightColor() const {
return myHiCol;
}

View File

@ -1,776 +0,0 @@
-- Created by: Tanya COOL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
-- Modified: EAV: 07-09-01 : NbSelected(), InitSelected(),
-- MoreSelected(), NextSelected()
-- SAV: 15/11/01 MoveCircleTo(). detection by circle. SetDetectionMode().
-- Detect() - internal
class InteractiveContext from AIS2D inherits TShared from MMgt
---Purpose: The InteractiveContext class allows you to manage
-- graphic behavior and selection of Interactive Objects
-- in one or more viewers.
uses
TypeOfLine from Aspect,
WidthOfLine from Aspect,
MarkerStyle from Aspect,
TypeOfMarker from Aspect,
FontStyle from Aspect,
GenericColorMap from Aspect,
TypeMap from Aspect,
WidthMap from Aspect,
MarkMap from Aspect,
FontMap from Aspect,
GridType from Aspect,
GridDrawMode from Aspect,
CardinalPoints from Aspect,
Color from Quantity,
PlaneAngle from Quantity,
Length from Quantity,
NameOfColor from Quantity,
ExtendedString from TCollection,
Primitive from Graphic2d,
PickMode from Graphic2d,
TransientManager from Graphic2d,
DisplayList from Graphic2d,
Viewer from V2d,
View from V2d,
Drawer from Prs2d,
InteractiveObject from AIS2D,
KindOfIO from AIS2D,
DataMapOfIOStatus from AIS2D,
DataMapOfLC from AIS2D,
StatusOfDetection from AIS2D,
DisplayStatus from AIS2D,
StatusOfPick from AIS2D,
TypeOfDetection from AIS2D,
PToListOfInt from AIS2D,
ListOfIO from AIS2D,
HSequenceOfIO from AIS2D
is
Create( MainViewer: Viewer from V2d )
returns mutable InteractiveContext from AIS2D;
---Purpose: Initiates <MainViewer>
Create( MainViewer, aCollector: Viewer from V2d)
returns mutable InteractiveContext from AIS2D;
---Purpose: Initiates the principal viewer and Collector(trash) viewer together
-- *************************************************************
---Category: Editing general Display Services
-- *************************************************************
Display( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Display when no local context is opened.
-- if <anIObj> has no proper display mode, the defaut
-- display mode of the session is used
-- Same for the selection Mode (by default =0)
Display( me : mutable;
anIObj : InteractiveObject from AIS2D;
aDispMode : Integer from Standard ;
aSelectMode : Integer from Standard;
UpdateVwr : Boolean from Standard = Standard_True;
AllowDecomp : Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Use only if a local context is opened. Displays the
-- <aDispMode> the presentation of interactive object,
-- activates the selection mode <aSelectMode> if
-- <UpdateVwr> = Standard_False, the object is
-- displayed but no viewer will be updated; CONVENTION :
-- <aSelectMode> = -1 means no activation for <anIObj>
-- : it will be displayed but not selectable. (Option
-- only available for local context...)
-- <AllowDecomp> = true means that <anIObj> is
-- able to have subshapes detected by selection mechanisms.
-- 2 conditions: <anIObj> must be able to give a shape
-- selection modes fit the AIS2D_Shape
-- selection modes ( 1->vertex, 2->edges, 3->wires...)
Load( me: mutable;
anIObj: InteractiveObject from AIS2D;
SelMode : Integer from Standard = -1;
AllowDecomp : Boolean from Standard = Standard_False );
---Purpose: Available when opened local contexts only;
-- option to load in the selector objects which will
-- be selectable but not displayed. Nevertheless, they
-- will be hilighted when detected by the selector.
-- ex : be able to select center of a line without
-- displaying all centers before selection process
Erase( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard = Standard_True;
PutInCollector : Boolean from Standard = Standard_True );
---Level: Public
---Purpose: Erases presentations in current local context,
-- or failing that, in other local contexts which allow erasing.
-- If <PutInCollector> is false, the object is erased but
-- not put in the Collector.
EraseAll( me : mutable;
PutInCollector : Boolean from Standard = Standard_True;
updateVwr : Boolean from Standard = Standard_True );
---Purpose: Every erased object goes into the Collector viewer
DisplayAll( me : mutable;
OnlyFromCollector : Boolean from Standard = Standard_True;
updateVwr : Boolean from Standard = Standard_True);
---Purpose: Displays all erased objects, in other words,
-- all objects in the Collector viewer.
EraseSelected( me : mutable;
PutInCollector : Boolean from Standard = Standard_True;
updateVwr : Boolean from Standard = Standard_True );
---Purpose: Erases selected objects if a local context is open.
-- Erases current objects if there is no active local context.
-- If a local context is open and if <updateVwr> equals
-- Standard_False, the presentation of the Interactive Object
-- activates the selection mode; the object is displayed but
-- no viewer will be updated.
DisplaySelected( me : mutable;
updateVwr : Boolean from Standard = Standard_True );
---Purpose: Displays or erases selected objects if a local
-- context is open. If no active local context is found,
-- only current objects can be displayed or erased.
KeepTemporary( me : mutable;
anIObj : InteractiveObject from AIS2D;
InWhichLocal: Integer from Standard = -1)
returns Boolean from Standard;
---Purpose: Changes the status of a temporary object it will be --
-- kept at the neutral point, i.e. put in the list of
-- displayed objects, with its temporary attributes
-- (displaymode,selection mode) returns true if done --
-- inWhichLocal means that gives the local context in
-- which <anIObj> is displayed. By default, -1 means the
-- last opened one
Redisplay( me : mutable;
anIObj : InteractiveObject from AIS2D;
updateVwr : Boolean from Standard = Standard_True;
allModes : Boolean from Standard = Standard_False);
---Purpose: Forces Recompute of the seen presentations of the object;
-- if <allModes>= True -> recomputes all the
-- presentations .
--***********************************************************************
---Category: Querying and Editing Selection Process
--***********************************************************************
IsCurrent( me; anIObj: InteractiveObject from AIS2D )
returns Boolean from Standard;
---Purpose: Finds the current selected entity <anIObj> in Neutral Point.
IsSelected( me; anIObj: InteractiveObject from AIS2D )
returns Boolean from Standard;
---Purpose: Confirms selection. Returns true if <anIObj> is selected in the interactive context
Highlight( me : mutable;
anIObj : InteractiveObject from AIS2D;
updateVwr: Boolean from Standard = Standard_True);
---Purpose: Updates the display in the viewer to take dynamic detection
-- into account.
-- If a local context is open and if <updateVwr> equals Standard_False,
-- the presentation of the Interactive Object activates the selection
-- mode; the object is displayed but no viewer will be updated.
HighlightWithColor( me: mutable;
anIObj:InteractiveObject from AIS2D;
aCol: NameOfColor from Quantity;
updateVwr: Boolean from Standard = Standard_True );
---Purpose: Changes the color of the object in view <anIObj>.
-- It paints this object the color passed as the argument <aCol>
-- If a local context is open and if <updateVwr> equals Standard_False,
-- the presentation of the Interactive Object activates the selection
-- mode; the object is displayed but no viewer will be updated.
Unhighlight( me : mutable;
anIObj : InteractiveObject from AIS2D;
updateVwr : Boolean from Standard = Standard_True );
---Purpose: Removes hilighting from the entity <anIObj>. Updates the viewer.
-- If a local context is open and if <updateVwr> equals Standard_False,
-- the presentation of the Interactive Object activates the selection
-- mode; the object is displayed but no viewer will be updated.
--****************************************************************
---Category: Graphic Detection and Selection
--****************************************************************
SetPrecision( me: mutable; aPrec: Integer from Standard );
---C++: inline
---Level: Public
---Purpose: Sets the precision of detection
DetectPrecision( me ) returns Integer from Standard;
---C++: inline
---Level: Public
---Purpose: Returns the precision of detection
Place( me : mutable;
XPix, YPix : Integer from Standard;
aView : View from V2d;
anIO : InteractiveObject from AIS2D;
isTemporary : Boolean from Standard = Standard_False );
---Level: Public
---Purpose: Places object <anIO> to the pixel position (XPix, YPix)
-- in the view <aView> is using TransientManager.
-- It's possible to use without preliminary application of Display method.
Drag( me : mutable;
XPix, YPix : Integer from Standard;
aView : View from V2d;
isTemporary: Boolean from Standard = Standard_True );
---Level: Public
---Purpose: Places selected objects to the pixel position (XPix, YPix)
-- in the view <aView>. If <isTemporary> is True, is used TransientManager.
MoveTo( me: mutable;
XPix, YPix: Integer from Standard;
aView: View from V2d ) returns StatusOfDetection from AIS2D;
---Level: Public
---Purpose: Relays mouse position in pixels XPix and YPix to the
-- interactive context selectors. This is done by the view <aView>
-- passing this position to the main viewer and updating it.
-- Functions in both Neutral Point and local contexts.
---SAV
MoveCircleTo( me: mutable; XPix, YPix, Radius : Integer from Standard;
aView: View from V2d ) returns StatusOfDetection from AIS2D;
---Level: Public
---Purpose: Relays mouse position in circle <XPix, YPix> and <Radius> to the
-- interactive context selectors. This is done by the view <aView>
-- passing this position to the main viewer and updating it.
-- Functions in both Neutral Point and local contexts.
MoveTo( me: mutable;
Xmin, Ymin, Xmax, Ymax: Integer from Standard;
aView: View from V2d ) returns StatusOfDetection from AIS2D;
---Level: Public
---Purpose: Relays mouse position in rectangle Xmin, Ymin, Xmax, Ymax to the
-- interactive context selectors. This is done by the view <aView>
-- passing this position to the main viewer and updating it.
-- Functions in both Neutral Point and local contexts.
---SAV
Detect( me: mutable; dList : DisplayList from Graphic2d; aView : View from V2d )
returns StatusOfDetection from AIS2D is private;
Select( me : mutable;
UpdateVwr : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS2D;
---Level: Public
---Purpose: Stores and hilights the previous detected; Unhilights
-- the previous picked.
ShiftSelect( me: mutable; UpdateVwr: Boolean from Standard = Standard_True )
returns StatusOfPick from AIS2D;
---Level: Public
---Purpose: adds the last detected to the list of previous picked.
-- if the last detected was already declared as picked,
-- removes it from the Picked List.
ShiftSelect( me: mutable; XPMin, YPMin, XPMax, YPMax: Integer from Standard;
aView: View from V2d; UpdateVwr : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS2D;
---Level: Public
---Purpose: rectangle of selection ; adds new detected entities into the
-- picked list, removes the detected entities that were already stored...
SetHighlightColor( me: mutable; aCol: NameOfColor from Quantity );
---Purpose: Allows to set the color used to show highlighted entities,
-- that is, entities picked out by the mouse.
SetSelectionColor( me: mutable; aCol: NameOfColor from Quantity );
---Purpose: Sets the color used to show selected entities
SetSubIntensityColor( me: mutable; aCol: NameOfColor from Quantity );
---Purpose: Allows you to set the color used to show that an object
-- is not currently selected
DisplayMode( me ) returns Integer from Standard;
---C++: inline
---Purpose: Returns the display mode setting
HighlightColor( me ) returns NameOfColor from Quantity;
---C++: inline
---Level: Public
---Purpose: Returns the name of the color used to show highlighted entities,
-- that is, entities picked out by the mouse
SelectionColor( me ) returns NameOfColor from Quantity;
---C++: inline
---Level: Public
---Purpose: Returns the name of the color used to show selected entities.
SubIntensityColor( me ) returns NameOfColor from Quantity;
---C++: inline
---Level: Public
---Purpose: Returns the name of the color used to show
-- that an object is not currently selected.
SubIntensityOn( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Highlights, and removes highlights from, the displayed object
-- <anIObj> which is displayed at Neutral Point with subintensity
-- color; available only for active local context.
-- There is no effect if there is no local context.
SubIntensityOff( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Removes the subintensity option for the entity <anIObj>.
-- *************************************************************
-- Management of the Trash Bin Viewer
-- *************************************************************
IsCollectorClosed( me ) returns Boolean from Standard;
---C++: inline
---Level: Internal
---Purpose:
CloseCollector( me: mutable );
---C++: inline
---Level: Internal
---Purpose: Allows to close Collector
OpenCollector( me: mutable );
---Level: Internal
---Purpose: Allows to open Collector
--************************************************************************
---Category: Specific Local Context Action
--************************************************************************
OpenLocalContext( me : mutable;
UseDispObj : Boolean from Standard = Standard_True;
AllowDecomposit : Boolean from Standard = Standard_True;
AcceptEraseOfObj: Boolean from Standard = Standard_False )
returns Integer from Standard;
---Level: Public
---Purpose: Opens a local context of display and selection
-- returns the index of new opened local context.
-- Must be stored and used to close the local context.
CloseLocalContext( me : mutable;
ind : Integer from Standard = -1;
updateVwr : Boolean from Standard = Standard_True );
---Level: Public
---Purpose: close the current opened local context.
-- Use <ind> to be sure to close the local context you Opened !
-- if <ind> == -1 the current local context is closed
-- WITHOUT VERIFICATION.
-- if <ind> is greater than the current opened local context,
-- nothing is done.
IndexOfCurrentLocal( me ) returns Integer from Standard;
---Level: Public
---Purpose: returns -1 if no opened local context.
CloseAllContext( me: mutable; updateVwr: Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Allows to close all local contexts at one go and return to
-- Neutral Point.
--****************************************************************
---Category: non interactive actions about Selection
-- 2 categories are distinct:
-- - Current Objects
-- - Selected Objects
-- a Current object is the object picked
-- at neutral Point.
-- The Selected objects are objects picked
-- when a local context is opened
SetCurrentObject( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr: Boolean from Standard = Standard_True );
---Level: Public
---Purpose: Updates the view of the current object in open context.
-- Objects selected when there is no open local context
-- are called current objects; those selected in open local context,
-- selected objects.
AddOrRemoveCurObject( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Allows to add a current object to the list of current objects
-- or remove it from that list.
-- Objects selected when there is no open local context are called
-- current objects; those selected in open local context,
-- selected objects.
UpdateCurrent( me: mutable );
---Level: Public
---Purpose: updates the list of current objects
-- i.e. hilights new current objects,
-- unhighlights old current objects
--
SetOkCurrent( me: mutable );
---Level: Internal
---Purpose:
--FirstCurrentObject( me: mutable ) returns InteractiveObject from AIS2D;
---Level: Public
---Purpose: Returns the first current object in the list of current objects.
HighlightCurrent( me: mutable;
UpdateVwr: Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Highlights current objects.
UnhighlightCurrent( me: mutable;
UpdateVwr: Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Unhighlights current objects.
ClearCurrent(me: mutable; UpdateVwr: Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Empties previous current objects in order to get the current
-- objects detected by the selector using UpdateCurrent.
SetSelected( me: mutable; anIObj: InteractiveObject from AIS2D;
UpdateVwr: Boolean from Standard = Standard_True );
---Level: Public
---Purpose: Puts the selected <anIObj> in the current objects list.
SetSelectedCurrent( me: mutable );
---Level: Public
---Purpose: Puts the selected list in the current objects list.
UpdateSelected( me: mutable;
UpdateVwr: Boolean from Standard=Standard_True );
---Level: Public
---Purpose: Updates the list of selected objects, i.e. hilights
-- new selected objects, removes hilighting from former
-- selected objects.
AddOrRemoveSelected( me: mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr: Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Allows you to add a selected object <anIObj> to the list of selected
-- objects or remove it from that list.
HighlightSelected( me: mutable;
UpdateVwr: Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Highlights selected objects.
UnhighlightSelected( me: mutable;
UpdateVwr: Boolean from Standard = Standard_True );
---Level: Public
---Purpose: UnHighlights selected objects.
ClearSelected( me: mutable;
UpdateVwr: Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Empties previous selected objects in order to get
-- the selected objects detected by the selector using UpdateSelected.
NbSelected( me ) returns Integer from Standard;
---Level: Public
---Purpose: Returns number of objects selected in
--- local context ( if opened ) or in neutral context
InitSelected( me: mutable );
---Level: Public
---Purpose: Iteration
MoreSelected( me ) returns Boolean from Standard;
---Level: Public
---Purpose: Iteration
NextSelected( me: mutable );
---Level: Public
---Purpose: Iteration
SelectedObject( me ) returns TShared from MMgt;
---Level: Public
---Purpose: Returns current selected object ( see InitSelected() .. )
-- The object type depends on highlight mode
-- ( OBJECT, PRIMITIVE etc )
--*****************************************************************
-- Querying Graphic Attributes
--*****************************************************************
DisplayStatus( me; anIObj: InteractiveObject from AIS2D )
returns DisplayStatus from AIS2D;
---Level: Public
---Purpose: Returns the display status of the entity <anIObj>.
DisplayedModes( me; anIObj: InteractiveObject from AIS2D )
returns PToListOfInt from AIS2D;
---Level: Public
---Purpose: Returns the list of active display modes for the entity <anIObj>
IsDisplayed( me; anIObj:InteractiveObject from AIS2D )
returns Boolean from Standard;
---Level: Public
---Purpose: Returns true if <anIObj> is displayed in the interactive context
IsDisplayed( me;
anIObj: InteractiveObject from AIS2D;
aMode : Integer from Standard )
returns Boolean from Standard;
---Level: Public
---Purpose: Returns true if <anIObj> is displayed in the interactive context with <aMode> display mode
IsHighlighted( me; anIObj: InteractiveObject from AIS2D )
returns Boolean from Standard;
---Level: Public
---Purpose: Returns true if the Interactive Object <anIObj>
-- is highlighted in the interactive context.
IsHighlighted( me;
anIObj : InteractiveObject from AIS2D;
WithColor : out Boolean from Standard;
theHiCol : out NameOfColor from Quantity )
returns Boolean from Standard;
---Level: Public
---Purpose: if <anIObj> is highlighted with a specific color
-- <WithColor> will be returned TRUE
-- <theHiCol> gives the name of the hilightcolor
IsInCollector( me; anIObj: InteractiveObject from AIS2D )
returns Boolean from Standard;
---Level: Public
---Purpose: Returns true if the entity <anIObj> is in the Collector viewer.
Status( me;
anIObj : InteractiveObject from AIS2D;
aStatus: in out ExtendedString from TCollection);
---Level: Public
---Purpose: Modified the status of the entity <anIObj>
UpdateCurrentViewer( me: mutable );
---Level: Public
---Purpose: Updates the current viewer, the viewer in Neutral Point.
UpdateCollector( me: mutable );
---Level: Public
---Purpose: Updates the Collector viewer
--********************************************************************************
---Category: Information methods - Get Fields
--********************************************************************************
CurrentViewer( me ) returns any Viewer from V2d;
---C++: inline
---Level: Public
---Purpose: Returns the current viewer.
HasOpenedContext( me ) returns Boolean from Standard;
---C++: inline
---Level: Public
---Purpose: Returns true if there is an open context.
DisplayedObjects( me;
aListOfIO : in out ListOfIO from AIS2D;
OnlyFromNeutral : Boolean from Standard = Standard_False );
---Level: Public
---Purpose: gives the list of displayed objects in the main viewer.
--********************************************************************************
GetDefModes( me;
anIObj : InteractiveObject from AIS2D;
Dmode : out Integer from Standard;
HiMod : out TypeOfDetection from AIS2D;
SelMode : out Integer from Standard ) is private;
---Level: Public
---Purpose: Returns display, highlight and selection modes of the <anIObj>
EraseGlobal( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard = Standard_True;
PutInCollector : Boolean from Standard = Standard_True) is private;
---Level: Internal
---Purpose:
SetPickMode( me: mutable; aMode: PickMode from Graphic2d );
---C++: inline
---Level: Public
---Purpose: Allows to provide settings for pick mode.
GetPickMode( me) returns PickMode from Graphic2d;
---C++: inline
---Level: Public
---Purpose: Returns the pick mode
--**********************************************************************************
HighestIndex( me ) returns Integer from Standard;
---Level: Internal
---Purpose:
--**********************************************************************************
-- Category: initialization of the attributes
--**********************************************************************************
InitializeColor( me: mutable; aColor: Color from Quantity ) returns Integer from Standard;
---Purpose: Initialize <aColor> in the color map
InitializeStyle( me: mutable; aType: TypeOfLine from Aspect ) returns Integer from Standard;
---Purpose: Initialize <aType> in the type map
InitializeWidth( me: mutable; aWidth: WidthOfLine from Aspect ) returns Integer from Standard;
---Purpose: Initialize <aWidth> in the width map
InitializeMarker( me: mutable; aMark: TypeOfMarker from Aspect ) returns Integer from Standard;
---Purpose: Initialize <aMark> in the mark map
InitializeFont( me: mutable; aFont: FontStyle from Aspect ) returns Integer from Standard;
---Purpose: Initialize <aFont> in the font map
--**********************************************************************************
ResetOriginalState( me : mutable;
updateVwr : Boolean from Standard = Standard_True );
---Level: Public
---Purpose: to be used only with no opened
-- local context.. displays and activates objects in their
-- original state before local contexts were opened...
DrawObject( me: mutable; anObj: InteractiveObject from AIS2D; aDispMode: Integer from Standard )
is private;
AvailableToDetect( me; anObj: InteractiveObject from AIS2D ) returns Boolean from Standard
is private;
DoDetectObject( me: mutable; anObj: InteractiveObject from AIS2D; aDrawer: TransientManager from Graphic2d )
is private;
IsIOPicked( me; anObj: InteractiveObject from AIS2D )
returns Boolean from Standard is private;
IsPrimPicked( me; anObj: InteractiveObject from AIS2D; aPrim: Primitive from Graphic2d )
returns Boolean from Standard is private;
IsElemPicked( me; anObj: InteractiveObject from AIS2D;
aPrim: Primitive from Graphic2d; ind: Integer from Standard )
returns Boolean from Standard is private;
IsElemSelected( me; anObj: InteractiveObject from AIS2D;
aPrim: Primitive from Graphic2d; ind: Integer from Standard )
returns Boolean from Standard is private;
IsIOSelected( me; anObj: InteractiveObject from AIS2D )
returns Boolean from Standard is private;
IsPrimSelected( me; anObj: InteractiveObject from AIS2D;
aPrim: Primitive from Graphic2d )
returns Boolean from Standard is private;
--**********************************************************************************
-- Category: immediate mode management
--**********************************************************************************
BeginImmediateDraw( me: mutable; aView: View from V2d );
---Level: Public
---Purpose: switches on immediate mode
ImmediateDraw(me: mutable; anIObj: InteractiveObject from AIS2D; aView: View from V2d );
---Level: Public
---Purpose: draws object <anIObj> into immediate mode
EndImmediateDraw( me: mutable; aView: View from V2d );
---Level: Public
---Purpose: switches of immediate mode
IsImmediateModeOn( me; aView: View from V2d ) returns Boolean from Standard;
---Level: Public
---Purpose: returns true if immediate mode is on
---SAV
SetDetectionMode(me:mutable; mode : TypeOfDetection from AIS2D);
fields
myMainVwr : Viewer from V2d;
myCollectorVwr : Viewer from V2d;
myIsCollClosed : Boolean from Standard;
myObjects : DataMapOfIOStatus from AIS2D;
-- the selection and current objects.
myDetectPrecision: Integer from Standard;
myResetDetect : Boolean from Standard;
myLastPicked : InteractiveObject from AIS2D;
myLastinMain : InteractiveObject from AIS2D;
myLastinColl : InteractiveObject from AIS2D;
mySeqOfDetIO : HSequenceOfIO from AIS2D;
mySeqOfSelIO : HSequenceOfIO from AIS2D;
myCurDetectMode : TypeOfDetection from AIS2D;
myWasLastMain : Boolean from Standard;
myPickMode : PickMode from Graphic2d;
-- the attributes of session...
myHighlightColor : NameOfColor from Quantity;
mySelectionColor : NameOfColor from Quantity;
mySubIntensity : NameOfColor from Quantity;
myDisplayMode : Integer from Standard;
-- The Local Context...
myLocalContexts : DataMapOfLC from AIS2D;
myCurLocalIndex : Integer from Standard;
myLastMoveView : View from V2d;
myColorMap : GenericColorMap from Aspect is protected;
myTypeMap : TypeMap from Aspect is protected;
myWidthMap : WidthMap from Aspect is protected;
myMarkMap : MarkMap from Aspect is protected;
myFontMap : FontMap from Aspect is protected;
-- Iteration
myCurSelected : Integer from Standard;
myMaxSelected : Integer from Standard;
friends
class LocalContext from AIS2D
end InteractiveContext;

File diff suppressed because it is too large Load Diff

View File

@ -1,66 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
inline Handle(V2d_Viewer) AIS2D_InteractiveContext::CurrentViewer() const {
return myMainVwr;
}
inline Standard_Boolean AIS2D_InteractiveContext::IsCollectorClosed() const {
return myIsCollClosed;
}
inline void AIS2D_InteractiveContext::CloseCollector() {
myIsCollClosed = Standard_True;
}
inline Standard_Boolean AIS2D_InteractiveContext::HasOpenedContext() const {
return myCurLocalIndex != 0;
}
inline void AIS2D_InteractiveContext::SetPrecision( const Standard_Integer aPrec ) {
myDetectPrecision = aPrec;
}
inline Standard_Integer AIS2D_InteractiveContext::DetectPrecision() const {
return myDetectPrecision;
}
inline Quantity_NameOfColor AIS2D_InteractiveContext::HighlightColor() const {
return myHighlightColor;
}
inline Quantity_NameOfColor AIS2D_InteractiveContext::SelectionColor() const {
return mySelectionColor;
}
inline Quantity_NameOfColor AIS2D_InteractiveContext::SubIntensityColor() const {
return mySubIntensity;
}
inline Standard_Integer AIS2D_InteractiveContext::DisplayMode() const {
return myDisplayMode;
}
inline Graphic2d_PickMode AIS2D_InteractiveContext::GetPickMode() const {
return myPickMode;
}
inline void AIS2D_InteractiveContext::SetPickMode(const Graphic2d_PickMode aPickMode ) {
myPickMode = aPickMode;
}

View File

@ -1,281 +0,0 @@
-- Created on: 2000-04-07
-- Created by: Tanya COOL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
class InteractiveObject from AIS2D inherits GraphicObject from Graphic2d
---Purpose: Class Interactive Object defines a class of objects
-- with display and selection services.
-- Using visualization and selection machanisms,
-- interactive objects are used to display datum, curves,
-- shapes, markers, dimensions, etc. Interactive objects
-- also provide links to the interactive context.
uses
Primitive from Graphic2d,
TypeOfDetection from AIS2D,
KindOfIO from AIS2D,
InteractiveContext from AIS2D,
Drawer from Prs2d,
AspectRoot from Prs2d,
AspectName from Prs2d,
DataMapOfPrimAspects from AIS2D,
HSequenceOfPrimArchit from AIS2D,
AsciiString from TCollection,
FStream from Aspect,
IFStream from Aspect
is
Create returns mutable InteractiveObject from AIS2D;
---Purpose: Initialize the Interactive Object
--------------------------------------------------------------------
---Category: Methods for attributes management
Attributes( me ) returns Drawer from Prs2d;
---C++: inline
---Level: Public
---Purpose: Returns the attributes settings
SetAttributes( me: mutable; aDrawer: Drawer from Prs2d ) is virtual;
---Level: Public
---Purpose: Initializes the drawing tool <aDrawer>
UnsetAttributes( me: mutable ) is virtual;
---Level: Public
---Purpose: Clears settings provided by the drawing tool <aDrawer>
SetAspect( me: mutable; anAspect: AspectRoot from Prs2d );
---Level: Public
---Purpose: Sets the attributes from Aspect <anAspect>
-- to all primitives appropriate this Aspect.
SetAspect( me: mutable; anAspect: AspectRoot from Prs2d;
aPrimitive: Primitive from Graphic2d );
---Level: Public
---Purpose: Sets the attributes from Aspect <anAspect>
-- to primitive <aPrimitive>
-- Method works only for objects are linked
-- with InteractiveContext
GetAspect( me; aPrimitive: Primitive from Graphic2d )
returns AspectRoot from Prs2d;
---Level: Public
---Purpose: Returns Aspect for primitive <aPrimitive>
-- Method works only for objects are linked
-- with InteractiveContext
HasAspect( me; aPrimitive: Primitive from Graphic2d )
returns Boolean from Standard;
---Level: Public;
---Purpose: Returns true if primitive <aPrimitive>
-- is linked with an aspect
--------------------------------------------------------------------
---Category: Link To InteractiveContext
HasInteractiveContext( me ) returns Boolean from Standard;
---Level: Public
---Purpose: Indicates whether the Interactive Object has a pointer
-- to an interactive context.
GetContext( me ) returns InteractiveContext from AIS2D;
---Level: Public
---Purpose: Returns the context pointer to the interactive context.
SetContext( me:mutable; aCntx : InteractiveContext from AIS2D ) is virtual;
---Level: Public
---Purpose: Places a link to <aCnTx>. The drawer of AIS2D_InteractiveObject
-- is connected to the Default Drawer Of <aCntx>.
-- That Means that this method has to be redefined if
-- computations depend on drawer values.
--------------------------------------------------------------------
---Category: Methods for display modes management
DisplayMode( me ) returns Integer;
---C++: inline
---Level: Public
---Purpose: Indicates the display mode of the Interactive Object
HasDisplayMode ( me ) returns Boolean from Standard;
---C++: inline
---Level: Public
---Purpose: Returns True if the Interactive Object has
-- a display mode setting. Otherwise, it is
-- displayed in Neutral Point.
SetDisplayMode( me: mutable; aMode: Integer from Standard );
---C++: inline
---Level: Public
---Purpose: Allows to provide a setting <aMode> for an
-- Interactive Object's display mode.
UnsetDisplayMode( me: mutable );
---C++: inline
---Level: Public
---Purpose: Removes display mode settings from the Interactive object
DefaultDisplayMode( me ) returns Integer from Standard is virtual;
---C++: inline
---Level: Public
---Purpose: Returns the default display mode. This method is to be
-- implemented when the main mode is not mode 0.
AcceptDisplayMode( me; aMode: Integer from Standard ) returns Boolean from Standard is virtual;
---C++: inline
---Level: Public
---Purpose: Returns true if the class of objects accepts the display mode <aMode>
--------------------------------------------------------------------
---Category: Methods for highlight modes management
HighlightMode( me ) returns TypeOfDetection from AIS2D;
---C++: inline
---Level: Public
---Purpose: Returns the setting for highlight mode.
HasHighlightMode( me ) returns Boolean from Standard;
---C++: inline
---Level: Public
---Purpose: Returns true if the Interactive Object is in highlight mode
SetHighlightMode( me: mutable; aMode: TypeOfDetection from AIS2D );
---C++: inline
---Level: Public
---Purpose: Allows to provide settings for highlight mode.
UnsetHighlightMode( me: mutable );
---C++: inline
---Level: Public
---Purpose: Removes settings for highlight mode
DefaultHighlightMode( me ) returns TypeOfDetection from AIS2D is virtual;
---C++: inline
---Level: Public
---Purpose: Returns the default highlight mode
--------------------------------------------------------------------
---Category: Methods for selection modes management
--------------------------------------------------------------------
SelectionMode( me ) returns Integer from Standard;
---C++: inline
---Level: Public
---Purpose: Indicates the selection mode of the Interactive Object
HasSelectionMode( me ) returns Boolean from Standard;
---C++: inline
---Level: Public
---Purpose: Allows you to change the selection mode of an Interactive Object
SetSelectionMode( me: mutable; aMode: Integer from Standard );
---C++: inline
---Level: Public
---Purpose: Allows to provide a setting <aMode> for an
-- Interactive Object's selection mode.
UnsetSelectionMode( me: mutable );
---C++: inline
---Level: Public
---Purpose: Removes settings for selection mode
DefaultSelectionMode( me ) returns Integer from Standard is virtual;
---C++: inline
---Level: Public
---Purpose: Returns the default selection mode
PrimitiveExist( me; aName: AspectName from Prs2d )
returns Boolean from Standard is private;
---Level: Internal
State( me ) returns Integer from Standard;
---C++: inline
---Level: Internal
---Purpose:
SetState( me: mutable; aState: Integer from Standard );
---C++: inline
---Level: Internal
---Purpose:
SelectPrimitive (me : mutable; anIndex: Integer from Standard;
append: Boolean from Standard );
---Level: Public
---Purpose: Selects primitive with index( TOD_PRIMITIVE mode only )
AddDetectPrim( me: mutable; aPrim: Primitive from Graphic2d;
anInd: Integer from Standard ) is private;
---Level: Internal
---Purpose:
AddSelectPrim( me: mutable; aPrim: Primitive from Graphic2d;
anInd: Integer from Standard ) is private;
---Level: Internal
---Purpose:
RemoveSelectPrim( me: mutable; aPrim: Primitive from Graphic2d;
anInd: Integer from Standard ) is private;
---Level: Internal
---Purpose:
SetSelSeqPrim( me: mutable; aSeq: HSequenceOfPrimArchit from AIS2D ) is private;
---Level: Internal
---Purpose:
ClearSeqDetPrim( me: mutable ) is private;
---Level: Internal
---Purpose:
ClearSeqSelPrim( me: mutable ) is private;
---Level: Internal
---Purpose:
GetDetectSeqPrim( me ) returns HSequenceOfPrimArchit from AIS2D is private;
---Level: Internal
---Purpose:
GetSelectedSeqPrim( me ) returns HSequenceOfPrimArchit from AIS2D is private;
---Level: Internal
---Purpose:
--------------------------------------------------------------------
Save(me; aFStream: in out FStream from Aspect) is virtual;
Retrieve(me; anIFStream: in out IFStream from Aspect) is virtual;
fields
myICTX : InteractiveContext from AIS2D;
myDrawer : Drawer from Prs2d is protected;
myDisplayMode : Integer from Standard;
myHighlightMode : TypeOfDetection from AIS2D is protected;
mySelectionMode : Integer from Standard;
myAspects : DataMapOfPrimAspects from AIS2D;
myState : Integer from Standard;
myDetectedPrimSeq : HSequenceOfPrimArchit from AIS2D;
mySelectedPrimSeq : HSequenceOfPrimArchit from AIS2D;
friends
class InteractiveContext from AIS2D
end InteractiveObject;

View File

@ -1,482 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <AIS2D_InteractiveObject.ixx>
#include <Prs2d_AspectLine.hxx>
#include <Prs2d_Point.hxx>
#include <V2d_Viewer.hxx>
#include <AIS2D_ProjShape.hxx>
#include <AIS2D_PrimitiveArchit.hxx>
#include <Graphic2d_Segment.hxx>
#include <Graphic2d_InfiniteLine.hxx>
#include <Graphic2d_Polyline.hxx>
#include <Graphic2d_PolylineMarker.hxx>
#include <Graphic2d_Circle.hxx>
#include <Graphic2d_CircleMarker.hxx>
#include <Graphic2d_Ellips.hxx>
#include <Graphic2d_EllipsMarker.hxx>
#include <GGraphic2d_Curve.hxx>
#include <stdio.h>
#define NUM_ASPECTROOT 29
AIS2D_InteractiveObject::AIS2D_InteractiveObject()
: Graphic2d_GraphicObject(),
myDrawer( new Prs2d_Drawer() ),
myHighlightMode( AIS2D_TOD_PRIMITIVE ),
myICTX(),
myDisplayMode( 0 ),
mySelectionMode( 0 ),
myAspects(),
myState( 0 ),
myDetectedPrimSeq( new AIS2D_HSequenceOfPrimArchit() ),
mySelectedPrimSeq( new AIS2D_HSequenceOfPrimArchit() )
{
AIS2D_DataMapOfPrimAspects theAspect(NUM_ASPECTROOT);
myAspects = theAspect;
printf(" $$$ Creates AIS2D_InteractiveObject()\n");
}
void AIS2D_InteractiveObject::SetAttributes( const Handle(Prs2d_Drawer)& aDrawer ) {
myDrawer = aDrawer;
}
void AIS2D_InteractiveObject::UnsetAttributes() {
myDrawer = new Prs2d_Drawer();
}
void AIS2D_InteractiveObject::SetAspect( const Handle(Prs2d_AspectRoot)& anAspect ) {
if ( ! PrimitiveExist(anAspect->GetAspectName()) ) return;
switch ( anAspect->GetAspectName() ) {
case Prs2d_AN_LINE: {
if ( GetContext().IsNull() ) {
myDrawer->SetAspect( anAspect, Prs2d_AN_LINE );
return;
}
Handle(Prs2d_AspectLine) theAspLine =
Handle(Prs2d_AspectLine)::DownCast( anAspect );
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Aspect_WidthOfLine aWidth;
Quantity_Color aIntColor;
Graphic2d_TypeOfPolygonFilling aTypeFill;
Standard_Integer aTile;
Standard_Boolean aDrawEdge;
theAspLine->ValuesOfLine( aColor, aType, aWidth );
theAspLine->ValuesOfPoly( aIntColor, aTypeFill, aTile, aDrawEdge );
Standard_Integer colorInd = theAspLine->ColorIndex();
Standard_Integer typeInd = theAspLine->TypeIndex();
Standard_Integer widthInd = theAspLine->WidthIndex();
Standard_Integer colorIntInd = theAspLine->InterColorIndex();
if ( !colorInd ) {
colorInd = GetContext()->InitializeColor( aColor );
theAspLine->SetColorIndex( colorInd );
}
if ( !typeInd ) {
typeInd = GetContext()->InitializeStyle( aType );
theAspLine->SetTypeIndex( typeInd );
}
if ( !widthInd ) {
widthInd = GetContext()->InitializeWidth( aWidth );
theAspLine->SetWidthIndex( widthInd );
}
if ( !colorIntInd ) {
colorIntInd = GetContext()->InitializeColor( aIntColor );
theAspLine->SetIntColorInd( colorIntInd );
}
if ( this->IsKind(STANDARD_TYPE(AIS2D_ProjShape) ) ) {
Handle(AIS2D_ProjShape) thePS = Handle(AIS2D_ProjShape)::DownCast(this);
Handle(Graphic2d_Line) theLines = thePS->GetPrimitives();
theLines->SetColorIndex( colorInd );
theLines->SetTypeIndex( typeInd );
theLines->SetWidthIndex( widthInd );
if ( thePS->IsHLMode() ) {
Handle(Graphic2d_Line) theHLines = thePS->GetHLPrimitives();
theHLines->SetColorIndex( colorInd );
theHLines->SetWidthIndex( widthInd );
Standard_Integer theDashInd = GetContext()->InitializeStyle( Aspect_TOL_DASH );
theHLines->SetTypeIndex( theDashInd );
}
} else
for ( Standard_Integer i = 1; i <= Length(); i++ ) {
if ( Primitive(i)->IsKind(STANDARD_TYPE(Graphic2d_Line)) ) {
Handle(Graphic2d_Line) theLine =
Handle(Graphic2d_Line)::DownCast( Primitive(i) );
theLine->SetColorIndex( colorInd );
theLine->SetTypeIndex( typeInd );
theLine->SetWidthIndex( widthInd );
theLine->SetInteriorColorIndex( colorIntInd );
theLine->SetTypeOfPolygonFilling( aTypeFill );
theLine->SetInteriorPattern( aTile );
theLine->SetDrawEdge( aDrawEdge );
if ( !myAspects.IsBound(theLine) )
myAspects.Bind( theLine, theAspLine );
else
myAspects( theLine ) = theAspLine;
} // end if STANDARD_TYPE is Graphic2d_Line
} // end for
break;
} // end case Prs2d_AN_LINE
case Prs2d_AN_HIDDENLINE: {
}
case Prs2d_AN_TEXT: {
}
case Prs2d_AN_HIDINGPOLY: {
}
case Prs2d_AN_HIDINGTEXT: {
}
case Prs2d_AN_FRAMEDTEXT: {
}
case Prs2d_AN_LAST: {
}
case Prs2d_AN_UNKNOWN: {
}
}
myDrawer->SetAspect( anAspect, anAspect->GetAspectName() );
if ( !GetContext().IsNull() )
GetContext()->CurrentViewer()->Update();
}
void AIS2D_InteractiveObject::SetAspect( const Handle(Prs2d_AspectRoot)& anAspect,
const Handle(Graphic2d_Primitive)& aPrim ) {
if ( ( GetContext().IsNull() ) || ( !IsIn(aPrim) ) ) return;
switch ( anAspect->GetAspectName() ) {
case Prs2d_AN_LINE: {
if ( aPrim->IsKind(STANDARD_TYPE(Graphic2d_Line)) ) {
Handle(Prs2d_AspectLine) theAspLine =
Handle(Prs2d_AspectLine)::DownCast( anAspect );
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Aspect_WidthOfLine aWidth;
Quantity_Color aIntColor;
Graphic2d_TypeOfPolygonFilling aTypeFill;
Standard_Integer aTile;
Standard_Boolean aDrawEdge;
theAspLine->ValuesOfLine( aColor, aType, aWidth );
theAspLine->ValuesOfPoly( aIntColor, aTypeFill, aTile, aDrawEdge );
Standard_Integer colorInd = theAspLine->ColorIndex();
Standard_Integer typeInd = theAspLine->TypeIndex();
Standard_Integer widthInd = theAspLine->WidthIndex();
Standard_Integer colorIntInd = theAspLine->InterColorIndex();
if ( !colorInd ) {
colorInd = GetContext()->InitializeColor( aColor );
theAspLine->SetColorIndex( colorInd );
}
if ( !typeInd ) {
typeInd = GetContext()->InitializeStyle( aType );
theAspLine->SetTypeIndex( typeInd );
}
if ( !widthInd ) {
widthInd = GetContext()->InitializeWidth( aWidth );
theAspLine->SetWidthIndex( widthInd );
}
if ( !colorIntInd ) {
colorIntInd = GetContext()->InitializeColor( aIntColor );
theAspLine->SetIntColorInd( colorIntInd );
}
Handle(Graphic2d_Line) theLine = Handle(Graphic2d_Line)::DownCast( aPrim );
theLine->SetColorIndex( colorInd );
theLine->SetTypeIndex( typeInd );
theLine->SetWidthIndex( widthInd );
theLine->SetInteriorColorIndex( colorIntInd );
theLine->SetTypeOfPolygonFilling( aTypeFill );
theLine->SetInteriorPattern( aTile );
theLine->SetDrawEdge( aDrawEdge );
if ( !myAspects.IsBound(aPrim) )
myAspects.Bind( theLine, theAspLine );
else
myAspects( theLine ) = theAspLine;
} // end if STANDARD_TYPE is Graphic2d_Line
break;
} // end case Prs2d_AN_LINE
case Prs2d_AN_HIDDENLINE: {
break;
}
case Prs2d_AN_TEXT: {
break;
}
case Prs2d_AN_HIDINGPOLY: {
break;
}
case Prs2d_AN_HIDINGTEXT: {
break;
}
case Prs2d_AN_FRAMEDTEXT: {
break;
}
case Prs2d_AN_LAST: {
break;
}
case Prs2d_AN_UNKNOWN: {
break;
}
} // end switch
myDrawer->SetAspect( anAspect, anAspect->GetAspectName() );
GetContext()->CurrentViewer()->Update();
}
Handle(Prs2d_AspectRoot) AIS2D_InteractiveObject::GetAspect
( const Handle(Graphic2d_Primitive)& aPrim ) const {
return myAspects( aPrim );
}
Standard_Boolean AIS2D_InteractiveObject::HasAspect
( const Handle(Graphic2d_Primitive)& aPrim ) const {
return myAspects.IsBound( aPrim );
}
Standard_Boolean AIS2D_InteractiveObject::HasInteractiveContext() const {
return ( ! myICTX.IsNull() );
}
Handle(AIS2D_InteractiveContext) AIS2D_InteractiveObject::GetContext() const {
return myICTX;
}
void AIS2D_InteractiveObject::SetContext( const Handle(AIS2D_InteractiveContext)& aCtx) {
myICTX = aCtx;
if ( myDrawer.IsNull() )
myDrawer = new Prs2d_Drawer;
}
void AIS2D_InteractiveObject::SelectPrimitive (const Standard_Integer anIndex, const Standard_Boolean append )
{
if ( !append )
{ // unselect all
for ( Standard_Integer i = 1; i <= mySelectedPrimSeq->Length(); i++ )
mySelectedPrimSeq->Value( i )->GetPrimitive()->Unhighlight();
mySelectedPrimSeq->Clear();
SetState( 0 );
}
// select new primitive
SetPickedIndex( anIndex );
}
Standard_Boolean AIS2D_InteractiveObject::PrimitiveExist( const Prs2d_AspectName aName) const {
Standard_Boolean isFound = Standard_False;
for ( Standard_Integer i = 1; i <= Length(); i++ )
switch ( aName ) {
case Prs2d_AN_LINE: {
if ( Primitive(i)->IsKind(STANDARD_TYPE(Graphic2d_Line)) )
isFound = Standard_True;
break;
}
case Prs2d_AN_HIDDENLINE: {
break;
}
case Prs2d_AN_TEXT: {
break;
}
case Prs2d_AN_HIDINGPOLY: {
break;
}
case Prs2d_AN_HIDINGTEXT: {
break;
}
case Prs2d_AN_FRAMEDTEXT: {
break;
}
case Prs2d_AN_LAST: {
break;
}
case Prs2d_AN_UNKNOWN: {
break;
}
} // end switch
return isFound;
}
void AIS2D_InteractiveObject::AddDetectPrim ( const Handle(Graphic2d_Primitive)& aPrim,
const Standard_Integer anInd) {
Handle(AIS2D_PrimitiveArchit) thePA = new AIS2D_PrimitiveArchit( aPrim, anInd );
myDetectedPrimSeq->Append( thePA );
}
void AIS2D_InteractiveObject::AddSelectPrim ( const Handle(Graphic2d_Primitive)& aPrim,
const Standard_Integer anInd) {
Handle(AIS2D_PrimitiveArchit) thePA = new AIS2D_PrimitiveArchit( aPrim, anInd );
mySelectedPrimSeq->Append( thePA );
}
void AIS2D_InteractiveObject::RemoveSelectPrim ( const Handle(Graphic2d_Primitive)& aPrim,
const Standard_Integer anInd) {
if ( mySelectedPrimSeq->IsEmpty() ) return;
for ( int i = 1; i <= mySelectedPrimSeq->Length(); ++i )
if ( mySelectedPrimSeq->Value(i)->GetPrimitive() == aPrim &&
mySelectedPrimSeq->Value(i)->GetIndex() == anInd ) {
mySelectedPrimSeq->Remove(i);
return;
}
}
void AIS2D_InteractiveObject::SetSelSeqPrim( const Handle(AIS2D_HSequenceOfPrimArchit)& aSeq ) {
mySelectedPrimSeq = aSeq;
}
void AIS2D_InteractiveObject::ClearSeqDetPrim() {
myDetectedPrimSeq->Clear();
}
void AIS2D_InteractiveObject::ClearSeqSelPrim() {
mySelectedPrimSeq->Clear();
}
Handle(AIS2D_HSequenceOfPrimArchit) AIS2D_InteractiveObject::GetDetectSeqPrim() const {
return myDetectedPrimSeq;
}
Handle(AIS2D_HSequenceOfPrimArchit) AIS2D_InteractiveObject::GetSelectedSeqPrim() const {
return mySelectedPrimSeq;
}
void AIS2D_InteractiveObject::Save(Aspect_FStream& aFStream) const
{
int lnOfPr = Length();
*aFStream << "AIS2D_InteractiveObject" << endl;
for (int j = 1; j <= lnOfPr; j++)
{
Handle(Graphic2d_Primitive) thePrm = this->Primitive(j);
thePrm->Save(aFStream);
}
}
void AIS2D_InteractiveObject::Retrieve(Aspect_IFStream& anIFStream) const
{
char buf[100];
anIFStream->getline(buf, 100);
while (! anIFStream->eof())
{
if (! strcmp(buf, "Graphic2d_Segment"))
{
Graphic2d_Segment::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "Graphic2d_InfiniteLine"))
{
Graphic2d_InfiniteLine::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "Graphic2d_Polyline"))
{
Graphic2d_Polyline::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "Graphic2d_PolylineMarker"))
{
Graphic2d_PolylineMarker::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "Graphic2d_Circle"))
{
Graphic2d_Circle::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "Graphic2d_CircleMarker"))
{
Graphic2d_CircleMarker::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "Graphic2d_Ellips"))
{
Graphic2d_Ellips::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "Graphic2d_EllipsMarker"))
{
Graphic2d_EllipsMarker::Retrieve(anIFStream, this);
}
else if (! strcmp(buf, "GGraphic2d_Curve"))
{
GGraphic2d_Curve::Retrieve(anIFStream, this);
}
anIFStream->getline(buf, 100);
}
}

View File

@ -1,92 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
inline Handle(Prs2d_Drawer) AIS2D_InteractiveObject::Attributes() const {
return myDrawer;
}
inline Standard_Integer AIS2D_InteractiveObject::DisplayMode() const {
return myDisplayMode;
}
inline Standard_Boolean AIS2D_InteractiveObject::HasDisplayMode() const {
return myDisplayMode != -1;
}
inline void AIS2D_InteractiveObject::SetDisplayMode( const Standard_Integer aMode ) {
myDisplayMode = aMode;
}
inline void AIS2D_InteractiveObject::UnsetDisplayMode() {
myDisplayMode = -1;
}
inline Standard_Integer AIS2D_InteractiveObject::DefaultDisplayMode() const {
return 0;
}
inline Standard_Boolean AIS2D_InteractiveObject::AcceptDisplayMode( const Standard_Integer /*aMode*/ ) const {
return Standard_True;
}
inline AIS2D_TypeOfDetection AIS2D_InteractiveObject::HighlightMode() const {
return myHighlightMode;
}
inline Standard_Boolean AIS2D_InteractiveObject::HasHighlightMode() const {
return myHighlightMode != AIS2D_TOD_NONE;
}
inline void AIS2D_InteractiveObject::SetHighlightMode( const AIS2D_TypeOfDetection aMode ) {
myHighlightMode = aMode;
}
inline void AIS2D_InteractiveObject::UnsetHighlightMode() {
myHighlightMode = AIS2D_TOD_NONE;
}
inline AIS2D_TypeOfDetection AIS2D_InteractiveObject::DefaultHighlightMode() const {
return AIS2D_TOD_PRIMITIVE;
}
inline Standard_Integer AIS2D_InteractiveObject::SelectionMode() const {
return mySelectionMode;
}
inline Standard_Boolean AIS2D_InteractiveObject::HasSelectionMode() const {
return mySelectionMode != -1;
}
inline void AIS2D_InteractiveObject::SetSelectionMode( const Standard_Integer aMode ) {
mySelectionMode = aMode;
}
inline void AIS2D_InteractiveObject::UnsetSelectionMode() {
mySelectionMode = -1;
}
inline Standard_Integer AIS2D_InteractiveObject::DefaultSelectionMode() const {
return 0;
}
inline Standard_Integer AIS2D_InteractiveObject::State() const {
return myState;
}
inline void AIS2D_InteractiveObject::SetState( const Standard_Integer aState ) {
myState = aState;
}

View File

@ -1,227 +0,0 @@
-- Created by: Tanya COOL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
private class LocalContext from AIS2D inherits TShared from MMgt
---Purpose: defines a specific context for selection: One can
-- loads InteractiveObjects with a mode to be
-- activated associate InteractiveObjects with a
-- set of temporary selectable Objects
--
uses
ListOfInteger from TColStd,
SequenceOfInteger from TColStd,
MapOfTransient from TColStd,
NameOfColor from Quantity,
PlaneAngle from Quantity,
Length from Quantity,
GridType from Aspect,
GridDrawMode from Aspect,
View from V2d,
Primitive from Graphic2d,
InteractiveObject from AIS2D,
InteractiveContext from AIS2D,
LocalStatus from AIS2D,
StatusOfPick from AIS2D,
StatusOfDetection from AIS2D,
PToListOfInt from AIS2D,
DataMapOfLocStat from AIS2D,
ClearMode from AIS2D
is
Create returns mutable LocalContext from AIS2D;
---Purpose: Constructor By Default, the displayed objects are
-- automatically loaded.
Create ( aCtx : InteractiveContext from AIS2D;
anIndex : Integer from Standard;
LoadDisplayed : Boolean from Standard = Standard_True;
AcceptStdModes : Boolean from Standard = Standard_True;
AcceptErase : Boolean from Standard = Standard_False )
returns mutable LocalContext from AIS2D;
---Purpose: Constructor
-- *************************************************************
-- Editing general Display Services
-- *************************************************************
Display( me : mutable;
anIObj : InteractiveObject from AIS2D;
DisplayMode : Integer from Standard = 0;
AllowDecomp : Boolean from Standard = Standard_True;
ActivationMode : Integer from Standard = 0 )
returns Boolean from Standard;
---Level: Internal
---Purpose:
Load( me : mutable;
anIObj : InteractiveObject from AIS2D;
AllowDecomp : Boolean from Standard = Standard_True;
ActivationMode : Integer from Standard = 0)
returns Boolean from Standard;
---Level: Internal
---Purpose:
Erase( me : mutable;
anIObj : InteractiveObject from AIS2D )
returns Boolean from Standard;
---Level: Internal
---Purpose:
Remove( me : mutable;
aSelObj : InteractiveObject from AIS2D )
returns Boolean from Standard;
---Level: Internal
---Purpose:
LoadContextObjects( me: mutable );
UnloadContextObjects( me: mutable );
Terminate( me: mutable );
---Level: Internal
---Purpose:
Clear( me: mutable; aType: ClearMode from AIS2D = AIS2D_CM_All );
---Purpose: according to <aType>, clears the different parts of
-- the selector (filters, modeof activation, objects...)
HighlightPicked( me: mutable; UpdateVwr: Boolean from Standard = Standard_True ) ;
UnhighlightPicked( me: mutable; UpdateVwr: Boolean from Standard = Standard_True ) ;
UpdateSelected( me : mutable;
UpdateVwr : Boolean from Standard = Standard_True );
SetSelected( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard=Standard_True );
---Purpose: useful to update selection with objects coming from
-- Collector or stack
AddOrRemoveSelected( me : mutable;
anIObj : InteractiveObject from AIS2D;
UpdateVwr : Boolean from Standard = Standard_True );
---Purpose: useful to update selection with objects coming from
-- Collector or stack
--***************************************************************************
-- Information about Detection
--***************************************************************************
IsSelected( me; anIObj: InteractiveObject from AIS2D) returns Boolean from Standard;
SelectedIO( me ) returns InteractiveObject from AIS2D;
-- *******************************************************************************
-- Management Of Temporary Attributes
-- *******************************************************************************
SetDisplayPriority( me : mutable;
anIObj : InteractiveObject from AIS2D;
Prior : Integer from Standard);
DisplayedObjects( me; theMapToFill: in out MapOfTransient from TColStd )
returns Integer from Standard;
IsDisplayed( me; anIObj: InteractiveObject from AIS2D) returns Boolean from Standard;
IsDisplayed( me; anIObj: InteractiveObject from AIS2D;
aMode: Integer from Standard)
returns Boolean from Standard;
Unhighlight( me:mutable; anIObj: InteractiveObject from AIS2D);
IsHighlight( me; anIObj: InteractiveObject from AIS2D) returns Boolean from Standard;
IsHighlight( me;
anIObj : InteractiveObject from AIS2D;
WithColor : out Boolean from Standard;
HiCol : out NameOfColor from Quantity)
returns Boolean from Standard;
IsIn( me; anIObj: InteractiveObject from AIS2D) returns Boolean from Standard;
SubIntensityOn( me: mutable; anIObj: InteractiveObject from AIS2D );
SubIntensityOff( me: mutable; anIObj: InteractiveObject from AIS2D );
--****************************************************************
-- Graphic Detection and Selection
--****************************************************************
UnhighLastDetect( me: mutable; aView: View from V2d) returns Boolean from Standard;
MoveTo( me: mutable; Xpix, Ypix: Integer from Standard; aView: View from V2d)
returns StatusOfDetection from AIS2D;
Select( me: mutable; UpdateVwr: Boolean from Standard = Standard_True )
returns StatusOfPick from AIS2D;
ShiftSelect( me: mutable; UpdateVwr: Boolean from Standard = Standard_True)
returns StatusOfPick from AIS2D;
--**********************************************************************************
--**********************************************************************************
ClearSelected( me: mutable; UpdateVwr: Boolean from Standard=Standard_True );
ClearObjects( me:mutable ) is static private;
ClearDetected( me:mutable ) is static private;
IsValidForSelection( me; anIObj: InteractiveObject from AIS2D) returns Boolean from Standard is static private;
DrawObject( me: mutable; anObj: InteractiveObject from AIS2D; aDispMode: Integer from Standard )
is private;
DetectedIndex(me:mutable) returns Integer from Standard is static private;
Status( me; anObject: InteractiveObject from AIS2D )
returns any LocalStatus from AIS2D is private;
---C++: return const&
fields
myICTX : InteractiveContext from AIS2D;
myActiveObjects : DataMapOfLocStat from AIS2D;
myLastPicked : InteractiveObject from AIS2D;
myLastinMain : InteractiveObject from AIS2D;
myLastSelPrim : Primitive from Graphic2d;
myLastPickPrim : Primitive from Graphic2d;
myLastPickElInd : Integer from Standard;
myLastSelElInd : Integer from Standard;
myLoadDisplayed : Boolean from Standard;
myAcceptStdMode : Boolean from Standard;
myAcceptErase : Boolean from Standard;
myListOfStdMode : ListOfInteger from TColStd;
myAutoHighlight : Boolean from Standard;
myLastIndex : Integer from Standard;
myLastGood : Integer from Standard;
myDetectedSeq : SequenceOfInteger from TColStd;
myCurDetected : Integer from Standard;
myResetDetect : Boolean from Standard;
friends
KeepTemporary from InteractiveContext from AIS2D(me:mutable; anIObj:InteractiveObject from AIS2D; WhichMode: Integer from Standard = -1)
end LocalContext;

View File

@ -1,979 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <AIS2D_LocalContext.ixx>
#include <AIS2D_LocalStatus.hxx>
#include <AIS2D_ProjShape.hxx>
#include <AIS2D_ListOfIO.hxx>
#include <AIS2D_DataMapIteratorOfDataMapOfLocStat.hxx>
#include <Prs2d_AspectLine.hxx>
#include <Prs2d_Drawer.hxx>
#include <Prs2d_Point.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <AIS2D_ListIteratorOfListOfIO.hxx>
#include <TColStd_Array1OfTransient.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <V2d_Viewer.hxx>
#include <Graphic2d_TransientManager.hxx>
#include <Graphic2d_Line.hxx>
#include <Graphic2d_View.hxx>
#include <Graphic2d_DisplayList.hxx>
#include <AIS2D_HSequenceOfIO.hxx>
static Standard_Integer GetHiMod(const Handle(AIS2D_InteractiveObject)& anIO)
{
return anIO->HasHighlightMode() ? anIO->HighlightMode()
: anIO->DefaultHighlightMode();
}
AIS2D_LocalContext::AIS2D_LocalContext()
{
}
AIS2D_LocalContext::AIS2D_LocalContext(
const Handle(AIS2D_InteractiveContext)& aCtx,
const Standard_Integer /*Index*/,
const Standard_Boolean LoadDisplayed,
const Standard_Boolean AcceptStdModes,
const Standard_Boolean AcceptEraseOfTemp ):
myICTX( aCtx ),
myLastPicked( new AIS2D_InteractiveObject()),
myLastinMain( new AIS2D_InteractiveObject()),
myLastPickElInd( 0 ),
myLastSelElInd( 0 ),
myLoadDisplayed( LoadDisplayed ),
myAcceptStdMode( AcceptStdModes ),
myAcceptErase( AcceptEraseOfTemp ),
myAutoHighlight( Standard_True ),
myLastIndex( 0 ),
myLastGood( 0 ),
myCurDetected( 0 ),
myResetDetect( Standard_True )
{
if ( myLoadDisplayed ) LoadContextObjects();
}
Standard_Boolean AIS2D_LocalContext::Display(
const Handle( AIS2D_InteractiveObject)& anIObj,
const Standard_Integer WhichMode,
const Standard_Boolean /*AllowDecomp*/,
const Standard_Integer ActivationMode ) {
if ( myActiveObjects.IsBound(anIObj) ) {
const Handle( AIS2D_LocalStatus )& LStatus = myActiveObjects( anIObj );
if ( LStatus->DisplayMode() == -1) {
if ( !anIObj->IsDisplayed() )
anIObj->Display();
if ( LStatus->IsTemporary() )
LStatus->SetDisplayMode( WhichMode );
} else if ( LStatus->DisplayMode() != WhichMode && LStatus -> IsTemporary() ) {
anIObj->Remove();
LStatus->SetDisplayMode( WhichMode );
if ( !anIObj->IsDisplayed() )
anIObj->Display();
}
if ( ActivationMode !=-1 ) {
if ( !LStatus->IsActivated( ActivationMode ) ) {
LStatus->ClearSelectionModes();
//mySelMgr->Load( anIObj, myMainVS );
LStatus->AddSelectionMode( ActivationMode );
//mySelMgr->Activate( anIObj, ActivationMode, myMainVS );
}
}
} else {
Handle(AIS2D_LocalStatus) LStatus = new AIS2D_LocalStatus();
/*if ( anIObj->AcceptDecomposition() && AllowDecomp )
LStatus->SetDecomposition(Standard_True);
else
LStatus->SetDecomposition(Standard_False);
*/
if( myICTX->DisplayStatus(anIObj) == AIS2D_DS_None ||
myICTX->DisplayStatus(anIObj) == AIS2D_DS_Temporary )
LStatus->SetTemporary(Standard_True);
else
LStatus->SetTemporary(Standard_False);
AIS2D_TypeOfDetection HiMod ;
if( !myICTX->IsDisplayed( anIObj, WhichMode) ) {
LStatus->SetDisplayMode(WhichMode);
if ( ActivationMode != -1 )
LStatus->AddSelectionMode(ActivationMode);
HiMod = anIObj->HasHighlightMode() ?
anIObj->HighlightMode() : anIObj->DefaultHighlightMode();
LStatus->SetHighlightMode( HiMod );
if( !anIObj->IsDisplayed()) {
DrawObject(anIObj,WhichMode);
anIObj->Display();
}
/*if(ActivationMode!=-1) {
mySelMgr->Load(anIObj,myMainVS);
mySelMgr->Activate(anIObj,ActivationMode,myMainVS);
} */
} else {
HiMod = anIObj->HasHighlightMode()? anIObj->HighlightMode(): anIObj->DefaultHighlightMode();
LStatus->SetHighlightMode( HiMod );
}
myActiveObjects.Bind(anIObj,LStatus);
}
return Standard_True;
}
Standard_Boolean AIS2D_LocalContext::Erase( const Handle(AIS2D_InteractiveObject)& anIObj) {
if ( !myActiveObjects.IsBound( anIObj ) ) return Standard_False;
const Handle(AIS2D_LocalStatus)& LStatus = myActiveObjects( anIObj );
if ( LStatus->IsSubIntensityOn() ) {
LStatus->SubIntensityOff();
anIObj->Unhighlight();
}
Standard_Boolean stat( Standard_False );
if ( LStatus->DisplayMode() != -1 ) {
// if ( IsSelected( anIObj ) )
// AddOrRemoveSelected( anIObj );
if ( anIObj->IsHighlighted() )
anIObj->Unhighlight();
anIObj->Remove();
LStatus->SetDisplayMode(-1);
stat = Standard_True;
}
if ( LStatus->IsTemporary() )
if ( anIObj->IsDisplayed() )
anIObj->Remove();
/* TColStd_ListIteratorOfListOfInteger It( * LStatus->SelectionModes() );
for ( ; It.More(); It.Next() )
mySelMgr->Deactivate( anIObj, It.Value(), myMainVS );
*/
return stat;
}
Standard_Boolean AIS2D_LocalContext::Load(
const Handle(AIS2D_InteractiveObject)& anIObj,
const Standard_Boolean /*AllowDecomp*/,
const Standard_Integer ActivationMode ) {
if ( myActiveObjects.IsBound( anIObj ) ) return Standard_False;
Handle(AIS2D_LocalStatus) LStatus = new AIS2D_LocalStatus();
/*if ( anIObj->AcceptDecomposition() && AllowDecomp )
LStatus->SetDecomposition( Standard_True );
else
LStatus->SetDecomposition( Standard_False );
*/
if ( !myICTX->IsDisplayed( anIObj ) )
LStatus->SetTemporary( Standard_True );
else
LStatus->SetTemporary( Standard_False );
LStatus->SetDisplayMode( -1 );
//storing information....
if ( ActivationMode !=-1 )
LStatus->AddSelectionMode( ActivationMode );
AIS2D_TypeOfDetection HiMod = anIObj->HasHighlightMode() ? anIObj->HighlightMode() : anIObj->DefaultHighlightMode();
LStatus->SetHighlightMode( HiMod );
/*mySelMgr->Load( anIObj, myMainVS );
if ( ActivationMode != -1 ) {
mySelMgr->Activate( anIObj, ActivationMode, myMainVS );
} */
myActiveObjects.Bind( anIObj, LStatus );
return Standard_True;
}
Standard_Boolean AIS2D_LocalContext::Remove(const Handle(AIS2D_InteractiveObject)& /*aSelObj*/ ) {
return Standard_False;
}
void AIS2D_LocalContext::LoadContextObjects() {
AIS2D_ListIteratorOfListOfIO It;
if ( myLoadDisplayed ) {
AIS2D_ListOfIO theLOI;
myICTX->DisplayedObjects( theLOI, Standard_True );
Handle(AIS2D_LocalStatus) LStatus;
for ( It.Initialize(theLOI); It.More(); It.Next() ) {
LStatus = new AIS2D_LocalStatus();
// LStatus->SetDecomposition((It.Value()->AcceptDecomposition() && myAcceptStdMode));
LStatus->SetTemporary(Standard_False);
LStatus->SetHighlightMode( It.Value()->HasHighlightMode() ? It.Value()->HighlightMode(): It.Value()->DefaultHighlightMode() );
myActiveObjects.Bind(It.Value(),LStatus);
}
}
}
void AIS2D_LocalContext::UnloadContextObjects()
{}
void AIS2D_LocalContext::Terminate() {
ClearDetected();
Clear();
myLastIndex = 0;
if ( ! myICTX->mySeqOfSelIO->IsEmpty() )
for ( int i = 1; i <= myICTX->mySeqOfSelIO->Length(); ++i )
myICTX->mySeqOfSelIO->Value(i)->SetState(0);
/*
AIS2D_Selection::Select();
AIS2D_Selection::Remove(mySelName.ToCString());*/
Handle(V2d_Viewer) Vwr = myICTX->CurrentViewer();
Handle(V2d_View) curV;
for ( Vwr->InitActiveViews(); Vwr->MoreActiveViews(); Vwr->NextActiveViews() ) {
curV = Vwr->ActiveView();
}
}
void AIS2D_LocalContext::Clear(const AIS2D_ClearMode aType) {
switch (aType){
case AIS2D_CM_All:
{
ClearObjects();
break;
}
case AIS2D_CM_Interactive:
ClearObjects();
break;
case AIS2D_CM_StandardModes:
{
while(!myListOfStdMode.IsEmpty())
//DeactivateStdMode(AIS2D_Shape::SelectionType(myListOfStdMode.Last()));
break;
}
case AIS2D_CM_TemporaryShapePrs:
ClearDetected();
}
//UpdateSort();
}
Standard_Boolean AIS2D_LocalContext::IsSelected( const Handle(AIS2D_InteractiveObject)& anIObj) const {
if ( ! myICTX->mySeqOfSelIO->IsEmpty() )
for ( int i = 1; i <= myICTX->mySeqOfSelIO->Length(); ++i )
if ( myICTX->mySeqOfSelIO->Value(i) == anIObj )
return Standard_True;
return Standard_False;
}
Handle(AIS2D_InteractiveObject) AIS2D_LocalContext::SelectedIO() const {
return myLastPicked;
}
AIS2D_StatusOfDetection AIS2D_LocalContext::MoveTo(
const Standard_Integer XPix,
const Standard_Integer YPix,
const Handle(V2d_View)& aView ) {
if ( aView->Viewer() == myICTX->CurrentViewer() ) {
Standard_Integer Dprecision = myICTX->DetectPrecision();
Standard_Boolean UpdVwr = Standard_False;
Handle(V2d_Viewer) theViewer = aView->Viewer();
AIS2D_StatusOfDetection theStat( AIS2D_SOD_Nothing );
Handle(Graphic2d_Primitive) thePrim;
Handle(Graphic2d_TransientManager) theDrawer =
Handle(Graphic2d_TransientManager)::DownCast( theViewer->View()->Drawer() );
Handle(Graphic2d_DisplayList) thePickList = aView->Pick( XPix, YPix, Dprecision );
if ( thePickList->Length() > 0 ) {
if ( thePickList->Length() == 1 ) {
Handle(AIS2D_InteractiveObject) theIO = Handle(AIS2D_InteractiveObject)::DownCast(thePickList->Value(1));
if ( theIO == myLastPicked )
switch ( theIO->HighlightMode() ) {
default:
case AIS2D_TOD_OBJECT:
return AIS2D_SOD_OnlyOneDetected;
break;
case AIS2D_TOD_PRIMITIVE:
if ( myLastPicked->Primitive(myLastPicked->PickedIndex()) == myLastPickPrim )
return AIS2D_SOD_OnlyOneDetected;
break;
case AIS2D_TOD_ELEMENT:
if ( ( myLastPicked->Primitive(myLastPicked->PickedIndex()) == myLastPickPrim ) &&
( myLastPicked->Primitive(myLastPicked->PickedIndex())->PickedIndex() == myLastPickElInd ) )
return AIS2D_SOD_OnlyOneDetected;
break;
case AIS2D_TOD_VERTEX:
if ( ( myLastPicked->Primitive(myLastPicked->PickedIndex()) == myLastPickPrim ) &&
( myLastPicked->Primitive(myLastPicked->PickedIndex())->PickedIndex() == myLastPickElInd ) )
return AIS2D_SOD_OnlyOneDetected;
break;
}
}
if ( !myLastPicked.IsNull() )
if ( !myLastPicked->State() ) {
myLastPicked->Unhighlight();
UpdVwr = Standard_True;
} // end if the last picked object isn't selected one
if ( myResetDetect ) {
theDrawer->SetOverride(Standard_True);
theDrawer->SetOverrideColor( theViewer->InitializeColor(myICTX->HighlightColor()) );
theDrawer->BeginDraw( aView->Driver() );
for ( int i = 1 ; i <= thePickList->Length(); i++ ) {
myLastPicked = Handle(AIS2D_InteractiveObject)::DownCast( thePickList->Value(i) );
myLastinMain = myLastPicked;
if ( myLastPicked->HasHighlightMode() ) {
myLastPicked->Highlight(theViewer->InitializeColor(myICTX->HighlightColor()));
switch( myLastPicked->HighlightMode() ) {
default:
case AIS2D_TOD_OBJECT:
if ( myLastPicked->State() != 1 ) {
theDrawer->Draw( myLastPicked );
} else {
theStat = AIS2D_SOD_Selected;
}
break;
case AIS2D_TOD_PRIMITIVE:
myLastPickPrim = myLastPicked->Primitive(myLastPicked->PickedIndex());
if ( !myLastPickPrim->IsHighlighted() ) {
theDrawer->Draw(myLastPickPrim);
} else {
theStat = AIS2D_SOD_Selected;
}
break;
case AIS2D_TOD_ELEMENT: {
Standard_Integer pInd = myLastPicked->PickedIndex();
myLastPickPrim = myLastPicked->Primitive(pInd);
if ( myLastPickPrim != myLastSelPrim ||
( myLastPickPrim == myLastSelPrim &&
myLastPickPrim->PickedIndex() != myLastSelElInd ) ||
( !myLastPickPrim->PickedIndex() &&
!myLastPickPrim->IsHighlighted() ) ) {
myLastPickElInd = myLastPickPrim->PickedIndex();
theDrawer->DrawElement(myLastPickPrim,myLastPickElInd);
} else {
theStat = AIS2D_SOD_Selected;
}
break;
}
case AIS2D_TOD_VERTEX: {
myLastPickPrim = myLastPicked->Primitive(myLastPicked->PickedIndex());
if ( myLastPickPrim != myLastSelPrim ||
( myLastPickPrim == myLastSelPrim &&
myLastPickPrim->PickedIndex() != myLastSelElInd ) ||
( !myLastPickPrim->PickedIndex() &&
!myLastPickPrim->IsHighlighted() ) ) {
myLastPickElInd = myLastPickPrim->PickedIndex();
theDrawer->DrawVertex(myLastPickPrim,-myLastPickElInd);
} else {
theStat = AIS2D_SOD_Selected;
}
break;
}
} //end switch
} // end if lastPicked has highlight mode
} // end for
theDrawer->EndDraw();
theDrawer->SetOverride(Standard_False);
myResetDetect= Standard_False;
} // end if myResetDetect is true
} else {
theStat = AIS2D_SOD_Nothing;
theDrawer->RestoreArea( aView->Driver() );
myResetDetect= Standard_True;
if ( !myLastPicked.IsNull() ) {
if ( myLastPicked->HighlightMode() == AIS2D_TOD_ELEMENT ||
myLastPicked->HighlightMode() == AIS2D_TOD_VERTEX ) {
myLastPicked->Highlight(theViewer->InitializeColor( myICTX->SelectionColor() ));
myLastPicked->Unhighlight();
UpdVwr = Standard_True;
} else if ( !myLastPicked->State() ) {
myLastPicked->Unhighlight();
UpdVwr = Standard_True;
}
}
myLastinMain.Nullify();
myLastPickPrim.Nullify();
myLastPickElInd = 0;
} // end if PickList isn't empty
//if ( !myLastPicked.IsNull() ) myLastPicked->Unhighlight();
if ( UpdVwr ) theViewer->Update();
myLastPicked.Nullify();
//myLastMoveView = aView;
return theStat;
} else
return AIS2D_SOD_Error;
}
AIS2D_StatusOfPick AIS2D_LocalContext::Select( const Standard_Boolean UpdateVwr ) {
if ( myAutoHighlight )
UnhighlightPicked( Standard_False );
Standard_Integer DI = DetectedIndex();
// AIS2D_Selection::SetCurrentSelection( mySelName.ToCString() );
// Standard_Integer NbSel = AIS2D_Selection::Extent();
Standard_Integer NbSel = myICTX->mySeqOfSelIO->Length();
if ( DI <= 0 ) {
ClearSelected( UpdateVwr );
return NbSel == 0 ? AIS2D_SOP_NothingSelected : AIS2D_SOP_Removed;
}
if ( myAutoHighlight )
HighlightPicked( UpdateVwr );
//return ( AIS2D_Selection::Extent() == 1) ? AIS2D_SOP_OneSelected : AIS2D_SOP_SeveralSelected;
return ( myICTX->mySeqOfSelIO->Length() == 1) ? AIS2D_SOP_OneSelected : AIS2D_SOP_SeveralSelected;
}
AIS2D_StatusOfPick AIS2D_LocalContext::ShiftSelect( const Standard_Boolean /*UpdateVwr*/ ) {
/* Standard_Integer I = DetectedIndex();
if ( I > 0 ) {
UnhighlightPicked(Standard_False);
AIS2D_Selection::SetCurrentSelection(mySelName.ToCString());
const Handle(SelectMgr_EntityOwner)& EntOwr = myMapOfOwner(I);
Standard_Integer mod = EntOwr->State() == 0 ? 1 : 0;
EntOwr->State(mod);
AIS2D_Selection::Select(EntOwr);
if ( myAutoHighlight )
HighlightPicked(UpdateVwr);
}*/
return AIS2D_SOP_Error;
}
void AIS2D_LocalContext::SetDisplayPriority(
const Handle(AIS2D_InteractiveObject)& anIObj,
const Standard_Integer /*Prior*/ ) {
if ( !myActiveObjects.IsBound(anIObj) ) return;
const Handle(AIS2D_LocalStatus)& LStatus = myActiveObjects(anIObj);
if ( LStatus->DisplayMode() == -1) return;
//myMainPM->SetDisplayPriority(anIObj, LStatus->DisplayMode(),Prior);
//if ( LStatus->IsSubIntensityOn())
// myMainPM->SetDisplayPriority(anIObj, LStatus->HighlightMode(), Prior);
}
Standard_Integer AIS2D_LocalContext::DisplayedObjects(TColStd_MapOfTransient& theMap) const {
Standard_Integer NbDisp(0);
for ( AIS2D_DataMapIteratorOfDataMapOfLocStat theIt(myActiveObjects); theIt.More(); theIt.Next() ) {
const Handle(AIS2D_InteractiveObject)& SObj = theIt.Key();
if ( !theMap.Contains(SObj) )
if ( theIt.Value()->DisplayMode() != -1 ) {
theMap.Add(SObj);
NbDisp++;
}
}
return NbDisp;
}
Standard_Boolean AIS2D_LocalContext::IsDisplayed(const Handle(AIS2D_InteractiveObject)& anIObj) const {
if ( !myActiveObjects.IsBound(anIObj) )
return Standard_False;
return ( myActiveObjects(anIObj)->DisplayMode() != -1 );
}
Standard_Boolean AIS2D_LocalContext::IsDisplayed(const Handle(AIS2D_InteractiveObject)& anIObj,
const Standard_Integer aMode) const {
if (!myActiveObjects.IsBound(anIObj)) return Standard_False;
return (myActiveObjects(anIObj)->DisplayMode()==aMode);
}
void AIS2D_LocalContext::Unhighlight(const Handle(AIS2D_InteractiveObject)& /*anIObj*/)
{
}
Standard_Boolean AIS2D_LocalContext::IsHighlight(const Handle(AIS2D_InteractiveObject)& anIObj) const {
if ( !myActiveObjects.IsBound(anIObj) ) return Standard_False;
return myActiveObjects( anIObj )->IsSubIntensityOn();
}
Standard_Boolean AIS2D_LocalContext::IsHighlight(const Handle(AIS2D_InteractiveObject)& anIObj,
Standard_Boolean& WithColor,
Quantity_NameOfColor& HiCol) const
{
if(!myActiveObjects.IsBound(anIObj)) return Standard_False;
if( myActiveObjects(anIObj)->IsSubIntensityOn()){
HiCol = myActiveObjects(anIObj)->HighlightColor();
if(HiCol==Quantity_NOC_WHITE)
WithColor = Standard_True;
else
WithColor = Standard_False;
return Standard_True;
}
return Standard_False;
}
void AIS2D_LocalContext::SubIntensityOn(const Handle(AIS2D_InteractiveObject)& anIObj) {
if ( !myActiveObjects.IsBound(anIObj) ) return;
const Handle(AIS2D_LocalStatus)& LStatus = myActiveObjects(anIObj);
if ( LStatus->IsTemporary() ) {
Quantity_NameOfColor aCol = myICTX->SubIntensityColor();
myICTX->HighlightWithColor(anIObj, aCol);
}
LStatus->SubIntensityOn();
}
void AIS2D_LocalContext::SubIntensityOff(const Handle(AIS2D_InteractiveObject)& anIObj) {
if ( !myActiveObjects.IsBound(anIObj) ) return;
const Handle(AIS2D_LocalStatus)& LStatus = myActiveObjects(anIObj);
if ( LStatus->IsTemporary())
myICTX->Unhighlight(anIObj);
LStatus->SubIntensityOff();
}
Standard_Boolean AIS2D_LocalContext::IsIn( const Handle(AIS2D_InteractiveObject)& anIObj) const {
return myActiveObjects.IsBound(anIObj);
}
Standard_Boolean AIS2D_LocalContext::UnhighLastDetect(const Handle(V2d_View)& /*aView*/) {
// if ( !IsValidIndex(myLastIndex) ) return Standard_False;
/* myMainPM->BeginDraw();
const Handle(SelectMgr_EntityOwner)& Ownr = myMapOfOwner(myLastIndex);
Standard_Integer HM(0);
if ( Ownr->HasSelectable() ) {
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
HM = GetHiMod(* ( (Handle(AIS2D_InteractiveObject ) * ) & SO ) );
}
myMapOfOwner( myLastIndex )->Unhilight( myMainPM, HM );
myMainPM->EndDraw( aView );
*/
myLastIndex =0;
return Standard_True;
}
void AIS2D_LocalContext::DrawObject( const Handle(AIS2D_InteractiveObject)& anIObj, const Standard_Integer /*aDispMode*/ ) {
if ( anIObj->IsKind(STANDARD_TYPE(AIS2D_ProjShape) ) ) {
Handle(AIS2D_ProjShape) thePS = Handle(AIS2D_ProjShape)::DownCast(anIObj);
Handle(Graphic2d_Line) theLines = thePS->GetPrimitives();
Handle(Prs2d_AspectLine) theAspLine;
if ( !anIObj->HasAspect(theLines) ) {
Handle(Prs2d_AspectRoot) theAspRoot = anIObj->Attributes()->FindAspect(Prs2d_AN_LINE);
theAspLine = Handle(Prs2d_AspectLine)::DownCast(theAspRoot);
anIObj->SetAspect( theAspLine, theLines );
} else {
theAspLine = Handle(Prs2d_AspectLine)::DownCast( anIObj->GetAspect(theLines) );
}
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Aspect_WidthOfLine aWidth;
theAspLine->ValuesOfLine( aColor, aType, aWidth );
Standard_Integer colorInd = theAspLine->ColorIndex();
Standard_Integer typeInd = theAspLine->TypeIndex();
Standard_Integer widthInd = theAspLine->WidthIndex();
if ( !colorInd ) {
colorInd = myICTX->InitializeColor( aColor );
theLines->SetColorIndex( colorInd );
}
if ( !typeInd ) {
typeInd = myICTX->InitializeStyle( aType );
theLines->SetTypeIndex( typeInd );
}
if ( !widthInd ) {
widthInd = myICTX->InitializeWidth( aWidth );
theLines->SetWidthIndex( widthInd );
}
if ( thePS->IsHLMode() ) {
Handle(Graphic2d_Line) theHLines = thePS->GetHLPrimitives();
theHLines->SetColorIndex( colorInd );
theHLines->SetWidthIndex( widthInd );
Standard_Integer theDashInd = myICTX->InitializeStyle( Aspect_TOL_DASH );
theHLines->SetTypeIndex( theDashInd );
}
} else {
Handle(Graphic2d_Primitive) thePrim;
for ( Standard_Integer i = 1; i <= anIObj->Length(); i++ ) {
thePrim = anIObj->Primitive( i );
if ( thePrim->IsKind(STANDARD_TYPE(Graphic2d_Line) ) ) {
Handle(Graphic2d_Line) theLine = Handle(Graphic2d_Line)::DownCast(thePrim);
Handle(Prs2d_AspectLine) theAspLine;
if ( !anIObj->HasAspect(theLine) ) {
Handle(Prs2d_AspectRoot) theAspRoot = anIObj->Attributes()->FindAspect(Prs2d_AN_LINE);
theAspLine = Handle(Prs2d_AspectLine)::DownCast(theAspRoot);
anIObj->SetAspect( theAspLine, theLine );
} else {
theAspLine = Handle(Prs2d_AspectLine)::DownCast( anIObj->GetAspect(theLine) );
}
Quantity_Color aColor;
Aspect_TypeOfLine aType;
Aspect_WidthOfLine aWidth;
Quantity_Color aIntColor;
Graphic2d_TypeOfPolygonFilling aTypeFill;
Standard_Integer aTile;
Standard_Boolean aDrawEdge;
theAspLine->ValuesOfLine( aColor, aType, aWidth );
theAspLine->ValuesOfPoly( aIntColor, aTypeFill, aTile, aDrawEdge );
Standard_Integer colorInd = theAspLine->ColorIndex();
Standard_Integer typeInd = theAspLine->TypeIndex();
Standard_Integer widthInd = theAspLine->WidthIndex();
Standard_Integer colorIntInd = theAspLine->InterColorIndex();
if ( !colorInd ) {
colorInd = myICTX->InitializeColor( aColor );
theLine->SetColorIndex( colorInd );
}
if ( !typeInd ) {
typeInd = myICTX->InitializeStyle( aType );
theLine->SetTypeIndex( typeInd );
}
if ( !widthInd ) {
widthInd = myICTX->InitializeWidth( aWidth );
theLine->SetWidthIndex( widthInd );
}
if ( !colorIntInd ) {
colorIntInd = myICTX->InitializeColor( aIntColor );
theLine->SetInteriorColorIndex( colorIntInd );
}
theLine->SetTypeOfPolygonFilling( aTypeFill );
theLine->SetInteriorPattern( aTile );
theLine->SetDrawEdge( aDrawEdge );
if ( theLine->IsKind(STANDARD_TYPE(Prs2d_Point) ) ) {
Handle(Prs2d_Point) thePnt = Handle(Prs2d_Point)::DownCast(theLine);
thePnt->SetIndex( myICTX->InitializeMarker( thePnt->Marker() ) );
}
} // end if the kind of primitive is Graphic2d_Line
} // end for exploration of the interactive object
} // end if IO is AIS2D_ProjShape
}
void AIS2D_LocalContext::ClearObjects() {
AIS2D_DataMapIteratorOfDataMapOfLocStat It( myActiveObjects );
for ( ; It.More(); It.Next() ) {
Handle(AIS2D_InteractiveObject) SObj = Handle(AIS2D_InteractiveObject)::DownCast( It.Key() );
const Handle(AIS2D_LocalStatus) LStatus = It.Value();
// TColStd_ListIteratorOfListOfInteger ItL;
AIS2D_DisplayStatus theDS = myICTX->DisplayStatus( SObj );
if ( theDS != AIS2D_DS_Displayed){
//if ( myMainPM->IsDisplayed( SObj, LStatus->DisplayMode() ) ) {
if ( myICTX->IsDisplayed(SObj) ) {
if ( LStatus->IsSubIntensityOn() && SObj->IsHighlighted() )
SObj->Unhighlight();
SObj->Remove();
}
if ( LStatus->IsTemporary() )
SObj->Remove();
} else {
if ( LStatus->IsSubIntensityOn() ) {
myICTX->SubIntensityOff(Handle(AIS2D_InteractiveObject)::DownCast(SObj) ); }
Standard_Integer DiMo = SObj->HasDisplayMode() ? SObj->DisplayMode() : myICTX->DisplayMode();
if ( LStatus->DisplayMode() !=-1 && LStatus->DisplayMode() != DiMo)
SObj->Remove();
}
}
ClearSelected();
myActiveObjects.Clear();
}
void AIS2D_LocalContext::ClearDetected() {
/*for ( Standard_Integer i = 1; i <= myMapOfOwner.Extent(); i++ ) {
if ( !myMapOfOwner(i).IsNull() ) {
if ( myMapOfOwner(i)->IsHilighted(myMainPM) )
myMapOfOwner(i)->Unhilight(myMainPM);
else if ( myMapOfOwner(i)->IsHilighted( myICTX->CollectorPrsMgr() ) )
myMapOfOwner(i)->Unhilight( myICTX->CollectorPrsMgr() );
else {
const Handle(SelectMgr_SelectableObject)& SO =
myMapOfOwner.FindKey(i)->Selectable();
if ( myActiveObjects.IsBound(SO) ) {
const Handle(AIS2D_LocalStatus)& LStatus = myActiveObjects(SO);
if ( LStatus->IsTemporary() &&
LStatus->DisplayMode() == -1 &&
LStatus->SelectionModes()->IsEmpty() )
myMapOfOwner(i)->Clear(myMainPM);
}
}
}
} */
}
void AIS2D_LocalContext::ClearSelected(const Standard_Boolean UpdateVwr) {
UnhighlightPicked(UpdateVwr);
// AIS2D_Selection::SetCurrentSelection(mySelName.ToCString());
// Handle(AIS2D_Selection) Sel = AIS2D_Selection::CurrentSelection();
/*Handle(Standard_Transient) Tr;
Handle(SelectMgr_EntityOwner) EO;
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
for ( Standard_Integer i = Obj.Lower(); i <= Sel->NbStored(); i++ ) {
Tr = Obj(i);
if ( !Tr.IsNull() )
(*((Handle(SelectMgr_EntityOwner)*)&Tr))->State(0);
} */
//AIS2D_Selection::Select();
myLastIndex = 0;
}
void AIS2D_LocalContext::HighlightPicked(const Standard_Boolean /*UpdateVwr*/) {
/*Standard_Boolean updMain(Standard_False),updColl(Standard_False);
Quantity_NameOfColor SelCol = myICTX->SelectionColor();
Handle(AIS2D_Selection) Sel = AIS2D_Selection::Selection(mySelName.ToCString());
Handle(Standard_Transient) Tr;
Handle(SelectMgr_EntityOwner) Ownr;
Handle(PrsMgr_PresentationManager2d) PM = myMainPM;
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
for ( Standard_Integer i = Obj.Lower(); i <= Sel->NbStored(); i++ ) {
Tr = Obj(i);
if ( !Tr.IsNull() ) {
Ownr = * ( (Handle(SelectMgr_EntityOwner) * ) &Tr );
Handle(AIS2D_InteractiveObject) IO;
if ( Ownr->HasSelectable() )
if ( !Ownr->ComesFromDecomposition() ) {
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
Handle(AIS2D_InteractiveObject) IO =
* ( (Handle(AIS2D_InteractiveObject) * ) &SO );
if ( myICTX->IsInCollector(IO) ) {
PM = myICTX->CollectorPrsMgr();
updColl = Standard_True;
} else
updMain = Standard_True;
} else
updMain = Standard_True;
else
updMain = Standard_True;
// endif HasSelectable
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
Standard_Integer HM = GetHiMod( * ( (Handle(AIS2D_InteractiveObject ) * ) &SO ) );
// Ownr->HilightWithColor( PM, myICTX->SelectionColor(), HM );
if ( Ownr->HasSelectable() ) {
Quantity_NameOfColor aCol = myICTX->SelectionColor();
Standard_Integer indCol = myICTX->CurrentViewer()->InitializeColor( aCol );
PM->SetHighlightColor( indCol );
PM->ColorHighlight( SO, indCol, HM );
}
} //endif
} //end for
if (UpdateVwr) {
if ( updMain ) myICTX->CurrentViewer()->Update();
if ( updColl ) myICTX->Collector()->Update();
} */
}
void AIS2D_LocalContext::UnhighlightPicked( const Standard_Boolean /*UpdateVwr*/ ) {
/*Standard_Boolean updMain(Standard_False), updColl(Standard_False);
Quantity_NameOfColor SelCol = myICTX->SelectionColor();
Handle(AIS2D_Selection) Sel = AIS2D_Selection::Selection(mySelName.ToCString());
Handle(Standard_Transient) Tr;
Handle(SelectMgr_EntityOwner) Ownr;
Handle(PrsMgr_PresentationManager2d) PM = myMainPM;
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
for ( Standard_Integer i = Obj.Lower(); i <= Sel->NbStored(); i++ ) {
Tr = Obj(i);
if ( !Tr.IsNull() ) {
Ownr = * ( (Handle(SelectMgr_EntityOwner) * ) &Tr );
Standard_Integer HM(0);
if ( Ownr->HasSelectable() )
if ( !Ownr->ComesFromDecomposition() ) {
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
Handle(AIS2D_InteractiveObject) IO =
* ( (Handle(AIS2D_InteractiveObject) * ) &SO );
HM = GetHiMod(IO);
if ( myICTX->IsInCollector(IO) ) {
PM = myICTX->CollectorPrsMgr();
updColl = Standard_True;
} else
updMain = Standard_True;
} else
updMain = Standard_True;
// endif HasSelectable
Ownr->Unhilight( PM, HM );
} //end if
} //end for
if ( UpdateVwr ) {
if ( updMain ) myICTX->CurrentViewer()->Update();
if ( updColl ) myICTX->Collector()->Update();
} */
}
Standard_Boolean AIS2D_LocalContext::IsValidForSelection(const Handle(AIS2D_InteractiveObject)& /*anIObj*/) const {
// return myFilter->IsOk(new SelectMgr_EntityOwner(anIObj));
return Standard_False;
}
void AIS2D_LocalContext::UpdateSelected(const Standard_Boolean UpdateVwr) {
UnhighlightPicked(Standard_False);
HighlightPicked(UpdateVwr);
}
void AIS2D_LocalContext::SetSelected( const Handle(AIS2D_InteractiveObject)& /*anIObj*/,
const Standard_Boolean /*UpdateVwr*/ ) {
/*if ( !IsValidForSelection(anIObj) ) return;
UnhighlightPicked(Standard_False);
Handle(AIS2D_Selection) sel = AIS2D_Selection::Selection(mySelName.ToCString());
Standard_Boolean found(Standard_False);
Handle(Standard_Transient) Tr;
Handle(SelectMgr_EntityOwner) EntOwr = FindSelectedOwnerFromIO(anIObj);
if ( EntOwr.IsNull() ) {
if ( anIObj->HasSelection(0) ) {
const Handle(SelectMgr_Selection)& SIObj = anIObj->Selection(0);
SIObj->Init();
if ( SIObj->More() ) {
Handle(SelectBasics_EntityOwner) BO = SIObj->Sensitive()->OwnerId();
EntOwr = *( (Handle(SelectMgr_EntityOwner) * ) & BO );
}
}
if ( EntOwr.IsNull() )
EntOwr = new SelectMgr_EntityOwner(anIObj);
}
ClearSelected(Standard_False);
EntOwr->State(1);
AIS2D_Selection::Select(EntOwr);
HighlightPicked(UpdateVwr);
*/
}
void AIS2D_LocalContext::AddOrRemoveSelected(
const Handle(AIS2D_InteractiveObject)& /*anIObj*/,
const Standard_Boolean /*UpdateVwr*/) {
/*if ( !IsValidForSelection(anIObj) ) return;
UnhighlightPicked(Standard_False);
Handle(SelectMgr_EntityOwner) EntOwr;
EntOwr = FindSelectedOwnerFromIO(anIObj);
if ( !EntOwr.IsNull() )
EntOwr->State(0);
else {
if ( anIObj->HasSelection(0) ) {
const Handle(SelectMgr_Selection)& SIObj = anIObj->Selection(0);
SIObj->Init();
if ( SIObj->More() ) {
Handle(SelectBasics_EntityOwner) BO = SIObj->Sensitive()->OwnerId();
EntOwr = * ( ( Handle(SelectMgr_EntityOwner)* )& BO );
}
}
if ( EntOwr.IsNull() )
EntOwr = new SelectMgr_EntityOwner(anIObj);
EntOwr->State(1);
}
const Handle(AIS2D_Selection)& aSel = AIS2D_Selection::Selection(mySelName.ToCString() );
if ( !aSel.IsNull() )
aSel->Select(EntOwr);
HighlightPicked(UpdateVwr);
*/
}
Standard_Integer AIS2D_LocalContext::DetectedIndex() {
return myLastIndex;
}
const Handle(AIS2D_LocalStatus)& AIS2D_LocalContext::Status(const Handle(AIS2D_InteractiveObject)& anObject) const {
return myActiveObjects(anObject);
}

View File

@ -1,162 +0,0 @@
-- Created by: Tanya COOL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
private class LocalStatus from AIS2D inherits TShared from MMgt
---Purpose: Stored Info about temporary objects.
uses
ListOfInteger from TColStd,
NameOfColor from Quantity,
PToListOfInt from AIS2D,
TypeOfDetection from AIS2D
is
Create( isTemporary : Boolean from Standard = Standard_True;
Decompose : Boolean from Standard = Standard_False;
DMode : Integer from Standard = -1;
SMode : Integer from Standard = -1;
HMode : TypeOfDetection from AIS2D = AIS2D_TOD_PRIMITIVE;
SubIntensity : Boolean from Standard = 0;
HighlCol : NameOfColor from Quantity = Quantity_NOC_WHITE )
returns mutable LocalStatus from AIS2D;
---Purpose: Initializes the default Local Status
Decomposed( me ) returns Boolean from Standard;
---C++: inline
---Level: Internal
---Purpose:
IsTemporary( me ) returns Boolean from Standard;
---C++: inline
---Level: Internal
---Purpose:
DisplayMode( me ) returns Integer from Standard;
---C++: inline
---Level: Internal
---Purpose:
SelectionModes( me: mutable ) returns PToListOfInt from AIS2D;
---C++: inline
---Level: Internal
---Purpose:
IsActivated( me; aSelMode: Integer from Standard ) returns Boolean from Standard;
---Level: Internal
---Purpose:
HighlightMode( me ) returns TypeOfDetection from AIS2D;
---C++: inline
---Level: Internal
---Purpose:
IsSubIntensityOn( me ) returns Boolean from Standard;
---C++: inline
---Level: Internal
---Purpose:
HighlightColor( me ) returns NameOfColor from Quantity;
---C++: inline
---Level: Internal
---Purpose:
IsFirstDisplay( me ) returns Boolean from Standard;
---C++: inline
---Level: Internal
---Purpose:
SetDecomposition( me:mutable; aStatus: Boolean from Standard);
---C++: inline
---Level: Internal
---Purpose:
SetTemporary( me:mutable; aStatus: Boolean from Standard);
---C++: inline
---Level: Internal
---Purpose:
SetDisplayMode( me:mutable; aMode: Integer from Standard);
---C++: inline
---Level: Internal
---Purpose:
SetFirstDisplay( me:mutable; aStatus: Boolean from Standard) ;
---C++: inline
---Level: Internal
---Purpose:
AddSelectionMode( me:mutable; aMode: Integer from Standard );
---Level: Internal
---Purpose:
RemoveSelectionMode( me:mutable; aMode: Integer from Standard );
---Level: Internal
---Purpose:
ClearSelectionModes( me:mutable );
---Level: Internal
---Purpose:
IsSelModeIn( me; aMode: Integer from Standard ) returns Boolean from Standard;
---Level: Internal
---Purpose:
SetHighlightMode( me: mutable; aMode: TypeOfDetection from AIS2D );
---C++: inline
---Level: Internal
---Purpose:
SetHighlightColor( me: mutable; aHiCol: NameOfColor from Quantity );
---C++: inline
---Level: Internal
---Purpose:
SubIntensityOn( me:mutable );
---C++: inline
---Level: Internal
---Purpose:
SubIntensityOff( me:mutable );
---Level: Internal
---Purpose:
SetPreviousState( me:mutable; aStatus: Transient from Standard );
---Level: Internal
---Purpose:
PreviousState( me ) returns any Transient from Standard;
---C++: inline
---Level: Internal
---Purpose:
fields
myDecomposition : Boolean from Standard;
myIsTemporary : Boolean from Standard;
myDMode : Integer from Standard;
myFirstDisplay : Boolean from Standard;
myHMode : TypeOfDetection from AIS2D;
mySModes : ListOfInteger from TColStd;
mySubIntensity : Boolean from Standard;
myHighlCol : NameOfColor from Quantity;
myPrevState : Transient from Standard;
end LocalStatus;

View File

@ -1,91 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <AIS2D_LocalStatus.ixx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
AIS2D_LocalStatus::AIS2D_LocalStatus( const Standard_Boolean isTemporary,
const Standard_Boolean Decompose,
const Standard_Integer DMode,
const Standard_Integer SMode,
const AIS2D_TypeOfDetection HMode,
const Standard_Boolean SubIntensity,
const Quantity_NameOfColor HighlCol ):
myDecomposition( Decompose ),
myIsTemporary( isTemporary ),
myDMode( DMode ),
myFirstDisplay( Standard_False),
myHMode( HMode ),
mySModes(),
mySubIntensity( SubIntensity ),
myHighlCol( HighlCol )
{
if ( SMode != -1 ) mySModes.Append( SMode );
}
Standard_Boolean AIS2D_LocalStatus::IsActivated(const Standard_Integer aSelMode) const {
TColStd_ListIteratorOfListOfInteger It( mySModes );
for ( ; It.More(); It.Next() )
if ( It.Value() == aSelMode )
return Standard_True;
return Standard_False;
}
Standard_Boolean AIS2D_LocalStatus::IsSelModeIn(const Standard_Integer aMode) const {
TColStd_ListIteratorOfListOfInteger It( mySModes );
for ( ; It.More(); It.Next() )
if( It.Value() == aMode )
return Standard_True;
return Standard_False;
}
void AIS2D_LocalStatus::AddSelectionMode(const Standard_Integer aMode) {
if( IsSelModeIn( aMode ) ) return;
if( aMode != -1 )
mySModes.Append( aMode );
else
mySModes.Clear();
}
void AIS2D_LocalStatus::RemoveSelectionMode(const Standard_Integer aMode) {
TColStd_ListIteratorOfListOfInteger It(mySModes);
for ( ; It.More(); It.Next() )
if ( It.Value() == aMode ) {
mySModes.Remove( It );
return;
}
}
void AIS2D_LocalStatus::ClearSelectionModes() {
mySModes.Clear();
}
void AIS2D_LocalStatus::SubIntensityOff() {
mySubIntensity = Standard_False;
}
void AIS2D_LocalStatus::SetPreviousState(const Handle(Standard_Transient)& aStatus) {
myPrevState = aStatus;
}

View File

@ -1,82 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
inline Handle(Standard_Transient) AIS2D_LocalStatus::PreviousState() const {
return myPrevState;
}
inline Standard_Boolean AIS2D_LocalStatus::Decomposed() const {
return myDecomposition;
}
inline Standard_Boolean AIS2D_LocalStatus::IsTemporary() const {
return myIsTemporary;
}
inline Standard_Integer AIS2D_LocalStatus::DisplayMode() const {
return myDMode;
}
inline AIS2D_PToListOfInt AIS2D_LocalStatus::SelectionModes() {
return &mySModes;
}
inline AIS2D_TypeOfDetection AIS2D_LocalStatus::HighlightMode() const {
return myHMode;
}
inline Standard_Boolean AIS2D_LocalStatus::IsSubIntensityOn() const {
return mySubIntensity;
}
inline Standard_Boolean AIS2D_LocalStatus::IsFirstDisplay() const {
return myFirstDisplay;
}
inline Quantity_NameOfColor AIS2D_LocalStatus::HighlightColor() const {
return myHighlCol;
}
inline void AIS2D_LocalStatus::SubIntensityOn() {
mySubIntensity = Standard_True;
}
inline void AIS2D_LocalStatus::SetDecomposition(const Standard_Boolean aStatus) {
myDecomposition = aStatus;
}
inline void AIS2D_LocalStatus::SetTemporary(const Standard_Boolean aStatus) {
myIsTemporary = aStatus;
}
inline void AIS2D_LocalStatus::SetDisplayMode(const Standard_Integer aMode) {
myDMode = aMode;
}
inline void AIS2D_LocalStatus::SetFirstDisplay(const Standard_Boolean aStatus) {
myFirstDisplay = aStatus;
}
inline void AIS2D_LocalStatus::SetHighlightMode(const AIS2D_TypeOfDetection aMode) {
myHMode = aMode;
}
inline void AIS2D_LocalStatus::SetHighlightColor(const Quantity_NameOfColor aHiCol) {
myHighlCol = aHiCol;
}

View File

@ -1,37 +0,0 @@
-- Created by: TCL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
private class PrimitiveArchit from AIS2D inherits TShared from MMgt
uses
Primitive from Graphic2d
is
Create( aPrim: Primitive from Graphic2d; ind: Integer from Standard )
returns mutable PrimitiveArchit from AIS2D;
GetPrimitive( me ) returns Primitive from Graphic2d;
GetIndex( me ) returns Integer from Standard;
fields
myPrimitive : Primitive from Graphic2d;
myInd : Integer from Standard;
end PrimitiveArchit;

View File

@ -1,33 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <AIS2D_PrimitiveArchit.ixx>
AIS2D_PrimitiveArchit::AIS2D_PrimitiveArchit( const Handle(Graphic2d_Primitive)& aPrim,
const Standard_Integer ind ) :
myPrimitive( aPrim ),
myInd( ind )
{
}
Handle(Graphic2d_Primitive) AIS2D_PrimitiveArchit::GetPrimitive() const {
return myPrimitive;
}
Standard_Integer AIS2D_PrimitiveArchit::GetIndex() const {
return myInd;
}

View File

@ -1,132 +0,0 @@
-- Created by: Tanya COOL
-- Copyright (c) 2000-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
class ProjShape from AIS2D inherits InteractiveObject from AIS2D
---Purpose: Constructs presentable and selectable projection of
-- TopoDS_Shape on the view plane
uses
Shape from TopoDS,
Line from Graphic2d,
ListOfShape from TopTools,
Projector from HLRAlgo,
Algo from HLRBRep,
PolyAlgo from HLRBRep,
SetOfSegments from Graphic2d,
SetOfCurves from GGraphic2d
is
Create returns mutable ProjShape from AIS2D;
---Purpose: Initializes the projected shape
Create( aProjector: Projector from HLRAlgo;
nbIsos: Integer from Standard = 3;
isPolyAlgo: Boolean from Standard = Standard_False;
visHL: Boolean from Standard = Standard_True )
returns mutable ProjShape from AIS2D;
---Purpose: Initializes the projected shape with projector <aProjector>, number isolines <nbIsos>
Add( me: mutable; aShape: Shape from TopoDS );
---Level: Public
---Purpose: Adds <aShape> to the list of projected shapes.
SetProjector( me: mutable; aProjector: Projector from HLRAlgo );
---Level: Public
---Purpose: sets the projector <aProjector>
Projector( me ) returns Projector from HLRAlgo;
---Level: Public
---Purpose: Indicates the projector
SetNbIsos( me: mutable; aNbIsos: Integer from Standard );
---Level: Internal
---Purpose:
SetPolyAlgo( me: mutable; aIsPoly: Boolean from Standard = Standard_False );
---Level: Internal
---Purpose: sets the projection of the shape as a polyhedral
-- simplification of the shape if <aIsPoly> is True
SetHLMode( me: mutable; aIsHLM: Boolean from Standard = Standard_True );
---Level: Internal
---Purpose: Sets the hidden line mode if <aIsHLM> is True
IsHLMode( me ) returns Boolean from Standard;
---Level: Public
---Purpose: Indicates the hidden lines are visible
GetNbIsos( me ) returns Integer from Standard;
---Level: Public
---Purpose: Indicates the number of isolines
GetIsPoly( me ) returns Boolean from Standard;
---Level: Public
---Purpose: Indicates the shape was extracted as Algo or PolyAlgo
GetPrimitives( me ) returns Line from Graphic2d;
---Level: Internal
---Purpose: Returns the set of primitives are included into Shape,
-- except hidden lines
GetHLPrimitives( me ) returns Line from Graphic2d;
---Level: Internal
---Purpose: Returns the set of hidden line primitives are included into Shape
ShowEdges( me: mutable;
aSharp, aSmooth, aSewn, anOutline, anIsoline: Boolean from Standard = Standard_True );
---Level: Public
---Purpose: Sets the flags for display of all types of edges
----------------------------------------------------------------------------
---Category: Private methods
CreateAlgo( me: mutable ) is private;
CreatePolyAlgo( me: mutable ) is private;
DrawSegments( me: mutable; aShape: Shape from TopoDS;
aSofS: in out SetOfSegments from Graphic2d ) is private;
DrawCurves( me: mutable; aShape: Shape from TopoDS;
aSofC: in out SetOfCurves from GGraphic2d ) is private;
ComputeShape( me: mutable ) is private;
fields
myListOfShape : ListOfShape from TopTools;
myProjector : Projector from HLRAlgo;
myAlgo : Algo from HLRBRep;
myPolyAlgo : PolyAlgo from HLRBRep;
myNbIsos : Integer from Standard;
myIsPolyAlgo : Boolean from Standard;
myIsHiddenLine : Boolean from Standard;
myESharp : Boolean from Standard;
myESmooth : Boolean from Standard;
myESewn : Boolean from Standard;
myEOutline : Boolean from Standard;
myEIsoline : Boolean from Standard;
mySetOfSegments : SetOfSegments from Graphic2d;
myHSetOfSegments : SetOfSegments from Graphic2d;
mySetOfCurves : SetOfCurves from GGraphic2d;
myHSetOfCurves : SetOfCurves from GGraphic2d;
end ProjShape;

View File

@ -1,341 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <AIS2D_ProjShape.ixx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Surface.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_ListOfShape.hxx>
#include <HLRBRep_PolyAlgo.hxx>
#include <HLRAlgo_Projector.hxx>
#include <HLRBRep_PolyHLRToShape.hxx>
#include <HLRBRep_HLRToShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopLoc_Location.hxx>
#include <Standard_Assert.hxx>
#include <V2d_Viewer.hxx>
#include <AIS2D_InteractiveContext.hxx>
AIS2D_ProjShape::AIS2D_ProjShape( )
:
AIS2D_InteractiveObject(),
myProjector( HLRAlgo_Projector() ),
myNbIsos( 3 ),
myIsPolyAlgo( Standard_False ),
myIsHiddenLine( Standard_True ),
myESharp( Standard_True ),
myESmooth( Standard_True ),
myESewn( Standard_True ),
myEOutline( Standard_True ),
myEIsoline( Standard_True )
{
}
AIS2D_ProjShape::AIS2D_ProjShape( const HLRAlgo_Projector& aProjector,
const Standard_Integer nbIsos,
const Standard_Boolean isPolyAlgo,
const Standard_Boolean visHL )
:
AIS2D_InteractiveObject(),
myProjector( aProjector ),
myNbIsos( nbIsos ),
myIsPolyAlgo( isPolyAlgo ),
myIsHiddenLine( visHL ),
myESharp( Standard_True ),
myESmooth( Standard_True ),
myESewn( Standard_True ),
myEOutline( Standard_True ),
myEIsoline( Standard_True )
{
}
void AIS2D_ProjShape::Add( const TopoDS_Shape& aShape ) {
myListOfShape.Append( aShape );
myAlgo.Nullify();
myPolyAlgo.Nullify();
ComputeShape();
}
void AIS2D_ProjShape::ComputeShape() {
TopoDS_Shape VCompound, Rg1LineVCompound, RgNLineVCompound,
OutLineVCompound, IsoLineVCompound,
HCompound, Rg1LineHCompound, RgNLineHCompound,
OutLineHCompound, IsoLineHCompound;
if ( myIsPolyAlgo ) {
if ( myPolyAlgo.IsNull() ) CreatePolyAlgo();
HLRBRep_PolyHLRToShape aPolyHLRToShape;
aPolyHLRToShape.Update( myPolyAlgo );
mySetOfSegments = new Graphic2d_SetOfSegments( this );
myHSetOfSegments = new Graphic2d_SetOfSegments( this );
if ( myESharp ) {
VCompound = aPolyHLRToShape.VCompound();
DrawSegments( Rg1LineVCompound, mySetOfSegments );
}
if ( myESmooth ) {
Rg1LineVCompound = aPolyHLRToShape.Rg1LineVCompound();
DrawSegments( RgNLineVCompound, mySetOfSegments );
}
if ( myESewn ) {
RgNLineVCompound = aPolyHLRToShape.RgNLineVCompound();
DrawSegments( OutLineVCompound, mySetOfSegments );
}
if ( myEOutline ) {
OutLineVCompound = aPolyHLRToShape.OutLineVCompound();
DrawSegments( VCompound, mySetOfSegments );
}
if ( myIsHiddenLine ) {
if ( myESharp ) {
HCompound = aPolyHLRToShape.HCompound();
DrawSegments( Rg1LineHCompound, myHSetOfSegments );
}
if ( myESmooth ) {
Rg1LineHCompound = aPolyHLRToShape.Rg1LineHCompound();
DrawSegments( RgNLineHCompound, myHSetOfSegments );
}
if ( myESewn ) {
RgNLineHCompound = aPolyHLRToShape.RgNLineHCompound();
DrawSegments( OutLineHCompound, myHSetOfSegments );
}
if ( myEOutline ) {
OutLineHCompound = aPolyHLRToShape.OutLineHCompound();
DrawSegments( HCompound, myHSetOfSegments );
}
} // end if is HiddenLine
} else {
if ( myAlgo.IsNull() ) CreateAlgo();
HLRBRep_HLRToShape aHLRToShape( myAlgo );
mySetOfCurves = new GGraphic2d_SetOfCurves( this );
myHSetOfCurves = new GGraphic2d_SetOfCurves( this );
if ( myESharp ) {
VCompound = aHLRToShape.VCompound();
DrawCurves( VCompound, mySetOfCurves );
}
if ( myESmooth ) {
Rg1LineVCompound = aHLRToShape.Rg1LineVCompound();
DrawCurves( Rg1LineVCompound, mySetOfCurves );
}
if ( myESewn ) {
RgNLineVCompound = aHLRToShape.RgNLineVCompound();
DrawCurves( RgNLineVCompound, mySetOfCurves );
}
if ( myEOutline ) {
OutLineVCompound = aHLRToShape.OutLineVCompound();
DrawCurves( OutLineVCompound, mySetOfCurves );
}
if ( myEIsoline ) {
IsoLineVCompound = aHLRToShape.IsoLineVCompound();
DrawCurves( IsoLineVCompound, mySetOfCurves );
}
if ( myIsHiddenLine ) {
if ( myESharp ) {
HCompound = aHLRToShape.HCompound();
DrawCurves( HCompound, myHSetOfCurves );
}
if ( myESmooth ) {
Rg1LineHCompound = aHLRToShape.Rg1LineHCompound();
DrawCurves( Rg1LineHCompound, myHSetOfCurves );
}
if ( myESewn ) {
RgNLineHCompound = aHLRToShape.RgNLineHCompound();
DrawCurves( RgNLineHCompound, myHSetOfCurves );
}
if ( myEOutline ) {
OutLineHCompound = aHLRToShape.OutLineHCompound();
DrawCurves( OutLineHCompound, myHSetOfCurves );
}
if ( myEIsoline ) {
IsoLineHCompound = aHLRToShape.IsoLineHCompound();
DrawCurves( IsoLineHCompound, myHSetOfCurves );
}
} //end if is HiddenLine
} // end if is PolyAlgo
}
inline HLRAlgo_Projector AIS2D_ProjShape::Projector() const {
return myProjector;
}
void AIS2D_ProjShape::SetProjector(const HLRAlgo_Projector& aProjector) {
myProjector = aProjector;
myAlgo.Nullify();
myPolyAlgo.Nullify();
if ( Length() ) {
RemovePrimitives();
ComputeShape();
}
}
void AIS2D_ProjShape::SetNbIsos( const Standard_Integer aNbIsos ) {
myNbIsos = aNbIsos;
myAlgo.Nullify();
if ( Length() ) {
RemovePrimitives();
ComputeShape();
}
}
void AIS2D_ProjShape::SetPolyAlgo( const Standard_Boolean aIsPoly ) {
myIsPolyAlgo = aIsPoly;
if ( Length() ) {
RemovePrimitives();
ComputeShape();
}
}
void AIS2D_ProjShape::SetHLMode( const Standard_Boolean aIsHLM ) {
myIsHiddenLine = aIsHLM;
if ( Length() ) {
RemovePrimitives();
ComputeShape();
}
}
Standard_Boolean AIS2D_ProjShape::IsHLMode() const {
return myIsHiddenLine;
}
Standard_Integer AIS2D_ProjShape::GetNbIsos() const {
return myNbIsos;
}
Standard_Boolean AIS2D_ProjShape::GetIsPoly() const {
return myIsPolyAlgo;
}
Handle(Graphic2d_Line) AIS2D_ProjShape::GetPrimitives() const {
if ( myIsPolyAlgo )
return mySetOfSegments;
else
return mySetOfCurves;
}
Handle(Graphic2d_Line) AIS2D_ProjShape::GetHLPrimitives() const {
if ( myIsPolyAlgo )
return myHSetOfSegments;
else
return myHSetOfCurves;
}
void AIS2D_ProjShape::CreateAlgo() {
myAlgo = new HLRBRep_Algo();
TopTools_ListIteratorOfListOfShape anIterator( myListOfShape );
for ( ; anIterator.More(); anIterator.Next() )
myAlgo->Add( anIterator.Value(), myNbIsos );
myAlgo->Projector( myProjector );
myAlgo->Update();
myAlgo->Hide();
}
void AIS2D_ProjShape::CreatePolyAlgo() {
myPolyAlgo = new HLRBRep_PolyAlgo();
TopTools_ListIteratorOfListOfShape anIterator(myListOfShape);
for ( ; anIterator.More(); anIterator.Next() )
myPolyAlgo->Load( anIterator.Value() );
myPolyAlgo->Projector( myProjector );
myPolyAlgo->Update();
}
void AIS2D_ProjShape::DrawSegments( const TopoDS_Shape& aShape,
Handle(Graphic2d_SetOfSegments)& aSofS ) {
if ( aShape.IsNull() ) return;
TopExp_Explorer theExp( aShape, TopAbs_EDGE );
while ( theExp.More() ) {
const TopoDS_Edge& CurrentEdge = TopoDS::Edge( theExp.Current() );
const TopoDS_Vertex& FirstVertex = TopExp::FirstVertex(CurrentEdge);
const TopoDS_Vertex& LastVertex = TopExp::LastVertex(CurrentEdge);
gp_Pnt FirstPoint = BRep_Tool::Pnt(FirstVertex);
gp_Pnt LastPoint = BRep_Tool::Pnt(LastVertex);
aSofS->Add( FirstPoint.X(), FirstPoint.Y(), LastPoint.X(), LastPoint.Y() );
theExp.Next();
}
}
void AIS2D_ProjShape::DrawCurves( const TopoDS_Shape& aShape,
Handle(GGraphic2d_SetOfCurves)& aSofC) {
if ( aShape.IsNull() ) return;
TopExp_Explorer theExp( aShape, TopAbs_EDGE );
Handle(Geom2d_Curve) aCurve;
Handle(Geom_Surface) aSurface;
TopLoc_Location theLoc;
Standard_Real f, l;
while ( theExp.More() ) {
const TopoDS_Edge& CurrentEdge = TopoDS::Edge( theExp.Current() );
BRep_Tool::CurveOnSurface( CurrentEdge, aCurve, aSurface, theLoc, f, l );
Standard_ASSERT (theLoc.IsIdentity(), "Unexpected edge with non-identity location", continue);
Standard_ASSERT (! aCurve.IsNull(), "Null PCurve", continue);
Handle(Geom2d_TrimmedCurve) theCurve = new Geom2d_TrimmedCurve(aCurve,f,l);
aSofC->Add(theCurve);
theExp.Next();
}
}
void AIS2D_ProjShape::ShowEdges( const Standard_Boolean aSharp,
const Standard_Boolean aSmooth,
const Standard_Boolean aSewn,
const Standard_Boolean anOutline,
const Standard_Boolean anIsoline ) {
myESharp = aSharp;
myESmooth = aSmooth;
myESewn = aSewn;
myEOutline = anOutline;
myEIsoline = anIsoline;
if ( Length() ) {
RemovePrimitives();
ComputeShape();
}
}

View File

@ -87,8 +87,7 @@ is
---Category: Methods to define the WidthIndexs
SetFontMap(me: mutable;
aFontMap: FontMap from Aspect;
useMFT: Boolean from Standard = Standard_True)
aFontMap: FontMap from Aspect)
raises DriverError from Aspect is static;
---Category: Methods to define the FontIndexs
---Purpose:
@ -414,8 +413,6 @@ is
-- the DWU position .
---Category: Inquire methods
UseMFT ( me ) returns Boolean from Standard is static;
---Level: Advanced
---Purpose: Returns TRUE when the driver must use MDTV fonts
-- instead system fonts.
@ -431,6 +428,5 @@ fields
myTypeMapIsDefined: Boolean from Standard;
myFontMapIsDefined: Boolean from Standard;
myMarkMapIsDefined: Boolean from Standard;
myUseMFT: Boolean from Standard;
end Driver from Aspect;

View File

@ -43,31 +43,9 @@
#include <Aspect_Driver.ixx>
#include <OSD_Environment.hxx>
static Standard_Boolean dirMFTisDefined = Standard_False;
Aspect_Driver::Aspect_Driver () {
OSD_Environment CSF_MDTVFontDirectory ;
char *fontdir , *casroot ;
fontdir = getenv("CSF_MDTVFontDirectory" );
if ( !fontdir) {
casroot = getenv("CASROOT");
if ( casroot ) {
TCollection_AsciiString CasRootString (casroot);
CasRootString += "/src/FontMFT" ;
CSF_MDTVFontDirectory = OSD_Environment(CasRootString.ToCString());
} else {
cout << " CASROOT or CSF_MDTVFontDirectory are mandatory to use this fonctionnality " << endl;
Standard_Failure::Raise ( "CSF_MDTVTexturesDirectory and CASROOT not setted " );
}
} else {
CSF_MDTVFontDirectory = OSD_Environment("CSF_MDTVFontDirectory");
}
TCollection_AsciiString dir(CSF_MDTVFontDirectory.Value());
dirMFTisDefined = (dir.Length() > 0);
myUseMFT = Standard_True;
myColorMapIsDefined = Standard_False;
myWidthMapIsDefined = Standard_False;
myTypeMapIsDefined = Standard_False;
@ -112,10 +90,8 @@ Handle(Aspect_WidthMap) Aspect_Driver::WidthMap () const {
return myWidthMap;
}
void Aspect_Driver::SetFontMap (const Handle(Aspect_FontMap)& aFontMap,
const Standard_Boolean useMFT)
void Aspect_Driver::SetFontMap (const Handle(Aspect_FontMap)& aFontMap)
{
myUseMFT = useMFT;
myFontMap = aFontMap;
this->InitializeFontMap(aFontMap);
myFontMapIsDefined = Standard_True;
@ -138,6 +114,3 @@ Handle(Aspect_MarkMap) Aspect_Driver::MarkMap () const {
return myMarkMap;
}
Standard_Boolean Aspect_Driver::UseMFT () const {
return myUseMFT & dirMFTisDefined;
}

View File

@ -1,39 +0,0 @@
-- Created on: 1997-06-25
-- Created by: Laurent GARRIGA
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
package CGM
uses
Aspect,
PlotMgt,
TCollection,
Quantity,
TShort,
TColStd,
Standard,
TColQuantity
is
class Driver;
---Purpose: Creates the CGM driver.
---Category: Classes
end CGM;

View File

@ -1,198 +0,0 @@
-- Created on: 1996-09-13
-- Created by: DCB
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
class Driver from CGM inherits PlotterDriver from PlotMgt
---Purpose: This class defines a CGM (Computer Graphic Metafile) plotter Driver.
--- All necessary information about methods (purpose, level, category, etc.)
--- can be found in CDL files from the inheritance tree (PlotMgt_PlotterDriver,
--- Aspect_Driver).
uses
Plotter from PlotMgt,
ExtendedString from TCollection,
ColorMap from Aspect,
TypeMap from Aspect,
WidthMap from Aspect,
TypeOfText from Aspect,
TypeOfColorSpace from Aspect,
PlaneAngle from Quantity,
Length from Quantity,
Factor from Quantity,
Ratio from Quantity,
Array1OfShortReal from TShort
is
Create(aPlotter : Plotter from PlotMgt;
aName : CString from Standard;
aDX,aDY : Length from Quantity;
aTypeOfColorSpace : TypeOfColorSpace from Aspect = Aspect_TOCS_RGB)
returns mutable Driver from CGM;
Create(aName : CString from Standard;
aDX,aDY : Length from Quantity;
aTypeOfColorSpace : TypeOfColorSpace from Aspect = Aspect_TOCS_RGB)
returns mutable Driver from CGM;
BeginFile(me: mutable;
aPlotter : Plotter from PlotMgt;
aDX,aDY : Length from Quantity;
aTypeOfColorSpace : TypeOfColorSpace from Aspect)
is private;
Close(me: mutable)
is redefined protected;
---C++: alias ~
BeginDraw (me: mutable)
is redefined;
EndDraw (me: mutable; dontFlush: Boolean = Standard_False)
is redefined;
---------------------------------------------
-- Category: Methods to define the attributes
---------------------------------------------
InitializeColorMap(me: mutable; aColorMap: ColorMap from Aspect)
is redefined protected;
InitializeTypeMap(me: mutable; aTypeMap: TypeMap from Aspect)
is redefined protected;
InitializeWidthMap(me: mutable; aWidthMap: WidthMap from Aspect)
is virtual protected;
-----------------------------------------
-- Category: Methods to manage the images
-----------------------------------------
SizeOfImageFile (me; anImageFile: CString from Standard;
aWidth,aHeight: out Integer from Standard)
returns Boolean from Standard is redefined;
--------------------------------
-- Actual set graphic attributes
--------------------------------
PlotLineAttrib (me: mutable;
ColorIndex: Integer from Standard;
TypeIndex: Integer from Standard;
WidthIndex: Integer from Standard)
is redefined protected;
PlotPolyAttrib (me: mutable;
ColorIndex: Integer from Standard;
TileIndex: Integer from Standard;
DrawEdge: Boolean from Standard)
is redefined protected;
-----------------------------------------------
-- Category: Private methods to draw primitives
-----------------------------------------------
PlotPoint (me : mutable; X, Y: ShortReal from Standard)
returns Boolean from Standard
is redefined protected;
PlotSegment (me : mutable;
X1, Y1: ShortReal from Standard;
X2, Y2: ShortReal from Standard)
returns Boolean from Standard
is redefined protected;
PlotPolyline (me : mutable;
xArray : Address from Standard;
yArray : Address from Standard;
nPts : Address from Standard;
nParts : Integer from Standard)
returns Boolean from Standard
is redefined protected;
PlotPolygon (me : mutable;
xArray : Address from Standard;
yArray : Address from Standard;
nPts : Address from Standard;
nParts : Integer from Standard)
returns Boolean from Standard
is redefined protected;
PlotArc (me : mutable; X,Y : ShortReal from Standard;
anXradius,anYradius : ShortReal from Standard;
sAngle: ShortReal from Standard;
oAngle: ShortReal from Standard)
returns Boolean from Standard
is redefined protected;
PlotPolyArc (me : mutable; X,Y : ShortReal from Standard;
anXradius,anYradius : ShortReal from Standard;
sAngle: ShortReal from Standard;
oAngle: ShortReal from Standard)
returns Boolean from Standard
is redefined protected;
PlotImage (me: mutable;
aX, aY, aWidth: ShortReal from Standard;
aHeight, aScale: ShortReal from Standard;
anImageFile: CString from Standard;
anArrayOfPixels: Address from Standard;
aLineIndex: Integer from Standard = -1)
returns Boolean from Standard
is redefined protected;
InitializeDriver (me: mutable; aName: CString from Standard)
is private;
WriteData (me: mutable;
aCode: Integer from Standard;
pLongData: Address from Standard;
pFloatData: Address from Standard;
pCharData: Address from Standard)
is private;
fields
myBKIndex: Integer from Standard;
myCurrentPage: Integer from Standard;
myFileIsOpened: Boolean from Standard;
myFillIndex: Integer from Standard;
myEdgeColor: Integer from Standard;
myEdgeType: Integer from Standard;
myEdgeWidth: Integer from Standard;
myInteriorStyle: Integer from Standard;
myEdgeVisibility: Integer from Standard;
end Driver from CGM;

View File

@ -1,841 +0,0 @@
// Created on: 1996-09-13
// Created by: DCB
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#define xBUG // GG 140699
// Ascendante compatibillity using OLD driver constructor
// must generates directly a file.
#define IMP020701 //GG
// Don't creates an external reference named error please ...
// Thanks to SAMTECH
#include <CGM_Driver.ixx>
#include <MFT_FontManager.hxx>
#include <PlotMgt_TextManager.hxx>
#include <PlotMgt_HListOfMFTFonts.hxx>
#include <TShort_HArray1OfShortReal.hxx>
#include <Aspect_Units.hxx>
#include <Aspect_ColorMapEntry.hxx>
#include <Aspect_TypeMapEntry.hxx>
#include <Aspect_WidthMapEntry.hxx>
#include <Aspect_GenericColorMap.hxx>
#include <Aspect_RGBPixel.hxx>
#include <Aspect_DriverError.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <OSD_Environment.hxx>
#include <cgmlib.hxx>
#include <AlienImage.hxx>
#include <Image_Image.hxx>
static Handle(Image_Image) myImage;
/////////////////////////////////////////////////////////////////////////*/
#define TRACE 0
#define PPI (float)(72.F/(0.0254005F METER))
#define MAXPARAM 1024
#define TRANSFORMCOLOR(c) \
{ if (TypeOfCgm == CgmCharEncoding) c = (((c+1) << 2) - 1); }
#define DRAD (M_PI/180.)
#define DEFPLOTTER "DIRECT_CGM"
//-----------------------------------------------------------------
// Standard CGM settings.
//-----------------------------------------------------------------
#define CGMVER 1
#define INTBITS 32
#define MAXREAL 32767.0000F // Clear text
#define MINREAL -32768.0000F
#define REALBITS 15 // Character encoding
#define REALPLACES -5
#define REALDEFEXP 0
#define REALEXP 0
#define REALFORM 0 // Binary encoding
#define REALWHOLE 15
#define REALFRACTION 20
#define INDEXBITS 8
#define CLRBITS 16
#define CLRINDBITS 8
#define SCALEMOD ABSTRACT
#define SCALFACT 1
#define IMCOLRPREC 65536
#define BACKRED 255
#define BACKGREEN 255
#define BACKBLUE 255
//-----------------------------------------------------------------
// CGM states.
//-----------------------------------------------------------------
typedef enum {
CgmBinary,
CgmCharEncoding,
CgmClearText
} CgmType;
typedef enum {
mfDesc,
picDesc,
picBody,
imgDraw
} CGMstate;
static CGMstate myState;
static TColStd_DataMapOfIntegerInteger aTypeIndex;
static CgmType TypeOfCgm;
//Definition of the C handle who handles the CGM metafile
FILE* cgmo;
//Those C arrays are the parameters used by the CGM library.
long ptablong[MAXPARAM];
float ptabreal[MAXPARAM];
char ptabchar[MAXPARAM];
//Declare the array in wich WIDTHS will be put (an internal widthmap).
float* WIDTHMAP = NULL;
// Error string
#ifndef IMP020701
char error[1024];
#endif
//=============================================================
CGM_Driver::CGM_Driver (const Handle(PlotMgt_Plotter)& aPlotter,
const Standard_CString aName,
const Quantity_Length aDX,
const Quantity_Length aDY,
const Aspect_TypeOfColorSpace aTypeOfColorSpace)
: PlotMgt_PlotterDriver (aPlotter, aName)
{
BeginFile (aPlotter, aDX, aDY, aTypeOfColorSpace);
}
//=============================================================
CGM_Driver::CGM_Driver (const Standard_CString aName,
const Quantity_Length aDX,
const Quantity_Length aDY,
const Aspect_TypeOfColorSpace aTypeOfColorSpace)
: PlotMgt_PlotterDriver (aName)
{
Handle(PlotMgt_Plotter) thePlotter =
#ifdef BUG
new PlotMgt_Plotter(TCollection_AsciiString(DEFPLOTTER));
#else
new PlotMgt_Plotter(TCollection_AsciiString(DEFPLOTTER),Standard_True);
#endif
BeginFile (thePlotter, aDX, aDY, aTypeOfColorSpace);
}
//=============================================================
void CGM_Driver::BeginFile (const Handle(PlotMgt_Plotter)& aPlotter,
const Quantity_Length aDX,
const Quantity_Length aDY,
const Aspect_TypeOfColorSpace aTypeOfColorSpace)
{
SetPlotter (aPlotter);
// Initialization of buffers
memset (ptablong, 0, sizeof(ptablong));
memset (ptabreal, 0, sizeof(ptabreal));
memset (ptabchar, 0, sizeof(ptabchar));
myWidth = Standard_ShortReal(aDX - 2*myPaperMargin);
myHeight = Standard_ShortReal(aDY - 2*myPaperMargin);
myTypeOfColorSpace = aTypeOfColorSpace;
// Set the type of CGM file by reading the environment variable "CSF_CGM_Type".
OSD_Environment cgmType = OSD_Environment ( "CSF_CGM_Type" );
if (cgmType.Value().IsEmpty()) TypeOfCgm = CgmClearText;
else {
if (cgmType.Value().IsEqual("BIN")) {
TypeOfCgm = CgmBinary;
} else if (cgmType.Value().IsEqual("CAR")) {
TypeOfCgm = CgmCharEncoding;
} else if (cgmType.Value().IsEqual("TEX")) {
TypeOfCgm = CgmClearText;
} else TypeOfCgm = CgmClearText;
}
// Open the CGM metafile
cgmo = OPEN_FILE ((Standard_PCharacter)myFileName.ToCString(), TypeOfCgm + 1);
if (!cgmo) {
#ifdef IMP020701
char error[1024];
#endif
sprintf (error, "****** CGM_Driver ERROR, unable to open file '%s'\n",
myFileName.ToCString());
Aspect_DriverError::Raise(error);
}
// Write the metafile descriptor
myFileIsOpened = Standard_True;
myState = mfDesc;
InitializeDriver (myFileName.ToCString());
}
//=============================================================
void CGM_Driver::Close()
{
if (myFileIsOpened) {
// Declare the end of the CGM metafile
WriteData (ENDMF, ptablong, ptabreal, ptabchar);
// Free memory allocated for WIDTHS
if (WIDTHMAP)
delete[] WIDTHMAP;
// Close the CGM metafile
CLOSE_FILE ();
myFileIsOpened = Standard_False;
}
aTypeIndex.Clear ();
}
//=============================================================
void CGM_Driver::BeginDraw ()
{
// Create TextManager
myTextManager = new PlotMgt_TextManager(this);
//============================================
if (myCurrentPage <= 0) myCurrentPage = 1;
else myCurrentPage++;
// Write the picture descriptor in the CGM metafile
myState = picDesc;
// Declare the new image
ptablong[0] = myCurrentPage;
WriteData (BEGPIC, ptablong, ptabreal, ptabchar);
// Set the color selection mode (always index)
old.color_mode = DIRECT;
cur.color_mode = INDEXED;
WriteData (COLRMODE, ptablong, ptabreal, ptabchar);
// Set the scale mode
cur.scale_mode = SCALEMOD;
cur.scale_factor = (float)SCALFACT;
WriteData (SCALEMODE, ptablong, ptabreal, ptabchar);
// Set the method to compute line width
old.linewidth_mode = SCALED;
cur.linewidth_mode = ABS;
WriteData (LINEWIDTHMODE, ptablong, ptabreal, ptabchar);
//Set the method to compute edge width
old.edgewidth_mode = SCALED;
cur.edgewidth_mode = ABS;
WriteData (EDGEWIDTHMODE, ptablong, ptabreal, ptabchar);
// Declare the window in which the picture will be drawn
cur.vdc_extent.a.x.real = (float)0;
cur.vdc_extent.a.y.real = (float)0;
cur.vdc_extent.b.x.real = myWidth;
cur.vdc_extent.b.y.real = myHeight;
WriteData (VDCEXT, ptablong, ptabreal, ptabchar);
// set the background color
cur.back.red = BACKRED; TRANSFORMCOLOR (cur.back.red);
cur.back.green = BACKGREEN; TRANSFORMCOLOR (cur.back.green);
cur.back.blue = BACKBLUE; TRANSFORMCOLOR (cur.back.blue);
WriteData (BACKCOLR, ptablong, ptabreal, ptabchar);
// Declare the body of the picture
WriteData (BEGPICBODY, ptablong, ptabreal, ptabchar);
myState = picBody;
// Write color map in the picture body
InitializeColorMap(ColorMap ());
// Set clipping rectangle
cur.clip_rect.a.x.real = (float)0;
cur.clip_rect.a.y.real = (float)0;
cur.clip_rect.b.x.real = myWidth;
cur.clip_rect.b.y.real = myHeight;
WriteData (CLIPRECT, ptablong, ptabreal, ptabchar);
// Set clip indicator to ON
cur.clip_ind = ON;
WriteData (CLIP, ptablong, ptabreal, ptabchar);
// Reset default values for line & fill color and type of line
oldatt.line.index = -1;
oldatt.fill.index = -1;
oldatt.edge.index = -1;
oldatt.line_type = -1;
oldatt.edge_type = -1;
}
//=============================================================
void CGM_Driver::EndDraw (const Standard_Boolean )//dontFlush)
{
// Close the current picture
WriteData (ENDPIC, ptablong, ptabreal, ptabchar);
myImage.Nullify ();
}
//=============================================================
void CGM_Driver::InitializeColorMap (const Handle(Aspect_ColorMap)& aColorMap)
{
// CGM version 1 allows the COLOR MAP setting only in the body of a picture.
if (myState == picBody || myState == imgDraw) {
Standard_Real r,g,b;
Standard_Integer index,cpt,tab=2,Size = aColorMap->Size();
Aspect_ColorMapEntry entry;
Quantity_Color color;
ptablong[0] = Size;
ptablong[1] = cpt = aColorMap->Entry(1).Index();
for (Standard_Integer i=1; i<= Size; i++) {
entry = aColorMap->Entry(i);
index = entry.Index();
color = entry.Color();
color.Values(r, g, b, Quantity_TOC_RGB);
if (myTypeOfColorSpace != Aspect_TOCS_BlackAndWhite) {
ptablong[tab ] = Standard_Integer(255*r); TRANSFORMCOLOR(ptablong[tab ]);
ptablong[tab+1] = Standard_Integer(255*g); TRANSFORMCOLOR(ptablong[tab+1]);
ptablong[tab+2] = Standard_Integer(255*b); TRANSFORMCOLOR(ptablong[tab+2]);
} else {
ptablong[tab ] = 0; TRANSFORMCOLOR(ptablong[tab ]);
ptablong[tab+1] = 0; TRANSFORMCOLOR(ptablong[tab+1]);
ptablong[tab+2] = 0; TRANSFORMCOLOR(ptablong[tab+2]);
}
tab += 3;
if (cpt != index)
break;
cpt++;
}
// Put backgrount color at the end of ColorMap
ptablong[0]++;
ptablong[tab ] = BACKRED; TRANSFORMCOLOR(ptablong[tab ]);
ptablong[tab+1] = BACKGREEN; TRANSFORMCOLOR(ptablong[tab+1]);
ptablong[tab+2] = BACKBLUE; TRANSFORMCOLOR(ptablong[tab+2]);
myBKIndex = cpt;
// Write ColorMap to the CGM file
WriteData (COLRTABLE, ptablong, ptabreal, ptabchar);
if (myTypeOfColorSpace == Aspect_TOCS_BlackAndWhite)
myTypeOfColorSpace = Aspect_TOCS_RGB;
}
}
//=============================================================
void CGM_Driver::InitializeTypeMap (const Handle(Aspect_TypeMap)& aTypeMap)
{
/*
In CGM File:
LINEEDGETYPEDEF - code
LONG [0] - linetype (negative)
LING [1] - repeat length
for (i=0; i < LONG[1]; i++)
REAL [i] - line description element
it's necessary to put all line description elements as integers
*/
/*
if (CGMstates == picdes) {
Standard_Integer Size = aTypeMap->Size();
switch (TypeOfCgm) {
case (CgmBinary):
Aspect_DriverError::Raise("CGM BINARY ENCODING not implemented yet");
break;
case (CgmCharEncoding):
Aspect_DriverError::Raise("CGM CHARACTER ENCODING not implemented yet");
break;
case (CgmClearText):
for (Standard_Integer i=1; i<= Size; i++) {
fprintf(cgmo, "LINEEDGETYPEDEF");
const TColQuantity_Array1OfLength& asr = aTypeMap->Entry(i).Type().Values();
fprintf (cgmo," (%ld), ", -aTypeMap->Entry(i).Index());
fprintf (cgmo,"%ld", asr.Upper()-asr.Lower()+1);
if ( (asr.Upper()-asr.Lower()+1) > 1 ) {
fprintf(cgmo,",");
}
for (Standard_Integer j = asr.Lower(); j < asr.Upper(); j += 2) {
fprintf(cgmo, "%.*f, %.*f", 5, asr(j+1), 5, asr(j));
if (j+2 < asr.Upper()) {
fprintf(cgmo,",");
}
}
fprintf(cgmo,";\n");
}
break;
}
} else {
CGMTypeMap = aTypeMap;
}
*/
Standard_Integer Size = aTypeMap->Size(), i;
aTypeIndex.Clear();
for (i = 1; i <= Size; i++) {
Standard_Integer index = aTypeMap->Entry(i).Index();
if (aTypeMap->Entry(i).Type().Style() == Aspect_TOL_USERDEFINED)
aTypeIndex.Bind (index, 1);
else
aTypeIndex.Bind (index, aTypeMap->Entry(i).Type().Style()+1);
}
}
//=============================================================
void CGM_Driver::InitializeWidthMap (const Handle(Aspect_WidthMap)& aWidthMap)
{
Standard_Integer Size = aWidthMap->Size();
if (WIDTHMAP)
delete[] WIDTHMAP;
WIDTHMAP = new float[Size];
memset (WIDTHMAP, 0, Size * sizeof(float));
for (Standard_Integer i=1; i<= Size; i++) {
Standard_Real w = aWidthMap->Entry(i).Width();
WIDTHMAP[aWidthMap->Entry(i).Index()] = (float)w;
}
}
//=================================================================================
Standard_Boolean CGM_Driver::SizeOfImageFile (const Standard_CString anImageFile,
Standard_Integer& aWidth,
Standard_Integer& aHeight) const
{
return AlienImage::LoadImageFile (anImageFile, myImage, aWidth, aHeight);
}
//=============================================================
// Category: Methods to write attributes
//=============================================================
void CGM_Driver::PlotLineAttrib (const Standard_Integer ColorIndex,
const Standard_Integer TypeIndex,
const Standard_Integer WidthIndex)
{
// Set color of the line
if (myColorIndex != ColorIndex) {
curatt.line.index = myColorIndex = ColorIndex;
WriteData (LINECOLR, ptablong, ptabreal, ptabchar);
}
// Set type of the line
if (myTypeIndex != TypeIndex) {
curatt.line_type = myTypeIndex = TypeIndex;
WriteData (LINETYPE, ptablong, ptabreal, ptabchar);
}
// Set width of the line
if (myWidthIndex != WidthIndex) {
curatt.line_width.real = WIDTHMAP[(myWidthIndex = WidthIndex)];
WriteData (LINEWIDTH, ptablong, ptabreal, ptabchar);
}
// Set the color of the edge of polygon
if (myEdgeColor != ColorIndex) {
curatt.edge.index = myEdgeColor = ColorIndex;
WriteData (EDGECOLR, ptablong, ptabreal, ptabchar);
}
// Set the type of the edge of polygon
if (myEdgeType != TypeIndex) {
curatt.edge_type = myEdgeType = TypeIndex;
WriteData (EDGETYPE, ptablong, ptabreal, ptabchar);
}
// Set the width of the edge of polygon
if (myEdgeWidth != WidthIndex) {
curatt.edge_width.real = WIDTHMAP[(myEdgeWidth = WidthIndex)];
WriteData (EDGEWIDTH, ptablong, ptabreal, ptabchar);
}
}
//===============================================================================
void CGM_Driver::PlotPolyAttrib (const Standard_Integer ColorIndex,
const Standard_Integer TileIndex,
const Standard_Boolean DrawEdge)
{
// Set the edge visibility to the corresponding value
if (myEdgeVisibility != (DrawEdge ? ON : OFF)) {
curatt.edge_vis = myEdgeVisibility = (DrawEdge ? ON : OFF);
WriteData (EDGEVIS, ptablong, ptabreal, ptabchar);
}
// Set the interior style to fill by solid
if (myInteriorStyle != (TileIndex < 0 ? EMPTY : SOLID)) {
curatt.int_style = myInteriorStyle = (TileIndex < 0 ? EMPTY : SOLID);
WriteData (INTSTYLE, ptablong, ptabreal, ptabchar);
}
// Set the fill color for drawing
if (myFillIndex != ColorIndex) {
if (ColorIndex > 0) curatt.fill.index = myFillIndex = ColorIndex;
else curatt.fill.index = myFillIndex = myBKIndex;
WriteData (FILLCOLR, ptablong, ptabreal, ptabchar);
}
}
//=============================================================
// Category: Methods to draw primitives
//=============================================================
//=============================================================
Standard_Boolean CGM_Driver::PlotPoint (const Standard_ShortReal X,
const Standard_ShortReal Y)
{
ptablong[0] = 2;
ptabreal[0] = X; ptabreal[1] = Y;
ptabreal[2] = X + 0.1F; ptabreal[3] = Y + 0.1F;
WriteData (LINE, ptablong, ptabreal, ptabchar);
return Standard_True;
}
//=============================================================
Standard_Boolean CGM_Driver::PlotSegment (const Standard_ShortReal X1,
const Standard_ShortReal Y1,
const Standard_ShortReal X2,
const Standard_ShortReal Y2)
{
ptablong[0] = 2;
ptabreal[0] = X1; ptabreal[1] = Y1;
ptabreal[2] = X2; ptabreal[3] = Y2;
WriteData (LINE, ptablong, ptabreal, ptabchar);
return Standard_True;
}
//=============================================================
#define _XP(idx) ((float*)xArray)[(idx)]
#define _YP(idx) ((float*)yArray)[(idx)]
//=============================================================
Standard_Boolean CGM_Driver::PlotPolyline (const Standard_Address xArray,
const Standard_Address yArray,
const Standard_Address nPts,
const Standard_Integer nParts)
{
// Multipart drawing can only be used for text drawing
// (called from PlotMgt_TextManager::EndChar()
int Tab, N = 0;
for (int i = 0; i < nParts; i++) {
Tab = 0;
ptablong[0] = ((int*)nPts)[i];
for (int j = N; j < N + ptablong[0]; j++) {
ptabreal[Tab++] = _XP(j); ptabreal[Tab++] = _YP(j);
}
WriteData (LINE, ptablong, ptabreal, ptabchar);
N += ptablong[0];
}
return Standard_True;
}
//=============================================================
Standard_Boolean CGM_Driver::PlotPolygon (const Standard_Address xArray,
const Standard_Address yArray,
const Standard_Address nPts,
const Standard_Integer nParts)
{
if (nParts == 1) {
int Tab = 0;
ptablong[0] = ((int*)nPts)[0];
for (int i=0; i < ptablong[0]; i++) {
ptabreal[Tab++] = _XP(i); ptabreal[Tab++] = _YP(i);
}
WriteData (POLYGON, ptablong, ptabreal, ptabchar);
} else {
// This can only be used for text drawing
// (called from PlotMgt_TextManager::EndChar()
int Tab = 0, Vis = 1, N = 0, cpN;
ptablong[0] = 0;
for (int i = 0; i < nParts; i++) {
cpN = ((int*)nPts)[i];
for (int j = N; j < N + cpN - 1; j++) {
ptabreal[Tab++] = _XP(j); ptabreal[Tab++] = _YP(j);
ptablong[Vis++] = VIS; ptablong[0]++;
}
N += cpN;
ptabreal[Tab++] = _XP(N-1); ptabreal[Tab++] = _YP(N-1);
ptablong[Vis++] = CLOSEVIS; ptablong[0]++;
}
WriteData (POLYGONSET, ptablong, ptabreal, ptabchar);
}
return Standard_True;
}
//=============================================================
#undef _XP
#undef _YP
//=============================================================
Standard_Boolean CGM_Driver::PlotArc (const Standard_ShortReal Xpos,
const Standard_ShortReal Ypos,
const Standard_ShortReal aXradius,
const Standard_ShortReal aYradius,
const Standard_ShortReal sAngle,
const Standard_ShortReal oAngle)
{
Standard_ShortReal san = sAngle;
Standard_ShortReal fan = sAngle + oAngle;
if (oAngle >= 2*M_PI) {
PlotPolyAttrib (myLineColorIndex, -1, Standard_True);
if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)aXradius;
WriteData (CIRCLE, ptablong, ptabreal, ptabchar);
} else {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)(Xpos + aXradius); ptabreal[3] = (float)Ypos;
ptabreal[4] = (float)Xpos; ptabreal[5] = (float)(Ypos + aYradius);
WriteData (ELLIPSE, ptablong, ptabreal, ptabchar);
}
} else {
if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)cos(san); ptabreal[3] = (float)sin(san);
ptabreal[4] = (float)cos(fan); ptabreal[5] = (float)sin(fan);
ptabreal[6] = (float)aXradius;
WriteData (ARCCTR, ptablong, ptabreal, ptabchar);
} else {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)(Xpos + aXradius); ptabreal[3] = (float)Ypos;
ptabreal[4] = (float)Xpos; ptabreal[5] = (float)(Ypos + aYradius);
ptabreal[6] = (float)cos(san); ptabreal[7] = (float)sin(san);
ptabreal[8] = (float)cos(fan); ptabreal[9] = (float)sin(fan);
WriteData (ELLIPARC, ptablong, ptabreal, ptabchar);
}
}
return Standard_True;
}
//=============================================================
Standard_Boolean CGM_Driver::PlotPolyArc (const Standard_ShortReal Xpos,
const Standard_ShortReal Ypos,
const Standard_ShortReal aXradius,
const Standard_ShortReal aYradius,
const Standard_ShortReal sAngle,
const Standard_ShortReal oAngle)
{
Standard_ShortReal san = sAngle;
Standard_ShortReal fan = sAngle + oAngle;
if (oAngle >= 2.*M_PI) {
if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)aXradius;
WriteData (CIRCLE, ptablong, ptabreal, ptabchar);
} else {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)(Xpos + aXradius); ptabreal[3] = (float)aYradius;
ptabreal[4] = (float)Xpos; ptabreal[5] = (float)(Ypos + aYradius);
WriteData (ELLIPSE, ptablong, ptabreal, ptabchar);
}
} else {
if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)cos(san); ptabreal[3] = (float)sin(san);
ptabreal[4] = (float)cos(fan); ptabreal[5] = (float)sin(fan);
ptabreal[6] = (float)aXradius; ptablong[8] = 0;
WriteData (ARCCTRCLOSE, ptablong, ptabreal, ptabchar);
} else {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)(Xpos + aXradius); ptabreal[3] = (float)Ypos;
ptabreal[4] = (float)Xpos; ptabreal[5] = (float)(Ypos + aYradius);
ptabreal[6] = (float)cos(san); ptabreal[7] = (float)sin(san);
ptabreal[8] = (float)(aXradius*cos(fan)); ptabreal[9] = (float)(aYradius*sin(fan));
ptablong[11] = 0;
WriteData (ELLIPARCCLOSE, ptablong, ptabreal, ptabchar);
}
}
return Standard_True;
}
//=============================================================
// Private methods
//=============================================================
void CGM_Driver::InitializeDriver (const Standard_CString aName)
{
//declare the Metafile
strcpy(ptabchar,aName);
WriteData (BEGMF, ptablong, ptabreal, ptabchar);
//Set the CGM's version
ptablong[0] = CGMVER;
WriteData (MFVERSION, ptablong, ptabreal, ptabchar);
//Put in the metafile a string whose content is free
strcpy(ptabchar,"Generated with CGM_Driver from MATRA-DATAVISION");
WriteData (MFDESC, ptablong, ptabreal, ptabchar);
//Set the element list (always 'DRAWINGPLUS')
ptablong[1]=1;
WriteData (MFELEMLIST, ptablong, ptabreal, ptabchar);
//Set the type of value (integer or real)
cur.vdc_type = REAL;
WriteData (VDCTYPE, ptablong, ptabreal, ptabchar);
//Set the integer precision
cur.int_bits = INTBITS;
WriteData (INTEGERPREC, ptablong, ptabreal, ptabchar);
//Set the real precision
cur.max_real = MAXREAL; // Clear text
cur.min_real = MINREAL;
cur.real_bits = REALBITS; // Character encoding
cur.real_places = REALPLACES;
cur.real_defexp = REALDEFEXP;
cur.real_expald = REALEXP;
curbin.real_type = REALFORM; // Binary encoding
curbin.real_whole = REALWHOLE;
curbin.real_fraction = REALFRACTION;
WriteData (REALPREC, ptablong, ptabreal, ptabchar);
//Set the index precision
cur.index_bits = INDEXBITS;
WriteData (INDEXPREC, ptablong, ptabreal, ptabchar);
//Set the color precision
cur.col_bits = CLRBITS;
WriteData (COLRPREC, ptablong, ptabreal, ptabchar);
//Set the Color Index precision
cur.colind_bits = CLRINDBITS;
WriteData (COLRINDEXPREC, ptablong, ptabreal, ptabchar);
//set the max color index
cur.max_colind = 255;
WriteData (MAXCOLRINDEX, ptablong, ptabreal, ptabchar);
//Set the minimum color and the maximum color
cur.min_rgb.red = cur.min_rgb.green = cur.min_rgb.blue = 0;
cur.max_rgb.red = cur.max_rgb.green = cur.max_rgb.blue = 255;
TRANSFORMCOLOR(cur.max_rgb.red);
TRANSFORMCOLOR(cur.max_rgb.green);
TRANSFORMCOLOR(cur.max_rgb.blue);
WriteData (COLRVALUEEXT, ptablong, ptabreal, ptabchar);
//Set the internal variables
myBKIndex = 0;
myCurrentPage = 0;
myFillIndex = -9;
myEdgeColor = -9;
myEdgeType = -9;
myEdgeWidth = -9;
myInteriorStyle = -9;
myEdgeVisibility = -9;
myImage.Nullify ();
}
//=============================================================
void CGM_Driver::WriteData (const Standard_Integer aCode,
const Standard_Address pLongData,
const Standard_Address pFloatData,
const Standard_Address pCharData)
{
short code = (short) aCode;
long* aLong = (long*) pLongData;
float* aFloat = (float*)pFloatData;
char* aChar = (char*) pCharData;
if (code == LINETYPE) {
curatt.line_type = aTypeIndex.Find(curatt.line_type);
} else if (code == EDGETYPE) {
curatt.edge_type = aTypeIndex.Find(curatt.edge_type);
}
switch (TypeOfCgm) {
case (CgmBinary):
CGMObin (cgmo, code, aLong, aFloat, aChar);
break;
case (CgmCharEncoding):
CGMOchar (cgmo, code, aLong, aFloat, aChar);
break;
case (CgmClearText):
CGMOtext (cgmo, code, aLong, aFloat, aChar);
break;
}
}
//=============================================================
Standard_Boolean CGM_Driver::PlotImage (const Standard_ShortReal aX,
const Standard_ShortReal aY,
const Standard_ShortReal aWidth,
const Standard_ShortReal aHeight,
const Standard_ShortReal aScale,
const Standard_CString anImageFile,
const Standard_Address anArrayOfPixels,
const Standard_Integer aLineIndex)
{
Aspect_ColorMapEntry anEntry;
Handle(Aspect_GenericColorMap) aColorMap = new Aspect_GenericColorMap;
// We'll create new colormap here and will set it
Standard_Boolean status;
Standard_Integer idx = 0, found = 0, fidx = 0, LowX = 0, LowY = 0;
Standard_Integer width = Standard_Integer(aWidth),
height = Standard_Integer(aHeight);
Standard_Integer x, y;
Standard_Real r, g, b;
Aspect_RGBPixel* g2dp = (Aspect_RGBPixel*) anArrayOfPixels;
Quantity_Color color;
// Load image if necessary
if (anImageFile) {
status = SizeOfImageFile (anImageFile, width, height);
if (status) {
LowX = myImage -> LowerX ();
LowY = myImage -> LowerY ();
}
} else {
status = Standard_True;
}
// Put image colormap and pixels to the file
if (status) {
Standard_ShortReal wscale, hscale;
wscale = hscale = (float)(aScale * myPixelSize * PPI / 2.F);
// Put image in the file
float a2X = (float)(aX - wscale * width/2.F);
float a2Y = (float)(aY + hscale * (height/2.F - (aLineIndex == -1 ? 0:aLineIndex)));
if (aLineIndex != -1) height = 1;
int cellsSize = sizeof(long)*(width*height + 10);
Aspect_RGBPixel* pixels =
(Aspect_RGBPixel*) malloc (IMCOLRPREC*sizeof(Aspect_RGBPixel));
if (pixels == NULL) return Standard_False;
long* cells = (long*) malloc (cellsSize);
if (cells == NULL) { free (pixels); return Standard_False; }
//Initialize the array
memset (pixels, 0, IMCOLRPREC*sizeof(Aspect_RGBPixel));
int pixidx = 10; // Pixel description begins with index 10
// Put cellarray entry data
ptabreal[0] = a2X; ptabreal[1] = a2Y; // P
ptabreal[2] = a2X+(width*wscale); ptabreal[3] = a2Y-(height*hscale); // Q
ptabreal[4] = a2X+(width*wscale); ptabreal[5] = a2Y; // R
cells[0] = width*height; cells[7] = width;
cells[8] = height;
// For all pixels of an Image
for (y=0; y < height; y++) {
for (x=0; x < width; x++) {
// Get pixel of image at (x,y) position
if (anImageFile) {
color = myImage -> PixelColor (x + LowX, y + LowY);
color.Values (r, g, b, Quantity_TOC_RGB);
} else {
r = g2dp -> red;
g = g2dp -> green;
b = g2dp -> blue;
g2dp++;
}
// Try to find the pixel
for (int c = 0; c < idx; c++) {
if (pixels[c].red == r && pixels[c].green == g && pixels[c].blue == b) {
found = 1;
fidx = c;
}
if (found) break;
}
if (!found) {
// It's necessary to add new color to colormap
pixels[idx].red = (float)r;
pixels[idx].green = (float)g;
pixels[idx].blue = (float)b;
color.SetValues (r, g, b, Quantity_TOC_RGB);
anEntry = Aspect_ColorMapEntry (idx, color);
anEntry.SetIndex (idx);
aColorMap->AddEntry (anEntry);
cells[pixidx++] = idx;
idx++;
} else {
cells[pixidx++] = fidx;
}
if (idx > IMCOLRPREC) {
free (pixels);
free (cells);
return Standard_False;
}
found = 0;
} // for (x=0; x < width; x++)
} // for (y=0; y < height; y++)
free (pixels);
// Calculate image color precision
int imcolprec = 0, tmp = 1L;
while (tmp < aColorMap->Size()) { tmp <<= 1L; imcolprec++; }
cells[9] = imcolprec;
// Write image data to file (colormap and image data).
myState = imgDraw;
InitializeColorMap (aColorMap);
WriteData (CELLARRAY, cells, ptabreal, ptabchar);
// Restore old colormap
myState = picBody;
InitializeColorMap (ColorMap ());
free (cells);
return Standard_True;
} // IF STATUS
return Standard_False;
}

View File

@ -1,14 +0,0 @@
cgmlib.hxx
cgmatt.h
cgminit.h
cgmpar.h
cgmtypes.h
cgmelem.h
cgmmach.h
cgmstruc.h
cgmerr.h
cgmout.h
cgmobin.c
cgmotext.c
cgmochar.c
Gestfic.cxx

View File

@ -1,65 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <stdio.h>
#include <sys/stat.h>
#ifdef WNT
# include <io.h>
#endif /* WNT */
static FILE* filed;
/***************************************************OPEN_FILE**************/
FILE* OPEN_FILE (char* f_name, int TypeCgm)
{
switch (TypeCgm){
case 1:
case 2:
if ((filed = fopen(f_name,"wb" ))) {
#ifdef WNT
chmod (f_name, S_IREAD | S_IWRITE);
#else
chmod (f_name, 00777);
#endif
/* setbuf (filed, NULL);*/
}
break;
case 3:
if ((filed = fopen(f_name,"w" ))) {
#ifdef WNT
chmod (f_name, S_IREAD | S_IWRITE);
#else
chmod (f_name, 00777);
#endif
/* setbuf (filed, NULL);*/
}
break;
}
return filed;
}
/**************************************************CLOSE_FILE************/
void CLOSE_FILE ()
{
fclose (filed);
}
/**************************************************getfd************/
FILE* getfd ()
{
return filed;
}

View File

@ -1,177 +0,0 @@
/*
Copyright (c) 1999-2012 OPEN CASCADE SAS
The content of this file is subject to the Open CASCADE Technology Public
License Version 6.5 (the "License"). You may not use the content of this file
except in compliance with the License. Please obtain a copy of the License
at http://www.opencascade.org and read it completely before using this file.
The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
The Original Code and all software distributed under the License is
distributed on an "AS IS" basis, without warranty of any kind, and the
Initial Developer hereby disclaims all such warranties, including without
limitation, any warranties of merchantability, fitness for a particular
purpose or non-infringement. Please see the License for the specific terms
and conditions governing the rights and limitations under the License.
*/
/*This file is used to define all attrib structures of the library used to
*/
/*generate CGM files*/
#ifndef CGMATT_H
#define CGMATT_H
#ifdef CGMATT_C
#define Extern
#else
#define Extern extern
#endif
#include "cgmtypes.h"
struct sharedatt {
Index auxindex;
RGBcolour aux;
Enum colmode,
transparency;
float xgrain,
ygrain;
};
typedef struct sharedatt Sharedatt;
struct lineatt {
Index type;
float width;
Enum widthmode;
Index colindex;
RGBcolour col;
Sharedatt *shared;
};
typedef struct lineatt Lineatt;
struct markeratt {
Index type;
float size;
Enum sizemode;
Index colindex;
RGBcolour col;
Sharedatt *shared;
};
typedef struct markeratt Markeratt;
struct textatt {
int fontcount; /* environmental variables */
char **fontlist;
int csetcount;
char **csetlist;
Enum csetannouncer;
Index fontindex; /* bundleable attributes */
Enum precision;
float expansion;
float spacing;
Index colindex;
RGBcolour col;
float height; /* device-independent variables */
float xup,
yup,
xbase,
ybase;
Enum path;
Enum halign,
valign;
float hcont,
vcont;
Index csindex,
acsindex;
Sharedatt *shared;
};
typedef struct textatt Textatt;
struct fillatt {
Index style;
Index colindex;
RGBcolour col;
Index hatch,
pattern;
Sharedatt *shared;
};
typedef struct fillatt Fillatt;
struct edgeatt {
Index type;
float width;
Enum widthmode;
Index colindex;
RGBcolour col;
Sharedatt *shared;
};
typedef struct edgeatt Edgeatt;
struct linebundle {
Index type;
float width;
Index colindex;
Colourentry col;
};
typedef struct linebundle Linebundle;
struct markerbundle {
Index type;
float size;
Index colindex;
Colourentry col;
};
typedef struct markerbundle Markerbundle;
struct textbundle {
Index font;
Enum precision;
float expansion;
float spacing;
Index colindex;
Colourentry col;
};
typedef struct textbundle Textbundle;
struct fillbundle {
Index style;
Index pattern;
Index hatch;
Index colindex;
Colourentry col;
};
typedef struct fillbundle Fillbundle;
struct edgebundle {
Index type;
float width;
Index colindex;
Colourentry col;
};
typedef struct edgebundle Edgebundle;
Extern void ATTline();
Extern void ATTmarker();
Extern void ATTtext();
Extern void ATTfill();
Extern void ATTedge();
#undef Extern
#endif /* end of cgmatt.h */

View File

@ -1,275 +0,0 @@
/*
Copyright (c) 1999-2012 OPEN CASCADE SAS
The content of this file is subject to the Open CASCADE Technology Public
License Version 6.5 (the "License"). You may not use the content of this file
except in compliance with the License. Please obtain a copy of the License
at http://www.opencascade.org and read it completely before using this file.
The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
The Original Code and all software distributed under the License is
distributed on an "AS IS" basis, without warranty of any kind, and the
Initial Developer hereby disclaims all such warranties, including without
limitation, any warranties of merchantability, fitness for a particular
purpose or non-infringement. Please see the License for the specific terms
and conditions governing the rights and limitations under the License.
*/
#ifndef CGMELEM_H
#define CGMELEM_H
/* Include the files on which this is dependent. */
#include "cgmtypes.h"
#define ASFS 18
/* Non-Op */
#define NONOP (Code) 0
/* Character CGM hex values */
#define BEGMF (Code) 0x3020
#define ENDMF (Code) 0x3021
#define BEGPIC (Code) 0x3022
#define BEGPICBODY (Code) 0x3023
#define ENDPIC (Code) 0x3024
/* Metafile Descriptor elements */
#define MFVERSION (Code) 0x3120
#define MFDESC (Code) 0x3121
#define VDCTYPE (Code) 0x3122
#define INTEGERPREC (Code) 0x3123
#define REALPREC (Code) 0x3124
#define INDEXPREC (Code) 0x3125
#define COLRPREC (Code) 0x3126
#define COLRINDEXPREC (Code) 0x3127
#define MAXCOLRINDEX (Code) 0x3128
#define COLRVALUEEXT (Code) 0x3129
#define MFELEMLIST (Code) 0x312A
#define BEGMFDEFAULTS (Code) 0x312B
#define ENDMFDEFAULTS (Code) 0x312C
#define FONTLIST (Code) 0x312D
#define CHARSETLIST (Code) 0x312E
#define CHARCODING (Code) 0x312F
/* Picture descriptor elements */
#define SCALEMODE (Code) 0x3220
#define COLRMODE (Code) 0x3221
#define LINEWIDTHMODE (Code) 0x3222
#define MARKERSIZEMODE (Code) 0x3223
#define EDGEWIDTHMODE (Code) 0x3224
#define VDCEXT (Code) 0x3225
#define BACKCOLR (Code) 0x3226
/* Control elements */
#define VDCINTEGERPREC (Code) 0x3320
#define VDCREALPREC (Code) 0x3321
#define AUXCOLR (Code) 0x3322
#define TRANSPARENCY (Code) 0x3323
#define CLIPRECT (Code) 0x3324
#define CLIP (Code) 0x3325
/* Graphics primitives */
#define LINE (Code) 0x20
#define DISJTLINE (Code) 0x21
#define MARKER (Code) 0x22
#define TEXT (Code) 0x23
#define RESTRTEXT (Code) 0x24
#define APNDTEXT (Code) 0x25
#define POLYGON (Code) 0x26
#define POLYGONSET (Code) 0x27
#define CELLARRAY (Code) 0x28
#define GDP (Code) 0x29
#define RECT (Code) 0x2A
#define CIRCLE (Code) 0x3420
#define ARC3PT (Code) 0x3421
#define ARC3PTCLOSE (Code) 0x3422
#define ARCCTR (Code) 0x3423
#define ARCCTRCLOSE (Code) 0x3424
#define ELLIPSE (Code) 0x3425
#define ELLIPARC (Code) 0x3426
#define ELLIPARCCLOSE (Code) 0x3427
/* Attribute elements */
#define LINEINDEX (Code) 0x3520
#define LINETYPE (Code) 0x3521
#define LINEWIDTH (Code) 0x3522
#define LINECOLR (Code) 0x3523
#define MARKERINDEX (Code) 0x3524
#define MARKERTYPE (Code) 0x3525
#define MARKERSIZE (Code) 0x3526
#define MARKERCOLR (Code) 0x3527
#define TEXTINDEX (Code) 0x3530
#define TEXTFONTINDEX (Code) 0x3531
#define TEXTPREC (Code) 0x3532
#define CHAREXPAN (Code) 0x3533
#define CHARSPACE (Code) 0x3534
#define TEXTCOLR (Code) 0x3535
#define CHARHEIGHT (Code) 0x3536
#define CHARORI (Code) 0x3537
#define TEXTPATH (Code) 0x3538
#define TEXTALIGN (Code) 0x3539
#define CHARSETINDEX (Code) 0x353A
#define ALTCHARSETINDEX (Code) 0x353B
#define FILLINDEX (Code) 0x3620
#define INTSTYLE (Code) 0x3621
#define FILLCOLR (Code) 0x3622
#define HATCHINDEX (Code) 0x3623
#define PATINDEX (Code) 0x3624
#define EDGEINDEX (Code) 0x3625
#define EDGETYPE (Code) 0x3626
#define EDGEWIDTH (Code) 0x3627
#define EDGECOLR (Code) 0x3628
#define EDGEVIS (Code) 0x3629
#define FILLREFPT (Code) 0x362A
#define PATTABLE (Code) 0x362B
#define PATSIZE (Code) 0x362C
#define COLRTABLE (Code) 0x3630
#define ASF (Code) 0x3631
/* Escape Elements */
#define ESCAPE (Code) 0x3720
#define MESSAGE (Code) 0x3721
#define APPLDATA (Code) 0x3722
#define DOMAINRING (Code) 0x3730
/* Version 2 Elements - Addendum 1 */
#if CGMVERSION > 1
#define BEGSEG (Code) 0x3025
#define ENDSEG (Code) 0x3026
#define BEGFIG (Code) 0x3027
#define ENDFIG (Code) 0x3028
#define NAMEPREC (Code) 0x3130
#define MAXVDCEXT (Code) 0x3131
#define SEGPRIEXT (Code) 0x3132
#define DEVVP (Code) 0x3227
#define DEVVPMODE (Code) 0x3228
#define DEVVPMAP (Code) 0x3229
#define LINEREP (Code) 0x322A
#define MARKERREP (Code) 0x322B
#define TEXTREP (Code) 0x322C
#define FILLREP (Code) 0x322D
#define EDGEREP (Code) 0x322E
#define LINECLIPMODE (Code) 0x3326
#define MARKERCLIPMODE (Code) 0x3327
#define EDGECLIPMODE (Code) 0x3328
#define NEWREGION (Code) 0x3329
#define SAVEPRIMCONT (Code) 0x332A
#define RESPRIMCONT (Code) 0x332B
#define ARCCTRREV (Code) 0x3428
#define CONNEDGE (Code) 0x3429
#define PICKID (Code) 0x3632
#define COPYSEG (Code) 0x3820
#define INHFILTER (Code) 0x3821
#define CLIPINH (Code) 0x3822
#define SEGTRANS (Code) 0x3823
#define SEGHIGHLIGHT (Code) 0x3824
#define SEGDISPPRI (Code) 0x3825
#define SEGPICKPRI (Code) 0x3826
/* GKS Annex elements */
#define BEGGKSSESSIONMF (Code) 0x3029
#define BEGGKSSESSION (Code) 0x302A
#define ENDGKSSESSION (Code) 0x302B
#define WSVP (Code) 0x332C
#define CLEAR (Code) 0x332D
#define UPD (Code) 0x332E
#define DEFERST (Code) 0x332F
#define DELSEG (Code) 0x3827
#define RENAMESEG (Code) 0x3828
#define REDRAWALLSEG (Code) 0x3829
#define SEGVIS (Code) 0x382A
#define SEGDET (Code) 0x382B
/* Version 3 Elements - Addendum 3 */
#if CGMVERSION > 2
#define BEGPROTREGION (Code) 0x302C
#define ENDPROTREGION (Code) 0x302D
#define BEGCOMPOLINE (Code) 0x302E
#define ENDCOMPOLINE (Code) 0x302F
#define BEGCOMPOTEXTPATH (Code) 0x3030
#define ENDCOMPOTEXTPATH (Code) 0x3031
#define BEGTILEARRAY (Code) 0x3032
#define ENDTILEARRAY (Code) 0x3033
#define COLRMODEL (Code) 0x3133
#define COLRCALIB (Code) 0x3134
#define FONTPROP (Code) 0x3135
#define GLYPHMAP (Code) 0x3136
#define SYMBOLLIBLIST (Code) 0x3137
#define INTSTYLEMODE (Code) 0x322F
#define LINEEDGETYPEDEF (Code) 0x3230
#define HATCHSTYLEDEF (Code) 0x3231
#define GEOPATDEF (Code) 0x3232
#define PROTREGION (Code) 0x3330
#define GENTEXTPATHMODE (Code) 0x3331
#define MITRELLIMIT (Code) 0x3332
#define TRANSPCELLCOLR (Code) 0x3333
#define HYPERBARC (Code) 0x342A
#define PARABARC (Code) 0x342B
#define NUB (Code) 0x342C
#define NURB (Code) 0x342D
#define POLYBEZIER (Code) 0x342E
#define SYMBOL (Code) 0x342F
#define INCRSYMBOL (Code) 0x342F
#define BITONALTILE (Code) 0x3430
#define TILE (Code) 0x3431
#define LINECAP (Code) 0x3528
#define LINEJOIN (Code) 0x3529
#define LINETYPECONT (Code) 0x352A
#define LINETYPEINITOFFSET (Code) 0x352B
#define TEXTSCORETYPE (Code) 0x352C
#define RESTTEXTTYPE (Code) 0x352D
#define INTERPINT (Code) 0x352E
#define EDGECAP (Code) 0x352F
#define EDGEJOIN (Code) 0x362D
#define EDGETYPECONT (Code) 0x362E
#define EDGETYPEINITOFFSET (Code) 0x362F
#define SYMBOLLIBINDEX (Code) 0x3633
#define SYMBOLCOLR (Code) 0x3634
#define SYMBOLSIZE (Code) 0x3635
#define SYMBOLORI (Code) 0x3636
#endif /* Version 3 */
#endif /* Version 2 */
#endif /* end of cgmelem.h */

View File

@ -1,340 +0,0 @@
/*
Copyright (c) 1999-2012 OPEN CASCADE SAS
The content of this file is subject to the Open CASCADE Technology Public
License Version 6.5 (the "License"). You may not use the content of this file
except in compliance with the License. Please obtain a copy of the License
at http://www.opencascade.org and read it completely before using this file.
The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
The Original Code and all software distributed under the License is
distributed on an "AS IS" basis, without warranty of any kind, and the
Initial Developer hereby disclaims all such warranties, including without
limitation, any warranties of merchantability, fitness for a particular
purpose or non-infringement. Please see the License for the specific terms
and conditions governing the rights and limitations under the License.
*/
#ifndef CGMERR_H
#define CGMERR_H
/* Include the files on which this is dependent. */
#include "cgmtypes.h"
#ifdef CGMERR_C
#define Extern
#else
#define Extern extern
#endif
#ifdef CGMINIT_H
FILE *cgmerr;
#else
extern FILE *cgmerr;
#endif
/* Error function call */
#ifdef PROTO
Extern int CGMerror ( char*, int, Enum, char*);
#else
Extern int CGMerror ();
#endif
/* Get Error Count */
#ifdef PROTO
Extern int CGMcounterr ( void );
#else
Extern int CGMcounterr();
#endif
/* Macro to make life a little simpler */
#define CGMERROR (void) CGMerror
/* Error categories */
#define WARNING (Enum) 1
#define ERROR (Enum) 2
#define FATAL (Enum) 3
/* Return Codes - (System Dependent) */
#ifndef RC_FILERR
#define RC_FILERR (Index) 28
#endif
#ifndef RC_FATAL
#define RC_FATAL (Index) 99
#endif
#define RC_NULL (Index) 0
/* Error codes */
#define ERR_NOTFOUND -1
#define ERR_MANYERR 100
#define ERR_APNDTXT 101
#define ERR_BIGCELL 102
#define ERR_BIGEDGES 103
#define ERR_BIGINTS 104
#define ERR_BIGPATT 105
#define ERR_BIGPOINTS 106
#define ERR_BIGSTR 107
#define ERR_DIRCELL 108
#define ERR_DIRPATT 109
#define ERR_ELEMENT 110
#define ERR_ENCODING 111
#define ERR_EOF 112
#define ERR_FEWPNTS 113
#define ERR_FONTFILE 114
#define ERR_INTCHR 115
#define ERR_INVATT 116
#define ERR_INVCOLR 117
#define ERR_INVCONT 118
#define ERR_INVDELIM 119
#define ERR_INVELEM 120
#define ERR_INVENUM 121
#define ERR_INVESC 122
#define ERR_INVMFDESC 123
#define ERR_INVOPCODE 124
#define ERR_INVOUT 125
#define ERR_INVPDESC 126
#define ERR_INVPRIM 127
#define ERR_MAXCOLR 128
#define ERR_MENUFONT 129
#define ERR_MFOPEN 130
#define ERR_NOBACKSP 131
#define ERR_NOCLT 132
#define ERR_NOCODE 133
#define ERR_NOFONT 134
#define ERR_NOGDP 135
#define ERR_NOMEMORY 136
#define ERR_NOTAPNDTXT 137
#define ERR_NOTCGM 138
#define ERR_NOTERM 139
#define ERR_OPENFILE 140
#define ERR_PATINDEX 141
#define ERR_PATTABLE 142
#define ERR_PICOPEN 143
#define ERR_REDIRECT 144
#define ERR_SEEKEOF 145
#define ERR_VERSION 146
#define ERR_DIRCOL 147
#define ERR_HUFFMAN 148
#define ERR_STATE 149
#define ERR_NAME2LONG 150
#define ERR_INVARG 151
#define ERR_INVASF 152
#define ERR_RALGKS111 153
#define ERR_NOENDPIC 154
#define ERR_NODRIVER 155
#define ERR_RANDOM 156
#define ERR_INVOPT 157
#define ERR_NOFILE 158
#define ERR_CELL2SMALL 159
#define ERR_ELMNOTSUP 160
#define ERR_BADPENDEF 161
#define ERR_PICLGRPAP 162
#define ERR_GDIFAIL 163
/* General font system messages */
#define ERR_NOCSETS 200
#define ERR_BADCSETS 201
#define ERR_NOFAMS 202
#define ERR_BADFAMS 203
#define ERR_NOFAMSYN 204
#define ERR_BADFAMSYN 205
#define ERR_NODSN 206
#define ERR_BADDSN 207
#define ERR_CSETRANGE 208
#define ERR_CSETUNKNOWN 209
#define ERR_FONTRANGE 210
#define ERR_METHOD 211
#define ERR_NOMETHODS 212
#define ERR_METHRANGE 213
#define ERR_NOREQFONTS 214
#define ERR_PACKMISSING 215
#define ERR_NOFMATCH 216
#define ERR_NOFSETS 217
#define ERR_BADFSETS 218
#define ERR_XSFPERM 219
#define ERR_XSISOCSETS 220
#define ERR_XSISOFONTS 221
#define ERR_XSFAMILY 222
#define ERR_XSALIAS 223
#define ERR_XSDESIGN 224
#define ERR_XSSOURCE 225
#define ERR_XSSFONTS 226
#define ERR_XSRFONTS 227
#define ERR_NOFNTSPACE 228
#define ERR_XFONTLIST 229
#define ERR_XOPENDISP 230
/* Bezier font system messages */
#define ERR_BEZDIR 250
#define ERR_BEZDBAD 251
#define ERR_NOFONTS 252
#define ERR_BEZOPEN 253
#define ERR_BEZNODEF 254
#define ERR_DBUNAV 255
#define ERR_NPCINSTR 256
#define ERR_FNTNOTSUP 257
#define ERR_CURVE2BIG 258
#define ERR_FNTNOTOPEN 259
#define ERR_COMPZERO 260
#define ERR_FILCOR 261
/* Text and PostScript system messages */
#define ERR_NOPROLG 300
#define ERR_NOALIAS 301
#define ERR_TXTSYSNFND 302
#define ERR_2MANYFILES 303
#define ERR_CHBASEZERO 304
#define ERR_CHUPZERO 305
/* Polygon and Polygon Set messages */
#define ERR_NOMEMPSL 400
#define ERR_BADEDGETAB 401
#undef Extern
#ifdef CGMERR_C
struct errmessage{
int number;
Index rc;
char *mess;
};
struct errmessage cgmerrs[] =
{
ERR_2MANYFILES, RC_FATAL, "Too many metafiles in input file.",
ERR_APNDTXT, RC_NULL, "Append Text in wrong state",
ERR_BADCSETS, RC_NULL, "Character set file corrupt",
ERR_BADDSN, RC_NULL, "Design group file corrupt",
ERR_BADEDGETAB, RC_NULL, "Edge table corrupt",
ERR_BADFAMS, RC_NULL, "Font file corrupt",
ERR_BADFAMSYN, RC_NULL, "Font alias file corrupt",
ERR_BADFSETS, RC_NULL, "Fudge character set definition file corrupt",
ERR_BEZDBAD, RC_NULL, " ",
ERR_DBUNAV, RC_NULL, "Font database unavailable",
ERR_BEZDIR, RC_NULL, " ",
ERR_FILCOR, RC_NULL, "Bezier file corrupt",
ERR_BEZNODEF, RC_NULL, "No defined characters in font",
ERR_NOFONTS, RC_NULL, "No fonts in directory",
ERR_BEZOPEN, RC_NULL, " ",
ERR_BIGCELL, RC_NULL, "Cell Array too big",
ERR_BIGEDGES, RC_NULL, "Too many edges",
ERR_BIGINTS, RC_NULL, "Too many intersections",
ERR_BIGPATT, RC_NULL, "Patterns size too large",
ERR_BIGPOINTS, RC_NULL, "Too many points",
ERR_BIGSTR, RC_NULL, "String too long",
ERR_COMPZERO, RC_NULL, "Both character components are zero",
ERR_CSETRANGE, RC_NULL, "Character set index out of range",
ERR_CSETUNKNOWN, RC_NULL, "Character set index unknown",
ERR_CHBASEZERO, RC_NULL, "Character base vector zero",
ERR_CHUPZERO, RC_NULL, "Character up vector zero",
ERR_CURVE2BIG, RC_NULL, "Expanded curve too big for system",
ERR_DIRCELL, RC_NULL, "Direct Colour Cell arrays not supported",
ERR_DIRCOL, RC_FATAL, "Direct Colour not supported",
ERR_DIRPATT, RC_NULL, "Direct Colour Patterns not supported",
ERR_ELEMENT, RC_NULL, "Unknown Element",
ERR_ENCODING, RC_FATAL, "Unknown CGM encoding",
ERR_EOF, RC_NULL, "End of File reached",
ERR_FEWPNTS, RC_NULL, "Too few points",
ERR_FNTNOTOPEN, RC_NULL, "Font file could not be opened",
ERR_FNTNOTSUP, RC_NULL, "Font not supported",
ERR_FONTFILE, RC_NULL, "Supported fonts file invalid",
ERR_FONTRANGE, RC_NULL, "Font index outside CGM fontlist range",
ERR_GDIFAIL, RC_NULL, "Windows GDI function failed:",
ERR_HUFFMAN, RC_NULL, "Huffman points list not supported",
ERR_INTCHR, RC_NULL, "Invalid character in integer",
ERR_INVARG, RC_NULL, "Invalid argument",
ERR_INVASF, RC_NULL, "Invalid Aspect Source flag",
ERR_INVATT, RC_NULL, "Invalid Attribute",
ERR_INVCOLR, RC_NULL, "Invalid color type",
ERR_INVCONT, RC_NULL, "Invalid Control Element",
ERR_INVDELIM, RC_NULL, "Invalid Delimiter",
ERR_INVELEM, RC_NULL, "Invalid CGM Element",
ERR_INVENUM, RC_NULL, "Invalid Enumerated type",
ERR_INVESC, RC_NULL, "Invalid Escape Element",
ERR_INVMFDESC, RC_NULL, "Invalid Metafile Descriptor Element",
ERR_INVOPCODE, RC_NULL, "Invalid Opcode",
ERR_INVOPT, RC_NULL, "Invalid Option",
ERR_INVOUT, RC_NULL, "Invalid Output Element",
ERR_INVPDESC, RC_NULL, "Invalid Picture Descriptor Element",
ERR_INVPRIM, RC_NULL, "Invalid Graphics Primitive",
ERR_MANYERR, RC_FATAL, "Too many errors",
ERR_MAXCOLR, RC_NULL, "Maximum Colour Index Exceeded,",
ERR_MENUFONT, RC_NULL, "Menu font not supported",
ERR_METHOD, RC_NULL, "Text method outside allowed range",
ERR_METHRANGE, RC_NULL, "Text method outside allowed range",
ERR_MFOPEN, RC_NULL, "Metafile already open",
ERR_NAME2LONG, RC_NULL, "Illegal length in filename",
ERR_NOALIAS, RC_NULL, "No alias found in file alias.psd for font",
ERR_NOBACKSP, RC_NULL, "This input file cannot move backwards",
ERR_NOCLT, RC_NULL, "File is not a clear text metafile" ,
ERR_NOCODE, RC_FATAL, "Unknown Output Code",
ERR_NOCSETS, RC_NULL, "Character set file not opened",
ERR_NODRIVER, RC_FATAL, "Output driver not supported",
ERR_NODSN, RC_NULL, "Design group file not opened",
ERR_NOENDPIC, RC_NULL, "Missing ENDPIC",
ERR_NOFAMS, RC_NULL, "Font file not opened",
ERR_NOFAMSYN, RC_NULL, "Font alias file not opened",
ERR_NOFMATCH, RC_NULL, "No trace of requested font found",
ERR_NOFNTSPACE, RC_NULL, "No free memory for font system element",
ERR_NOFONT, RC_NULL, "Unable to obtain fontlist from X server",
ERR_NOFILE, RC_FATAL, "No file name specified",
ERR_CELL2SMALL, RC_NULL, "Cell array cells to small for this device",
ERR_ELMNOTSUP, RC_NULL, "Element not supported",
ERR_BADPENDEF, RC_NULL, "Bad HPGL pen definition",
ERR_PICLGRPAP, RC_FATAL, "Metric picture larger than page",
ERR_NOFSETS, RC_NULL, "Fudge character set definition file not opened",
ERR_NOGDP, RC_NULL, "Unknown GDP",
ERR_NOMEMORY, RC_FATAL, "Out of memory",
ERR_NOMEMPSL, RC_NULL, "Out of memory for Polygon Section List",
ERR_NOMETHODS, RC_NULL, "No text emulation methods supplied",
ERR_NOPROLG, RC_NULL, "PostScript prologue file not found",
ERR_NOREQFONTS, RC_NULL, "Cannot open requestable fonts list",
ERR_NOTAPNDTXT, RC_NULL, "Text not allowed in Append Text State",
ERR_NOTCGM, RC_FATAL, "Not a recognisable CGM",
ERR_NOTERM, RC_NULL, "Terminal address must be specified",
ERR_NPCINSTR, RC_NULL, "Non-printable character in string:",
ERR_OPENFILE, RC_FILERR, "Cannot open file",
ERR_PACKMISSING, RC_NULL, "Fonts specified but not found for package",
ERR_PATINDEX, RC_NULL, "Pattern Index too high",
ERR_PATTABLE, RC_NULL, "Pattern Table Full",
ERR_PICOPEN, RC_NULL, "Picture already open",
ERR_RALGKS111, RC_NULL, "RAL-GKS 1.11 CGM has invalid structure",
ERR_RANDOM, RC_FATAL, "Random frame access structure uninitialised",
ERR_REDIRECT, RC_FILERR, "Redirected input invalid for this encoding",
ERR_SEEKEOF, RC_NULL, "Seeking past end of file",
ERR_STATE, RC_NULL, "Element in wrong CGM state",
ERR_TXTSYSNFND, RC_NULL, "Did not find a valid text system",
ERR_VERSION, RC_FATAL, "Wrong Version number",
ERR_XFONTLIST, RC_NULL, "Inconsistency in X font list string",
ERR_XSALIAS, RC_NULL, "Too many aliases",
ERR_XSDESIGN, RC_NULL, "Too many design codes",
ERR_XSFAMILY, RC_NULL, "Too many type families",
ERR_XSFPERM, RC_NULL, "Too many fonts per implementation method for",
ERR_XSISOCSETS, RC_NULL, "Too many ISO character sets",
ERR_XSISOFONTS, RC_NULL, "Too many ISO fonts",
ERR_XOPENDISP, RC_FATAL, "Cannot open display",
ERR_XSRFONTS, RC_NULL, "Too many requestable fonts",
ERR_XSSFONTS, RC_NULL, "Too many special fonts",
ERR_XSSOURCE, RC_NULL, "Too many source codes",
/* NOTE: This code must be last */
ERR_NOTFOUND, RC_NULL, "Unknown error message"
};
#endif /* end of CGMERR_C */
#endif /* end of cgmerr.h */

View File

@ -1,581 +0,0 @@
/*
Copyright (c) 1999-2012 OPEN CASCADE SAS
The content of this file is subject to the Open CASCADE Technology Public
License Version 6.5 (the "License"). You may not use the content of this file
except in compliance with the License. Please obtain a copy of the License
at http://www.opencascade.org and read it completely before using this file.
The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
The Original Code and all software distributed under the License is
distributed on an "AS IS" basis, without warranty of any kind, and the
Initial Developer hereby disclaims all such warranties, including without
limitation, any warranties of merchantability, fitness for a particular
purpose or non-infringement. Please see the License for the specific terms
and conditions governing the rights and limitations under the License.
*/
#ifndef CGMINIT_H
#define CGMINIT_H
/* Include all files on which this is dependent. */
#include "cgmmach.h"
#include "cgmtypes.h"
#include "cgmpar.h"
#include "cgmelem.h"
#include "cgmstruc.h"
#include "cgmerr.h"
/* All default values set within the control program */
/* with Character encoding defaults */
/* Initialise flags */
Enum cgmstate = MF_CLOSED; /* Initial CGM State */
Logical cgmterm = FALSE; /* Flag set for input from stdin */
Logical cgmEOF = FALSE; /* End of File flag is OFF */
Logical cgmfinished = FALSE ; /* Interpreter finished flag */
/* Default string start and terminator */
Code st_start = 0x1b58, st_term = 0x1b5c;
/* Driver names */
struct cgmdrivers {
char *name; /* Name or abreviation */
int chrs; /* Minimum number of characters to match */
Enum type; /* Output driver */
};
/* Arrays for decoding Clear Text elements */
const struct commands cgmelement[] = {
/* Graphics primitives */
{0x20, "LINE"}, {0x20, "INCRLINE"},
{0x21, "DISJTLINE"}, {0x21, "INCRDISJTLINE"},
{0x22, "MARKER"}, {0x22, "INCRMARKER"},
{0x23, "TEXT"},
{0x24, "RESTRTEXT"},
{0x25, "APNDTEXT"},
{0x26, "POLYGON"}, {0x26, "INCRPOLYGON"},
{0x27, "POLYGONSET"}, {0x27, "INCRPOLYGONSET"},
{0x28, "CELLARRAY"},
{0x29, "GDP"},
{0x2A, "RECT"},
{0x3420, "CIRCLE"},
{0x3421, "ARC3PT"},
{0x3422, "ARC3PTCLOSE"},
{0x3423, "ARCCTR"},
{0x3424, "ARCCTRCLOSE"},
{0x3425, "ELLIPSE"},
{0x3426, "ELLIPARC"},
{0x3427, "ELLIPARCCLOSE"},
/* Attribute elements */
{0x3520, "LINEINDEX"},
{0x3521, "LINETYPE"},
{0x3522, "LINEWIDTH"},
{0x3523, "LINECOLR"},
{0x3524, "MARKERINDEX"},
{0x3525, "MARKERTYPE"},
{0x3526, "MARKERSIZE"},
{0x3527, "MARKERCOLR"},
{0x3530, "TEXTINDEX"},
{0x3531, "TEXTFONTINDEX"},
{0x3532, "TEXTPREC"},
{0x3533, "CHAREXPAN"},
{0x3534, "CHARSPACE"},
{0x3535, "TEXTCOLR"},
{0x3536, "CHARHEIGHT"},
{0x3537, "CHARORI"},
{0x3538, "TEXTPATH"},
{0x3539, "TEXTALIGN"},
{0x353A, "CHARSETINDEX"},
{0x353B, "ALTCHARSETINDEX"},
{0x3620, "FILLINDEX"},
{0x3621, "INTSTYLE"},
{0x3622, "FILLCOLR"},
{0x3623, "HATCHINDEX"},
{0x3624, "PATINDEX"},
{0x3625, "EDGEINDEX"},
{0x3626, "EDGETYPE"},
{0x3627, "EDGEWIDTH"},
{0x3628, "EDGECOLR"},
{0x3629, "EDGEVIS"},
{0x362A, "FILLREFPT"},
{0x362B, "PATTABLE"},
{0x362C, "PATSIZE"},
{0x3630, "COLRTABLE"},
{0x3631, "ASF"},
/* Control elements */
{0x3320, "VDCINTEGERPREC"},
{0x3321, "VDCREALPREC"},
{0x3322, "AUXCOLR"},
{0x3323, "TRANSPARENCY"},
{0x3324, "CLIPRECT"},
{0x3325, "CLIP"},
/* Metafile Control Elements */
{0x3020, "BEGMF"},
{0x3021, "ENDMF"},
{0x3022, "BEGPIC"},
{0x3023, "BEGPICBODY"},
{0x3024, "ENDPIC"},
/* Metafile Descriptor elements */
{0x3120, "MFVERSION"},
{0x3121, "MFDESC"},
{0x3122, "VDCTYPE"},
{0x3123, "INTEGERPREC"},
{0x3124, "REALPREC"},
{0x3125, "INDEXPREC"},
{0x3126, "COLRPREC"},
{0x3127, "COLRINDEXPREC"},
{0x3128, "MAXCOLRINDEX"},
{0x3129, "COLRVALUEEXT"},
{0x312A, "MFELEMLIST"},
{0x312B, "BEGMFDEFAULTS"},
{0x312C, "ENDMFDEFAULTS"},
{0x312D, "FONTLIST"},
{0x312E, "CHARSETLIST"},
{0x312F, "CHARCODING"},
/* Picture descriptor elements */
{0x3220, "SCALEMODE"},
{0x3221, "COLRMODE"},
{0x3222, "LINEWIDTHMODE"},
{0x3223, "MARKERSIZEMODE"},
{0x3224, "EDGEWIDTHMODE"},
{0x3225, "VDCEXT"},
{0x3226, "BACKCOLR"},
/* Escape Elements */
{0x3720, "ESCAPE"},
{0x3721, "MESSAGE"},
{0x3722, "APPLDATA"},
/* Version 2 element names */
#if CGMVERSION > 1
{0x3025, "BEGSEG"},
{0x3026, "ENDSEG"},
{0x3027, "BEGFIG"},
{0x3028, "ENDFIG"},
{0x3029, "BEGGKSSESSIONMF"},
{0x302A, "BEGGKSSESSION"},
{0x302B, "ENDGKSSESSION"},
{0x3130, "NAMEPREC"},
{0x3131, "MAXVDCEXT"},
{0x3132, "SEGPRIEXT"},
{0x3227, "DEVVP"},
{0x3228, "DEVVPMODE"},
{0x3229, "DEVVPMAP"},
{0x322A, "LINEREP"},
{0x322B, "MARKERREP"},
{0x322C, "TEXTREP"},
{0x322D, "FILLREP"},
{0x322E, "EDGEREP"},
{0x3326, "LINECLIPMODE"},
{0x3327, "MARKERCLIPMODE"},
{0x3328, "EDGECLIPMODE"},
{0x3329, "NEWREGION"},
{0x332A, "SAVEPRIMCONT"},
{0x332B, "RESPRIMCONT"},
{0x332C, "WSVP"},
{0x332D, "CLEAR"},
{0x332E, "UPD"},
{0x332F, "DEFERST"},
{0x3428, "ARCCTRREV"},
{0x3429, "CONNEDGE"},
{0x3632, "PICKID"},
{0x3820, "COPYSEG"},
{0x3821, "INHFILTER"},
{0x3822, "CLIPINH"},
{0x3823, "SEGTRANS"},
{0x3824, "SEGHIGHLIGHT"},
{0x3825, "SEGDISPPRI"},
{0x3826, "SEGPICKPRI"},
{0x3827, "DELSEG"},
{0x3828, "RENAMESEG"},
{0x3829, "REDRAWALLSEG"},
{0x382A, "SEGVIS"},
{0x382B, "SEGDET"},
#if CGMVERSION > 2
{0x302C, "BEGPROTREGION"},
{0x302D, "ENDPROTREGION"},
{0x302E, "BEGCOMPOLINE"},
{0x302F, "ENDCOMPOLINE"},
{0x3030, "BEGCOMPOTEXTPATH"},
{0x3031, "ENDCOMPOTEXTPATH"},
{0x3032, "BEGTILEARRAY"},
{0x3033, "ENDTILEARRAY"},
{0x3133, "COLRMODEL"},
{0x3134, "COLRCALIB"},
{0x3135, "FONTPROP"},
{0x3136, "GLYPHMAP"},
{0x3137, "SYMBOLLIBLIST"},
{0x322F, "INTSTYLEMODE"},
{0x3230, "LINEEDGETYPEDEF"},
{0x3231, "HATCHSTYLEDEF"},
{0x3232, "GEOPATDEF"},
{0x3330, "PROTREGION"},
{0x3331, "GENTEXTPATHMODE"},
{0x3332, "MITRELLIMIT"},
{0x3333, "TRANSPCELLCOLR"},
{0x342A, "HYPERBARC"},
{0x342B, "PARABARC"},
{0x342C, "NUB"},
{0x342D, "NURB"},
{0x342E, "POLYBEZIER"},
{0x342F, "SYMBOL"}, {0x342F, "INCRSYMBOL"},
{0x3430, "BITONALTILE"},
{0x3431, "TILE"},
{0x3528, "LINECAP"},
{0x3529, "LINEJOIN"},
{0x352A, "LINETYPECONT"},
{0x352B, "LINETYPEINITOFFSET"},
{0x352C, "TEXTSCORETYPE"},
{0x352D, "RESTTEXTTYPE"},
{0x352E, "INTERPINT"},
{0x352F, "EDGECAP"},
{0x362D, "EDGEJOIN"},
{0x362E, "EDGETYPECONT"},
{0x362F, "EDGETYPEINITOFFSET"},
{0x3633, "SYMBOLLIBINDEX"},
{0x3634, "SYMBOLCOLR"},
{0x3635, "SYMBOLSIZE"},
{0x3636, "SYMBOLORI"},
#endif
#endif
/* MFelemlist special names */
{0x10, "DRAWINGSET"},
{0x11, "DRAWINGPLUS"},
#if CGMVERSION > 1
{0x12, "VERSION2"},
{0x13, "EXTDPRIM"},
{0x14, "VERSION2GKSM"},
#if CGMVERSION > 2
{0x15, "VERSION3"},
#endif
#endif
{EOF, "EOF"}
};
/* Metafile Default settings */
const struct char_defaults chardef = {
10, /* integer prec */
10, /* index prec*/
20, /* vdc integer prec */
{10, -10, -10, 1}, /* real precision */
{10, -10, -10, 1}, /* vdc real precision */
6, /* colour prec */
10, /* colour index prec */
{0, 0, 0, 0}, /* minimum colour extent */
{1, 63, 63, 63}, /* maximum colour extent */
0, 1, 1 /* ring parameters for DCC (Huffman codes) */
};
struct char_defaults mfchar, mfichar, curichar, curchar, oldchar;
const struct text_defaults textdef = {
-32767, /* min integer */
32767, /* max integer */
0, /* min index */
127, /* max index */
-32767.0F, /* min real */
32767.0F, /* max real */
4, /* digits */
{-32767, 0.0F}, /* min VDC (int, real) */
{ 32767, 1.0F}, /* max VDC (int, real) */
4, /* digits */
127, /* colour index*/
255, /* colour precision*/
{0, 0, 0, 0}, /* minimum colour value extent */
{1, 255, 255, 255} /* maximum colour value extent */
};
struct text_defaults mftext, mfitext, curitext, curtext;
const struct bin_defaults bindef = {
16, /* integer prec */
16, /* index prec */
16, /* vdc integer prec */
1, /* real type */
1, /* vdc type */
16, /* real whole */
16, /* real fraction */
16, /* vdc real whole */
16, /* vdc real fraction */
8, /* colour prec */
8, /* colour index prec */
{0, 0, 0, 0}, /* minimum colour value extent */
{1, 255, 255, 255} /* maximum colour value extent */
};
struct bin_defaults mfbin, mfibin, curibin, curbin;
const struct defaults commondef = {
63, /* max colour index */
REAL, /* VDC type */
ON, /* clip indicator */
ON, /* transparency */
INDEXED, /* colour mode */
ABSTRACT, /* scale mode */
1.0F, /* scale factor */
SCALED, /* line width mode */
SCALED, /* marker size mode */
SCALED, /* edge width mode */
{0, 0, 0, 0}, /* background colour */
{0, 0, 0, 0}, /* auxilary colour (device dependent) */
{{{0, 0.0F}, {0, 0.0F}}, /* vdc extent - bottom left */
{{32767, 1.0F}, {32767, 1.0F}}}, /* top right */
{{{0, 0.0F}, {0, 0.0F}}, /* clip rectangle - bottom left */
{{32767, 1.0F}, {32767, 1.0F}}}, /* top right */
/* set precisions to character defaults */
10, /* int prec */
10, /* index prec */
10, /* vdcint prec */
10, /* real prec */
-10, /* real bits */
10, /* vdc prec */
-10, /* vdc bits */
6, /* col_prec */
10, /* colind_prec */
-32767.0F, /* min_real */
32767.0F, /* max_real */
0.00015F, /* realmin */
0.0F, /* min_vdc */
1.0F, /* max_vdc */
0.00015F, /* vdcmin */
-10, 1, /* Real default exp and exponent allowed */
-10, 1, /* VDC default exp and exponent allowed */
{0, 0, 0, 0}, /* min_rgb */
{1, 255,255,255}, /* max_rgb */
FALSE, FALSE /* Colour prec & value extent not yet set */
};
/* also use structure for picture defaults and current settings */
struct defaults mf, cur, old;
/* Hold current attributes seperately */
const struct attributes defatt = {
1, /* line index */
1, /* marker index */
1, /* text index*/
1, /* fill Index */
1, /* edge index */
1, /* line type */
3, /* marker type */
1, /* text font */
1, /* edge type */
{33, 1.0F}, /* line width */
{327, 1.0F}, /* marker size */
{33, 1.0F}, /* edge width */
{1, 1,1,1}, /* line colour */
{1, 1,1,1}, /* marker colour */
{1, 1,1,1}, /* text colour */
{1, 1,1,1}, /* fill colour */
{1, 1,1,1}, /* edge colour */
0, /* text prec */
0, /* text path */
0, /* horiz alignment */
0, /* vertical alignment */
OFF, /* edge vis */
1.0F, /* continuous horiz alignment */
1.0F, /* continuous vertical alignment */
1, /* character set */
1, /* alt character set */
1.0F, /* character expansion */
0.0F, /* character space */
{{0, 0.0F}, {1, 1.0F}}, /* character up vector*/
{{1, 1.0F}, {0, 0.0F}}, /* character base vector */
{327, 0.01F}, /* character height */
0, /* interior style */
1, /* hatch index */
1, /* pattern index */
{{0, 0.0F}, {0, 0.0F}}, /* fill Reference point */
{{{0, 0.0F}, {1, 1.0F}}, /* pattern size - height */
{{1, 1.0F}, {0, 0.0F}}}, /* width */
{0, 0, 0, /* Aspect source flags - line (all individual) */
0, 0, 0, /* marker */
0, 0, 0, 0, 0, /* text */
0, 0, 0, 0, /* fill */
0, 0, 0}, /* edge */
FALSE, FALSE, FALSE, FALSE, FALSE /* VDC dependent flag settings */
};
struct attributes mfatt, curatt, oldatt;
/* Flags for changes to attributes - initially set to false */
struct flags att;
/* Set default values for common flags */
Int cgmerrcount = ERROR_MAX; /* USE error count limit by default */
Logical cgmralgks = DEFRALGKSGDP; /* Use RAL-GKS GDPs */
Logical cgmralbin = FALSE; /* Old version of RALCGM Binary CGM */
Logical cgmverbose = DEFVERBOSE; /* Verbose output */
Logical cgmquiet = DEFQUIET; /* Quiet output */
/* Clear text listing */
Logical cgmlist = FALSE;
/* Structures for Font list and Character set */
struct cgmfont cgmfonts;
struct cgmcset cgmcsets;
/* Null pointer for function calls - to fool LINT */
long *null = NULL;
/* Default colour table */
const RGBcolour GKScol[256] = {
/* GKS default colours */
{0, 0, 0}, /* Background - Black */
{255, 255, 255}, /* Foreground - White */
{255, 0, 0}, /* Red */
{0, 255, 0}, /* Green */
{0, 0, 255}, /* Blue */
{255, 255, 0}, /* Yellow */
{0, 255, 255}, /* Cyan */
{255, 0, 255}, /* Magenta */
/* 8 Grey scales ( White to Black ) */
{255, 255, 255}, {177, 177, 177}, {158, 158, 158}, {128, 128, 128},
{100, 100, 100}, { 78, 78, 78}, { 64, 64, 64}, { 0, 0, 0},
/* GKS colour maps from Versatec 16 - 255 */
{98, 192, 255}, {139, 122, 255}, { 92, 70, 255}, { 51, 0, 243},
{28, 0, 133}, { 20, 0, 93}, { 14, 0, 65}, { 11, 0, 56},
{9, 0, 46}, {128, 138, 255}, { 85, 85, 255}, { 0, 0, 255},
{0, 0, 168}, { 0, 13, 116}, { 0, 8, 76}, { 0, 8, 68},
{122, 139, 255}, { 80, 93, 255}, { 0, 59, 252}, { 0, 39, 168},
{0, 28, 122}, { 0, 18, 80}, { 0, 16, 70}, { 122, 149, 255},
{70, 108, 255}, { 0, 83, 230}, { 0, 61, 175}, { 0, 44, 128},
{0, 29, 85}, { 0, 26, 74}, { 116, 154, 255}, { 59, 118, 255},
{0, 97, 219}, { 0, 77, 182}, { 0, 56, 133}, { 0, 37, 89},
{0, 33, 79}, {110, 159, 255}, { 43, 131, 255}, { 0, 112, 225},
{0, 92, 186}, { 0, 68, 138}, { 0, 46, 93}, { 0, 40, 80},
{177, 213, 255}, {104, 173, 255}, { 0, 151, 250}, { 0, 136, 225},
{0, 120, 198}, { 0, 89, 147}, { 0, 59, 97}, { 0, 52, 86},
{0, 43, 70}, { 0, 186, 186}, { 0, 160, 147}, { 0, 142, 129},
{0, 121, 106}, { 0, 89, 78}, { 0, 62, 55}, { 0, 53, 46},
{0, 192, 160}, { 0, 160, 123}, { 0, 138, 105}, { 0, 119, 91},
{0, 89, 68}, { 0, 59, 44}, { 0, 53, 40}, { 0, 243, 169},
{0, 192, 134}, { 0, 160, 113}, { 0, 138, 97}, { 0, 118, 83},
{0, 89, 63}, { 0, 59, 41}, { 0, 51, 36}, { 0, 43, 30},
{0, 216, 115}, { 0, 175, 113}, { 0, 151, 102}, { 0, 138, 91},
{0, 104, 68}, { 0, 70, 46}, { 0, 61, 40}, { 0, 230, 74},
{0, 189, 110}, { 0, 171, 100}, { 0, 156, 92}, { 0, 116, 69},
{0, 80, 47}, { 0, 56, 33}, { 105, 238, 0}, { 0, 216, 46},
{0, 202, 65}, { 0, 189, 71}, { 0, 142, 53}, { 0, 97, 36},
{0, 83, 31}, {161, 240, 0}, { 99, 225, 0}, { 120, 219, 0},
{92, 208, 0}, { 69, 156, 0}, { 46, 104, 0}, { 41, 93, 0},
{197, 243, 0}, {172, 232, 0}, { 168, 227, 0}, { 160, 219, 0},
{122, 168, 0}, { 80, 110, 0}, { 70, 97, 0}, { 255, 251, 175},
{255, 250, 110}, {255, 249, 70}, { 254, 248, 0}, { 253, 245, 0},
{189, 183, 0}, {128, 124, 0}, { 113, 110, 0}, { 89, 86, 0},
{255, 209, 116}, {255, 194, 97}, { 255, 191, 85}, { 255, 177, 65},
{195, 136, 0}, {133, 92, 0}, { 116, 81, 0}, { 255, 190, 119},
{255, 163, 104}, {255, 168, 89}, { 255, 160, 80}, { 195, 113, 0},
{133, 77, 0}, {116, 67, 0}, { 255, 173, 122}, { 255, 154, 107},
{255, 142, 89}, {255, 112, 0}, { 195, 86, 0}, { 128, 56, 0},
{113, 50, 0}, {255, 162, 122}, { 255, 125, 104}, { 255, 100, 65},
{247, 80, 0}, {186, 60, 0}, { 122, 39, 0}, { 110, 35, 0},
{255, 147, 124}, {255, 98, 89}, { 255, 56, 43}, { 238, 44, 0},
{182, 34, 0}, {122, 22, 0}, { 104, 19, 0}, { 255, 168, 170},
{255, 122, 128}, {255, 70, 80}, { 250, 0, 38}, { 225, 0, 35},
{168, 0, 26}, {110, 0, 17}, { 100, 0, 15}, { 80, 0, 12},
{255, 122, 147}, {255, 70, 108}, { 247, 0, 83}, { 225, 0, 72},
{168, 0, 54}, {110, 0, 35}, { 97, 0, 31}, { 255, 166, 197},
{255, 110, 170}, {255, 43, 150}, { 232, 0, 134}, { 211, 0, 122},
{160, 0, 92}, {104, 0, 60}, { 93, 0, 54}, { 76, 0, 44},
{255, 80, 204}, {227, 0, 189}, { 199, 0, 165}, { 168, 0, 142},
{122, 0, 104}, { 85, 0, 72}, { 74, 0, 63}, { 255, 70, 225},
{205, 0, 213}, {175, 0, 175}, { 141, 0, 147}, { 106, 0, 110},
{71, 0, 74}, { 62, 0, 65}, { 245, 43, 255}, { 193, 0, 227},
{153, 0, 195}, {107, 0, 147}, { 80, 0, 110}, { 55, 0, 76},
{47, 0, 65}, {216, 89, 255}, { 150, 43, 255}, { 118, 0, 216},
{80, 0, 147}, { 59, 0, 107}, { 38, 0, 70}, { 35, 0, 64},
{187, 110, 255}, {122, 59, 255}, { 86, 0, 230}, { 55, 0, 147},
{38, 0, 100}, { 25, 0, 68}, { 22, 0, 60}, { 177, 177, 177},
{158, 158, 158}, {128, 128, 128}, { 100, 100, 100}, { 78, 78, 78},
{0, 0, 0}, { 61, 50, 59}, { 52, 45, 62}, { 36, 61, 59},
{127, 118, 109}, { 91, 70, 72}, { 71, 57, 64}, { 79, 62, 64},
{28, 33, 32}, { 34, 31, 36}, { 31, 0, 22}, { 252, 182, 142},
{223, 145, 135}, {191, 133, 119}, { 155, 100, 94}, { 137, 94, 90},
{64, 51, 53}, { 48, 41, 42}, { 255, 148, 116}, { 151, 96, 91}
};
#endif /* end of cgminit.h */

View File

@ -1,944 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#define ASFS 18
typedef short Logical;
typedef long Index;
typedef unsigned short Enum;
typedef short Code;
typedef long Prec;
typedef unsigned long Posint;
typedef float Ptype;
typedef double Mtype;
/* Define anything that has not been explicitly set **************/
#ifndef SignChar
#define SignChar signed char
#endif
#ifndef Int16
#define Int16 short
#endif
#ifndef Char
#define Char char
#endif
#ifndef Int
#define Int int
#endif
#ifndef Long
#define Long long
#endif
#ifndef Float
#define Float float
#endif
#ifndef Double
#define Double double
#endif
/* Define real precision structure (character encoding) */
struct real_prec {
Prec prec, min, defexp, expald;
};
/* CGM element codes for clear text input and output */
struct colour {
Index index;
Posint red, green, blue;
};
typedef struct colour Colour;
struct vdc {
long intr;
float real;
};
typedef struct vdc Vdc;
struct point {
struct vdc x, y;
};
typedef struct point Cpoint;
struct rect {
struct point a, b;
};
typedef struct { float left, right, top, bot; } Rect;
struct colourentry {
float red, green, blue;
};
typedef struct colourentry Colourentry;
struct commands {
Code code;
const char *string;
};
/* Structures for metafile default elements */
/* Encoding Specific defaults */
struct char_defaults{
Prec int_prec, index_prec, vdcint_prec;
struct real_prec real, vdc;
Prec col_prec, colind_prec;
struct colour min_rgb, max_rgb;
long ring_angres, ring_int, ring_real;
};
struct text_defaults{
long min_int, max_int, min_index, max_index;
float min_real, max_real;
Prec real_digits;
struct vdc min_vdc, max_vdc;
Prec vdc_digits, colind_prec, col_prec;
struct colour min_rgb, max_rgb;
};
struct bin_defaults{
Prec int_prec, index_prec, vdcint_prec;
Enum real_type, vdc_type;
Prec real_whole, real_fraction, vdc_whole, vdc_fraction;
Prec col_prec, colind_prec;
struct colour min_rgb, max_rgb;
};
struct defaults {
/* Encoding independent defaults */
Index max_colind;
Enum vdc_type, transparency, clip_ind;
Enum color_mode, scale_mode;
float scale_factor;
Enum linewidth_mode, markersize_mode, edgewidth_mode;
struct colour back, aux;
struct rect vdc_extent, clip_rect;
/* Retain encoding defaults for common access */
Prec int_bits, /* integer prec in bits */
index_bits, /* index prec in bits */
vdcint_bits, /* vdc integer precision in bits */
real_bits, /* real prec in bits */
real_places, /* binary bits after decimal place */
vdc_bits, /* vdc prec in bits */
vdc_places, /* binary bits after decimal place */
col_bits, /* colour prec in bits */
colind_bits; /* colour index prec in bits */
float min_real, /* min real value */
max_real, /* max real value */
realmin, /* smallest real value */
min_vdc, /* min real vdc value */
max_vdc, /* max real vdc value */
vdcmin; /* smallest vdc real value */
Prec real_defexp, /* Real default exponent */
real_expald, /* Real exponenet allowed */
vdc_defexp, /* VDC default exponent */
vdc_expald; /* VDC exponenet allowed */
struct colour min_rgb, /* integer values: index/RGB */
max_rgb; /* integer values: index/RGB */
Logical colprec_flag, /* Flag to show if colour precision set */
colval_flag; /* Flag to show if colour value extent set */
};
/* Graphics attributes */
struct attributes {
Index line_ind, mark_ind, text_ind, fill_ind, edge_ind;
Index line_type, mark_type, text_font, edge_type;
struct vdc line_width, mark_size, edge_width;
struct colour line, marker, text, fill, edge;
Enum text_prec, text_path, text_halign, text_valign, edge_vis;
float text_hcont, text_vcont;
Index char_set, altchar_set;
float char_exp, char_space;
struct point char_up, char_base;
struct vdc char_height;
Enum int_style;
Index hatch_ind, pat_ind;
struct point fill_ref;
struct rect pat_size;
Enum asf[ASFS];
/* Flags for VDC dependent defaults */
Logical linewidth_flag, markersize_flag, edgewidth_flag,
charheight_flag, cliprect_flag;
};
/* Structure for attribute change flags */
struct flags {
Logical line_index, line_type, line_width, line_color;
Logical mark_index, mark_type, mark_size, mark_color;
Logical text_index, text_font, text_prec, char_expan, char_space,
text_color, char_height, char_orient, char_set,
altchar_set, text_path, text_align;
Logical fill_index, int_style, hatch_ind,
pat_ind, pat_size, fill_color, fill_ref;
Logical edge_index, edge_type, edge_width, edge_color, edge_vis;
};
/* Non-Op */
#define NONOP (Code) 0
/* Character CGM hex values */
#define BEGMF (Code) 0x3020
#define ENDMF (Code) 0x3021
#define BEGPIC (Code) 0x3022
#define BEGPICBODY (Code) 0x3023
#define ENDPIC (Code) 0x3024
/* Metafile Descriptor elements */
#define MFVERSION (Code) 0x3120
#define MFDESC (Code) 0x3121
#define VDCTYPE (Code) 0x3122
#define INTEGERPREC (Code) 0x3123
#define REALPREC (Code) 0x3124
#define INDEXPREC (Code) 0x3125
#define COLRPREC (Code) 0x3126
#define COLRINDEXPREC (Code) 0x3127
#define MAXCOLRINDEX (Code) 0x3128
#define COLRVALUEEXT (Code) 0x3129
#define MFELEMLIST (Code) 0x312A
#define BEGMFDEFAULTS (Code) 0x312B
#define ENDMFDEFAULTS (Code) 0x312C
#define FONTLIST (Code) 0x312D
#define CHARSETLIST (Code) 0x312E
#define CHARCODING (Code) 0x312F
/* Picture descriptor elements */
#define SCALEMODE (Code) 0x3220
#define COLRMODE (Code) 0x3221
#define LINEWIDTHMODE (Code) 0x3222
#define MARKERSIZEMODE (Code) 0x3223
#define EDGEWIDTHMODE (Code) 0x3224
#define VDCEXT (Code) 0x3225
#define BACKCOLR (Code) 0x3226
/* Control elements */
#define VDCINTEGERPREC (Code) 0x3320
#define VDCREALPREC (Code) 0x3321
#define AUXCOLR (Code) 0x3322
#define TRANSPARENCY (Code) 0x3323
#define CLIPRECT (Code) 0x3324
#define CLIP (Code) 0x3325
/* Graphics primitives */
#define LINE (Code) 0x20
#define DISJTLINE (Code) 0x21
#define MARKER (Code) 0x22
#define TEXT (Code) 0x23
#define RESTRTEXT (Code) 0x24
#define APNDTEXT (Code) 0x25
#define POLYGON (Code) 0x26
#define POLYGONSET (Code) 0x27
#define CELLARRAY (Code) 0x28
#define GDP (Code) 0x29
#define RECT (Code) 0x2A
#define CIRCLE (Code) 0x3420
#define ARC3PT (Code) 0x3421
#define ARC3PTCLOSE (Code) 0x3422
#define ARCCTR (Code) 0x3423
#define ARCCTRCLOSE (Code) 0x3424
#define ELLIPSE (Code) 0x3425
#define ELLIPARC (Code) 0x3426
#define ELLIPARCCLOSE (Code) 0x3427
/* Attribute elements */
#define LINEINDEX (Code) 0x3520
#define LINETYPE (Code) 0x3521
#define LINEWIDTH (Code) 0x3522
#define LINECOLR (Code) 0x3523
#define MARKERINDEX (Code) 0x3524
#define MARKERTYPE (Code) 0x3525
#define MARKERSIZE (Code) 0x3526
#define MARKERCOLR (Code) 0x3527
#define TEXTINDEX (Code) 0x3530
#define TEXTFONTINDEX (Code) 0x3531
#define TEXTPREC (Code) 0x3532
#define CHAREXPAN (Code) 0x3533
#define CHARSPACE (Code) 0x3534
#define TEXTCOLR (Code) 0x3535
#define CHARHEIGHT (Code) 0x3536
#define CHARORI (Code) 0x3537
#define TEXTPATH (Code) 0x3538
#define TEXTALIGN (Code) 0x3539
#define CHARSETINDEX (Code) 0x353A
#define ALTCHARSETINDEX (Code) 0x353B
#define FILLINDEX (Code) 0x3620
#define INTSTYLE (Code) 0x3621
#define FILLCOLR (Code) 0x3622
#define HATCHINDEX (Code) 0x3623
#define PATINDEX (Code) 0x3624
#define EDGEINDEX (Code) 0x3625
#define EDGETYPE (Code) 0x3626
#define EDGEWIDTH (Code) 0x3627
#define EDGECOLR (Code) 0x3628
#define EDGEVIS (Code) 0x3629
#define FILLREFPT (Code) 0x362A
#define PATTABLE (Code) 0x362B
#define PATSIZE (Code) 0x362C
#define COLRTABLE (Code) 0x3630
#define ASF (Code) 0x3631
/* Escape Elements */
#define ESCAPE (Code) 0x3720
#define MESSAGE (Code) 0x3721
#define APPLDATA (Code) 0x3722
#define DOMAINRING (Code) 0x3730
/* Version 2 Elements - Addendum 1 */
#if CGMVERSION > 1
#define BEGSEG (Code) 0x3025
#define ENDSEG (Code) 0x3026
#define BEGFIG (Code) 0x3027
#define ENDFIG (Code) 0x3028
#define NAMEPREC (Code) 0x3130
#define MAXVDCEXT (Code) 0x3131
#define SEGPRIEXT (Code) 0x3132
#define DEVVP (Code) 0x3227
#define DEVVPMODE (Code) 0x3228
#define DEVVPMAP (Code) 0x3229
#define LINEREP (Code) 0x322A
#define MARKERREP (Code) 0x322B
#define TEXTREP (Code) 0x322C
#define FILLREP (Code) 0x322D
#define EDGEREP (Code) 0x322E
#define LINECLIPMODE (Code) 0x3326
#define MARKERCLIPMODE (Code) 0x3327
#define EDGECLIPMODE (Code) 0x3328
#define NEWREGION (Code) 0x3329
#define SAVEPRIMCONT (Code) 0x332A
#define RESPRIMCONT (Code) 0x332B
#define ARCCTRREV (Code) 0x3428
#define CONNEDGE (Code) 0x3429
#define PICKID (Code) 0x3632
#define COPYSEG (Code) 0x3820
#define INHFILTER (Code) 0x3821
#define CLIPINH (Code) 0x3822
#define SEGTRANS (Code) 0x3823
#define SEGHIGHLIGHT (Code) 0x3824
#define SEGDISPPRI (Code) 0x3825
#define SEGPICKPRI (Code) 0x3826
/* GKS Annex elements */
#define BEGGKSSESSIONMF (Code) 0x3029
#define BEGGKSSESSION (Code) 0x302A
#define ENDGKSSESSION (Code) 0x302B
#define WSVP (Code) 0x332C
#define CLEAR (Code) 0x332D
#define UPD (Code) 0x332E
#define DEFERST (Code) 0x332F
#define DELSEG (Code) 0x3827
#define RENAMESEG (Code) 0x3828
#define REDRAWALLSEG (Code) 0x3829
#define SEGVIS (Code) 0x382A
#define SEGDET (Code) 0x382B
/* Version 3 Elements - Addendum 3 */
#if CGMVERSION > 2
#define BEGPROTREGION (Code) 0x302C
#define ENDPROTREGION (Code) 0x302D
#define BEGCOMPOLINE (Code) 0x302E
#define ENDCOMPOLINE (Code) 0x302F
#define BEGCOMPOTEXTPATH (Code) 0x3030
#define ENDCOMPOTEXTPATH (Code) 0x3031
#define BEGTILEARRAY (Code) 0x3032
#define ENDTILEARRAY (Code) 0x3033
#define COLRMODEL (Code) 0x3133
#define COLRCALIB (Code) 0x3134
#define FONTPROP (Code) 0x3135
#define GLYPHMAP (Code) 0x3136
#define SYMBOLLIBLIST (Code) 0x3137
#define INTSTYLEMODE (Code) 0x322F
#define LINEEDGETYPEDEF (Code) 0x3230
#define HATCHSTYLEDEF (Code) 0x3231
#define GEOPATDEF (Code) 0x3232
#define PROTREGION (Code) 0x3330
#define GENTEXTPATHMODE (Code) 0x3331
#define MITRELLIMIT (Code) 0x3332
#define TRANSPCELLCOLR (Code) 0x3333
#define HYPERBARC (Code) 0x342A
#define PARABARC (Code) 0x342B
#define NUB (Code) 0x342C
#define NURB (Code) 0x342D
#define POLYBEZIER (Code) 0x342E
#define SYMBOL (Code) 0x342F
#define INCRSYMBOL (Code) 0x342F
#define BITONALTILE (Code) 0x3430
#define TILE (Code) 0x3431
#define LINECAP (Code) 0x3528
#define LINEJOIN (Code) 0x3529
#define LINETYPECONT (Code) 0x352A
#define LINETYPEINITOFFSET (Code) 0x352B
#define TEXTSCORETYPE (Code) 0x352C
#define RESTTEXTTYPE (Code) 0x352D
#define INTERPINT (Code) 0x352E
#define EDGECAP (Code) 0x352F
#define EDGEJOIN (Code) 0x362D
#define EDGETYPECONT (Code) 0x362E
#define EDGETYPEINITOFFSET (Code) 0x362F
#define SYMBOLLIBINDEX (Code) 0x3633
#define SYMBOLCOLR (Code) 0x3634
#define SYMBOLSIZE (Code) 0x3635
#define SYMBOLORI (Code) 0x3636
#endif /* Version 3 */
#endif /* Version 2 */
/* CGM Statelists */
#define MF_CLOSED (Enum) 0
#define MF_DESC (Enum) 1
#define MF_ELEMLIST (Enum) 2
#define MF_DEFAULTS (Enum) 3
#define PIC_DESC (Enum) 4
#define PIC_OPEN (Enum) 5
#define PIC_CLOSED (Enum) 6
#define TEXT_OPEN (Enum) 7
/* CGM Enumerated types */
#define INTEGER (Enum) 0
#define REAL (Enum) 1
#define ABSTRACT (Enum) 0
#define METRIC (Enum) 1
#define INDEXED (Enum) 0
#define DIRECT (Enum) 1
#define ABS (Enum) 0
#define ABSOLUTE (Enum) 0
#define SCALED (Enum) 1
#define INDIV (Enum) 0
#define INDIVIDUAL (Enum) 0
#define BUNDLED (Enum) 1
#define ALLOWED (Enum) 0
#define FORBIDDEN (Enum) 1
#define OFF (Enum) 0
#define ON (Enum) 1
#define NOACTION (Enum) 0
#define ACTION (Enum) 1
/* Enumerated types for text precision */
#define STRING (Enum) 0
#define CHAR (Enum) 1
#define STROKE (Enum) 2
/* Enumerated types for Text Path Values */
#define P_RIGHT (Enum) 0
#define P_LEFT (Enum) 1
#define P_UP (Enum) 2
#define UP (Enum) 2
#define P_DOWN (Enum) 3
#define DOWN (Enum) 3
/* Enumerated types for Text's Horziontal Alignment */
#define NORMHORIZ (Enum) 0
#define LEFT (Enum) 1
#define CTR (Enum) 2
#define RIGHT (Enum) 3
#define CONTHORIZ (Enum) 4
/* Enumerated types for Text's Vertical Alignment */
#define NORMVERT (Enum) 0
#define TOP (Enum) 1
#define CAP (Enum) 2
#define HALF (Enum) 3
#define BASE (Enum) 4
#define BOTTOM (Enum) 5
#define CONTVERT (Enum) 6
/* Final text flag */
#define NOTFINAL (Enum) 0
#define FINAL (Enum) 1
/* Interior styles */
#define HOLLOW (Enum) 0
#define SOLID (Enum) 1
#define PAT (Enum) 2
#define PATTERN (Enum) 2
#define HATCH (Enum) 3
#define EMPTY (Enum) 4
/* Closure types */
#define PIE (Enum) 0
#define CHORD (Enum) 1
#define NOCLOSE (Enum) 2
/* Polygon set enumerated types */
#define EDGEVISIB (Enum) 1
#define EDGECLOSE (Enum) 2
#define INVIS (Enum) 0
#define VIS (Enum) 1
#define CLOSEINVIS (EDGECLOSE + INVIS)
#define CLOSEVIS (EDGECLOSE + VIS)
/* MF element list extra elements */
#define DRAWINGSET (Enum) 0
#define DRAWINGSETPLUS (Enum) 1
#define VER2 (Enum) 2
#define EXTPRIM (Enum) 3
#define VER2GKSM (Enum) 4
/* Character sets enumerated types */
#define STD94 (Enum) 0
#define STD96 (Enum) 1
#define STD94MULTIBYTE (Enum) 2
#define STD96MULTIBYTE (Enum) 3
#define COMPLETECODE (Enum) 4
/* Character coding announcer enumerated types */
#define BASIC7BIT (Enum) 0
#define BASIC8BIT (Enum) 1
#define EXTD7BIT (Enum) 2
#define EXTD8BIT (Enum) 3
/* ASF settings */
#define ALL (Enum) 511
#define ALLLINE (Enum) 510
#define ALLMARKER (Enum) 509
#define ALLTEXT (Enum) 508
#define ALLFILL (Enum) 507
#define ALLEDGE (Enum) 506
/* New Version 2 Enumerated types */
#define FRACTION (Enum) 0
#define MM (Enum) 1
#define PHYDEVUNITS (Enum) 2
#define FORCED (Enum) 0
#define NOTFORCED (Enum) 2
#define LOCUS (Enum) 0
#define SHAPE (Enum) 1
#define LOCUSTHENSHAPE (Enum) 2
#define NO (Enum) 0
#define YES (Enum) 1
#define STATELIST (Enum) 0
#define SEGMENT (Enum) 1
#define INTERSECTION (Enum) 1
#define NORMAL (Enum) 0
#define HIGHLIGHT (Enum) 1
/* Element Group names in addition to normal elements */
#define LINEATTR (Enum) 35
#define MARKERATTR (Enum) 36
#define TEXTATTR (Enum) 37
#define CHARATTR (Enum) 38
#define FILLATTR (Enum) 39
#define EDGEATTR (Enum) 40
#define PATATTR (Enum) 41
#define OUTPUTCTRL (Enum) 42
#define ALLATTRCTRL (Enum) 44
#define ALLINH (Enum) 45
#define LINETYPEASF (Enum) 46
#define LINEWIDTHASF (Enum) 47
#define LINECOLRASF (Enum) 48
#define MARKERTYPEASF (Enum) 49
#define MARKERSIZEASF (Enum) 50
#define MARKERCOLRASF (Enum) 51
#define TEXTFONTINDEXASF (Enum) 52
#define TEXTPRECASF (Enum) 53
#define CHAREXPANASF (Enum) 54
#define CHARSPACEASF (Enum) 55
#define TEXTCOLRASF (Enum) 56
#define INTSTYLEASF (Enum) 57
#define FILLCOLRASF (Enum) 58
#define HATCHINDEXASF (Enum) 59
#define PATINDEXASF (Enum) 60
#define EDGETYPEASF (Enum) 61
#define EDGEWIDTHASF (Enum) 62
#define EDGECOLRASF (Enum) 63
/* Useful local Parameters for enumerated types */
#define VDC (Enum) 0
#define MULTIPLE FALSE
#define SINGLE TRUE
#define NOSET (Enum) 0
#define SET (Enum) 1
#define NOP (Enum) 0
#define NONE (Enum) 0
#define ANY (Enum) 0
/* Mathematical quantities */
#ifndef ZERO
#define ZERO (Int) 0
#endif
#define LOG2 0.30103
#define PARABIT 0x40
/* All default values set within the control program */
/* with Character encoding defaults */
/* Initialise flags */
#ifndef AIX
#define FALSE (Enum) 0
#define TRUE (Enum) 1
#endif
/*
Enum cgmstate = MF_CLOSED; Initial CGM State
Logical cgmterm = FALSE; Flag set for input from stdin
Logical cgmEOF = FALSE; End of File flag is OFF
Logical cgmfinished = FALSE ; Interpreter finished flag
Default string start and terminator
Code st_start = 0x1b58, st_term = 0x1b5c;
Arrays for coding and decoding Clear Text elements */
const struct commands cgmelement[] = {
/* Graphics primitives */
{0x20, "LINE"}, {0x20, "INCRLINE"},
{0x21, "DISJTLINE"}, {0x21, "INCRDISJTLINE"},
{0x22, "MARKER"}, {0x22, "INCRMARKER"},
{0x23, "TEXT"},
{0x24, "RESTRTEXT"},
{0x25, "APNDTEXT"},
{0x26, "POLYGON"}, {0x26, "INCRPOLYGON"},
{0x27, "POLYGONSET"}, {0x27, "INCRPOLYGONSET"},
{0x28, "CELLARRAY"},
{0x29, "GDP"},
{0x2A, "RECT"},
{0x3420, "CIRCLE"},
{0x3421, "ARC3PT"},
{0x3422, "ARC3PTCLOSE"},
{0x3423, "ARCCTR"},
{0x3424, "ARCCTRCLOSE"},
{0x3425, "ELLIPSE"},
{0x3426, "ELLIPARC"},
{0x3427, "ELLIPARCCLOSE"},
/* Attribute elements */
{0x3520, "LINEINDEX"},
{0x3521, "LINETYPE"},
{0x3522, "LINEWIDTH"},
{0x3523, "LINECOLR"},
{0x3524, "MARKERINDEX"},
{0x3525, "MARKERTYPE"},
{0x3526, "MARKERSIZE"},
{0x3527, "MARKERCOLR"},
{0x3530, "TEXTINDEX"},
{0x3531, "TEXTFONTINDEX"},
{0x3532, "TEXTPREC"},
{0x3533, "CHAREXPAN"},
{0x3534, "CHARSPACE"},
{0x3535, "TEXTCOLR"},
{0x3536, "CHARHEIGHT"},
{0x3537, "CHARORI"},
{0x3538, "TEXTPATH"},
{0x3539, "TEXTALIGN"},
{0x353A, "CHARSETINDEX"},
{0x353B, "ALTCHARSETINDEX"},
{0x3620, "FILLINDEX"},
{0x3621, "INTSTYLE"},
{0x3622, "FILLCOLR"},
{0x3623, "HATCHINDEX"},
{0x3624, "PATINDEX"},
{0x3625, "EDGEINDEX"},
{0x3626, "EDGETYPE"},
{0x3627, "EDGEWIDTH"},
{0x3628, "EDGECOLR"},
{0x3629, "EDGEVIS"},
{0x362A, "FILLREFPT"},
{0x362B, "PATTABLE"},
{0x362C, "PATSIZE"},
{0x3630, "COLRTABLE"},
{0x3631, "ASF"},
/* Control elements */
{0x3320, "VDCINTEGERPREC"},
{0x3321, "VDCREALPREC"},
{0x3322, "AUXCOLR"},
{0x3323, "TRANSPARENCY"},
{0x3324, "CLIPRECT"},
{0x3325, "CLIP"},
/* Metafile Control Elements */
{0x3020, "BEGMF"},
{0x3021, "ENDMF"},
{0x3022, "BEGPIC"},
{0x3023, "BEGPICBODY"},
{0x3024, "ENDPIC"},
/* Metafile Descriptor elements */
{0x3120, "MFVERSION"},
{0x3121, "MFDESC"},
{0x3122, "VDCTYPE"},
{0x3123, "INTEGERPREC"},
{0x3124, "REALPREC"},
{0x3125, "INDEXPREC"},
{0x3126, "COLRPREC"},
{0x3127, "COLRINDEXPREC"},
{0x3128, "MAXCOLRINDEX"},
{0x3129, "COLRVALUEEXT"},
{0x312A, "MFELEMLIST"},
{0x312B, "BEGMFDEFAULTS"},
{0x312C, "ENDMFDEFAULTS"},
{0x312D, "FONTLIST"},
{0x312E, "CHARSETLIST"},
{0x312F, "CHARCODING"},
/* Picture descriptor elements */
{0x3220, "SCALEMODE"},
{0x3221, "COLRMODE"},
{0x3222, "LINEWIDTHMODE"},
{0x3223, "MARKERSIZEMODE"},
{0x3224, "EDGEWIDTHMODE"},
{0x3225, "VDCEXT"},
{0x3226, "BACKCOLR"},
/* Escape Elements */
{0x3720, "ESCAPE"},
{0x3721, "MESSAGE"},
{0x3722, "APPLDATA"},
/* Version 2 element names */
#if CGMVERSION > 1
{0x3025, "BEGSEG"},
{0x3026, "ENDSEG"},
{0x3027, "BEGFIG"},
{0x3028, "ENDFIG"},
{0x3029, "BEGGKSSESSIONMF"},
{0x302A, "BEGGKSSESSION"},
{0x302B, "ENDGKSSESSION"},
{0x3130, "NAMEPREC"},
{0x3131, "MAXVDCEXT"},
{0x3132, "SEGPRIEXT"},
{0x3227, "DEVVP"},
{0x3228, "DEVVPMODE"},
{0x3229, "DEVVPMAP"},
{0x322A, "LINEREP"},
{0x322B, "MARKERREP"},
{0x322C, "TEXTREP"},
{0x322D, "FILLREP"},
{0x322E, "EDGEREP"},
{0x3326, "LINECLIPMODE"},
{0x3327, "MARKERCLIPMODE"},
{0x3328, "EDGECLIPMODE"},
{0x3329, "NEWREGION"},
{0x332A, "SAVEPRIMCONT"},
{0x332B, "RESPRIMCONT"},
{0x332C, "WSVP"},
{0x332D, "CLEAR"},
{0x332E, "UPD"},
{0x332F, "DEFERST"},
{0x3428, "ARCCTRREV"},
{0x3429, "CONNEDGE"},
{0x3632, "PICKID"},
{0x3820, "COPYSEG"},
{0x3821, "INHFILTER"},
{0x3822, "CLIPINH"},
{0x3823, "SEGTRANS"},
{0x3824, "SEGHIGHLIGHT"},
{0x3825, "SEGDISPPRI"},
{0x3826, "SEGPICKPRI"},
{0x3827, "DELSEG"},
{0x3828, "RENAMESEG"},
{0x3829, "REDRAWALLSEG"},
{0x382A, "SEGVIS"},
{0x382B, "SEGDET"},
#if CGMVERSION > 2
{0x302C, "BEGPROTREGION"},
{0x302D, "ENDPROTREGION"},
{0x302E, "BEGCOMPOLINE"},
{0x302F, "ENDCOMPOLINE"},
{0x3030, "BEGCOMPOTEXTPATH"},
{0x3031, "ENDCOMPOTEXTPATH"},
{0x3032, "BEGTILEARRAY"},
{0x3033, "ENDTILEARRAY"},
{0x3133, "COLRMODEL"},
{0x3134, "COLRCALIB"},
{0x3135, "FONTPROP"},
{0x3136, "GLYPHMAP"},
{0x3137, "SYMBOLLIBLIST"},
{0x322F, "INTSTYLEMODE"},
{0x3230, "LINEEDGETYPEDEF"},
{0x3231, "HATCHSTYLEDEF"},
{0x3232, "GEOPATDEF"},
{0x3330, "PROTREGION"},
{0x3331, "GENTEXTPATHMODE"},
{0x3332, "MITRELLIMIT"},
{0x3333, "TRANSPCELLCOLR"},
{0x342A, "HYPERBARC"},
{0x342B, "PARABARC"},
{0x342C, "NUB"},
{0x342D, "NURB"},
{0x342E, "POLYBEZIER"},
{0x342F, "SYMBOL"}, {0x342F, "INCRSYMBOL"},
{0x3430, "BITONALTILE"},
{0x3431, "TILE"},
{0x3528, "LINECAP"},
{0x3529, "LINEJOIN"},
{0x352A, "LINETYPECONT"},
{0x352B, "LINETYPEINITOFFSET"},
{0x352C, "TEXTSCORETYPE"},
{0x352D, "RESTTEXTTYPE"},
{0x352E, "INTERPINT"},
{0x352F, "EDGECAP"},
{0x362D, "EDGEJOIN"},
{0x362E, "EDGETYPECONT"},
{0x362F, "EDGETYPEINITOFFSET"},
{0x3633, "SYMBOLLIBINDEX"},
{0x3634, "SYMBOLCOLR"},
{0x3635, "SYMBOLSIZE"},
{0x3636, "SYMBOLORI"},
#endif
#endif
/* MFelemlist special names */
{0x10, "DRAWINGSET"},
{0x11, "DRAWINGPLUS"},
#if CGMVERSION > 1
{0x12, "VERSION2"},
{0x13, "EXTDPRIM"},
{0x14, "VERSION2GKSM"},
#if CGMVERSION > 2
{0x15, "VERSION3"},
#endif
#endif
{EOF, "EOF"}
};
extern "C" {
/* Metafile Default settings */
extern struct char_defaults mfchar, mfichar, curichar, curchar, oldchar;
extern struct text_defaults mftext, mfitext, curitext, curtext;
extern struct bin_defaults mfbin, mfibin, curibin, curbin;
extern struct defaults mf, cur, old;
extern struct attributes mfatt, curatt, oldatt;
/* Flags for changes to attributes - initially set to false */
extern struct flags att;
/*
FILE* OPEN_FILE(char*,int);
void CLOSE_FILE();
*/
void CGMOtext(FILE*,Code, Long*,float*,char*);
void CGMObin (FILE*,Code, Long*,float*,char*);
void CGMOchar (FILE*,Code, Long*,float*,char*);
FILE* getfd();
}
FILE* OPEN_FILE(char*,int);
void CLOSE_FILE();

View File

@ -1,303 +0,0 @@
/*
Copyright (c) 1999-2012 OPEN CASCADE SAS
The content of this file is subject to the Open CASCADE Technology Public
License Version 6.5 (the "License"). You may not use the content of this file
except in compliance with the License. Please obtain a copy of the License
at http://www.opencascade.org and read it completely before using this file.
The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
The Original Code and all software distributed under the License is
distributed on an "AS IS" basis, without warranty of any kind, and the
Initial Developer hereby disclaims all such warranties, including without
limitation, any warranties of merchantability, fitness for a particular
purpose or non-infringement. Please see the License for the specific terms
and conditions governing the rights and limitations under the License.
*/
/* Get local machine id, operating system, compiler and/or library */
#ifndef CGMMACH_H
#define CGMMACH_H
/* C Library routines needed in standard include files */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <time.h>
/* Current CGM version */
#define CGMVERSION 1
#define const
#define volatile
#define FREE(x) free ( (char *) x )
#ifndef NULL /* Null Pointer */
#define NULL (int *) 0
#endif
/* Define anything that has not been explicitly set **************/
#ifndef SignChar
#define SignChar signed char
#endif
#ifndef Int16
#define Int16 short
#endif
#ifndef Char
#define Char char
#endif
#ifndef Int
#define Int int
#endif
#ifndef Long
#define Long long
#endif
#ifndef Float
#define Float float
#endif
#ifndef Double
#define Double double
#endif
/* Define macros for some maths routines which may cause problems */
#ifndef SQRT
#define SQRT(x) sqrt( (double) (x) )
#endif
#ifndef FABS
#define FABS(x) fabs( (double) (x) )
#endif
#ifndef MALLOC
#define MALLOC(n,s) malloc( (size_t) ((n)*(s)) )
#endif
/* Define if font system needed */
#ifdef XW
#define FONTSYSTEM
#else
#ifdef POSTSCRIPT
#define FONTSYSTEM
#else
#ifdef IGL
#define FONTSYSTEM
#endif
#endif
#endif
#ifndef FIXED_BUFFER /* Use variable communications Area by default */
#define VAR_BUFFER
#endif
#ifndef ARRAY_MAX /* Maximum Sizes for Interface buffer */
#define ARRAY_MAX 1024
#endif
#ifndef STRING_MAX /* Maximum String length */
#define STRING_MAX 1024
#endif
#ifndef DEFOUT /* Default Standard Output type */
#define DEFOUT 'T'
#endif
#ifndef ERROR_MAX /* Maximum Number of errors */
#define ERROR_MAX 16
#endif
#ifndef DEFVERBOSE /* Default Verbose mode flag */
#define DEFVERBOSE FALSE
#endif
#ifndef DEFQUIET /* Default quiet output flag */
#define DEFQUIET FALSE
#endif
#ifndef DEFMOVIE /* Default Continuous play mode */
#define DEFMOVIE FALSE
#endif
#ifndef DEFDOUBLE /* Default Double buffer mode */
#define DEFDOUBLE FALSE
#endif
#ifndef DEFFULLSCRN /* Default Full screen mode */
#define DEFFULLSCRN TRUE
#endif
#ifndef DEFRALGKSGDP /* RAL-GKS GDPs recognised */
#define DEFRALGKSGDP FALSE
#endif
#ifndef LPOINT /* Define default LPOINT commands */
#define Lpoint Point
#define LPOINT(p) Lpoint *p
#define BEGINLIST(p)
#define STOREPOINT(p,q) (*p).x = q.x; (*p++).y = q.y
#define STOREVALUE(p,q,r) (*p).x = q; (*p++).y = r
#define CLOSELIST(p)
#define NEWSUBLIST(p)
#define ENDLIST(p)
#endif
#ifndef MAXFNSIZE /* Maximum font name size */
#define MAXFNSIZE 40
#endif
#ifndef DATADIR /* Directory for font & data files */
#define DATADIR ""
#endif
#ifndef FILESEP /* File seperator */
#define FILESEP "."
#endif
#ifndef PATHDELIM /* Path seperator */
#define PATHDELIM '/'
#endif
#ifndef MAXFLSIZE /* Maximum length of filename - whole tree */
#define MAXFLSIZE 80
#endif
#ifndef NAMELGTH /* Maximum length of filename - name only */
#define NAMELGTH 8
#endif
#ifndef EXTLGTH /* Maximum length of filename - extension */
#define EXTLGTH 3
#endif
#ifndef LFILEDEF /* Maximum length of filename extra data */
#define LFILEDEF 0
#endif
#ifndef F_READ /* Read file mode */
#define F_READ 'r'
#endif
#ifndef F_WRITE /* Write file mode */
#define F_WRITE 'w'
#endif
#ifndef BUFF_LEN /* CGM output record length */
#define BUFF_LEN (size_t) 80
#endif
#ifndef OBUFF_LEN /* CGM output buffer size */
#define OBUFF_LEN (size_t) 512
#endif
#ifndef NFRAME /* Maximum number of frames */
#define NFRAME 100
#endif
#ifndef NMETA /* Maximum number of metafiles */
#define NMETA 10
#endif
#ifndef MAXPTS /* Maximum storage for fill area processing */
#define MAXPTS 4096
#endif
#ifndef SET_MAX /* Maximum number of Polygon sets ?? */
#define SET_MAX 50
#endif
#ifndef COLOUR_TAB /* Colour table size */
#define COLOUR_TAB 256
#endif
#ifndef COLOUR_BITS /* Number of bit planes */
#define COLOUR_BITS 8
#endif
#ifndef PATT_TAB /* Pattern table size */
#define PATT_TAB 1024
#endif
#ifndef PATTERNS /* Maximum number of Patterns */
#define PATTERNS 40
#endif
#ifndef NPOWER /* No of entries in power-of-two table */
#define NPOWER 32
#endif
#ifndef HASHSIZE /* No of entries in Code hash table */
#if CGMVERSION == 1
#define HASHSIZE 280
#endif
#if CGMVERSION == 2
#define HASHSIZE 512
#endif
#if CGMVERSION == 3
#define HASHSIZE 1024
#endif
#endif
#ifndef NULLSTR /* Null string pointer */
#define NULLSTR (char *) NULL
#endif
#ifdef DEBUG /* turn on extra debugging in font package */
#define CSETNAMES
#define DESNAMES
#endif
/* All the following definitions provide limits for the number
| of values that can be read in by the font utility; they do
| not cause any permanent memory to be allocated, so can be
| set high for safety.
*/
#ifndef MAXCSET /* maximum number of ISO character sets */
#define MAXCSET 1000
#endif
#ifndef MAXFUDGE /* maximum number of fudge character sets */
#define MAXFUDGE 25
#endif
#ifndef MAXFAMILY /* maximum number of typeface family definitions */
#define MAXFAMILY 2000
#endif
#ifndef MAXALIAS /* maximum number of family aliases */
#define MAXALIAS 200
#endif
#ifndef MAXSFONT /* maximum number of specific fonts */
#define MAXFONT 2000
#endif
#ifndef MAXSOURCE /* maximum number of typeface sources */
#define MAXSOURCE 100
#endif
#ifndef MAXDESIGN /* maximum number of ISO design groups */
#define MAXDESIGN 200
#endif
#ifndef MAXMETHOD /* maximum number of output methods */
#define MAXMETHOD 5
#endif
#ifndef MAXFPERM /* maximum number of fonts per method */
#define MAXFPERM 1000
#endif
#ifndef MAXREQ /* maximum number of fonts per method */
#define MAXREQ 1000
#endif
#endif /* end of cgmmach.h */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More