#include <qsdrv.h>
Inheritance diagram for QSDrv:
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 QSProjection * | projection () 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 QSProjection * | m_t |
bool | m_clipping |
QSPt2f | m_curr_polyline_pos |
QSPt2f * | m_cpts2 |
int | m_ncpts2 |
int | m_max_cpts2 |
QSPt3f * | m_cpts3 |
int | m_ncpts3 |
int | m_max_cpts3 |
QSPt2f * | m_pts |
int | m_max_pts |
bool * | m_cedges |
int | m_max_cedges |
QSPt2f | m_polyline_label_pos |
QSPt2f | m_polyline_label_size |
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.
|
Color mode. See drawPoly3 . |
|
Normal mode. See drawPoly3 . |
|
Ordering. See drawPoly3 . |
|
Constructor. See also setProjection() |
|
Destructor |
|
Starts to draw a polyline. |
|
Returns the current bottom fill |
|
Returns a color mode required by this driver. Reimplemented in QSDrvOpenGL. |
|
Clear the canvas. Reimplemented in QSDrvHitTest. |
|
Returns the current clipping setting. |
|
Return a normals mode required by this driver. Reimplemented in QSDrvOpenGL. |
|
Returns a copy of this object. Implements QSCanvasDrv. Implemented in QSDrvHitTest. |
|
Copies a pointer to a projection object |
|
Returns an ordering required by this driver. Reimplemented in QSDrvOpenGL. |
|
Returns a category of the currently drawn element. See QSAxes::ElementCategory |
|
Returns a currently drawn element See QSAxes::ElementCategory |
|
Returns the current pen position. |
|
Draws an arrow. It can change current fill and line settings. It has a default implementation already. |
|
Draws a line end. It can change current fill settings. It has a default implementation already. |
|
Draws a circle. |
|
The same as QS |
|
Draws a line. Default implementation maps 3d points on 2d plane and draws 2d line. Reimplemented in QSDrvOpenGL. |
|
Draws a point. Because point contains its own color attr. it can change current fill and line settings It has a default implementation already. |
|
Draw a point mark. |
|
Draw a polygon defined by 'npoints' points in 'pts'. Can change the current line ( if edgeAuto color != 0 ) |
|
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 ) |
|
Draw the next line segment. |
|
Draw a rectangle. |
|
Draw a rotated text. This must be reimplemented. |
|
Draw a rotated text. Aligns the bounding rectangle, not the bounding poly. No need to be reimplemented |
|
Draw a text. |
|
Draws a text at the given position. Defaul implementation maps 3d point on 2d plane and draws text.. |
|
Ends polyline. |
|
Returns a projection object used by this driver. |
|
Sets a bottom fill |
|
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. |
|
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. |
|
Ups ! a little hack. Leave place for the label in the current polyline |
|
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. |
|
Turns on top/bottom detection for drawPoly3 |
|
Reimplemented Reimplemented from QSCanvasDrv. Reimplemented in QSDrvOpenGL. |
|
Reimplemented Reimplemented from QSCanvasDrv. Reimplemented in QSDrvOpenGL. |
|
Is top/bottom detection turned on ? |