GraphicObject Class Reference

Provides access to display properties for graphic objects. More...

#include <GraphicObject.h>

Inheritance diagram for GraphicObject:

Inheritance graph

List of all members.

Public Member Functions

virtual GraphicObjectType getGraphicObjectType () const =0
virtual void setName (const std::string &name)=0
virtual GraphicLayergetLayer () const =0
virtual CgmObjectconvertToCgm ()=0
virtual const BitMaskgetPixels ()=0
virtual bool setBoundingBox (LocationType llCorner, LocationType urCorner)=0
virtual LocationType getLlCorner () const =0
virtual LocationType getUrCorner () const =0
virtual bool setRotation (double dAngle)=0
virtual double getRotation () const =0
virtual bool setLineState (bool bLine)=0
virtual bool getLineState (bool *pSuccess=NULL) const =0
virtual bool setLineColor (ColorType lineColor)=0
virtual ColorType getLineColor () const =0
virtual bool setLineWidth (double dWidth)=0
virtual double getLineWidth () const =0
virtual bool setLineStyle (LineStyle eLine)=0
virtual LineStyle getLineStyle () const =0
virtual bool setLineScaled (bool scaled)=0
virtual bool getLineScaled () const =0
virtual bool setArcRegion (ArcRegion eRegion)=0
virtual ArcRegion getArcRegion () const =0
virtual bool setAngles (double dStart, double dStop)=0
virtual bool setStartAngle (double dStart)=0
virtual bool setStopAngle (double dStop)=0
virtual double getStartAngle () const =0
virtual double getStopAngle () const =0
virtual bool setFillState (bool bFill)=0
virtual bool getFillState (bool *pSuccess=NULL) const =0
virtual bool setFillColor (ColorType fillColor)=0
virtual ColorType getFillColor () const =0
virtual bool setFillStyle (FillStyle eFill)=0
virtual FillStyle getFillStyle () const =0
virtual bool setHatchStyle (SymbolType eHatch)=0
virtual SymbolType getHatchStyle () const =0
virtual bool setApex (double dApex)=0
virtual double getApex () const =0
virtual bool setText (const std::string &objectText)=0
virtual std::string getText () const =0
virtual bool setFont (const Font *pTextFont)=0
virtual const FontgetFont () const =0
virtual bool setTextColor (ColorType textColor)=0
virtual ColorType getTextColor () const =0
virtual bool setTextAlignment (int iAlignment)=0
virtual int getTextAlignment () const =0
virtual bool setScale (double dScale)=0
virtual double getScale () const =0
virtual bool setUnitSystem (UnitSystem units)=0
virtual UnitSystem getUnitSystem () const =0
virtual bool setImageFile (const char *pFilename)=0
virtual bool setObjectImage (const unsigned int *pData, int width, int height, ColorType transparent=ColorType())=0
virtual const unsigned int * getObjectImage (int &width, int &height, ColorType &transparent) const =0
virtual double getAlpha () const =0
virtual bool setAlpha (double alpha)=0
virtual bool setObjectView (View *pView)=0
virtual ViewgetObjectView () const =0
virtual bool addVertices (const std::vector< LocationType > &vertices)=0
virtual bool addGeoVertices (const std::vector< LocationType > &geoVertices)=0
virtual bool newPath ()=0
virtual bool isVisible () const =0
virtual bool setPixelSymbol (SymbolType symbol)=0
virtual SymbolType getPixelSymbol () const =0
virtual bool setSymbolName (const std::string &symbolName)=0
virtual const std::string & getSymbolName () const =0
virtual bool setSymbolSize (unsigned int symbolSize)=0
virtual unsigned int getSymbolSize () const =0
virtual bool setDrawMode (ModeType mode)=0
virtual ModeType getDrawMode () const =0

Protected Member Functions

virtual ~GraphicObject ()


Detailed Description

Provides access to display properties for graphic objects.

Graphic layers are comprised of graphic objects. The GraphicObject class provides access to set the display properties of each object. Not all methods apply to all object types.

This subclass of Subject will notify upon the following conditions:

See also:
GraphicLayer, GraphicObjectType

Definition at line 44 of file GraphicObject.h.


Constructor & Destructor Documentation

virtual GraphicObject::~GraphicObject (  )  [protected, virtual]

This should be destroyed by calling GraphicLayer::removeObject.

Definition at line 814 of file GraphicObject.h.


Member Function Documentation

virtual GraphicObjectType GraphicObject::getGraphicObjectType (  )  const [pure virtual]

Returns the type of the object.

Returns:
The object type.

virtual void GraphicObject::setName ( const std::string &  name  )  [pure virtual]

Sets the name of the object.

Parameters:
name The new name for the graphic object.

virtual GraphicLayer* GraphicObject::getLayer (  )  const [pure virtual]

Gets the GraphicLayer displaying this GraphicObject.

Returns:
The GraphicLayer displaying this GraphicObject. NULL is returned if no GraphicLayer is displaying this GraphicObject.

virtual CgmObject* GraphicObject::convertToCgm (  )  [pure virtual]

Converts the object to a CGM object containing CGM metadata.

Returns:
A pointer to the CGM object. NULL is returned if an error occurs or if the object cannot be converted.

virtual const BitMask* GraphicObject::getPixels (  )  [pure virtual]

Returns a bit mask containing selected pixels representing the object's position.

The bit mask represents those pixels that define the object's location, with rotation taken into account.

Returns:
A pointer to a BitMask object.

virtual bool GraphicObject::setBoundingBox ( LocationType  llCorner,
LocationType  urCorner 
) [pure virtual]

Sets the object bounding box location.

Parameters:
llCorner The new lower left corner position for the object in pixel coordinates.
urCorner The new upper right corner position for the object in pixel coordinates.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if an error occurs.

virtual LocationType GraphicObject::getLlCorner (  )  const [pure virtual]

Returns the lower left corner position of the object's bounding box.

Returns:
The lower left corner position in pixel coordinates.

virtual LocationType GraphicObject::getUrCorner (  )  const [pure virtual]

Returns the upper right corner position of the object's bounding box.

Returns:
The upper right corner position in pixel coordinates.

virtual bool GraphicObject::setRotation ( double  dAngle  )  [pure virtual]

Sets the object rotation value.

The rotation value indicates the amount in degrees counterclockwise that the object is rotated.

Parameters:
dAngle The new rotation angle. Valid values range from 0 to 360. Values outside this range are automatically adjusted to fall within the range.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if an error occurs.

virtual double GraphicObject::getRotation (  )  const [pure virtual]

Returns the object rotation value.

Returns:
The object rotation value. Valid values range from 0 to 360.

virtual bool GraphicObject::setLineState ( bool  bLine  )  [pure virtual]

Sets the line state for an object.

Parameters:
bLine Provide true if the object should be displayed, or false if the object line should not be displayed. This pertains primarily to filled objects where line state indicates whether the object border is visible.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if an error occurs.

virtual bool GraphicObject::getLineState ( bool *  pSuccess = NULL  )  const [pure virtual]

Returns the line state of a filled object.

Parameters:
pSuccess A valid bool pointer will be populated with the success of the method. pSuccess is populated with false if an error occurs.
Returns:
Returns true if the object line is displayed, otherwise false. This pertains primarily to filled objects where line state indicates whether the object border is visible.

virtual bool GraphicObject::setLineColor ( ColorType  lineColor  )  [pure virtual]

Sets the line color for an object.

Parameters:
lineColor The new line color.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if an error occurs.

virtual ColorType GraphicObject::getLineColor (  )  const [pure virtual]

Returns the line color of an object.

Returns:
The line color. An invalid color is returned if an error occurs.
See also:
ColorType::isValid()

virtual bool GraphicObject::setLineWidth ( double  dWidth  )  [pure virtual]

Sets the line width for an object.

Parameters:
dWidth The line width.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if an error occurs.

virtual double GraphicObject::getLineWidth (  )  const [pure virtual]

Returns the line width of an object.

Returns:
The line width. An invalid value of -1 is returned if an error occurs.

virtual bool GraphicObject::setLineStyle ( LineStyle  eLine  )  [pure virtual]

Sets the line style for an object.

Parameters:
eLine The line style.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if an error occurs.

virtual LineStyle GraphicObject::getLineStyle (  )  const [pure virtual]

Returns the line style of an object.

Returns:
The line style. An invalid value of -1 is returned if an error occurs.

virtual bool GraphicObject::setLineScaled ( bool  scaled  )  [pure virtual]

Set the whether the lines should be scaled with the zoom level.

Parameters:
scaled Provide true if the line widths should be scaled, false otherwise.
Returns:
Returns true if the operation succeeded, false otherwise.

virtual bool GraphicObject::getLineScaled (  )  const [pure virtual]

Get the whether the lines should be scaled with the zoom level.

Returns:
Returns true if the line widths should be scaled, false otherwise.

virtual bool GraphicObject::setArcRegion ( ArcRegion  eRegion  )  [pure virtual]

Sets the arc region for an arc object.

Parameters:
eRegion The new region type.
Returns:
Returns true if the region was set successfully, otherwise false. It will return false if the object is not an arc object.

virtual ArcRegion GraphicObject::getArcRegion (  )  const [pure virtual]

Returns the arc region of an arc object.

Returns:
The region type. An invalid value of -1 is returned if the object is not an arc object.

virtual bool GraphicObject::setAngles ( double  dStart,
double  dStop 
) [pure virtual]

Sets both the start and stop angles for an arc object.

An arc object is composed of a portion of an elliptical arc. The ellipse is divided into 360 sections, and the start and stop angles represent the location on the ellipse where the arc is defined.

Parameters:
dStart The start angle. Values are automatically adjusted to be between 0 and 360.
dStop The stop angle. Values are automatically adjusted to be between 0 and 360.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not an arc object.

virtual bool GraphicObject::setStartAngle ( double  dStart  )  [pure virtual]

Sets the start angle for an arc object.

Parameters:
dStart The start angle. Values are automatically adjusted to be between 0 and 360.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not an arc object.
See also:
setAngles()

virtual bool GraphicObject::setStopAngle ( double  dStop  )  [pure virtual]

Sets the stop angle for an arc object.

Parameters:
dStop The stop angle. Values are automatically adjusted to be between 0 and 360.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not an arc object.
See also:
setAngles()

virtual double GraphicObject::getStartAngle (  )  const [pure virtual]

Returns the start angle of an arc object.

Returns:
The start angle. An invalid value of -1 is returned if the object is not an arc object.
See also:
setStartAngle()

virtual double GraphicObject::getStopAngle (  )  const [pure virtual]

Returns the stop angle of an arc object.

Returns:
The stop angle. An invalid value of -1 is returned if the object is not an arc object.
See also:
setStopAngle()

virtual bool GraphicObject::setFillState ( bool  bFill  )  [pure virtual]

Sets the fill state for a filled object.

This method is similar to setFillStyle() method, but simply specifies whether the object have any fill or should be empty.

Parameters:
bFill Provide true if the object should be filled, or false if the object should have an empty fill. Passing in true fills the object according to it fill style.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a filled object.
See also:
setFillStyle()

virtual bool GraphicObject::getFillState ( bool *  pSuccess = NULL  )  const [pure virtual]

Returns the fill state of a filled object.

This method is similar to getFillStyle() method, but simply returns whether the object has any fill or is empty.

Parameters:
pSuccess A valid bool pointer will be populated with the success of the method. pSuccess will be populated with false if the object is not a filled object.
Returns:
Returns true if the object is filled, or false if the object fill is empty.
See also:
getFillStyle()

virtual bool GraphicObject::setFillColor ( ColorType  fillColor  )  [pure virtual]

Sets the background fill color for a filled object.

Parameters:
fillColor The new fill color.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a filled object.

virtual ColorType GraphicObject::getFillColor (  )  const [pure virtual]

Returns the background fill color of a filled object.

Returns:
The fill color. An invalid color is returned if the object is not a filled object.
See also:
ColorType::isValid()

virtual bool GraphicObject::setFillStyle ( FillStyle  eFill  )  [pure virtual]

Sets the fill style for a filled object.

Parameters:
eFill The fill style.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a filled object.

virtual FillStyle GraphicObject::getFillStyle (  )  const [pure virtual]

Returns the fill style of a filled object.

Returns:
The fill style. An invalid value of -1 is returned if the object is not a filled object.

virtual bool GraphicObject::setHatchStyle ( SymbolType  eHatch  )  [pure virtual]

Sets the hatch style for a filled object.

The hatch style corresponds with the hatch fill style. If the fill style is not set to hatch, setting the hatch style will still succeed, but the effect will not be seen in the object until the fill style is set to hatch.

Parameters:
eHatch The hatch style.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a filled object.

virtual SymbolType GraphicObject::getHatchStyle (  )  const [pure virtual]

Returns the hatch style of a filled object.

Returns:
The hatch style. An invalid value of -1 is returned if the object is not a filled object.

virtual bool GraphicObject::setApex ( double  dApex  )  [pure virtual]

Sets the apex value for a triangle object.

A triangle object always has at least one size bordering on its bounding box. The apex value specifies the position of the third point along the opposite side of the bounding box.

Parameters:
dApex The apex value. Valid values range from 0.0 to 1.0.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a triangle object.

virtual double GraphicObject::getApex (  )  const [pure virtual]

Returns the apex value of a triangle object.

Returns:
The apex value. An invalid value of -1 is returned if the object is not a triangle object.

virtual bool GraphicObject::setText ( const std::string &  objectText  )  [pure virtual]

Sets the text for a text object.

Parameters:
objectText The text string.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a text object.

virtual std::string GraphicObject::getText (  )  const [pure virtual]

Returns the text of a text object.

Returns:
The text string. An empty string is returned if the object is not a text object.

virtual bool GraphicObject::setFont ( const Font pTextFont  )  [pure virtual]

Sets the font for object text.

Parameters:
pTextFont The new object text font. This method does nothing if NULL is passed in.
Returns:
Returns true if the font was set successfully on the object. Returns false if this object does not support text fonts.

virtual const Font* GraphicObject::getFont (  )  const [pure virtual]

Returns the current object text font.

Returns:
The current object text font. NULL is returned if the object does not support text fonts.

virtual bool GraphicObject::setTextColor ( ColorType  textColor  )  [pure virtual]

Sets the text color for a text object.

Parameters:
textColor The new text color.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a text object.

virtual ColorType GraphicObject::getTextColor (  )  const [pure virtual]

Returns the text color of a text object.

Returns:
The text color. An invalid color is returned if the object is not a text object.
See also:
ColorType::isValid()

virtual bool GraphicObject::setTextAlignment ( int  iAlignment  )  [pure virtual]

Sets the alignment for text within a text object.

Parameters:
iAlignment The new text alignment. Valid values are defined to be the same values as the Qt::AlignmentFlags enumeration.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a text object.

virtual int GraphicObject::getTextAlignment (  )  const [pure virtual]

Returns the text alignment in a text object.

Returns:
The text alignment. The returned value is the same as the valid Qt::AlignmentFlags enumeration values.

virtual bool GraphicObject::setScale ( double  dScale  )  [pure virtual]

Sets the scale value for arrow, image and text objects.

Arrow, image, and text objects have a default scale value of 1.0. The for any other value, the size of the object displayed in the view is multiplied by the scale value.

Parameters:
dScale The new scale value.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not one of the valid objects.

virtual double GraphicObject::getScale (  )  const [pure virtual]

Returns the scale value of arrow, image and text objects.

Returns:
The scale value. An invalid value of -1 is returned if the object is not one of the valid objects.

virtual bool GraphicObject::setUnitSystem ( UnitSystem  units  )  [pure virtual]

Sets the unit system for a graphic object.

Parameters:
units The system of units to use.
Returns:
Returns true if the value was set successfully, otherwise false.

virtual UnitSystem GraphicObject::getUnitSystem (  )  const [pure virtual]

Returns the unit system of a graphic object.

Returns:
The units.

virtual bool GraphicObject::setImageFile ( const char *  pFilename  )  [pure virtual]

Sets the image for a file image object from a file.

Parameters:
pFilename The name of the file containing the image to display in the object. Cannot be NULL.
Returns:
Returns true if the image was set successfully from the file, otherwise false. It will return false if the object is not a file image object.
See also:
setObjectImage(), setAlpha()

virtual bool GraphicObject::setObjectImage ( const unsigned int *  pData,
int  width,
int  height,
ColorType  transparent = ColorType() 
) [pure virtual]

Sets the image for an image object.

Parameters:
pData A pointer to the image data. Cannot be NULL.
width The width of the image.
height The height of the image.
transparent Identifies the color of pixels that should be displayed transparently. An invalid color indicated that there are no transparent pixels. This value is separate from the object's alpha value.
Returns:
Returns true if the image was set successfully, otherwise false. It will return false if the object is not an image object.
See also:
setImageFile(), setAlpha()

virtual const unsigned int* GraphicObject::getObjectImage ( int &  width,
int &  height,
ColorType transparent 
) const [pure virtual]

Returns the image of an image object.

Parameters:
width Populated with the width of the image.
height Populated with the height of the image.
transparent Populated with color that is used to identify transparent pixels.
Returns:
A pointer to the image data. NULL is returned if an error occurs.

virtual double GraphicObject::getAlpha (  )  const [pure virtual]

Returns the alpha value of an image object.

Returns:
The alpha value. An invalid value of -1 is returned if the object is not an image object.

virtual bool GraphicObject::setAlpha ( double  alpha  )  [pure virtual]

Sets the alpha value for an image object.

The alpha value defines the transparency level for the image. An image can be converted into a watermark with a relatively low alpha value.

Parameters:
alpha The new alpha value. Valid values range from 0 to 255, with 0 being transparent and 255 being opaque.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not an image object.

virtual bool GraphicObject::setObjectView ( View pView  )  [pure virtual]

Sets the displayed view in a view object.

This method only sets the displayed view into a view object. This method does not cause the view to actually be drawn on the screen. As a result, any programmatic manipulation of how the view is displayed (panning, zooming, etc.) should not be done until the view displaying this object has been repainted.

Parameters:
pView A pointer to the view to display in the view object. NULL is a valid input, where the view object displays a message indicating that no view is available.
Returns:
Returns true if the value was set successfully, otherwise false. It will return false if the object is not a view object.
Subject Notifications:
This method will notify ViewObject::signalViewCreated() with any<View*> and/or ViewObject::signalViewDeleted() with any<View*> if the view is successfully set in the object.

virtual View* GraphicObject::getObjectView (  )  const [pure virtual]

Returns the view displayed in a view object.

Returns:
A pointer to the view displayed in the view object. NULL is returned if the object is not a view object.

virtual bool GraphicObject::addVertices ( const std::vector< LocationType > &  vertices  )  [pure virtual]

Adds vertices to a polyline or polygon object.

Parameters:
vertices The vertices to add to the object.
Returns:
Returns true if the vertices have been successfully added.

virtual bool GraphicObject::addGeoVertices ( const std::vector< LocationType > &  geoVertices  )  [pure virtual]

Adds geographic vertices to a polyline or polygon object.

Parameters:
geoVertices The lat/long vertices to add to the object.
Returns:
Returns true if the vertices have been successfully added.

virtual bool GraphicObject::newPath (  )  [pure virtual]

Adds a new path to a Polyline or Polygon graphic.

This method allows a single Polyline or Polygon to contain multiple discontinuous paths. For a Polygon, this allows a doughnut shape. The vertices added between calls to newPath() make a single path.

Returns:
Returns true if a new path was successfully added, false otherwise. This method will fail if no vertices have been added since the last call to newPath().

virtual bool GraphicObject::isVisible (  )  const [pure virtual]

Determine whether the object is a visible shape.

This method determines whether the object is a shape, like RECTANGLE_OBJECT or a tool, like MOVE_OBJECT.

Returns:
Returns true if the object is a visible shape, false if it is a non-visible tool.

virtual bool GraphicObject::setPixelSymbol ( SymbolType  symbol  )  [pure virtual]

Set the symbol to draw for each pixel when drawing individual pixels.

Parameters:
symbol The new symbol.

virtual SymbolType GraphicObject::getPixelSymbol (  )  const [pure virtual]

Get the pixel drawn for individual pixels.

Returns:
The symbol drawn.

virtual bool GraphicObject::setSymbolName ( const std::string &  symbolName  )  [pure virtual]

Set the name of the symbol to be drawn at the points of a MultipointObject.

Parameters:
symbolName The name of the symbol to draw
Returns:
Returns true if the operation succeeded, false otherwise.

virtual const std::string& GraphicObject::getSymbolName (  )  const [pure virtual]

Get the name of the symbol to be drawn at the points of a MultipointObject.

Returns:
The name of the symbol to draw

virtual bool GraphicObject::setSymbolSize ( unsigned int  symbolSize  )  [pure virtual]

Set the size of the symbol to be drawn at the points of a MultipointObject.

Parameters:
symbolSize The size of the symbol to draw. This is in screen pixels.
Returns:
Returns true if the operation succeeded, false otherwise.

virtual unsigned int GraphicObject::getSymbolSize (  )  const [pure virtual]

Get the size of the symbol to be drawn at the points of a MultipointObject.

Returns:
The size of the symbol to draw. This is in screen pixels.

virtual bool GraphicObject::setDrawMode ( ModeType  mode  )  [pure virtual]

Set the draw mode when composing bitmasks with this object.

Parameters:
mode The new draw mode.

virtual ModeType GraphicObject::getDrawMode (  )  const [pure virtual]

Get the draw mode for composing bitmasks with this object.

Returns:
The draw mode.


Software Development Kit - Opticks 4.9.0 Build 16218