Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | List of all members
Segment Class Reference

Selectable piecewise-defined line that follows a filtered line in the image. More...

#include <Segment.h>

Inheritance diagram for Segment:

Public Slots

void slotHover (bool hover)
 Slot for hover enter/leave events in the associated SegmentLines.
 

Signals

void signalMouseClickOnSegment (QPointF posSegmentStart)
 Pass mouse press event, with coordinates of first point in the Segment since that info uniquely identifies the owning Segment.
 

Public Member Functions

 Segment (QGraphicsScene &scene, int yLast, bool isGnuplot)
 Single constructor.
 
void appendColumn (int x, int y, const DocumentModelSegments &modelSegments)
 Add some more pixels in a new column to an active segment.
 
QList< QPoint > fillPoints (const DocumentModelSegments &modelSegments)
 Create evenly spaced points along the segment.
 
QPointF firstPoint () const
 Coordinates of first point in Segment.
 
void forwardMousePress ()
 Forward mouse press event from a component SegmentLine that was just clicked on.
 
double length () const
 Get method for length in pixels.
 
int lineCount () const
 Get method for number of lines.
 
void removeUnneededLines (int *foldedLines)
 Try to compress a segment that was just completed, by folding together line from point i to point i+1, with the line from i+1 to i+2, then the line from i+2 to i+3, until one of the points is more than a half pixel from the folded line.
 
void updateModelSegment (const DocumentModelSegments &modelSegments)
 Update this segment given the new settings.
 

Detailed Description

Selectable piecewise-defined line that follows a filtered line in the image.

Clicking on a Segment results in the immediate creation of multiple Points along that Segment.

Definition at line 21 of file Segment.h.

Constructor & Destructor Documentation

◆ Segment()

Segment::Segment ( QGraphicsScene &  scene,
int  yLast,
bool  isGnuplot 
)

Single constructor.

Definition at line 21 of file Segment.cpp.

◆ ~Segment()

Segment::~Segment ( )

Definition at line 32 of file Segment.cpp.

Member Function Documentation

◆ appendColumn()

void Segment::appendColumn ( int  x,
int  y,
const DocumentModelSegments modelSegments 
)

Add some more pixels in a new column to an active segment.

Definition at line 45 of file Segment.cpp.

◆ fillPoints()

QList< QPoint > Segment::fillPoints ( const DocumentModelSegments modelSegments)

Create evenly spaced points along the segment.

Definition at line 208 of file Segment.cpp.

◆ firstPoint()

QPointF Segment::firstPoint ( ) const

Coordinates of first point in Segment.

This info can be used to uniquely identify a Segment. This method relies on SegmentFactory::removeEmptySegments to guarantee every Segment has at least one line

Definition at line 284 of file Segment.cpp.

◆ forwardMousePress()

void Segment::forwardMousePress ( )

Forward mouse press event from a component SegmentLine that was just clicked on.

Definition at line 301 of file Segment.cpp.

◆ length()

double Segment::length ( ) const

Get method for length in pixels.

Definition at line 378 of file Segment.cpp.

◆ lineCount()

int Segment::lineCount ( ) const

Get method for number of lines.

Definition at line 383 of file Segment.cpp.

◆ removeUnneededLines()

void Segment::removeUnneededLines ( int *  foldedLines)

Try to compress a segment that was just completed, by folding together line from point i to point i+1, with the line from i+1 to i+2, then the line from i+2 to i+3, until one of the points is more than a half pixel from the folded line.

this should save memory and improve user interface responsiveness

Definition at line 419 of file Segment.cpp.

◆ slotHover

void Segment::slotHover ( bool  hover)
slot

Slot for hover enter/leave events in the associated SegmentLines.

Definition at line 525 of file Segment.cpp.

◆ updateModelSegment()

void Segment::updateModelSegment ( const DocumentModelSegments modelSegments)

Update this segment given the new settings.

Definition at line 537 of file Segment.cpp.


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