23#include "../lout/msg.h"
43 const bool filled =
false;
46 x + this->x,
y + this->y, this->width, this->height);
56 this->
x < otherRect->
x + otherRect->
width &&
57 this->
y < otherRect->
y + otherRect->
height &&
58 otherRect->
x < this->
x + this->
width &&
59 otherRect->
y < this->
y + this->
height;
65 otherRect->
x + otherRect->
width) - dest->
x;
67 otherRect->
y + otherRect->
height) - dest->
y;
90 x >= this->x &&
y >= this->y &&
108 const bool filled =
false;
111 x + this->x,
y + this->y, 2 * this->radius, 2 * this->radius,
118 (
x - this->x) * (
x - this->
x) + (y - this->y) * (
y - this->
y)
143 const bool filled =
false, convex =
false;
146 for (i = 0; i <
points->size(); i++) {
147 pointArray[i].
x = x +
points->getRef(i)->x;
148 pointArray[i].
y = y +
points->getRef(i)->y;
151 filled, convex, pointArray, i);
174 int bx1,
int by1,
int bx2,
int by2)
182 return (z1 <= 0 && z2 >= 0) || (z1 >= 0 && z2 <= 0);
190 int bx1,
int by1,
int bx2,
int by2)
193 linesCross0 (ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) &&
194 linesCross0 (bx1, by1, bx2, by2, ax1, ay1, ax2, ay2);
195 _MSG(
"(%d, %d) - (%d, %d) and (%d, %d) - (%d, %d) cross? %s.\n",
196 ax1, ay1, ax2, ay2, bx1, by1, bx2, by2, cross ?
"Yes" :
"No");
202 if (
points->size () < 3 ||
203 (x < minx || x >
maxx || y < miny || y >=
maxy))
207 for (
int i = 0; i <
points->size () - 1; i++) {
219 return numCrosses % 2 == 1;
225 rectangleList =
new container::typed::List <Rectangle> (
true);
241 container::typed::Iterator <Rectangle> it;
256 combinedWidth * combinedHeight <=
261 r->
width = combinedWidth;
262 r->
height = combinedHeight;
281 switch(content->
type) {
294 sb->
append (
"<widget in flow: ");
301 sb->
append (
"<widget oof ref: ");
310 sb->
append (
"<widget oof cont: ");
void draw(core::View *view, core::style::Style *style, int x, int y)
Circle(int x, int y, int radius)
bool isPointWithin(int x, int y)
int zOfVectorProduct(int x1, int y1, int x2, int y2)
Return the z-coordinate of the vector product of two vectors, whose z-coordinate is 0 (so that x and ...
bool isPointWithin(int x, int y)
bool linesCross(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2)
Return, whether the line, limited by (ax1, ay1) and (ax2, ay2), crosses the line, limited by (bx1,...
void addPoint(int x, int y)
bool linesCross0(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2)
Return, whether the line, limited by (ax1, ay1) and (ax2, ay2), crosses the unlimited line,...
lout::misc::SimpleVector< Point > * points
void draw(core::View *view, core::style::Style *style, int x, int y)
dw::core::Shape implemtation for simple rectangles.
bool isPointWithin(int x, int y)
void draw(core::View *view, core::style::Style *style, int x, int y)
bool intersectsWith(Rectangle *otherRect, Rectangle *dest)
Return whether this rectangle and otherRect intersect.
bool isSubsetOf(Rectangle *otherRect)
lout::container::typed::List< Rectangle > * rectangleList
void addRectangle(Rectangle *r)
Add a rectangle to the region and combine it with existing rectangles if possible.
An interface to encapsulate platform dependent drawing.
virtual void drawPolygon(style::Color *color, style::Color::Shading shading, bool filled, bool convex, Point *points, int npoints)=0
virtual void drawArc(style::Color *color, style::Color::Shading shading, bool filled, int centerX, int centerY, int width, int height, int angle1, int angle2)=0
virtual void drawRectangle(style::Color *color, style::Color::Shading shading, bool filled, int x, int y, int width, int height)=0
const char * getClassName()
Return the name, under which the class of this object was registered.
Simple (simpler than container::untyped::Vector and container::typed::Vector) template based vector.
A class for fast concatenation of a large number of strings.
void appendPointer(void *p)
void append(const char *str)
Append a NUL-terminated string to the buffer, with copying.
const char * getChars()
Return a NUL-terminated strings containing all appended strings.
Dw is in this namespace, or sub namespaces of this one.
static void print(Content *content)
@ WIDGET_OOF_REF
reference to a widget out of flow (OOF); this widget (containing this content) is only the generator ...
@ WIDGET_IN_FLOW
widget in normal flow, so that this widget (containing this content) is both container (parent) and g...
@ WIDGET_OOF_CONT
widget out of flow (OOF); this widget (containing this content) is only the container (parent),...
static Content::Type maskForSelection(bool followReferences)
static void maskIntoStringBuffer(Type mask, lout::misc::StringBuffer *sb)
static void intoStringBuffer(Content *content, lout::misc::StringBuffer *sb)
WidgetReference * widgetReference
static void printMask(Type mask)