MyGUI  3.4.0
MyGUI_PolygonalSkin.cpp
Go to the documentation of this file.
1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #include "MyGUI_Precompiled.h"
8 #include "MyGUI_PolygonalSkin.h"
9 #include "MyGUI_RenderItem.h"
10 #include "MyGUI_CommonStateInfo.h"
11 #include "MyGUI_RenderManager.h"
12 #include "MyGUI_GeometryUtility.h"
13 
14 namespace MyGUI
15 {
16 
18  mGeometryOutdated(false),
19  mLineWidth(1.0f),
20  mLineStroke(0),
21  mLineLength(0.0f),
22  mVertexCount(VertexQuad::VertexCount),
23  mEmptyView(false),
24  mCurrentColour(0xFFFFFFFF),
25  mNode(nullptr),
26  mRenderItem(nullptr)
27  {
28  mVertexFormat = RenderManager::getInstance().getVertexFormat();
29  }
30 
31  inline float len(float x, float y)
32  {
33  return std::sqrt(x * x + y * y);
34  }
35 
36  void PolygonalSkin::setPoints(const std::vector<FloatPoint>& _points)
37  {
38  if (_points.size() < 2)
39  {
40  mVertexCount = 0;
41  mResultVerticiesPos.clear();
42  mResultVerticiesUV.clear();
43  mLinePoints = _points;
44  return;
45  }
46 
47  VectorFloatPoint finalPoints;
48  finalPoints.reserve(_points.size());
49 
50  mLineLength = 0.0f;
51  FloatPoint point = _points[0];
52  finalPoints.push_back(point);
53  // ignore repeating points
54  for (std::vector<FloatPoint>::const_iterator iter = _points.begin() + 1; iter != _points.end(); ++iter)
55  {
56  if (point != *iter)
57  {
58  finalPoints.push_back(*iter);
59  mLineLength += len(iter->left - point.left, iter->top - point.top);
60  point = *iter;
61  }
62  }
63 
64  mLinePoints = finalPoints;
65 
66 #ifdef MYGUI_NO_POLYGONAL_SKIN_CROPPING
67  size_t count = (mLinePoints.size() - 1) * VertexQuad::VertexCount * 2;
68 #else
69  // it's too hard to calculate maximum possible verticies count and worst
70  // approximation gives 7 times more verticies than in not cropped geometry
71  // so we multiply count by 2, because this looks enough
72  size_t count = (mLinePoints.size() - 1) * VertexQuad::VertexCount * 2 * 2;
73 #endif
74  if (count > mVertexCount)
75  {
76  mVertexCount = count;
77  if (nullptr != mRenderItem) mRenderItem->reallockDrawItem(this, mVertexCount);
78  }
79 
80  _updateView();
81  }
82 
83  void PolygonalSkin::setWidth(float _width)
84  {
85  mLineWidth = _width;
86  _updateView();
87  }
88 
89  void PolygonalSkin::setStroke(size_t _value)
90  {
91  mLineStroke = _value;
92  _updateView();
93  }
94 
95  void PolygonalSkin::setVisible(bool _visible)
96  {
97  if (mVisible == _visible)
98  return;
99 
100  mVisible = _visible;
101  mGeometryOutdated = true;
102 
103  if (nullptr != mNode)
104  mNode->outOfDate(mRenderItem);
105  }
106 
107  void PolygonalSkin::setAlpha(float _alpha)
108  {
109  uint32 alpha = ((uint8)(_alpha * 255) << 24);
110  mCurrentColour = (mCurrentColour & 0x00FFFFFF) | (alpha & 0xFF000000);
111 
112  if (nullptr != mNode)
113  mNode->outOfDate(mRenderItem);
114  }
115 
117  {
118  mGeometryOutdated = true;
119 
120  if (nullptr != mNode)
121  mNode->outOfDate(mRenderItem);
122  }
123 
124  void PolygonalSkin::_setAlign(const IntSize& _oldsize)
125  {
126  // необходимо разобраться
127  bool need_update = true;
128 
129  // первоначальное выравнивание
130  if (mAlign.isHStretch())
131  {
132  // растягиваем
133  mCoord.width = mCoord.width + (mCroppedParent->getWidth() - _oldsize.width);
134  need_update = true;
135  mIsMargin = true; // при изменении размеров все пересчитывать
136  }
137  else if (mAlign.isRight())
138  {
139  // двигаем по правому краю
140  mCoord.left = mCoord.left + (mCroppedParent->getWidth() - _oldsize.width);
141  need_update = true;
142  }
143  else if (mAlign.isHCenter())
144  {
145  // выравнивание по горизонтали без растяжения
147  need_update = true;
148  }
149 
150  if (mAlign.isVStretch())
151  {
152  // растягиваем
154  need_update = true;
155  mIsMargin = true; // при изменении размеров все пересчитывать
156  }
157  else if (mAlign.isBottom())
158  {
159  // двигаем по нижнему краю
160  mCoord.top = mCoord.top + (mCroppedParent->getHeight() - _oldsize.height);
161  need_update = true;
162  }
163  else if (mAlign.isVCenter())
164  {
165  // выравнивание по вертикали без растяжения
167  need_update = true;
168  }
169 
170  if (need_update)
171  {
172  mCurrentCoord = mCoord;
173  _updateView();
174  }
175  }
176 
178  {
179  bool margin = _checkMargin();
180 
181  mEmptyView = ((0 >= _getViewWidth()) || (0 >= _getViewHeight()));
182 
183  mGeometryOutdated = true;
184 
185  mCurrentCoord.left = mCoord.left + mMargin.left;
186  mCurrentCoord.top = mCoord.top + mMargin.top;
187 
188  // вьюпорт стал битым
189  if (margin)
190  {
191  // проверка на полный выход за границу
192  if (_checkOutside())
193  {
194  // запоминаем текущее состояние
195  mIsMargin = margin;
196 
197  // обновить перед выходом
198  if (nullptr != mNode)
199  mNode->outOfDate(mRenderItem);
200  return;
201  }
202  }
203 
204  // мы обрезаны или были обрезаны
205  if (mIsMargin || margin)
206  {
207  mCurrentCoord.width = _getViewWidth();
208  mCurrentCoord.height = _getViewHeight();
209  }
210 
211  // запоминаем текущее состояние
212  mIsMargin = margin;
213 
214  if (nullptr != mNode)
215  mNode->outOfDate(mRenderItem);
216  }
217 
219  {
220  MYGUI_ASSERT(!mRenderItem, "mRenderItem must be nullptr");
221 
222  mNode = _node;
223  mRenderItem = mNode->addToRenderItem(_texture, true, false);
224  mRenderItem->addDrawItem(this, mVertexCount);
225  }
226 
228  {
229  MYGUI_ASSERT(mRenderItem, "mRenderItem must be not nullptr");
230 
231  mNode = nullptr;
232  mRenderItem->removeDrawItem(this);
233  mRenderItem = nullptr;
234  }
235 
237  {
238  if (!mVisible || mEmptyView)
239  return;
240 
241  bool update = mRenderItem->getCurrentUpdate();
242  if (update)
243  mGeometryOutdated = true;
244 
245  Vertex* verticies = mRenderItem->getCurrentVertexBuffer();
246 
247  float vertex_z = mNode->getNodeDepth();
248 
249  if (mGeometryOutdated)
250  {
252  }
253 
254  size_t size = mResultVerticiesPos.size();
255 
256  for (size_t i = 0; i < size; ++i)
257  {
258  verticies[i].set(mResultVerticiesPos[i].left, mResultVerticiesPos[i].top, vertex_z, mResultVerticiesUV[i].left, mResultVerticiesUV[i].top, mCurrentColour);
259  }
260 
261  mRenderItem->setLastVertexCount(size);
262  }
263 
264  void PolygonalSkin::_setColour(const Colour& _value)
265  {
266  uint32 colour = texture_utility::toColourARGB(_value);
267  texture_utility::convertColour(colour, mVertexFormat);
268  mCurrentColour = (colour & 0x00FFFFFF) | (mCurrentColour & 0xFF000000);
269 
270  if (nullptr != mNode)
271  mNode->outOfDate(mRenderItem);
272  }
273 
275  {
277  }
278 
280  {
281  mCurrentTexture = _rect;
282 
283  mGeometryOutdated = true;
284 
285  if (nullptr != mNode)
286  mNode->outOfDate(mRenderItem);
287  }
288 
290  {
291  if (mLinePoints.size() < 2)
292  return;
293  if (!mRenderItem || !mRenderItem->getRenderTarget())
294  return;
295 
296  mGeometryOutdated = false;
297 
298  // using mCurrentCoord as rectangle where we draw polygons
299 
300  // base texture coordinates
301  FloatPoint baseVerticiesUV[4] =
302  {
303  FloatPoint(mCurrentTexture.left, mCurrentTexture.top),
304  FloatPoint(mCurrentTexture.right, mCurrentTexture.top),
305  FloatPoint(mCurrentTexture.right, mCurrentTexture.bottom),
306  FloatPoint(mCurrentTexture.left, mCurrentTexture.bottom)
307  };
308 
309  // UV vectors
310  FloatPoint vectorU = baseVerticiesUV[1] - baseVerticiesUV[0];
311  //FloatPoint vectorV = baseVerticiesUV[3] - baseVerticiesUV[0];
312 
313  FloatPoint vertex1;
314  FloatPoint vertex2;
315  mResultVerticiesPos.clear();
316  mResultVerticiesUV.clear();
317  // add first two verticies
318  FloatPoint normal = _getPerpendicular(mLinePoints[0], mLinePoints[1]);
319 
320  FloatPoint points[2] = {mLinePoints[0] + normal, mLinePoints[0] - normal};
321  FloatPoint pointsUV[2] = {baseVerticiesUV[0], baseVerticiesUV[3]};
322 
323  bool draw = true;
324  size_t stroke = 0;
325 
326  // add other verticies
327  float currentLength = 0.0f;
328  for (size_t i = 1; i < mLinePoints.size(); ++i)
329  {
330  if (mLineStroke != 0)
331  {
332  stroke++;
333  if (stroke == mLineStroke)
334  {
335  stroke = 0;
336  draw = !draw;
337  }
338  }
339 
340  currentLength += len(mLinePoints[i - 1].left - mLinePoints[i].left, mLinePoints[i - 1].top - mLinePoints[i].top);
341 
342  // getting normal between previous and next point
343  if (i != mLinePoints.size() - 1)
344  normal = _getMiddleLine(mLinePoints[i - 1], mLinePoints[i + 1], mLinePoints[i]);
345  else
346  normal = _getPerpendicular(mLinePoints[i - 1], mLinePoints[i]);
347 
348  bool edge = false;
349  bool sharp = false;
350  if (normal == FloatPoint() /*|| len(normal.left, normal.top) > mLineWidth * 2*/)
351  {
352  edge = true;
353  normal = _getPerpendicular(mLinePoints[i - 1], mLinePoints[i]);
354  }
355  else if (len(normal.left, normal.top) > mLineWidth * 1.5f)
356  {
357  sharp = true;
358  normal = _getPerpendicular(mLinePoints[i - 1], mLinePoints[i]);
359  }
360 
361  // check orientation
362  FloatPoint lineDir = mLinePoints[i] - mLinePoints[i - 1];
363  if (lineDir.left * normal.top - lineDir.top * normal.left < 0)
364  {
365  normal.left = -normal.left;
366  normal.top = -normal.top;
367  }
368 
369  FloatPoint UVoffset(currentLength / mLineLength * vectorU.left, currentLength / mLineLength * vectorU.top);
370 
371  if (draw)
372  {
373  mResultVerticiesPos.push_back(points[0]);
374  mResultVerticiesPos.push_back(points[1]);
375  mResultVerticiesPos.push_back(mLinePoints[i] + normal);
376  mResultVerticiesUV.push_back(pointsUV[0]);
377  mResultVerticiesUV.push_back(pointsUV[1]);
378  mResultVerticiesUV.push_back(baseVerticiesUV[0] + UVoffset);
379 
380  mResultVerticiesPos.push_back(points[1]);
381  mResultVerticiesPos.push_back(mLinePoints[i] - normal);
382  mResultVerticiesPos.push_back(mLinePoints[i] + normal);
383  mResultVerticiesUV.push_back(pointsUV[1]);
384  mResultVerticiesUV.push_back(baseVerticiesUV[3] + UVoffset);
385  mResultVerticiesUV.push_back(baseVerticiesUV[0] + UVoffset);
386  }
387 
388  points[edge ? 1 : 0] = mLinePoints[i] + normal;
389  points[edge ? 0 : 1] = mLinePoints[i] - normal;
390  pointsUV[0] = baseVerticiesUV[0] + UVoffset;
391  pointsUV[1] = baseVerticiesUV[3] + UVoffset;
392 
393  if (sharp)
394  {
395  normal = _getMiddleLine(mLinePoints[i - 1], mLinePoints[i + 1], mLinePoints[i]);
396 
397  float sharpness = len(normal.left, normal.top) / mLineWidth;
398 
399  float length = len(normal.left, normal.top);
400  normal.left *= 2 * mLineWidth / length / (sharpness - 0.5f);
401  normal.top *= 2 * mLineWidth / length / (sharpness - 0.5f);
402 
403  // check orientation
404  lineDir = mLinePoints[i] - mLinePoints[i - 1];
405  if (lineDir.left * normal.top - lineDir.top * normal.left < 0)
406  {
407  normal.left = -normal.left;
408  normal.top = -normal.top;
409  }
410  FloatPoint lineDir1 = mLinePoints[i] - mLinePoints[i - 1];
411  FloatPoint lineDir2 = mLinePoints[i + 1] - mLinePoints[i];
412  if (lineDir1.left * lineDir2.top - lineDir1.top * lineDir2.left > 0)
413  {
414  normal.left = -normal.left;
415  normal.top = -normal.top;
416  }
417 
418  // check orientation
419  FloatPoint normal2 = _getPerpendicular(mLinePoints[i], mLinePoints[i + 1]);
420  lineDir = mLinePoints[i - 1] - mLinePoints[i];
421  if (lineDir.left * normal2.top - lineDir.top * normal2.left < 0)
422  {
423  normal2.left = -normal2.left;
424  normal2.top = -normal2.top;
425  }
426 
427  FloatPoint UVcenter((baseVerticiesUV[0].left + baseVerticiesUV[3].left) / 2, (baseVerticiesUV[0].top + baseVerticiesUV[3].top) / 2);
428 
429  if (draw)
430  {
431  mResultVerticiesPos.push_back(points[0]);
432  mResultVerticiesPos.push_back(mLinePoints[i] + normal);
433  mResultVerticiesPos.push_back(mLinePoints[i]);
434  mResultVerticiesUV.push_back(pointsUV[0]);
435  mResultVerticiesUV.push_back(baseVerticiesUV[0] + UVoffset);
436  mResultVerticiesUV.push_back(UVcenter + UVoffset);
437 
438  mResultVerticiesPos.push_back(mLinePoints[i] + normal);
439  mResultVerticiesPos.push_back(mLinePoints[i] + normal2);
440  mResultVerticiesPos.push_back(mLinePoints[i]);
441  mResultVerticiesUV.push_back(baseVerticiesUV[0] + UVoffset);
442  mResultVerticiesUV.push_back(baseVerticiesUV[0] + UVoffset);
443  mResultVerticiesUV.push_back(UVcenter + UVoffset);
444  }
445 
446  points[0] = mLinePoints[i] + normal2;
447  points[1] = mLinePoints[i] - normal2;
448  pointsUV[0] = baseVerticiesUV[0] + UVoffset;
449  pointsUV[1] = baseVerticiesUV[3] + UVoffset;
450  }
451  }
452 
453 
454 #ifndef MYGUI_NO_POLYGONAL_SKIN_CROPPING
455  // crop triangles
456  IntCoord cropRectangle(
457  mCurrentCoord.left,
458  mCurrentCoord.top,
459  mCurrentCoord.width,
460  mCurrentCoord.height
461  );
462 
463  VectorFloatPoint newResultVerticiesPos;
464  VectorFloatPoint newResultVerticiesUV;
465  newResultVerticiesPos.reserve(mResultVerticiesPos.size());
466  newResultVerticiesUV.reserve(mResultVerticiesPos.size());
467  for (size_t i = 0; i < mResultVerticiesPos.size(); i += 3)
468  {
469  VectorFloatPoint croppedTriangle =
470  geometry_utility::cropPolygon(&mResultVerticiesPos[i], 3, cropRectangle);
471  if (!croppedTriangle.empty())
472  {
473  FloatPoint v0 = mResultVerticiesUV[i + 2] - mResultVerticiesUV[i];
474  FloatPoint v1 = mResultVerticiesUV[i + 1] - mResultVerticiesUV[i];
475 
476  for (size_t j = 1; j < croppedTriangle.size() - 1; ++j)
477  {
478  newResultVerticiesPos.push_back(croppedTriangle[0]);
479  newResultVerticiesPos.push_back(croppedTriangle[j]);
480  newResultVerticiesPos.push_back(croppedTriangle[j + 1]);
481 
482  // calculate UV
483  FloatPoint point;
484  point = geometry_utility::getPositionInsideRect(croppedTriangle[0], mResultVerticiesPos[i], mResultVerticiesPos[i + 1], mResultVerticiesPos[i + 2]);
485  newResultVerticiesUV.push_back(geometry_utility::getUVFromPositionInsideRect(point, v0, v1, mResultVerticiesUV[i]));
486  point = geometry_utility::getPositionInsideRect(croppedTriangle[j], mResultVerticiesPos[i], mResultVerticiesPos[i + 1], mResultVerticiesPos[i + 2]);
487  newResultVerticiesUV.push_back(geometry_utility::getUVFromPositionInsideRect(point, v0, v1, mResultVerticiesUV[i]));
488  point = geometry_utility::getPositionInsideRect(croppedTriangle[j + 1], mResultVerticiesPos[i], mResultVerticiesPos[i + 1], mResultVerticiesPos[i + 2]);
489  newResultVerticiesUV.push_back(geometry_utility::getUVFromPositionInsideRect(point, v0, v1, mResultVerticiesUV[i]));
490  }
491  }
492  }
493  std::swap(mResultVerticiesPos, newResultVerticiesPos);
494  std::swap(mResultVerticiesUV, newResultVerticiesUV);
495 #endif
496 
497 
498  // now calculate widget base offset and then resulting position in screen coordinates
499  const RenderTargetInfo& info = mRenderItem->getRenderTarget()->getInfo();
500  float vertex_left_base = ((info.pixScaleX * (float)(mCroppedParent->getAbsoluteLeft()) + info.hOffset) * 2) - 1;
501  float vertex_top_base = -(((info.pixScaleY * (float)(mCroppedParent->getAbsoluteTop()) + info.vOffset) * 2) - 1);
502 
503  for (size_t i = 0; i < mResultVerticiesPos.size(); ++i)
504  {
505  mResultVerticiesPos[i].left = vertex_left_base + mResultVerticiesPos[i].left * info.pixScaleX * 2;
506  mResultVerticiesPos[i].top = vertex_top_base + mResultVerticiesPos[i].top * info.pixScaleY * -2;
507  }
508  }
509 
511  {
512  // dy, -dx
513  FloatPoint result(_point1.top - _point2.top, -(_point1.left - _point2.left));
514  // normalise
515  float length = len(result.top, result.left);
516  result.left /= length;
517  result.top /= length;
518  result.left *= mLineWidth / 2;
519  result.top *= mLineWidth / 2;
520  return result;
521  }
522 
523  FloatPoint PolygonalSkin::_getMiddleLine(const FloatPoint& _point1, const FloatPoint& _point2, const FloatPoint& _point3)
524  {
525  // bisectrix
526  FloatPoint line1 = _point3 - _point1;
527  FloatPoint line2 = _point3 - _point2;
528  float length = len(line1.top, line1.left);
529  line1.left /= length;
530  line1.top /= length;
531  length = len(line2.top, line2.left);
532  line2.left /= length;
533  line2.top /= length;
534  FloatPoint result = line1 + line2;
535  // normalise
536  length = len(result.top, result.left);
537  if (length < 1e-6f)
538  {
539  return _getPerpendicular(_point1, _point2);
540  }
541  result.left /= length;
542  result.top /= length;
543 
544  float cos = result.left * line1.left + result.top * line1.top;
545  float angle = std::acos(cos);
546 
547  // too sharp angle
548  if (std::fabs(angle) < 1e-6f /*< 0.2f*/)
549  return FloatPoint();
550 
551  float width = mLineWidth / 2 / std::sin(angle);
552  result.left *= width;
553  result.top *= width;
554  return result;
555  }
556 
557 } // namespace MyGUI
MyGUI::Singleton< RenderManager >::getInstance
static RenderManager & getInstance()
Definition: MyGUI_Singleton.h:44
MyGUI::PolygonalSkin::PolygonalSkin
PolygonalSkin()
Definition: MyGUI_PolygonalSkin.cpp:17
MyGUI::types::TRect::bottom
T bottom
Definition: MyGUI_TRect.h:23
MyGUI::RenderItem::setLastVertexCount
void setLastVertexCount(size_t _count)
Definition: MyGUI_RenderItem.cpp:235
MyGUI::RenderTargetInfo::vOffset
float vOffset
Definition: MyGUI_RenderTargetInfo.h:41
MyGUI::Align::isHCenter
bool isHCenter() const
Definition: MyGUI_Align.h:44
MyGUI::geometry_utility::cropPolygon
VectorFloatPoint cropPolygon(FloatPoint *_baseVerticiesPos, size_t _size, const IntCoord &_cropRectangle)
Definition: MyGUI_GeometryUtility.cpp:16
MyGUI::types::TSize::height
T height
Definition: MyGUI_TSize.h:21
MyGUI::PolygonalSkin::_setUVSet
void _setUVSet(const FloatRect &_rect) override
Definition: MyGUI_PolygonalSkin.cpp:279
MyGUI::RenderItem::reallockDrawItem
void reallockDrawItem(ISubWidget *_item, size_t _count)
Definition: MyGUI_RenderItem.cpp:143
MyGUI::types::TCoord::left
T left
Definition: MyGUI_TCoord.h:22
MyGUI::ICroppedRectangle::mIsMargin
bool mIsMargin
Definition: MyGUI_ICroppedRectangle.h:248
MyGUI::types::TPoint::top
T top
Definition: MyGUI_TPoint.h:21
MyGUI::texture_utility::convertColour
void convertColour(uint32 &_colour, VertexColourType _format)
Definition: MyGUI_TextureUtility.h:23
MyGUI::ICroppedRectangle::_getViewHeight
int _getViewHeight() const
Definition: MyGUI_ICroppedRectangle.h:153
MyGUI::types::TCoord::top
T top
Definition: MyGUI_TCoord.h:23
MyGUI::len
float len(float x, float y)
Definition: MyGUI_PolygonalSkin.cpp:31
MyGUI::ICroppedRectangle::getAbsoluteTop
int getAbsoluteTop() const
Definition: MyGUI_ICroppedRectangle.h:88
MyGUI::uint8
unsigned char uint8
Definition: MyGUI_Types.h:44
MyGUI::types::TRect< float >
MyGUI::ILayerNode::addToRenderItem
virtual RenderItem * addToRenderItem(ITexture *_texture, bool _firstQueue, bool _separate)=0
MyGUI::PolygonalSkin::setAlpha
void setAlpha(float _alpha) override
Definition: MyGUI_PolygonalSkin.cpp:107
MyGUI::ILayerNode::outOfDate
virtual void outOfDate(RenderItem *_item)=0
MyGUI::types::TRect::right
T right
Definition: MyGUI_TRect.h:22
MyGUI::ILayerNode
Definition: MyGUI_ILayerNode.h:30
MyGUI::SubSkinStateInfo::getRect
const FloatRect & getRect() const
Definition: MyGUI_CommonStateInfo.h:25
MyGUI::ICroppedRectangle::getAbsoluteLeft
int getAbsoluteLeft() const
Definition: MyGUI_ICroppedRectangle.h:83
MyGUI::ICroppedRectangle::mMargin
IntRect mMargin
Definition: MyGUI_ICroppedRectangle.h:244
MyGUI::Align::isVCenter
bool isVCenter() const
Definition: MyGUI_Align.h:49
MyGUI::types::TPoint
Definition: MyGUI_TPoint.h:19
MyGUI_CommonStateInfo.h
MyGUI::RenderTargetInfo::hOffset
float hOffset
Definition: MyGUI_RenderTargetInfo.h:40
MyGUI::types::TSize::width
T width
Definition: MyGUI_TSize.h:20
MyGUI::PolygonalSkin::_updateView
void _updateView() override
Definition: MyGUI_PolygonalSkin.cpp:177
MyGUI::types::TRect::left
T left
Definition: MyGUI_TRect.h:20
MyGUI::ISubWidget::mVisible
bool mVisible
Definition: MyGUI_ISubWidget.h:60
MyGUI::ILayerNode::getNodeDepth
virtual float getNodeDepth()=0
MyGUI::IStateInfo
Definition: MyGUI_IStateInfo.h:18
MyGUI_Precompiled.h
MyGUI::ICroppedRectangle::_checkOutside
bool _checkOutside() const
Definition: MyGUI_ICroppedRectangle.h:235
MyGUI::ICroppedRectangle::mCroppedParent
ICroppedRectangle * mCroppedParent
Definition: MyGUI_ICroppedRectangle.h:249
MyGUI::ICroppedRectangle::mCoord
IntCoord mCoord
Definition: MyGUI_ICroppedRectangle.h:245
MyGUI::geometry_utility::getPositionInsideRect
FloatPoint getPositionInsideRect(const FloatPoint &_point, const FloatPoint &_corner0, const FloatPoint &_corner1, const FloatPoint &_corner2)
Definition: MyGUI_GeometryUtility.cpp:89
MyGUI::PolygonalSkin::createDrawItem
void createDrawItem(ITexture *_texture, ILayerNode *_node) override
Definition: MyGUI_PolygonalSkin.cpp:218
MyGUI::geometry_utility::getUVFromPositionInsideRect
FloatPoint getUVFromPositionInsideRect(const FloatPoint &_point, const FloatPoint &_v0, const FloatPoint &_v1, const FloatPoint &_baseUV)
Definition: MyGUI_GeometryUtility.cpp:105
MyGUI::types::TPoint::left
T left
Definition: MyGUI_TPoint.h:20
MyGUI::uint32
unsigned int uint32
Definition: MyGUI_Types.h:46
MyGUI::PolygonalSkin::_getPerpendicular
FloatPoint _getPerpendicular(const FloatPoint &_point1, const FloatPoint &_point2)
Definition: MyGUI_PolygonalSkin.cpp:510
MyGUI::PolygonalSkin::setStateData
void setStateData(IStateInfo *_data) override
Definition: MyGUI_PolygonalSkin.cpp:274
MyGUI::RenderTargetInfo::pixScaleX
float pixScaleX
Definition: MyGUI_RenderTargetInfo.h:38
MyGUI::IRenderTarget::getInfo
virtual const RenderTargetInfo & getInfo()=0
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition: MyGUI_Diagnostic.h:34
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition: MyGUI_IObject.h:18
MyGUI::VertexQuad::VertexCount
@ VertexCount
Definition: MyGUI_VertexData.h:43
MyGUI::Align::isVStretch
bool isVStretch() const
Definition: MyGUI_Align.h:84
MyGUI::SubSkinStateInfo
Definition: MyGUI_CommonStateInfo.h:21
MyGUI::RenderItem::getRenderTarget
IRenderTarget * getRenderTarget()
Definition: MyGUI_RenderItem.cpp:240
MyGUI::VertexQuad
Definition: MyGUI_VertexData.h:34
MyGUI::PolygonalSkin::setStroke
void setStroke(size_t _value)
Definition: MyGUI_PolygonalSkin.cpp:89
MyGUI::RenderTargetInfo::pixScaleY
float pixScaleY
Definition: MyGUI_RenderTargetInfo.h:39
MyGUI::PolygonalSkin::_setColour
void _setColour(const Colour &_value) override
Definition: MyGUI_PolygonalSkin.cpp:264
MyGUI::types::TSize< int >
MyGUI::FloatPoint
types::TPoint< float > FloatPoint
Definition: MyGUI_Types.h:27
MyGUI_RenderItem.h
MyGUI::VectorFloatPoint
std::vector< FloatPoint > VectorFloatPoint
Definition: MyGUI_GeometryUtility.h:16
MyGUI::ISubWidget::mAlign
Align mAlign
Definition: MyGUI_ISubWidget.h:59
MyGUI::Align::isRight
bool isRight() const
Definition: MyGUI_Align.h:64
MyGUI::ITexture
Definition: MyGUI_ITexture.h:28
MyGUI::Colour
Definition: MyGUI_Colour.h:17
MyGUI::types::TRect::top
T top
Definition: MyGUI_TRect.h:21
MyGUI::PolygonalSkin::_setAlign
void _setAlign(const IntSize &_oldsize) override
Definition: MyGUI_PolygonalSkin.cpp:124
MyGUI::PolygonalSkin::setVisible
void setVisible(bool _visible) override
Definition: MyGUI_PolygonalSkin.cpp:95
MyGUI::RenderTargetInfo
Definition: MyGUI_RenderTargetInfo.h:16
MyGUI_RenderManager.h
MyGUI::Align::isBottom
bool isBottom() const
Definition: MyGUI_Align.h:79
MyGUI::types::TCoord::width
T width
Definition: MyGUI_TCoord.h:24
MyGUI::RenderItem::removeDrawItem
void removeDrawItem(ISubWidget *_item)
Definition: MyGUI_RenderItem.cpp:100
MyGUI::PolygonalSkin::_getMiddleLine
FloatPoint _getMiddleLine(const FloatPoint &_point1, const FloatPoint &_point2, const FloatPoint &_point3)
Definition: MyGUI_PolygonalSkin.cpp:523
MyGUI::ICroppedRectangle::_checkMargin
bool _checkMargin()
Definition: MyGUI_ICroppedRectangle.h:185
MyGUI::ICroppedRectangle::_getViewWidth
int _getViewWidth() const
Definition: MyGUI_ICroppedRectangle.h:149
MyGUI::RenderManager::getVertexFormat
virtual VertexColourType getVertexFormat()=0
MyGUI::ICroppedRectangle::getHeight
int getHeight() const
Definition: MyGUI_ICroppedRectangle.h:119
MyGUI_GeometryUtility.h
MyGUI::RenderItem::addDrawItem
void addDrawItem(ISubWidget *_item, size_t _count)
Definition: MyGUI_RenderItem.cpp:125
MyGUI::PolygonalSkin::destroyDrawItem
void destroyDrawItem() override
Definition: MyGUI_PolygonalSkin.cpp:227
MyGUI::Vertex
Definition: MyGUI_VertexData.h:17
MyGUI::RenderItem::getCurrentVertexBuffer
Vertex * getCurrentVertexBuffer() const
Definition: MyGUI_RenderItem.cpp:230
MyGUI::RenderItem::getCurrentUpdate
bool getCurrentUpdate() const
Definition: MyGUI_RenderItem.cpp:225
MyGUI::PolygonalSkin::doRender
void doRender() override
Definition: MyGUI_PolygonalSkin.cpp:236
MyGUI::types::TCoord< int >
MyGUI::ICroppedRectangle::getWidth
int getWidth() const
Definition: MyGUI_ICroppedRectangle.h:114
MyGUI::PolygonalSkin::setPoints
void setPoints(const std::vector< FloatPoint > &_points)
Definition: MyGUI_PolygonalSkin.cpp:36
MyGUI::PolygonalSkin::_correctView
void _correctView() override
Definition: MyGUI_PolygonalSkin.cpp:116
MyGUI::PolygonalSkin::_rebuildGeometry
void _rebuildGeometry()
Definition: MyGUI_PolygonalSkin.cpp:289
MyGUI::Vertex::set
void set(float _x, float _y, float _z, float _u, float _v, uint32 _colour)
Definition: MyGUI_VertexData.h:18
MyGUI::types::TCoord::height
T height
Definition: MyGUI_TCoord.h:25
MyGUI
Definition: MyGUI_ActionController.h:15
MyGUI::PolygonalSkin::setWidth
void setWidth(float _width)
Definition: MyGUI_PolygonalSkin.cpp:83
MyGUI_PolygonalSkin.h
MyGUI::Align::isHStretch
bool isHStretch() const
Definition: MyGUI_Align.h:69
MyGUI::texture_utility::toColourARGB
uint32 toColourARGB(const Colour &_colour)
Definition: MyGUI_TextureUtility.cpp:68