OCC Main Page | Visualization | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Visualization
TKV2d
Graphic2d


Graphic2d_ImageFile Class Reference

The primitive ImageFile
.

#include <Graphic2d_ImageFile.hxx>

Inheritance diagram for Graphic2d_ImageFile:

Inheritance graph
[legend]

Public Member Functions

Standard_EXPORT Graphic2d_ImageFile (const Handle(Graphic2d_GraphicObject)&aGraphicObject, OSD_File &aFile, const Quantity_Length X, const Quantity_Length Y, const Quantity_Length adx=0.0, const Quantity_Length ady=0.0, const Aspect_CardinalPoints aTypeOfPlacement=Aspect_CP_Center, const Quantity_Factor aScale=1.0)
 Defines an image with its center location;
<x>, <y> defines the position in the space model.
<adx>, <ady> defines an offset in the device space.
<ascale> defines a scale factor applied to the
original size of the image.
The image will be placed at this offset
according to the type of placement.
.
Standard_EXPORT void SetCenter (const Quantity_Length X, const Quantity_Length Y)
 Modifies the center location of the image <me>.
.
Standard_EXPORT void SetOffset (const Quantity_Length dx, const Quantity_Length dy)
 Modifies the offset of the image <me>.
.
Standard_EXPORT void SetPlacement (const Aspect_CardinalPoints aPlacement)
 Modifies the type of placement of the image <me>.
.
Standard_EXPORT void Translate (const Quantity_Length DX, const Quantity_Length DY)
 Modifies the center location of the image <me>
by translating it.
.
Standard_EXPORT void SetScale (const Quantity_Factor aScale)
 Changes the scale factor of the image.
.
Standard_EXPORT void SetZoomable (const Standard_Boolean aFlag=Standard_False)
 The image <me> follows the scale factor of the view
if the flag is Standard_True.
.
Standard_EXPORT void Clear ()
 Clear the reference to this imagefile if something
inside have changed,Forced the reload of this at Draw()
time.
.
Standard_EXPORT Quantity_Factor Scale () const
 Returns the original scale factor applied to
the image <me>.
.
Standard_EXPORT Standard_Boolean IsZoomable () const
 Returns Standard_True if the image <me> follows
the scale factor of the view.
.
Standard_EXPORT void Position (Quantity_Length &X, Quantity_Length &Y) const
 returns the position in the space model

Standard_EXPORT void Offset (Quantity_Length &aX, Quantity_Length &aY) const
 returns the offset in the device space

Standard_EXPORT Aspect_CardinalPoints Placement () const
 returns the type of placement

Standard_EXPORT OSD_File ImageFile () const
 returns the image file

virtual Standard_EXPORT void Save (Aspect_FStream &aFStream) const
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Static Public Member Functions

static Standard_EXPORT Standard_Boolean Values (OSD_File &aFile, Standard_Integer &aWidth, Standard_Integer &aHeight, Standard_Integer &aDepth)
 Returns Standard_True, the Image pixel size
and the Image planes depth, if the image file :
- is not open
- exists
- have the extension .xwd
NOTE that only XWD image file type are recognized.
.
static Standard_EXPORT void SwapLong (const Standard_Address anAddress, const Standard_Integer aNumOfBytes)
 Swaps long ints
.

Protected Member Functions

Standard_EXPORT void Draw (const Handle(Graphic2d_Drawer)&aDrawer)
 Draws the image at the required center location
defined by the SetCenter method.
.
Standard_EXPORT Standard_Boolean Pick (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal aPrecision, const Handle(Graphic2d_Drawer)&aDrawer)
 Returns Standard_True if the image <me> is picked,
Standard_False if not.
.

Private Member Functions

Standard_EXPORT Standard_Boolean ComputeCenterAndSize (const Handle(Graphic2d_Drawer)&aDrawer, Standard_ShortReal &cx, Standard_ShortReal &cy, Standard_ShortReal &width, Standard_ShortReal &height)
 Evaluates the center of the image in the device space.
Called by the methods :
- Graphic2d_ImageFile::Draw
- Graphic2d_ImageFile::Pick
- Graphic2d_ImageFile::FillAndDraw
.

Private Attributes

OSD_File myFile
TCollection_AsciiString myFileName
Standard_ShortReal myX
Standard_ShortReal myY
Standard_ShortReal mydx
Standard_ShortReal mydy
Standard_Integer myWidth
Standard_Integer myHeight
Aspect_CardinalPoints myPlacement
Standard_Boolean myIsZoomable
Standard_ShortReal myScale
Standard_Boolean myIsModified

Constructor & Destructor Documentation

Standard_EXPORT Graphic2d_ImageFile::Graphic2d_ImageFile const Handle(Graphic2d_GraphicObject)&  aGraphicObject,
OSD_File &  aFile,
const Quantity_Length  X,
const Quantity_Length  Y,
const Quantity_Length  adx = 0.0,
const Quantity_Length  ady = 0.0,
const Aspect_CardinalPoints  aTypeOfPlacement = Aspect_CP_Center,
const Quantity_Factor  aScale = 1.0
 


Member Function Documentation

Standard_EXPORT void Graphic2d_ImageFile::Clear  ) 
 

Standard_EXPORT Standard_Boolean Graphic2d_ImageFile::ComputeCenterAndSize const Handle(Graphic2d_Drawer)&  aDrawer,
Standard_ShortReal &  cx,
Standard_ShortReal &  cy,
Standard_ShortReal &  width,
Standard_ShortReal &  height
[private]
 

Standard_EXPORT void Graphic2d_ImageFile::Draw const Handle(Graphic2d_Drawer)&  aDrawer  )  [protected, virtual]
 

Implements Graphic2d_Primitive.

Standard_EXPORT const Graphic2d_ImageFile::Handle Standard_Type   )  const
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT OSD_File Graphic2d_ImageFile::ImageFile  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_ImageFile::IsZoomable  )  const
 

Standard_EXPORT void Graphic2d_ImageFile::Offset Quantity_Length &  aX,
Quantity_Length &  aY
const
 

Standard_EXPORT Standard_Boolean Graphic2d_ImageFile::Pick const Standard_ShortReal  X,
const Standard_ShortReal  Y,
const Standard_ShortReal  aPrecision,
const Handle(Graphic2d_Drawer)&  aDrawer
[protected, virtual]
 

Implements Graphic2d_Primitive.

Standard_EXPORT Aspect_CardinalPoints Graphic2d_ImageFile::Placement  )  const
 

Standard_EXPORT void Graphic2d_ImageFile::Position Quantity_Length &  X,
Quantity_Length &  Y
const
 

virtual Standard_EXPORT void Graphic2d_ImageFile::Save Aspect_FStream aFStream  )  const [virtual]
 

Implements Graphic2d_Primitive.

Standard_EXPORT Quantity_Factor Graphic2d_ImageFile::Scale  )  const
 

Standard_EXPORT void Graphic2d_ImageFile::SetCenter const Quantity_Length  X,
const Quantity_Length  Y
 

Standard_EXPORT void Graphic2d_ImageFile::SetOffset const Quantity_Length  dx,
const Quantity_Length  dy
 

Standard_EXPORT void Graphic2d_ImageFile::SetPlacement const Aspect_CardinalPoints  aPlacement  ) 
 

Standard_EXPORT void Graphic2d_ImageFile::SetScale const Quantity_Factor  aScale  ) 
 

Standard_EXPORT void Graphic2d_ImageFile::SetZoomable const Standard_Boolean  aFlag = Standard_False  ) 
 

static Standard_EXPORT void Graphic2d_ImageFile::SwapLong const Standard_Address  anAddress,
const Standard_Integer  aNumOfBytes
[static]
 

Standard_EXPORT void Graphic2d_ImageFile::Translate const Quantity_Length  DX,
const Quantity_Length  DY
 

static Standard_EXPORT Standard_Boolean Graphic2d_ImageFile::Values OSD_File &  aFile,
Standard_Integer &  aWidth,
Standard_Integer &  aHeight,
Standard_Integer &  aDepth
[static]
 


Field Documentation

Standard_ShortReal Graphic2d_ImageFile::mydx [private]
 

Standard_ShortReal Graphic2d_ImageFile::mydy [private]
 

OSD_File Graphic2d_ImageFile::myFile [private]
 

TCollection_AsciiString Graphic2d_ImageFile::myFileName [private]
 

Standard_Integer Graphic2d_ImageFile::myHeight [private]
 

Standard_Boolean Graphic2d_ImageFile::myIsModified [private]
 

Standard_Boolean Graphic2d_ImageFile::myIsZoomable [private]
 

Aspect_CardinalPoints Graphic2d_ImageFile::myPlacement [private]
 

Standard_ShortReal Graphic2d_ImageFile::myScale [private]
 

Standard_Integer Graphic2d_ImageFile::myWidth [private]
 

Standard_ShortReal Graphic2d_ImageFile::myX [private]
 

Standard_ShortReal Graphic2d_ImageFile::myY [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:55:33 2008 for OpenCASCADE by  doxygen 1.4.1