Revision: 57060
http://sourceforge.net/p/brlcad/code/57060
Author: vladbogo
Date: 2013-08-22 10:58:24 +0000 (Thu, 22 Aug 2013)
Log Message:
-----------
Check if Qpainter is null in drawVList and changed log position.
Modified Paths:
--------------
brlcad/trunk/src/libdm/dm-qt.cpp
Modified: brlcad/trunk/src/libdm/dm-qt.cpp
===================================================================
--- brlcad/trunk/src/libdm/dm-qt.cpp 2013-08-22 10:55:37 UTC (rev 57059)
+++ brlcad/trunk/src/libdm/dm-qt.cpp 2013-08-22 10:58:24 UTC (rev 57060)
@@ -81,6 +81,8 @@
HIDDEN int
qt_drawBegin(struct dm *dmp)
{
+ bu_log("qt_drawBegin called\n");
+
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
privars->pix->fill(privars->bg);
@@ -89,7 +91,6 @@
privars->painter->setPen(privars->fg);
privars->painter->setFont(*privars->font);
- bu_log("qt_drawBegin called\n");
return TCL_OK;
}
@@ -97,6 +98,8 @@
HIDDEN int
qt_drawEnd(struct dm *dmp)
{
+ bu_log("qt_drawEnd called\n");
+
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
privars->painter->end();
@@ -107,7 +110,6 @@
qt_sendRepaintEvent(dmp);
privars->qapp->processEvents();
- bu_log("qt_drawEnd called\n");
return TCL_OK;
}
@@ -123,11 +125,12 @@
HIDDEN int
qt_loadMatrix(struct dm *dmp, fastf_t *mat, int UNUSED(which_eye))
{
+ bu_log("qt_loadMatrix called\n");
+
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
MAT_COPY(privars->qmat, mat);
- bu_log("qt_loadMatrix called\n");
return 0;
}
@@ -143,6 +146,8 @@
HIDDEN int
qt_drawString2D(struct dm *dmp, const char *str, fastf_t x, fastf_t y, int
UNUSED(size), int use_aspect)
{
+ bu_log("qt_drawString2D called\n");
+
int sx, sy;
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
@@ -153,7 +158,6 @@
return TCL_ERROR;
privars->painter->drawText(sx, sy, str);
- bu_log("qt_drawString2D called\n");
return TCL_OK;
}
@@ -161,6 +165,7 @@
HIDDEN int
qt_drawLine2D(struct dm *dmp, fastf_t x_1, fastf_t y_1, fastf_t x_2, fastf_t
y_2)
{
+ bu_log("qt_drawLine2D called\n");
int sx1, sy1, sx2, sy2;
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
@@ -173,7 +178,6 @@
return TCL_ERROR;
privars->painter->drawLine(sx1, sy1, sx2, sy2);
- bu_log("qt_drawLine2D called\n");
return TCL_OK;
}
@@ -207,7 +211,6 @@
return TCL_ERROR;
privars->painter->drawPoint(sx, sy);
- bu_log("qt_drawPoint2D called\n");
return TCL_OK;
}
@@ -231,6 +234,8 @@
HIDDEN int
qt_drawVList(struct dm *dmp, struct bn_vlist *vp)
{
+ bu_log("qt_drawVList called\n");
+
static vect_t spnt, lpnt, pnt;
struct bn_vlist *tvp;
QLine lines[1024];
@@ -374,7 +379,8 @@
VMOVE(lpnt, spnt);
if (nseg == 1024) {
- privars->painter->drawLines(lines, nseg);
+ if (privars->painter != NULL)
+ privars->painter->drawLines(lines, nseg);
nseg = 0;
linep = lines;
}
@@ -386,10 +392,10 @@
}
if (nseg) {
- privars->painter->drawLines(lines, nseg);
+ if (privars->painter != NULL)
+ privars->painter->drawLines(lines, nseg);
}
- bu_log("qt_drawVList called\n");
return TCL_OK;
}
@@ -415,6 +421,8 @@
HIDDEN int
qt_setFGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned char
b, int UNUSED(strict), fastf_t UNUSED(transparency))
{
+ bu_log("qt_setFGColor called\n");
+
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
dmp->dm_fg[0] = r;
@@ -429,7 +437,6 @@
privars->painter->setPen(p);
}
- bu_log("qt_setFGColor called\n");
return TCL_OK;
}
@@ -437,6 +444,8 @@
HIDDEN int
qt_setBGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned char
b)
{
+ bu_log("qt_setBGColor called\n");
+
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
privars->bg.setRgb(r, g, b);
@@ -449,7 +458,6 @@
return TCL_ERROR;
privars->pix->fill(privars->bg);
- bu_log("qt_setBGColor called\n");
return TCL_OK;
}
@@ -457,6 +465,8 @@
HIDDEN int
qt_setLineAttr(struct dm *dmp, int width, int style)
{
+ bu_log("qt_setLineAttr called\n");
+
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
dmp->dm_lineWidth = width;
@@ -475,7 +485,6 @@
p.setStyle(Qt::SolidLine);
privars->painter->setPen(p);
- bu_log("qt_setLineAttr called\n");
return TCL_OK;
}
@@ -483,17 +492,20 @@
HIDDEN void
qt_reshape(struct dm *dmp, int width, int height)
{
+ bu_log("qt_reshape called\n");
+
dmp->dm_height = height;
dmp->dm_width = width;
dmp->dm_aspect = (fastf_t)dmp->dm_width / (fastf_t)dmp->dm_height;
- bu_log("qt_reshape called\n");
}
HIDDEN int
qt_configureWin(struct dm *dmp, int force)
{
+ bu_log("qt_configureWin called\n");
+
struct dm_xvars *pubvars = (struct dm_xvars *)dmp->dm_vars.pub_vars;
struct qt_vars *privars = (struct qt_vars *)dmp->dm_vars.priv_vars;
@@ -541,7 +553,6 @@
}
}
- bu_log("qt_configureWin called\n");
return TCL_OK;
}
@@ -549,6 +560,8 @@
HIDDEN int
qt_setWinBounds(struct dm *dmp, fastf_t *w)
{
+ bu_log("qt_setWinBounds called\n");
+
dmp->dm_clipmin[0] = w[0];
dmp->dm_clipmin[1] = w[2];
dmp->dm_clipmin[2] = w[4];
@@ -556,7 +569,6 @@
dmp->dm_clipmax[1] = w[3];
dmp->dm_clipmax[2] = w[5];
- bu_log("qt_setWinBounds called\n");
return TCL_OK;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits