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

QSDrv Class Reference

Abstract extedned graphic driver. More...

#include <qsdrv.h>

Inheritance diagram for QSDrv:

Inheritance graph
[legend]
List of all members.

Public Types

enum  CNormals { VertexNormals, MeshNormal, NoNormals }
enum  CColors { VertexColors, MeshColor }
enum  COrdering { FurtherFirst, NearerFirst, NoOrdering }

Public Methods

 QSDrv ()
virtual ~QSDrv ()
virtual QSDrv * copy ()=0
void copySettingsFrom (const QSDrv *drv)
virtual void setProjection (const QSProjection *t)
const QSProjectionprojection () const
virtual void startDrawing ()
virtual void stopDrawing ()
virtual void setClipping (bool enabled)
bool clipping () const
virtual void setCurrentElement (int category, int element)
int currentElement () const
int currentCategory () const
virtual void setTopBottom (bool enabled)
bool topBottom () const
virtual void setBottomFill (const QSGFill &fill)
QSGFill bottomFill () const
virtual CNormals cNormals () const
virtual CColors cColors () const
virtual COrdering cOrdering () const
virtual void clearCanvas (const QSGFill &f, const QSPt2f &pos, const QSPt2f &size)
virtual void drawLine2 (const QSPt2f &one, const QSPt2f &two)
virtual void drawRect2 (const QSPt2f &p1, const QSPt2f &p2)
virtual void drawPoly2 (const QSPt2f pts[], int npoints, const bool edges[]=NULL, int edgeAutoColor=0)
virtual void drawEllipse2 (const QSPt2f &p1, const QSPt2f &p2)
virtual void drawText2 (const QSPt2f &pos, const QString &text, int align=AlignLeft|AlignBottom)
virtual void drawRText2 (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)
virtual void drawRTextBox2 (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)
virtual void drawPoint2 (const QSPt2f &pos, const QSGPoint &style)
virtual void drawDart2 (const QSPt2f &pos, double angle, const QSGArrow &style)
virtual void drawArrow2 (const QSPt2f &p1, const QSPt2f &p2, const QSGArrow &p1style, const QSGArrow &p2style)
virtual void beginPolyline2 (const QSPt2f &pos)
virtual void setPolylineLabelPlace2 (const QString &label, const QSPt2f &label_place, int label_angle)
virtual void drawPolylineTo2 (const QSPt2f &pos)
virtual void endPolyline2 ()
virtual QSPt2f currPolylinePos2 ()
virtual void drawPoly3 (const QSPt3f pts[], int npoints, const QSPt3f *norm, const QSGFill *colors, const bool edges[]=NULL, int edgeAutoColor=0)
virtual void drawLine3 (const QSPt3f &begin, const QSPt3f &end, const QSPt3f norm[2])
virtual void drawText3 (const QSPt3f &pos, const QString &text, int align=AlignLeft|AlignBottom)
virtual void drawPoint3 (const QSPt3f &pos, const QSGPoint &point)

Protected Methods

QSProjection::ClipResult clip_poly (const QSPt2f *pts, int npoints, const bool edges[])
QSProjection::ClipResult clip_poly (const QSPt3f *pts, int npoints, const bool edges[])
void map_to_screen (const QSPt2f *pts, int npoints)
void map_to_screen (const QSPt3f *pts, int npoints)

Protected Attributes

int m_element
int m_category
bool m_top_bottom
QSGFill m_bottom_fill
const QSProjectionm_t
bool m_clipping
QSPt2f m_curr_polyline_pos
QSPt2fm_cpts2
int m_ncpts2
int m_max_cpts2
QSPt3fm_cpts3
int m_ncpts3
int m_max_cpts3
QSPt2fm_pts
int m_max_pts
bool * m_cedges
int m_max_cedges
QSPt2f m_polyline_label_pos
QSPt2f m_polyline_label_size

Detailed Description

Abstract extedned graphic driver.

Abstract base class for graphics drivers with 3D functions and logical cordinates. It expects all coordinates to be world coordinates - it means that all values between 0.0 and 1.0 are inside an axis cube/box, while others are outside of it. Generally those functions don't need to be reimplemented. Default implementation simply maps all coordinates to the screen ( using providen projection object ) and calls functions from QSCanvasDrv. This driver should additionaly do clipping as provided by QSProjection object.

Author:
Kamil Dobkowski


Member Enumeration Documentation

enum QSDrv::CColors
 

Color mode. See drawPoly3 .

enum QSDrv::CNormals
 

Normal mode. See drawPoly3 .

enum QSDrv::COrdering
 

Ordering. See drawPoly3 .


Constructor & Destructor Documentation

QSDrv::QSDrv  
 

Constructor. See also setProjection()

virtual QSDrv::~QSDrv   [virtual]
 

Destructor


Member Function Documentation

virtual void QSDrv::beginPolyline2 const QSPt2f   pos [virtual]
 

Starts to draw a polyline.

QSGFill QSDrv::bottomFill   const [inline]
 

Returns the current bottom fill

virtual CColors QSDrv::cColors   const [inline, virtual]
 

Returns a color mode required by this driver.

Reimplemented in QSDrvOpenGL.

virtual void QSDrv::clearCanvas const QSGFill   f,
const QSPt2f   pos,
const QSPt2f   size
[virtual]
 

Clear the canvas.

Reimplemented in QSDrvHitTest.

bool QSDrv::clipping   const [inline]
 

Returns the current clipping setting.

virtual CNormals QSDrv::cNormals   const [inline, virtual]
 

Return a normals mode required by this driver.

Reimplemented in QSDrvOpenGL.

virtual QSDrv* QSDrv::copy   [pure virtual]
 

Returns a copy of this object.

Implements QSCanvasDrv.

Implemented in QSDrvHitTest.

void QSDrv::copySettingsFrom const QSDrv *    drv
 

Copies a pointer to a projection object

virtual COrdering QSDrv::cOrdering   const [inline, virtual]
 

Returns an ordering required by this driver.

Reimplemented in QSDrvOpenGL.

int QSDrv::currentCategory   const [inline]
 

Returns a category of the currently drawn element. See QSAxes::ElementCategory

int QSDrv::currentElement   const [inline]
 

Returns a currently drawn element See QSAxes::ElementCategory

virtual QSPt2f QSDrv::currPolylinePos2   [virtual]
 

Returns the current pen position.

virtual void QSDrv::drawArrow2 const QSPt2f   p1,
const QSPt2f   p2,
const QSGArrow   p1style,
const QSGArrow   p2style
[virtual]
 

Draws an arrow. It can change current fill and line settings. It has a default implementation already.

virtual void QSDrv::drawDart2 const QSPt2f   pos,
double    angle,
const QSGArrow   style
[virtual]
 

Draws a line end. It can change current fill settings. It has a default implementation already.

virtual void QSDrv::drawEllipse2 const QSPt2f   p1,
const QSPt2f   p2
[virtual]
 

Draws a circle.

virtual void QSDrv::drawLine2 const QSPt2f   one,
const QSPt2f   two
[virtual]
 

The same as QS

virtual void QSDrv::drawLine3 const QSPt3f   begin,
const QSPt3f   end,
const QSPt3f    norm[2]
[virtual]
 

Draws a line. Default implementation maps 3d points on 2d plane and draws 2d line.

Reimplemented in QSDrvOpenGL.

virtual void QSDrv::drawPoint2 const QSPt2f   pos,
const QSGPoint   style
[virtual]
 

Draws a point. Because point contains its own color attr. it can change current fill and line settings It has a default implementation already.

virtual void QSDrv::drawPoint3 const QSPt3f   pos,
const QSGPoint   point
[virtual]
 

Draw a point mark.

virtual void QSDrv::drawPoly2 const QSPt2f    pts[],
int    npoints,
const bool    edges[] = NULL,
int    edgeAutoColor = 0
[virtual]
 

Draw a polygon defined by 'npoints' points in 'pts'. Can change the current line ( if edgeAuto color != 0 )

virtual void QSDrv::drawPoly3 const QSPt3f    pts[],
int    npoints,
const QSPt3f   norm,
const QSGFill   colors,
const bool    edges[] = NULL,
int    edgeAutoColor = 0
[virtual]
 

Draws a 3d polygon with 'npoints' vertices in 'pts' table. Each vertex has its color in 'colors' table. If 'VertexColors' is set, then color for each vertex is calculated separately, otherwise only colors[0] is set to the color of the whole polygon. Each vertex has its normal vector in 'norm', but the first position in this table is always occupied by a normal to the whole polygon. If 'MeshNormals' is set, the normal to the polygon, norm[0], is calculated. If 'VertexNormals' is set, a normal for each vertex is calculated separately but the normal to the polygon is also calculated and set as 'norm[0]'. If none of this two flags is set, contents of the table is undefined Default implementation maps 3d points on 2d plane and draws 2d polygon. Can change the current fill and the current line ( if edgeAuto color != 0 )

virtual void QSDrv::drawPolylineTo2 const QSPt2f   pos [virtual]
 

Draw the next line segment.

virtual void QSDrv::drawRect2 const QSPt2f   p1,
const QSPt2f   p2
[virtual]
 

Draw a rectangle.

virtual void QSDrv::drawRText2 const QSPt2f   pos,
int    angle,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Draw a rotated text. This must be reimplemented.

virtual void QSDrv::drawRTextBox2 const QSPt2f   pos,
int    angle,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Draw a rotated text. Aligns the bounding rectangle, not the bounding poly. No need to be reimplemented

virtual void QSDrv::drawText2 const QSPt2f   pos,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Draw a text.

virtual void QSDrv::drawText3 const QSPt3f   pos,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Draws a text at the given position. Defaul implementation maps 3d point on 2d plane and draws text..

virtual void QSDrv::endPolyline2   [virtual]
 

Ends polyline.

const QSProjection* QSDrv::projection   const [inline]
 

Returns a projection object used by this driver.

virtual void QSDrv::setBottomFill const QSGFill   fill [virtual]
 

Sets a bottom fill

virtual void QSDrv::setClipping bool    enabled [virtual]
 

Turns on clipping when drawing ( ..2(), *3() methods ). Must be called after startDrawing() Always clips polygons,lines,points using clipPoly2,clipLine2,clipPoint2,clipPoint3, clipPoly3.

Reimplemented in QSDrvOpenGL.

virtual void QSDrv::setCurrentElement int    category,
int    element
[virtual]
 

Sets a currently drawn element. It has no meaning for this objects - just a pair of ints. It is called by a graphic object, which uses this driver. It can be used for example in QSHitDrv to see what part of an object was exacly hit by mouse. It can be read, but further interpretation must be done in an other place. It is reset to -1, -1 in stopDrawing(). See QSAxes::ElementCategory

Reimplemented in QSDrvOpenGL.

virtual void QSDrv::setPolylineLabelPlace2 const QString &    label,
const QSPt2f   label_place,
int    label_angle
[virtual]
 

Ups ! a little hack. Leave place for the label in the current polyline

virtual void QSDrv::setProjection const QSProjection   t [virtual]
 

Sets a projection object used by this driver. None method of this interface can be called if projection is not set. Projection is not owned by this object, it only holds a pointer.

virtual void QSDrv::setTopBottom bool    enabled [virtual]
 

Turns on top/bottom detection for drawPoly3

virtual void QSDrv::startDrawing   [virtual]
 

Reimplemented

Reimplemented from QSCanvasDrv.

Reimplemented in QSDrvOpenGL.

virtual void QSDrv::stopDrawing   [virtual]
 

Reimplemented

Reimplemented from QSCanvasDrv.

Reimplemented in QSDrvOpenGL.

bool QSDrv::topBottom   const [inline]
 

Is top/bottom detection turned on ?


The documentation for this class was generated from the following file:
Generated on Mon Mar 18 19:16:43 2002 for KMatplot library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002