Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CDrawLogicsElements Class Reference

#include <CDrawLogicsElements.hpp>

Public Types

enum class  EMainShape {
  Circle , Ellipse , Path , Rectangle ,
  Square , Without
}
 
enum class  EDrawProperty { FillColor , Font , LineDash , StrokeColor }
 
using graphics_t = CGraphicsGooCanvas
 
typedef std::tuple< iv::logic::eLogicsElementType, iv::logic::eGeneralType, iv::types::logic::componentTypeTTupleElementType
 
typedef std::pair< EDrawProperty, std::string > TPairDrawPropertyValue
 
typedef std::set< TPairDrawPropertyValueTSetDrawProperties
 
typedef std::map< AbstractLogicsElement::TPairIndexPartType, TSetDrawPropertiesTMapPartTypeDrawProperties
 
typedef std::map< AbstractCanvasItem::TTupleDrawingMode, TMapPartTypeDrawPropertiesTMapDrawingModePartsDrawProperties
 

Public Member Functions

 CDrawLogicsElements ()=delete
 
 ~CDrawLogicsElements ()=delete
 
 CDrawLogicsElements (const CDrawLogicsElements &other)=delete
 
 CDrawLogicsElements (CDrawLogicsElements &&other)=delete
 
CDrawLogicsElementsoperator= (const CDrawLogicsElements &other)=delete
 
CDrawLogicsElementsoperator= (CDrawLogicsElements &&other)=delete
 

Static Public Member Functions

static TSetDrawProperties propertiesLogicElementsDefault (const TTupleElementType &elementType, AbstractLogicsElement::EPartType partType)
 
static TSetDrawProperties propertiesLogicElementsSelected (const TTupleElementType &elementType, AbstractLogicsElement::EPartType partType)
 
static TSetDrawProperties propertiesLogicElementsHighlightedDefault (const TTupleElementType &elementType, AbstractLogicsElement::EPartType partType)
 
static TSetDrawProperties propertiesLogicElementsHighlightedSelected (const TTupleElementType &elementType, AbstractLogicsElement::EPartType partType)
 
static TSetDrawProperties propertiesLogicElementsWarningDefault (const TTupleElementType &elementType, AbstractLogicsElement::EPartType partType)
 
static TSetDrawProperties propertiesLogicElementsWarningSelected (const TTupleElementType &elementType, AbstractLogicsElement::EPartType partType)
 
static double defaultElementHeight (const TTupleElementType &elementType)
 
static double defaultElementWidth (const TTupleElementType &elementType)
 
static void drawBackground (const std::shared_ptr< AbstractLogicsElement > &logicsElement, IGraphics *graphics)
 
static void drawConnection (const std::shared_ptr< AbstractLogicsElement > &logicsElement, IGraphics *graphics)
 
static void drawElement (const std::shared_ptr< AbstractLogicsElement > &logicsElement, const std::string &lCName, IGraphics *graphics, bool isGrabbed, bool startDragging)
 
static const TMapPartTypeDrawPropertiesdrawingModeProperties (const TTupleElementType &elementType, const AbstractCanvasItem::TTupleDrawingMode &drawingMode)
 
static AbstractCanvasItem::TPosition2d elementCenter (const std::shared_ptr< AbstractLogicsElement > &logicsElement)
 
static double elementHeight (const std::shared_ptr< AbstractLogicsElement > &logicsElement)
 
static double elementWidth (const std::shared_ptr< AbstractLogicsElement > &logicsElement)
 
static TTupleElementType elementType (const std::shared_ptr< AbstractLogicsElement > &logicsElement)
 
static TTupleElementType elementType (const AbstractLogicsElement *logicsElement)
 
static void eraseElement (const std::shared_ptr< AbstractLogicsElement > &logicsElement, IGraphics *graphics)
 
static graphics_tgraphicsTypeUsed (IGraphics *graphics)
 
static EMainShapemainShape (const TTupleElementType &elementType)
 
static const AbstractLogicsElement::TMapIndexPartTypeparts (const TTupleElementType &elementType)
 
static std::string strDrawProperty (EDrawProperty drawProperty)
 

Static Public Attributes

static const double kAverageTextHeight = 15.
 
static const double kMainTextHeight = 8.
 
static const double kSubText1Height = 8.
 
static const double kSubText2Height = 8.
 
static const double kSubText3Height = 8.
 
static const double kConnectionPointSize = 10.
 
static const double kComponentPadding = 4.
 
static const double kComponentCharacterWidth = 7.
 
static const double kComponentMinimumHeight = 15.
 
static const double kComponentMinimumWidth = 20.
 

Detailed Description

Class collecting a number of static methods that draw elements and shapes regarding the logic editor.

It will use CGraphicsGooCanvas, since it provides methods to draw with more options.

NOTE: we consider a logic component (for instance AND and OR gates) a subclass of a logic element (background, component, connection,...)

Member Typedef Documentation

◆ graphics_t

◆ TMapDrawingModePartsDrawProperties

◆ TMapPartTypeDrawProperties

◆ TPairDrawPropertyValue

◆ TSetDrawProperties

◆ TTupleElementType

Member Enumeration Documentation

◆ EDrawProperty

Enumeration for the properties that define the way a canvas item can be drawn.

Enumerator
FillColor 
Font 
LineDash 
StrokeColor 

◆ EMainShape

Enumeration defining the possible main shapes of a logic element.

Enumerator
Circle 
Ellipse 
Path 
Rectangle 
Square 
Without 

Constructor & Destructor Documentation

◆ CDrawLogicsElements() [1/3]

CDrawLogicsElements::CDrawLogicsElements ( )
delete

◆ ~CDrawLogicsElements()

CDrawLogicsElements::~CDrawLogicsElements ( )
delete

◆ CDrawLogicsElements() [2/3]

CDrawLogicsElements::CDrawLogicsElements ( const CDrawLogicsElements & other)
delete

◆ CDrawLogicsElements() [3/3]

CDrawLogicsElements::CDrawLogicsElements ( CDrawLogicsElements && other)
delete

Member Function Documentation

◆ defaultElementHeight()

double CDrawLogicsElements::defaultElementHeight ( const TTupleElementType & elementType)
static

◆ defaultElementWidth()

double CDrawLogicsElements::defaultElementWidth ( const TTupleElementType & elementType)
static

◆ drawBackground()

void CDrawLogicsElements::drawBackground ( const std::shared_ptr< AbstractLogicsElement > & logicsElement,
IGraphics * graphics )
static

◆ drawConnection()

void CDrawLogicsElements::drawConnection ( const std::shared_ptr< AbstractLogicsElement > & logicsElement,
IGraphics * graphics )
static

CDrawLogicsElements::drawConnection

Draws an element of type connection, and rises its connection points above it.

◆ drawElement()

void CDrawLogicsElements::drawElement ( const std::shared_ptr< AbstractLogicsElement > & logicsElement,
const std::string & lCName,
IGraphics * graphics,
bool isGrabbed,
bool startDragging )
static

CDrawLogicsElements::drawElement

Draws an element in the canvas depending on its state.

Parameters
[in]logicsElementElement to draw.
[in]lCNameLogic element's name to show.
[in]graphicsIGraphics to use to draw the element in the canvas.
[in]isGrabbedIndicates whether the element is grabbed or not.
[in]startDraggingIndicates whether it is the beginning of the dragging or not.

◆ drawingModeProperties()

const CDrawLogicsElements::TMapPartTypeDrawProperties & CDrawLogicsElements::drawingModeProperties ( const TTupleElementType & elementType,
const AbstractCanvasItem::TTupleDrawingMode & drawingMode )
static

◆ elementCenter()

AbstractCanvasItem::TPosition2d CDrawLogicsElements::elementCenter ( const std::shared_ptr< AbstractLogicsElement > & logicsElement)
static

◆ elementHeight()

double CDrawLogicsElements::elementHeight ( const std::shared_ptr< AbstractLogicsElement > & logicsElement)
static

◆ elementType() [1/2]

CDrawLogicsElements::TTupleElementType CDrawLogicsElements::elementType ( const AbstractLogicsElement * logicsElement)
static

◆ elementType() [2/2]

CDrawLogicsElements::TTupleElementType CDrawLogicsElements::elementType ( const std::shared_ptr< AbstractLogicsElement > & logicsElement)
static

◆ elementWidth()

double CDrawLogicsElements::elementWidth ( const std::shared_ptr< AbstractLogicsElement > & logicsElement)
static

◆ eraseElement()

void CDrawLogicsElements::eraseElement ( const std::shared_ptr< AbstractLogicsElement > & logicsElement,
IGraphics * graphics )
static

CDrawLogicsElements::eraseComponent

Erases a component from the canvas.

Parameters
[in]logicsElementElement to erase.
[in]graphicsIGraphics to use to erase the connection from the canvas.

◆ graphicsTypeUsed()

CDrawLogicsElements::graphics_t * CDrawLogicsElements::graphicsTypeUsed ( IGraphics * graphics)
static

◆ mainShape()

CDrawLogicsElements::EMainShape & CDrawLogicsElements::mainShape ( const TTupleElementType & elementType)
static

◆ operator=() [1/2]

CDrawLogicsElements & CDrawLogicsElements::operator= ( CDrawLogicsElements && other)
delete

◆ operator=() [2/2]

CDrawLogicsElements & CDrawLogicsElements::operator= ( const CDrawLogicsElements & other)
delete

◆ parts()

const AbstractLogicsElement::TMapIndexPartType & CDrawLogicsElements::parts ( const TTupleElementType & elementType)
static

◆ propertiesLogicElementsDefault()

CDrawLogicsElements::TSetDrawProperties CDrawLogicsElements::propertiesLogicElementsDefault ( const TTupleElementType & elementType,
AbstractLogicsElement::EPartType partType )
static

◆ propertiesLogicElementsHighlightedDefault()

CDrawLogicsElements::TSetDrawProperties CDrawLogicsElements::propertiesLogicElementsHighlightedDefault ( const TTupleElementType & elementType,
AbstractLogicsElement::EPartType partType )
static

◆ propertiesLogicElementsHighlightedSelected()

CDrawLogicsElements::TSetDrawProperties CDrawLogicsElements::propertiesLogicElementsHighlightedSelected ( const TTupleElementType & elementType,
AbstractLogicsElement::EPartType partType )
static

◆ propertiesLogicElementsSelected()

CDrawLogicsElements::TSetDrawProperties CDrawLogicsElements::propertiesLogicElementsSelected ( const TTupleElementType & elementType,
AbstractLogicsElement::EPartType partType )
static

◆ propertiesLogicElementsWarningDefault()

CDrawLogicsElements::TSetDrawProperties CDrawLogicsElements::propertiesLogicElementsWarningDefault ( const TTupleElementType & elementType,
AbstractLogicsElement::EPartType partType )
static

◆ propertiesLogicElementsWarningSelected()

CDrawLogicsElements::TSetDrawProperties CDrawLogicsElements::propertiesLogicElementsWarningSelected ( const TTupleElementType & elementType,
AbstractLogicsElement::EPartType partType )
static

◆ strDrawProperty()

std::string CDrawLogicsElements::strDrawProperty ( EDrawProperty drawProperty)
static

Member Data Documentation

◆ kAverageTextHeight

const double CDrawLogicsElements::kAverageTextHeight = 15.
inlinestatic

◆ kComponentCharacterWidth

const double CDrawLogicsElements::kComponentCharacterWidth = 7.
inlinestatic

◆ kComponentMinimumHeight

const double CDrawLogicsElements::kComponentMinimumHeight = 15.
inlinestatic

◆ kComponentMinimumWidth

const double CDrawLogicsElements::kComponentMinimumWidth = 20.
inlinestatic

◆ kComponentPadding

const double CDrawLogicsElements::kComponentPadding = 4.
inlinestatic

◆ kConnectionPointSize

const double CDrawLogicsElements::kConnectionPointSize = 10.
inlinestatic

◆ kMainTextHeight

const double CDrawLogicsElements::kMainTextHeight = 8.
inlinestatic

◆ kSubText1Height

const double CDrawLogicsElements::kSubText1Height = 8.
inlinestatic

◆ kSubText2Height

const double CDrawLogicsElements::kSubText2Height = 8.
inlinestatic

◆ kSubText3Height

const double CDrawLogicsElements::kSubText3Height = 8.
inlinestatic

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