USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::MosaicSceneItem Class Reference

A single cube in the mosaic scene. More...

#include <MosaicSceneItem.h>

Inheritance diagram for Isis::MosaicSceneItem:
Inheritance graph
Collaboration diagram for Isis::MosaicSceneItem:
Collaboration graph

Public Slots

void cubeDisplayChanged ()
 Someone changed something in the cube display properties, re-read the whole thing.
 

Signals

void colorChanged ()
 
void changed (const QList< QRectF > &)
 

Public Member Functions

 MosaicSceneItem (Image *image, MosaicSceneWidget *parent)
 MosaicSceneItem constructor.
 
 ~MosaicSceneItem ()
 Mosaic Item destructor.
 
virtual QRectF boundingRect () const
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 Re-paints the item.
 
QColor color () const
 
Imageimage ()
 
QGraphicsSimpleTextItem * getLabel () const
 
void reproject ()
 Called anytime the user reprojects the cube.
 
bool contains (const QPointF &) const
 Test if we contain the point.
 
void updateSelection (bool)
 Update the selected state.
 
void scenePropertiesChanged ()
 

Protected Member Functions

virtual bool sceneEvent (QEvent *event)
 This filters out events that happen within our polygons.
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 The user right clicked on us (or otherwise requested a context menu).
 

Private Slots

void lostCubeDisplay ()
 

Private Member Functions

 MosaicSceneItem (const MosaicSceneItem &)
 cannot copy
 
MosaicSceneItemoperator= (const MosaicSceneItem &)
 cannot assign
 
void updateChildren ()
 This applies the displayProperties and selectability.
 
StretchgetStretch ()
 This gets a Stretch object that will work for the cubeDisplay converting from DN to screen pixel.
 
void setupFootprint ()
 
void drawImage (QPainter *painter, const QStyleOptionGraphicsItem *option)
 This method reads in and draws the image associated with this item.
 
double getPixelValue (int sample, int line)
 Returns the pixel value at the given sample/line.
 
void setupStretch ()
 

Private Attributes

MosaicSceneWidgetm_scene
 
geos::geom::MultiPolygon * m_mp
 This item's multipolygon in the 0/360 longitude domain.
 
geos::geom::MultiPolygon * m_180mp
 This item's multipolygon in the -180/180 longitude domain.
 
QList< QGraphicsPolygonItem * > * m_polygons
 
UniversalGroundMapgroundMap
 
Imagem_image
 
Stretchm_cubeDnStretch
 
bool m_showingLabel
 
bool m_ignoreCubeDisplayChanged
 
QGraphicsSimpleTextItem * m_label
 

Detailed Description

A single cube in the mosaic scene.

Author
????-??-?? Stacy Alley
History:

2010-10-26 Tracie Sucharski Added missing includes to cpp after removing includes from ControlNet.h.

2011-05-07 Steven Lambright Refactored from MosaicItem to have far fewer responsibilities.

2011-05-10 Steven Lambright Reduced the amount of useless code

2011-05-11 Steven Lambright Reduced the amount of useless code, footprint is now gathered from the CubeDisplayProperties so duplicate work is not done.

2011-05-17 Steven Lambright Labels auto-rotate by 90 degrees once again

Definition at line 43 of file MosaicSceneItem.h.

Constructor & Destructor Documentation

Isis::MosaicSceneItem::~MosaicSceneItem ( )

Mosaic Item destructor.

Definition at line 100 of file MosaicSceneItem.cpp.

Isis::MosaicSceneItem::MosaicSceneItem ( const MosaicSceneItem )
private

cannot copy

Member Function Documentation

bool Isis::MosaicSceneItem::contains ( const QPointF &  p) const

Test if we contain the point.

Even though our rect is empty, return true if a child polygon contains it for toolTips and other events.

Definition at line 489 of file MosaicSceneItem.cpp.

Referenced by sceneEvent().

void Isis::MosaicSceneItem::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
protectedvirtual

The user right clicked on us (or otherwise requested a context menu).

Give it to them.

Definition at line 551 of file MosaicSceneItem.cpp.

References Isis::ImageList::append(), Isis::DisplayProperties::displayName(), Isis::Image::displayProperties(), and Isis::ImageList::supportedActions().

void Isis::MosaicSceneItem::cubeDisplayChanged ( )
slot

Someone changed something in the cube display properties, re-read the whole thing.

Definition at line 419 of file MosaicSceneItem.cpp.

References Isis::Image::displayProperties(), Isis::DisplayProperties::getValue(), reproject(), Isis::ImageDisplayProperties::ShowLabel, updateChildren(), and updateSelection().

Referenced by MosaicSceneItem().

void Isis::MosaicSceneItem::drawImage ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option 
)
private
double Isis::MosaicSceneItem::getPixelValue ( int  sample,
int  line 
)
private

Returns the pixel value at the given sample/line.

Parameters
sample
line
Returns
int

Definition at line 294 of file MosaicSceneItem.cpp.

References Isis::Image::cube(), Isis::Null, Isis::Cube::pixelType(), Isis::Cube::read(), and Isis::Brick::SetBasePosition().

Referenced by drawImage().

Stretch * Isis::MosaicSceneItem::getStretch ( )
private

This gets a Stretch object that will work for the cubeDisplay converting from DN to screen pixel.

The first time this is called the stretch is calculated, later calls re-use the original object. Ownership remains at the class scope.

Definition at line 667 of file MosaicSceneItem.cpp.

References Isis::Statistics::AddData(), Isis::Stretch::AddPair(), Isis::BufferManager::begin(), Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), Isis::Image::cube(), Isis::Cube::read(), Isis::Stretch::SetHis(), Isis::Stretch::SetHrs(), Isis::Stretch::SetLis(), Isis::Stretch::SetLrs(), and Isis::Stretch::SetNull().

Referenced by drawImage().

MosaicSceneItem& Isis::MosaicSceneItem::operator= ( const MosaicSceneItem )
private

cannot assign

void Isis::MosaicSceneItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget widget = 0 
)
virtual

Re-paints the item.

Parameters
painter
option
widget

Definition at line 137 of file MosaicSceneItem.cpp.

References Isis::Image::displayProperties(), drawImage(), Isis::DisplayProperties::getValue(), and Isis::ImageDisplayProperties::ShowDNs.

bool Isis::MosaicSceneItem::sceneEvent ( QEvent *  event)
protectedvirtual

This filters out events that happen within our polygons.

This is necessary because usually events are filtered based on the bounding box alone.

Parameters
watched
event
Returns
bool

Definition at line 447 of file MosaicSceneItem.cpp.

References contains().

void Isis::MosaicSceneItem::updateChildren ( )
private

This applies the displayProperties and selectability.

It's called updateChildren because the child items are the visually displayed items on the scene.

Definition at line 603 of file MosaicSceneItem.cpp.

References Isis::Image::displayProperties(), Isis::DisplayProperties::getValue(), Isis::ImageDisplayProperties::ShowFill, Isis::ImageDisplayProperties::ShowLabel, and Isis::ImageDisplayProperties::ShowOutline.

Referenced by cubeDisplayChanged(), and reproject().

void Isis::MosaicSceneItem::updateSelection ( bool  save)

Update the selected state.

Parameters
saveTrue if we need to write to the DisplayProperties, false if we need to read from them.

Definition at line 511 of file MosaicSceneItem.cpp.

References Isis::Image::displayProperties(), Isis::DisplayProperties::getValue(), Isis::ImageDisplayProperties::Selected, and Isis::ImageDisplayProperties::setSelected().

Referenced by cubeDisplayChanged().

Member Data Documentation

geos::geom::MultiPolygon* Isis::MosaicSceneItem::m_180mp
private

This item's multipolygon in the -180/180 longitude domain.

Definition at line 92 of file MosaicSceneItem.h.

Referenced by reproject().

geos::geom::MultiPolygon* Isis::MosaicSceneItem::m_mp
private

This item's multipolygon in the 0/360 longitude domain.

Definition at line 91 of file MosaicSceneItem.h.

Referenced by MosaicSceneItem(), and reproject().


The documentation for this class was generated from the following files: