void showCorners(Image *vimg) {
   vimg->setImage( cmap.w, cmap.h, PIXEL_RGB );
   showCorners( vimg->data, vimg->type );
 }
void ToonzExt::OverallDesigner::draw(ToonzExt::StrokeDeformation *sd)
{
	if (sd) {
		const TStroke *
			s;

		//glColor3d(1.0,0.0,1.0);
		s = sd->getCopiedStroke();
		if (s) {
			const ContextStatus *
				status = sd->getStatus();
			double
				w = 0.0,
				pixelSize = 1.0;

			if (status) {
				w = status->w_;
				pixelSize = status->pixelSize_ < 0 ? 1.0 : status->pixelSize_;
			}
#ifdef _DEBUG
			drawCross(s->getPoint(0),
					  2 * pixelSize);

			tglDrawCircle(s->getPoint(w), 8 * pixelSize);
			drawCross(s->getPoint(w), 8 * pixelSize);
#endif
			ToonzExt::Interval
				ex = sd->getExtremes();
			drawStrokeCenterLine(s,
								 pixelSize_,
								 ex);
			if (status) {
#ifdef _DEBUG
				glColor3d(0, 0, 0);
				showCorners(s,
							status->cornerSize_,
							pixelSize);

				glColor3d(0, 0, 0);
				TPointD
					offset = normalize(TPointD(1.0, 1.0)) * 20.0;
				std::ostringstream oss;
				oss << "(" << this->x_
					<< "," << this->y_
					<< ")\n{" << w
					<< ",{" << sd->getExtremes().first
					<< "," << sd->getExtremes().second
					<< "}}";
				extglDrawText(TPointD(x_, y_) + offset, oss.str());

				glColor3d(0.5, 1.0, 0.5);
				showCP(s,
					   pixelSize);
#endif
			}
		}

		/*
    glColor3d(1.0,1.0,0.0);
    s = sd->getStroke();
    if(s)
    {
      drawCross( s->getPoint(0),
                 4);

      drawStrokeCenterLine(s,
                           pixelSize_,
                           ToonzExt::Interval(0,1));
    }
    */

		s = sd->getTransformedStroke();

		glColor3d(1.0, 0.0, 0.0);
		if (s) {
#ifdef _DEBUG
			isValid(s);
#endif
			drawStrokeCenterline(*s,
								 pixelSize_);
		}

#ifdef _DEBUG
		{
			const TStroke
				*c = sd->getCopiedStroke(),
				*s = sd->getStroke();
			if (c && s) {
				//glColor3d(1,1,0);
				//tglDrawDisk(s->getPoint(0.0),
				//            5*pixelSize_);

				int count = std::min(c->getControlPointCount(),
									 s->getControlPointCount());
				for (int i = 0;
					 i < count;
					 ++i) {
					TThickPoint
						ccp = c->getControlPoint(i);
					TThickPoint
						scp = s->getControlPoint(i);
				}
			}
		}
#endif
	}
}