Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Txq2dPolygon Class Reference

A Txq2dPolygon is a TxqDrawable object that is a comprised of a number of lines that make a polygon This polygon can be outlined or filled. More...

#include <Txq2dPolygon.h>

Inheritance diagram for Txq2dPolygon::

Txq2dOutlined Txq2dSegmented Txq2dSeg Txq2dDrawable TxqDrawable List of all members.

Public Methods

 Txq2dPolygon ()
 This constructor is default. More...

 Txq2dPolygon (const std::vector< int > &xpoints, const std::vector< int > &ypoints)
 Constructs a Txq2dPolygon with the points xpoints[i], ypoints[i] as the vertices. More...

 Txq2dPolygon (const std::vector< double > &xpoints, const std::vector< double > &ypoints)
 Constructs a Txq2dPolygon with the points xpoints[i], ypoints[i] as the vertices. More...

 Txq2dPolygon (const std::vector< QPoint > &points)
 Constructs a Txq2dPolygon with the points points[i].x(), points[i].y() as the vertices. More...

virtual ~Txq2dPolygon ()
 destructor. More...

void resetSegments ()
 Resets the segments vector. More...

void makePolygon (int cx, int cy)
 Makes a polygon suitable for drawing with drawPolygon. More...

void updatePolarArrays ()
 Updates the polar arrays of the Txq2dPolygon from the x and y arrays of the Polygon and the current center point. More...

void addPoint (int x, int y)
 Appends a point to the (r,theta) array and to the Polygon of Txq2dPolygon. More...

void addPoint (double x, double y)
 Appends a point to the (r,theta) array and to the Polygon of Txq2dPolygon. More...

void setPoints (int x1, int y1, int x2, int y2)
 Appends the points x1,y1, x2,y2 to the Polygon of Txq2dPolygon. More...

void setPoints (double x1, double y1, double x2, double y2)
 Appends the points x1,y1, x2,y2 to the Polygon of Txq2dPolygon. More...

void setPoints (QPoint p1, QPoint p2)
 Appends the points p1.x, p1,y, p2.x, p2.y to the Polygon of Txq2dPolygon. More...

void setPoints (const std::vector< int > &xpoints, const std::vector< int > &ypoints)
 Appends the points x[i], y[i] to the Polygon of Txq2dPolygon. More...

void setPoints (const std::vector< double > &xpoints, const std::vector< double > &ypoints)
 Appends the points x[i], y[i] to the Polygon of Txq2dPolygon. More...

void setPoints (const std::vector< QPoint > &points)
 Appends the points p.x[i], p.y[i] to the Polygon of Txq2dPolygon. More...

void clearPoints ()
 Clears the polygon be creating a new one. More...

void rotate (double delta)
 Rotates the Polygon of Txq2dPolygon. More...

void paint (QPainter *g)
 Paints the polygon with fillPolygon() if it is set to be filled and drawPolygon() if it is set to be outlined. More...

void drawPolygon (QPainter *g)
 Draw the polygon line by line. More...


Protected Methods

void initialize ()
 Initialize the class data members. More...

void dump (QTextStream *ts)
 Dump the object contents to the text stream ts. More...


Private Attributes

Polygon polygon
 The polygon. More...


Detailed Description

A Txq2dPolygon is a TxqDrawable object that is a comprised of a number of lines that make a polygon This polygon can be outlined or filled.

Copyright 2000 by Tech-X Corporation

Author:
Kelly G. Luetkemeyer

Version:
Id:
Txq2dPolygon.h,v 1.5 2002/01/17 19:29:21 kgl Exp

Definition at line 39 of file Txq2dPolygon.h.


Constructor & Destructor Documentation

Txq2dPolygon::Txq2dPolygon ( )
 

This constructor is default.

Txq2dPolygon::Txq2dPolygon ( const std::vector< int > & xpoints,
const std::vector< int > & ypoints )
 

Constructs a Txq2dPolygon with the points xpoints[i], ypoints[i] as the vertices.

Parameters:
xpoints   the vector of x integer xpoints
ypoints   the vector of y integer ypoints

Txq2dPolygon::Txq2dPolygon ( const std::vector< double > & xpoints,
const std::vector< double > & ypoints )
 

Constructs a Txq2dPolygon with the points xpoints[i], ypoints[i] as the vertices.

Parameters:
xpoints   the vector of x double xpoints
ypoints   the vector of y double ypoints

Txq2dPolygon::Txq2dPolygon ( const std::vector< QPoint > & points )
 

Constructs a Txq2dPolygon with the points points[i].x(), points[i].y() as the vertices.

Parameters:
points   the vector of points

Txq2dPolygon::~Txq2dPolygon ( ) [virtual]
 

destructor.


Member Function Documentation

void Txq2dPolygon::addPoint ( double x,
double y )
 

Appends a point to the (r,theta) array and to the Polygon of Txq2dPolygon.

Parameters:
x   the x coordinate of the point
y   the y coordinate of the point

void Txq2dPolygon::addPoint ( int x,
int y )
 

Appends a point to the (r,theta) array and to the Polygon of Txq2dPolygon.

Parameters:
x   the x coordinate of the point
y   the y coordinate of the point

void Txq2dPolygon::clearPoints ( )
 

Clears the polygon be creating a new one.

void Txq2dPolygon::drawPolygon ( QPainter * g )
 

Draw the polygon line by line.

Parameters:
g   the paint device

void Txq2dPolygon::dump ( QTextStream * ts ) [protected, virtual]
 

Dump the object contents to the text stream ts.

Parameters:
ts   the text stream to use

Reimplemented from TxqDrawable.

void Txq2dPolygon::initialize ( ) [protected, virtual]
 

Initialize the class data members.

Reimplemented from TxqDrawable.

void Txq2dPolygon::makePolygon ( int cx,
int cy )
 

Makes a polygon suitable for drawing with drawPolygon.

The params must be in screen coordinates!

Parameters:
cx   the x center point
cy   the y center point

void Txq2dPolygon::paint ( QPainter * g ) [virtual]
 

Paints the polygon with fillPolygon() if it is set to be filled and drawPolygon() if it is set to be outlined.

Parameters:
g   the paint device

Reimplemented from Txq2dSegmented.

void Txq2dPolygon::resetSegments ( )
 

Resets the segments vector.

void Txq2dPolygon::rotate ( double delta ) [virtual]
 

Rotates the Polygon of Txq2dPolygon.

Reimplemented from TxqDrawable.

void Txq2dPolygon::setPoints ( const std::vector< QPoint > & points )
 

Appends the points p.x[i], p.y[i] to the Polygon of Txq2dPolygon.

Parameters:
points   the vector of points

void Txq2dPolygon::setPoints ( const std::vector< double > & xpoints,
const std::vector< double > & ypoints )
 

Appends the points x[i], y[i] to the Polygon of Txq2dPolygon.

Parameters:
xpoints   the vector of x double xpoints
ypoints   the vector of y double ypoints

void Txq2dPolygon::setPoints ( const std::vector< int > & xpoints,
const std::vector< int > & ypoints )
 

Appends the points x[i], y[i] to the Polygon of Txq2dPolygon.

Parameters:
xpoints   the vector of x integer xpoints
ypoints   the vector of y integer ypoints

void Txq2dPolygon::setPoints ( QPoint p1,
QPoint p2 )
 

Appends the points p1.x, p1,y, p2.x, p2.y to the Polygon of Txq2dPolygon.

Parameters:
p2   the x,y coordinate of the first point
p2   the x,y coordinate of the second point

void Txq2dPolygon::setPoints ( double x1,
double y1,
double x2,
double y2 )
 

Appends the points x1,y1, x2,y2 to the Polygon of Txq2dPolygon.

Parameters:
x1   the x coordinate of the first point
y1   the y coordinate of the first point
x2   the x coordinate of the second point
y2   the y coordinate of the second point

void Txq2dPolygon::setPoints ( int x1,
int y1,
int x2,
int y2 )
 

Appends the points x1,y1, x2,y2 to the Polygon of Txq2dPolygon.

Parameters:
x1   the x coordinate of the first point
y1   the y coordinate of the first point
x2   the x coordinate of the second point
y2   the y coordinate of the second point

void Txq2dPolygon::updatePolarArrays ( )
 

Updates the polar arrays of the Txq2dPolygon from the x and y arrays of the Polygon and the current center point.


Member Data Documentation

Polygon Txq2dPolygon::polygon [private]
 

The polygon.

Definition at line 221 of file Txq2dPolygon.h.


The documentation for this class was generated from the following file: Copyright Tech-X Corporation, all rights reserved.