本文整理汇总了C++中TRectD::getP11方法的典型用法代码示例。如果您正苦于以下问题:C++ TRectD::getP11方法的具体用法?C++ TRectD::getP11怎么用?C++ TRectD::getP11使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRectD
的用法示例。
在下文中一共展示了TRectD::getP11方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tglFillRect
void tglFillRect(const TRectD &rect)
{
glBegin(GL_POLYGON);
tglVertex(rect.getP00());
tglVertex(rect.getP10());
tglVertex(rect.getP11());
tglVertex(rect.getP01());
glEnd();
}
示例2: tglDrawRect
void tglDrawRect(const TRectD &rect)
{
glBegin(GL_LINE_LOOP);
tglVertex(rect.getP00());
tglVertex(rect.getP10());
tglVertex(rect.getP11());
tglVertex(rect.getP01());
glEnd();
}
示例3: TRectD
TRectD TAffine::operator*(const TRectD &rect) const
{
if (rect != TConsts::infiniteRectD) {
TPointD p1 = *this * rect.getP00(),
p2 = *this * rect.getP01(),
p3 = *this * rect.getP10(),
p4 = *this * rect.getP11();
return TRectD(tmin(p1.x, p2.x, p3.x, p4.x), tmin(p1.y, p2.y, p3.y, p4.y),
tmax(p1.x, p2.x, p3.x, p4.x), tmax(p1.y, p2.y, p3.y, p4.y));
} else
return TConsts::infiniteRectD;
}
示例4: drawControlRect
void ShiftTraceTool::drawControlRect() {
if (m_ghostIndex < 0 || m_ghostIndex > 1) return;
int row = m_row[m_ghostIndex];
if (row < 0) return;
int col = TApp::instance()->getCurrentColumn()->getColumnIndex();
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
TXshCell cell = xsh->getCell(row, col);
if (cell.isEmpty()) return;
TImageP img = cell.getImage(false);
if (!img) return;
TRectD box;
if (TRasterImageP ri = img) {
TRasterP ras = ri->getRaster();
box =
(convert(ras->getBounds()) - ras->getCenterD()) * ri->getSubsampling();
} else if (TToonzImageP ti = img) {
TRasterP ras = ti->getRaster();
box =
(convert(ras->getBounds()) - ras->getCenterD()) * ti->getSubsampling();
} else if (TVectorImageP vi = img) {
box = vi->getBBox();
} else {
return;
}
glPushMatrix();
tglMultMatrix(getGhostAff());
TPixel32 color;
color = m_highlightedGadget == TranslateGadget ? TPixel32(200, 100, 100)
: TPixel32(120, 120, 120);
tglColor(color);
glBegin(GL_LINE_STRIP);
glVertex2d(box.x0, box.y0);
glVertex2d(box.x1, box.y0);
glVertex2d(box.x1, box.y1);
glVertex2d(box.x0, box.y1);
glVertex2d(box.x0, box.y0);
glEnd();
color =
m_highlightedGadget == 2000 ? TPixel32(200, 100, 100) : TPixel32::White;
double r = 4 * sqrt(tglGetPixelSize2());
drawDot(box.getP00(), r, color);
drawDot(box.getP01(), r, color);
drawDot(box.getP10(), r, color);
drawDot(box.getP11(), r, color);
if (m_curveStatus == NoCurve) {
color =
m_highlightedGadget == 2001 ? TPixel32(200, 100, 100) : TPixel32::White;
TPointD c = m_center[m_ghostIndex];
drawDot(c, r, color);
}
glPopMatrix();
}
示例5: drawFloatingSelection
/*-- Paste後のフローティング状態の画像の描画 --*/
void RasterSelectionTool::drawFloatingSelection()
{
double pixelSize = TTool::getApplication()->getCurrentTool()->getTool()->getPixelSize();
TAffine aff = m_rasterSelection.getTransformation();
glPushMatrix();
tglMultMatrix(aff);
//draw m_floatingSelection
if (isFloating()) {
TRasterP floatingSelection = m_rasterSelection.getFloatingSelection();
TImageP app;
if (TRasterCM32P toonzRas = (TRasterCM32P)(floatingSelection))
app = TToonzImageP(toonzRas, toonzRas->getBounds());
if (TRaster32P fullColorRas = (TRaster32P)(floatingSelection))
app = TRasterImageP(fullColorRas);
if (TRasterGR8P grRas = (TRasterGR8P)(floatingSelection))
app = TRasterImageP(grRas);
app->setPalette(m_rasterSelection.getCurrentImage()->getPalette());
FourPoints points = getBBox() * aff.inv();
TRectD bbox = points.getBox();
TPointD center((bbox.getP00() + bbox.getP11()) * 0.5);
if (TToonzImageP ti = (TToonzImageP)app)
GLRasterPainter::drawRaster(TTranslation(center), ti, false);
if (TRasterImageP ri = (TRasterImageP)app)
GLRasterPainter::drawRaster(TTranslation(center), ri, true);
}
std::vector<TStroke> strokes = m_rasterSelection.getStrokes();
int i;
for (i = 0; i < (int)strokes.size(); i++) {
TStroke stroke = strokes[i];
glEnable(GL_LINE_STIPPLE);
glLineStipple(1, 0xF0F0);
tglColor(TPixel32::Black);
drawStrokeCenterline(stroke, pixelSize);
glDisable(GL_LINE_STIPPLE);
}
glPopMatrix();
}
示例6: getGadget
ShiftTraceTool::GadgetId ShiftTraceTool::getGadget(const TPointD &p) {
std::vector<std::pair<TPointD, GadgetId>> gadgets;
gadgets.push_back(std::make_pair(m_p0, CurveP0Gadget));
gadgets.push_back(std::make_pair(m_p1, CurveP1Gadget));
gadgets.push_back(std::make_pair(m_p2, CurvePmGadget));
TAffine aff = getGhostAff();
if (0 <= m_ghostIndex && m_ghostIndex < 2) {
gadgets.push_back(std::make_pair(aff * m_box.getP00(), RotateGadget));
gadgets.push_back(std::make_pair(aff * m_box.getP01(), RotateGadget));
gadgets.push_back(std::make_pair(aff * m_box.getP10(), RotateGadget));
gadgets.push_back(std::make_pair(aff * m_box.getP11(), RotateGadget));
gadgets.push_back(
std::make_pair(aff * m_center[m_ghostIndex], MoveCenterGadget));
}
int k = -1;
double minDist2 = pow(10 * getPixelSize(), 2);
for (int i = 0; i < (int)gadgets.size(); i++) {
double d2 = norm2(gadgets[i].first - p);
if (d2 < minDist2) {
minDist2 = d2;
k = i;
}
}
if (k >= 0) return gadgets[k].second;
// rect-point
if (0 <= m_ghostIndex && m_ghostIndex < 2) {
TPointD q = aff.inv() * p;
double big = 1.0e6;
double d = big, x = 0, y = 0;
if (m_box.x0 < q.x && q.x < m_box.x1) {
x = q.x;
double d0 = fabs(m_box.y0 - q.y);
double d1 = fabs(m_box.y1 - q.y);
if (d0 < d1) {
d = d0;
y = m_box.y0;
} else {
d = d1;
y = m_box.y1;
}
}
if (m_box.y0 < q.y && q.y < m_box.y1) {
double d0 = fabs(m_box.x0 - q.y);
double d1 = fabs(m_box.x1 - q.y);
if (d0 < d) {
d = d0;
y = q.y;
x = m_box.x0;
}
if (d1 < d) {
d = d1;
y = q.y;
x = m_box.x1;
}
}
if (d < big) {
TPointD pp = aff * TPointD(x, y);
double d = norm(p - pp);
if (d < 10 * getPixelSize()) {
return TranslateGadget;
}
}
}
return NoGadget;
}