Engauge Digitizer 2
Loading...
Searching...
No Matches
GuidelineFactory Class Reference

Factory for generating Guideline objects. More...

#include <GuidelineFactory.h>

Collaboration diagram for GuidelineFactory:
Collaboration graph

Public Member Functions

 GuidelineFactory (GraphicsScene *sceneMain)
 Single constructor.
virtual ~GuidelineFactory ()
GuidelineAbstractcreateGuideline (Guidelines &guidelines, GuidelineState stateInitial, MainWindow &mainWindow, const QString &identifier)

Detailed Description

Factory for generating Guideline objects.

The complications are:

  1. Some guidelines are lines (GuidelineLine) and some are ellipses (GuidelineEllipse)
  2. Guidelines are either horizontal (X or theta T) or vertical (Y or range R)

Definition at line 26 of file GuidelineFactory.h.

Constructor & Destructor Documentation

◆ GuidelineFactory()

GuidelineFactory::GuidelineFactory ( GraphicsScene * sceneMain)

Single constructor.

Definition at line 17 of file GuidelineFactory.cpp.

17 :
18 m_sceneMain (sceneMain)
19{
20 createEllipseMap ();
21}

◆ ~GuidelineFactory()

GuidelineFactory::~GuidelineFactory ( )
virtual

Definition at line 23 of file GuidelineFactory.cpp.

24{
25}

Member Function Documentation

◆ createGuideline()

GuidelineAbstract * GuidelineFactory::createGuideline ( Guidelines & guidelines,
GuidelineState stateInitial,
MainWindow & mainWindow,
const QString & identifier )

Definition at line 27 of file GuidelineFactory.cpp.

31{
32 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineFactory::createGuideline identifier="
33 << identifier.toLatin1().data();
34
35 // Main scene or one of the guideline scenes?
36 QGraphicsScene *scene = m_sceneMain;
37
38 // Line or ellipse?
39 GuidelineAbstract *guideline = nullptr;
40
41 if (m_mapStatesWithEllipse.contains (stateInitial)) {
42
43 guideline = new GuidelineEllipse (*scene,
44 mainWindow,
45 guidelines,
46 stateInitial,
47 identifier);
48
49 } else {
50
51 guideline = new GuidelineLine (*scene,
52 mainWindow,
53 guidelines,
54 stateInitial,
55 identifier);
56 }
57
58 QObject::connect (guideline, SIGNAL (signalGuidelineDragged (QString, double, bool, GuidelineState)),
59 &mainWindow, SLOT (slotGuidelineDragged (QString, double, bool, GuidelineState)));
60
61 return guideline;
62}
GuidelineState
Set of possible Guideline states. See class Guideline for more information.
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

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