Version: 9.12.0
GLViewer_LineList Class Reference

#include <GLViewer_Tools.h>

Public Member Functions

 GLViewer_LineList (int)
 
virtual ~GLViewer_LineList ()
 
int count () const
 Returns number of segments. More...
 
int size () const
 Returns real size. More...
 
bool addSegment (double coord1, double coord2)
 
bool removeSegment (int index)
 
bool removeSegment (double coord1, double coord2)
 
bool readSegment (int index, double &coord1, double &coord2)
 
int contains (double thePoint) const
 Returns index of segment, else -1. More...
 
void setMainCoord (double theVal)
 Sets level of segments. More...
 
double mainCoord () const
 
void clear ()
 
void print ()
 
void show (FieldDim)
 
GLViewer_LineListoperator= (GLViewer_LineList)
 

Private Attributes

double * myArray
 
int myRealSize
 
int mySegmentNumber
 
double myMainCoord
 

Detailed Description

Tools for distinct line This class implmented interface for segment operations: add, cut, remove and etc. Memory does not changed and allocated only one time

Constructor & Destructor Documentation

◆ GLViewer_LineList()

GLViewer_LineList::GLViewer_LineList ( int  size)

Constructor

Parameters
size- size of internal array

References myArray, myMainCoord, myRealSize, mySegmentNumber, and size().

◆ ~GLViewer_LineList()

GLViewer_LineList::~GLViewer_LineList ( )
virtual

Destructor

References myArray.

Member Function Documentation

◆ addSegment()

bool GLViewer_LineList::addSegment ( double  coord1,
double  coord2 
)

Adds new line segment to list

Parameters
coord1,coord2- co-ordinates of points

References myArray, myRealSize, mySegmentNumber, and readSegment().

◆ clear()

void GLViewer_LineList::clear ( )

Clears line list

References myArray, and myRealSize.

◆ contains()

int GLViewer_LineList::contains ( double  thePoint) const

Returns index of segment, else -1.

Returns
true if line list covers point
Parameters
thePoint- point co-ordinate

References myArray, and mySegmentNumber.

◆ count()

int GLViewer_LineList::count ( ) const
inline

Returns number of segments.

References mySegmentNumber.

◆ mainCoord()

double GLViewer_LineList::mainCoord ( ) const
inline

References myMainCoord.

◆ operator=()

GLViewer_LineList& GLViewer_LineList::operator= ( GLViewer_LineList  )

◆ print()

void GLViewer_LineList::print ( )

Prints debug info about line list

References myArray, myMainCoord, myRealSize, and mySegmentNumber.

◆ readSegment()

bool GLViewer_LineList::readSegment ( int  theIndex,
double &  coord1,
double &  coord2 
)

Gets info about segment

Parameters
theIndex- index of segment
coord1,coord2- co-ordinates of points

References myArray, and mySegmentNumber.

◆ removeSegment() [1/2]

bool GLViewer_LineList::removeSegment ( double  coord1,
double  coord2 
)

Removes segment from line list

Parameters
coord1,coord2- co-ordinates of points

References myArray, myRealSize, mySegmentNumber, and readSegment().

◆ removeSegment() [2/2]

bool GLViewer_LineList::removeSegment ( int  theIndex)

Removes segment

Parameters
theIndex- segment index

References myArray, and mySegmentNumber.

◆ setMainCoord()

void GLViewer_LineList::setMainCoord ( double  theVal)
inline

Sets level of segments.

References myMainCoord.

◆ show()

void GLViewer_LineList::show ( FieldDim  theDim)

Draws line list with help of OpenGL

Parameters
theDim- dimension

References FD_X, FD_Y, myArray, myMainCoord, and mySegmentNumber.

◆ size()

int GLViewer_LineList::size ( ) const
inline

Returns real size.

References myRealSize.

Member Data Documentation

◆ myArray

double* GLViewer_LineList::myArray
private

◆ myMainCoord

double GLViewer_LineList::myMainCoord
private

◆ myRealSize

int GLViewer_LineList::myRealSize
private

◆ mySegmentNumber

int GLViewer_LineList::mySegmentNumber
private

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