Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Private Types | Static Private Member Functions | Private Attributes | Static Private Attributes
Visualization::Shape Class Referenceabstract

Public Types

typedef ShapeStyle StyleType
 

Public Member Functions

 Shape (Item *parent, ShapeStyle *style=nullptr)
 
virtual ~Shape ()
 
virtual int contentLeft ()
 
virtual QRect contentRect ()=0
 
virtual int contentTop ()
 
QSize innerSize (int outerWidth, int outerHeight) const
 
virtual QSize innerSize (QSize outerSize) const
 
QSize outerSize (int innerWidth, int innerHeight) const
 
virtual QSize outerSize (QSize innerSize) const
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0
 
void setInnerSize (int width, int height)
 
void setOffset (int x, int y)
 
void setOuterSize (int width, int height)
 
virtual void setStyle (const Visualization::ShapeStyle *style)
 
const StyleTypestyle () const
 

Static Public Member Functions

static ShapecreateNewShape (const QString &shapeName, Item *parent)
 
static ShapeStylecreateNewShapeStyle (const QString &shapeName)
 
static StyleSet< Shape > & itemStyles ()
 
template<typename ShapeClass >
static void registerShape ()
 

Protected Types

enum  SizeType { InnerSize , OuterSize }
 

Protected Member Functions

int height () const
 
ItemparentItem () const
 
void setItemSize (int width, int height)
 
void setParentNeedsUpdate ()
 
SizeType sizeSpecified () const
 
virtual void update ()=0
 
int width () const
 
int xOffset () const
 
int yOffset () const
 

Private Types

typedef Shape *(* ShapeConstructor) (Item *parent_)
 
typedef ShapeStyle *(* ShapeStyleConstructor) ()
 

Static Private Member Functions

template<typename Base , typename Actual >
static Base * makeDefaultShape (Item *parent)
 
template<typename Base , typename Actual >
static Base * makeDefaultStyle ()
 

Private Attributes

int height_ {}
 
Itemparent_ {}
 
SizeType sizeToUse {}
 
const ShapeStylestyle_ {}
 
int width_ {}
 
int xOffset_ {}
 
int yOffset_ {}
 

Static Private Attributes

static QMap< QString, ShapeConstructorshapeConstructors
 
static QMap< QString, ShapeStyleConstructorshapeStyleConstructors
 

Member Typedef Documentation

◆ ShapeConstructor

typedef Shape*(* Visualization::Shape::ShapeConstructor) (Item *parent_)
private

◆ ShapeStyleConstructor

typedef ShapeStyle*(* Visualization::Shape::ShapeStyleConstructor) ()
private

◆ StyleType

Member Enumeration Documentation

◆ SizeType

Enumerator
InnerSize 
OuterSize 

Constructor & Destructor Documentation

◆ Shape()

Visualization::Shape::Shape ( Item parent,
ShapeStyle style = nullptr 
)

◆ ~Shape()

Visualization::Shape::~Shape ( )
virtual

Member Function Documentation

◆ contentLeft()

int Visualization::Shape::contentLeft ( )
virtual

◆ contentRect()

virtual QRect Visualization::Shape::contentRect ( )
pure virtual

◆ contentTop()

int Visualization::Shape::contentTop ( )
virtual

◆ createNewShape()

Shape * Visualization::Shape::createNewShape ( const QString &  shapeName,
Item parent 
)
static

◆ createNewShapeStyle()

ShapeStyle * Visualization::Shape::createNewShapeStyle ( const QString &  shapeName)
static

◆ height()

int Visualization::Shape::height ( ) const
inlineprotected

◆ innerSize() [1/2]

QSize Visualization::Shape::innerSize ( int  outerWidth,
int  outerHeight 
) const
inline

◆ innerSize() [2/2]

QSize Visualization::Shape::innerSize ( QSize  outerSize) const
virtual

◆ itemStyles()

StyleSet< Shape > & Visualization::Shape::itemStyles ( )
static

◆ makeDefaultShape()

template<typename Base , typename Actual >
Base * Visualization::Shape::makeDefaultShape ( Item parent)
inlinestaticprivate

◆ makeDefaultStyle()

template<typename Base , typename Actual >
Base * Visualization::Shape::makeDefaultStyle
inlinestaticprivate

◆ outerSize() [1/2]

QSize Visualization::Shape::outerSize ( int  innerWidth,
int  innerHeight 
) const
inline

◆ outerSize() [2/2]

QSize Visualization::Shape::outerSize ( QSize  innerSize) const
virtual

◆ paint()

virtual void Visualization::Shape::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
pure virtual

◆ parentItem()

Item * Visualization::Shape::parentItem ( ) const
inlineprotected

◆ registerShape()

template<typename ShapeClass >
void Visualization::Shape::registerShape
inlinestatic

◆ setInnerSize()

void Visualization::Shape::setInnerSize ( int  width,
int  height 
)

◆ setItemSize()

void Visualization::Shape::setItemSize ( int  width,
int  height 
)
protected

◆ setOffset()

void Visualization::Shape::setOffset ( int  x,
int  y 
)

◆ setOuterSize()

void Visualization::Shape::setOuterSize ( int  width,
int  height 
)

◆ setParentNeedsUpdate()

void Visualization::Shape::setParentNeedsUpdate ( )
protected

◆ setStyle()

void Visualization::Shape::setStyle ( const Visualization::ShapeStyle style)
virtual

◆ sizeSpecified()

Shape::SizeType Visualization::Shape::sizeSpecified ( ) const
inlineprotected

◆ style()

const Shape::StyleType * Visualization::Shape::style ( ) const
inline

◆ update()

virtual void Visualization::Shape::update ( )
protectedpure virtual

◆ width()

int Visualization::Shape::width ( ) const
inlineprotected

◆ xOffset()

int Visualization::Shape::xOffset ( ) const
inlineprotected

◆ yOffset()

int Visualization::Shape::yOffset ( ) const
inlineprotected

Member Data Documentation

◆ height_

int Visualization::Shape::height_ {}
private

◆ parent_

Item* Visualization::Shape::parent_ {}
private

◆ shapeConstructors

QMap< QString, Shape::ShapeConstructor > Visualization::Shape::shapeConstructors
staticprivate

◆ shapeStyleConstructors

QMap< QString, Shape::ShapeStyleConstructor > Visualization::Shape::shapeStyleConstructors
staticprivate

◆ sizeToUse

SizeType Visualization::Shape::sizeToUse {}
private

◆ style_

const ShapeStyle* Visualization::Shape::style_ {}
private

◆ width_

int Visualization::Shape::width_ {}
private

◆ xOffset_

int Visualization::Shape::xOffset_ {}
private

◆ yOffset_

int Visualization::Shape::yOffset_ {}
private