#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_LineList & | operator= (GLViewer_LineList) |
Private Attributes | |
double * | myArray |
int | myRealSize |
int | mySegmentNumber |
double | myMainCoord |
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
GLViewer_LineList::GLViewer_LineList | ( | int | size | ) |
Constructor
size | - size of internal array |
References myArray, myMainCoord, myRealSize, mySegmentNumber, and size().
|
virtual |
Destructor
References myArray.
bool GLViewer_LineList::addSegment | ( | double | coord1, |
double | coord2 | ||
) |
Adds new line segment to list
coord1,coord2 | - co-ordinates of points |
References myArray, myRealSize, mySegmentNumber, and readSegment().
void GLViewer_LineList::clear | ( | ) |
Clears line list
References myArray, and myRealSize.
int GLViewer_LineList::contains | ( | double | thePoint | ) | const |
thePoint | - point co-ordinate |
References myArray, and mySegmentNumber.
|
inline |
References mySegmentNumber.
|
inline |
References myMainCoord.
GLViewer_LineList& GLViewer_LineList::operator= | ( | GLViewer_LineList | ) |
void GLViewer_LineList::print | ( | ) |
Prints debug info about line list
References myArray, myMainCoord, myRealSize, and mySegmentNumber.
bool GLViewer_LineList::readSegment | ( | int | theIndex, |
double & | coord1, | ||
double & | coord2 | ||
) |
Gets info about segment
theIndex | - index of segment |
coord1,coord2 | - co-ordinates of points |
References myArray, and mySegmentNumber.
bool GLViewer_LineList::removeSegment | ( | int | theIndex | ) |
bool GLViewer_LineList::removeSegment | ( | double | coord1, |
double | coord2 | ||
) |
Removes segment from line list
coord1,coord2 | - co-ordinates of points |
References myArray, myRealSize, mySegmentNumber, and readSegment().
|
inline |
References myMainCoord.
void GLViewer_LineList::show | ( | FieldDim | theDim | ) |
Draws line list with help of OpenGL
theDim | - dimension |
References FD_X, FD_Y, myArray, myMainCoord, and mySegmentNumber.
|
inline |
References myRealSize.
|
private |
|
private |
|
private |
|
private |