Creating the Header File
For this Creating a new Graphic Object Class, you create a header file that declares the new class and the necessary overloaded member functions.
The header file shadellp.h contains the following lines:
#define DefaultShadowThickness 4
class ShadowEllipse
: public IlvSimpleGraphic {
public:
ShadowEllipse(IlvDisplay* display,
const IlvRect& rect,
IlUShort thickness = DefaultShadowThickness,
IlvPalette* palette = 0)
: IlvSimpleGraphic(display, palette),
_rect(rect), _thickness(thickness)
{
_invertedPalette = 0;
computeInvertedPalette();
}
~ShadowEllipse();
virtual void draw(IlvPort*, const IlvTransformer* t = 0,
const IlvRegion* clip = 0) const;
virtual IlBoolean contains(const IlvPoint& p,
const IlvPoint& tp,
const IlvTransformer* t) const;
virtual void boundingBox(IlvRect& rect,
const IlvTransformer* t = 0) const;
virtual void applyTransform(const IlvTransformer* t);
IlUShort getThickness() const
{ return _thickness; }
void setThickness(IlUShort thickness)
{ _thickness = thickness; }
virtual void setBackground(IlvColor* c);
virtual void setForeground(IlvColor* c);
virtual void setMode(IlvDrawMode m);
virtual void setPalette(IlvPalette* p);
DeclareTypeInfo();
DeclareIOConstructors(ShadowEllipse);
protected:
IlvRect _rect;
IlUShort _thickness;
IlvPalette* _invertedPalette;
void computeInvertedPalette();
};
This object, like a few others in the standard Views library, makes use of two different
The ShadowEllipse class defines the member functions draw, contains, and boundingBox. It also defines the necessary palette-management related member functions to update both the standard palette object (the one stored in the IlvSimpleGraphic class) and the new one, _invertedPalette.
No input/output member functions are declared in this synopsis. In fact, they are declared by the