KiCad PCB EDA Suite
Loading...
Searching...
No Matches
router_preview_item.cpp
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Tomasz Wlostowski <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include "router_preview_item.h"
23
24#include <deque>
25
26#include <board_item.h>
28#include <gal/color4d.h>
30#include <geometry/shape_rect.h>
32#include <pcb_painter.h>
33#include <trigo.h>
34
35#include "pns_arc.h"
36#include "pns_line.h"
37#include "pns_segment.h"
38#include "pns_via.h"
39#include "pns_kicad_iface.h"
40
41using namespace KIGFX;
42
43
45 KIGFX::VIEW* aView, int aFlags ) :
47 m_view( aView ),
48 m_iface( aIface ),
49 m_shape( nullptr ),
50 m_hole( nullptr ),
51 m_flags( aFlags )
52{
53 BOARD_ITEM* boardItem = aItem ? aItem->BoardItem() : nullptr;
54
55 // A PNS::SOLID for an edge-cut item must have 0 width for collision calculations, but when
56 // highlighting an edge we want to show it with its true width
57 if( boardItem && boardItem->IsOnLayer( Edge_Cuts ) )
58 {
59 m_shape = aItem->Shape( -1 )->Clone();
60
61 switch( m_shape->Type() )
62 {
63 case SH_SEGMENT: static_cast<SHAPE_SEGMENT*>( m_shape )->SetWidth( 0 ); break;
64 case SH_ARC: static_cast<SHAPE_ARC*>( m_shape )->SetWidth( 0 ); break;
65 case SH_LINE_CHAIN: static_cast<SHAPE_LINE_CHAIN*>( m_shape )->SetWidth( 0 ); break;
66 default: /* remaining shapes don't have width */ break;
67 }
68 }
69 else if( aItem )
70 {
71 // TODO(JE) padstacks -- need to know the layer here
72 m_shape = aItem->Shape( -1 )->Clone();
73
74 if( aItem->HasHole() )
75 m_hole = aItem->Hole()->Shape( -1 )->Clone();
76 }
77
78 m_clearance = -1;
79 m_originLayer = m_layer = LAYER_SELECT_OVERLAY ;
80
81 m_showClearance = false;
82
83 // initialize variables, overwritten by Update( aItem ), if aItem != NULL
84 m_type = PR_SHAPE;
85 m_width = ( aFlags & PNS_SEMI_SOLID ) ? 1 : 0;
86 m_depth = m_originDepth = aView->GetLayerOrder( m_originLayer );
87
88 if( aItem )
89 Update( aItem );
90}
91
92
94 KIGFX::VIEW* aView ) :
96 m_view( aView ),
97 m_iface( aIface ),
98 m_flags( 0 )
99{
100 m_shape = aShape.Clone();
101 m_hole = nullptr;
102
103 m_clearance = -1;
105
106 m_showClearance = false;
107
108 // initialize variables, overwritten by Update( aItem ), if aItem != NULL
110 m_width = 0;
112}
113
114
116{
117 delete m_shape;
118 delete m_hole;
119}
120
121
123{
124 m_originLayer = m_iface->GetBoardLayerFromPNSLayer( aItem->Layers().Start() );
125
126 if( const PNS::LINE* l = dyn_cast<const PNS::LINE*>( aItem ) )
127 {
128 if( !l->SegmentCount() )
129 return;
130 }
131 else if( const PNS::VIA* v = dyn_cast<const PNS::VIA*>( aItem ) )
132 {
133 if( v->IsVirtual() )
134 return;
135 }
136
137 if( m_originLayer < 0 )
138 m_originLayer = 0;
139
142 m_color.a = 0.8;
143 m_depth = m_originDepth - ( ( aItem->Layers().Start() + 1 ) * LayerDepthFactor );
144
145 switch( aItem->Kind() )
146 {
149 m_width = static_cast<const PNS::LINE*>( aItem )->Width();
150 break;
151
152 case PNS::ITEM::ARC_T:
154 m_width = static_cast<const PNS::ARC*>( aItem )->Width();
155 break;
156
159 m_width = static_cast<const PNS::SEGMENT*>( aItem )->Width();
160 break;
161
162 case PNS::ITEM::VIA_T:
163 {
166 m_width = 0;
167 m_color = COLOR4D( 0.7, 0.7, 0.7, 0.8 );
168 m_depth = m_originDepth - ( static_cast<double>( PCB_LAYER_ID_COUNT ) * LayerDepthFactor );
169
170 delete m_shape;
171 m_shape = nullptr;
172
173 auto via = static_cast<const PNS::VIA*>( aItem );
174 int shapeLayer = -1;
175 int largestDiameter = 0;
176
177 for( int layer : via->UniqueShapeLayers() )
178 {
179 if( via->Diameter( layer ) > largestDiameter )
180 {
181 largestDiameter = via->Diameter( layer );
182 shapeLayer = layer;
183 }
184 }
185
186 if( aItem->Shape( shapeLayer ) )
187 m_shape = aItem->Shape( shapeLayer )->Clone();
188
189 delete m_hole;
190 m_hole = nullptr;
191
192 if( aItem->HasHole() )
193 m_hole = aItem->Hole()->Shape( -1 )->Clone();
194
195 break;
196 }
197
200 break;
201
202 default:
203 break;
204 }
205
206 if( aItem->Marker() & PNS::MK_VIOLATION )
208
209 if( m_flags & PNS_COLLISION )
210 m_color = COLOR4D( 0, 1, 0, 1 );
211
212 if( m_flags & PNS_HOVER_ITEM )
213 m_color = m_color.WithAlpha( 1.0 );
214}
215
216
218{
219 BOX2I bbox;
220
221 switch( m_type )
222 {
223 case PR_SHAPE:
224 if( m_shape )
225 {
226 bbox = m_shape->BBox();
227 bbox.Inflate( m_width / 2 );
228 }
229
230 if( m_hole )
231 bbox.Merge( m_hole->BBox() );
232
233 return bbox;
234
235 case PR_POINT:
236 bbox = BOX2I ( m_pos - VECTOR2I( 100000, 100000 ), VECTOR2I( 200000, 200000 ) );
237 return bbox;
238
239 default:
240 break;
241 }
242
243 return bbox;
244}
245
246
248{
249 wxCHECK( aL, /* void */ );
250
251 gal->SetIsFill( false );
252
253 for( int s = 0; s < (int) aL->GetSegmentCount(); s++ )
254 {
255 SEG seg = aL->GetSegment( s );
256
257 if( seg.A == seg.B )
258 {
259 gal->SetIsFill( true );
260 gal->SetIsStroke( false );
261 gal->DrawCircle( seg.A, gal->GetLineWidth() / 2 );
262 gal->SetIsFill( false );
263 gal->SetIsStroke( true );
264 }
265 else
266 {
267 gal->DrawLine( seg.A, seg.B );
268 }
269 }
270
271 const SHAPE_LINE_CHAIN* lineChain = dynamic_cast<const SHAPE_LINE_CHAIN*>( aL );
272
273 for( size_t s = 0; lineChain && s < lineChain->ArcCount(); s++ )
274 {
275 const SHAPE_ARC& arc = lineChain->CArcs()[s];
276 EDA_ANGLE start_angle = arc.GetStartAngle();
277 EDA_ANGLE angle = arc.GetCentralAngle();
278
279 gal->DrawArc( arc.GetCenter(), arc.GetRadius(), start_angle, angle);
280 }
281
282 if( aL->IsClosed() )
283 gal->DrawLine( aL->GetSegment( -1 ).B, aL->GetSegment( 0 ).A );
284}
285
286
287void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) const
288{
289 bool holeDrawn = false;
290 bool showClearance = m_showClearance;
291
292 // Always show clearance when we're in collision, even if the preference is off
293 if( ( m_flags & PNS_COLLISION ) > 0 )
294 showClearance = true;
295
296 switch( aShape->Type() )
297 {
299 {
300 const SHAPE_LINE_CHAIN_BASE* l = (const SHAPE_LINE_CHAIN_BASE*) aShape;
301
302 if( showClearance && m_clearance > 0 )
303 {
304 gal->SetLineWidth( m_width + 2 * m_clearance );
305 drawLineChain( l, gal );
306 }
307
308 gal->SetLayerDepth( m_depth );
309 gal->SetLineWidth( m_width );
310 gal->SetStrokeColor( m_color );
311 gal->SetFillColor( m_color );
312 drawLineChain( l, gal );
313 break;
314 }
315
316 case SH_LINE_CHAIN:
317 {
318 const SHAPE_LINE_CHAIN* l = (const SHAPE_LINE_CHAIN*) aShape;
319 const int w = m_width;
320
321 if( showClearance && m_clearance > 0 )
322 {
323 gal->SetLineWidth( w + 2 * m_clearance );
324 drawLineChain( l, gal );
325 }
326
327 gal->SetLayerDepth( m_depth );
328 gal->SetLineWidth( w );
329 gal->SetStrokeColor( m_color );
330 gal->SetFillColor( m_color );
331 drawLineChain( l, gal );
332 break;
333 }
334
335 case SH_SEGMENT:
336 {
337 const SHAPE_SEGMENT* s = (const SHAPE_SEGMENT*) aShape;
338 const int w = s->GetWidth();
339
340 gal->SetIsStroke( false );
341
342 if( showClearance && m_clearance > 0 )
343 {
344 gal->SetLineWidth( w + 2 * m_clearance );
345 gal->DrawSegment( s->GetSeg().A, s->GetSeg().B, s->GetWidth() + 2 * m_clearance );
346 }
347
348 gal->SetLayerDepth( m_depth );
349 gal->SetLineWidth( w );
350 gal->SetFillColor( m_color );
351 gal->DrawSegment( s->GetSeg().A, s->GetSeg().B, s->GetWidth() );
352 break;
353 }
354
355 case SH_CIRCLE:
356 {
357 const SHAPE_CIRCLE* c = static_cast<const SHAPE_CIRCLE*>( aShape );
358 gal->SetStrokeColor( m_color );
359
360 if( showClearance && m_clearance > 0 )
361 {
362 gal->SetIsStroke( false );
363 gal->DrawCircle( c->GetCenter(), c->GetRadius() + m_clearance );
364 }
365
366 gal->SetLayerDepth( m_depth );
367
368 if( m_hole && dynamic_cast<SHAPE_CIRCLE*>( m_hole ) )
369 {
370 const SHAPE_CIRCLE* h = static_cast<const SHAPE_CIRCLE*>( m_hole );
371 int halfWidth = m_width / 2;
372
373 gal->SetIsStroke( true );
374 gal->SetIsFill( false );
375 gal->SetLineWidth( halfWidth + c->GetRadius() - h->GetRadius() );
376 gal->DrawCircle( c->GetCenter(), ( halfWidth + c->GetRadius() + h->GetRadius() ) / 2 );
377
378 holeDrawn = true;
379 }
380 else
381 {
382 gal->SetIsStroke( m_width ? true : false );
383 gal->SetLineWidth( m_width );
384 gal->SetFillColor( m_color );
385 gal->DrawCircle( c->GetCenter(), c->GetRadius() );
386 }
387
388 break;
389 }
390
391 case SH_RECT:
392 {
393 const SHAPE_RECT* r = (const SHAPE_RECT*) aShape;
394 gal->SetFillColor( m_color );
395
396 if( showClearance && m_clearance > 0 )
397 {
398 VECTOR2I p0( r->GetPosition() ), s( r->GetSize() );
399 gal->SetIsStroke( true );
400 gal->SetLineWidth( 2 * m_clearance );
401 gal->DrawLine( p0, VECTOR2I( p0.x + s.x, p0.y ) );
402 gal->DrawLine( p0, VECTOR2I( p0.x, p0.y + s.y ) );
403 gal->DrawLine( p0 + s , VECTOR2I( p0.x + s.x, p0.y ) );
404 gal->DrawLine( p0 + s, VECTOR2I( p0.x, p0.y + s.y ) );
405 }
406
407 gal->SetLayerDepth( m_depth );
408 gal->SetIsStroke( m_width ? true : false );
409 gal->SetLineWidth( m_width);
410 gal->SetStrokeColor( m_color );
411 gal->DrawRectangle( r->GetPosition(), r->GetPosition() + r->GetSize() );
412
413 break;
414 }
415
416 case SH_SIMPLE:
417 {
418 const SHAPE_SIMPLE* c = (const SHAPE_SIMPLE*) aShape;
419 std::deque<VECTOR2D> polygon = std::deque<VECTOR2D>();
420
421 for( int i = 0; i < c->PointCount(); i++ )
422 {
423 polygon.push_back( c->CDPoint( i ) );
424 }
425
426 gal->SetFillColor( m_color );
427
428 if( showClearance && m_clearance > 0 )
429 {
430 gal->SetIsStroke( true );
431 gal->SetLineWidth( 2 * m_clearance );
432
433 // need the implicit last segment to be explicit for DrawPolyline
434 polygon.push_back( c->CDPoint( 0 ) );
435 gal->DrawPolyline( polygon );
436 }
437
438 gal->SetLayerDepth( m_depth );
439 gal->SetIsStroke( m_width ? true : false );
440 gal->SetLineWidth( m_width );
441 gal->SetStrokeColor( m_color );
442 gal->DrawPolygon( polygon );
443 break;
444 }
445
446 case SH_ARC:
447 {
448 const SHAPE_ARC* arc = static_cast<const SHAPE_ARC*>( aShape );
449 const int w = arc->GetWidth();
450 EDA_ANGLE start_angle = arc->GetStartAngle();
451 EDA_ANGLE angle = arc->GetCentralAngle();
452
453 gal->SetIsFill( false );
454 gal->SetIsStroke( true );
455
456 if( showClearance && m_clearance > 0 )
457 {
458 gal->SetLineWidth( w + 2 * m_clearance );
459 gal->DrawArc( arc->GetCenter(), arc->GetRadius(), start_angle, angle );
460 }
461
462 gal->SetLayerDepth( m_depth );
463 gal->SetStrokeColor( m_color );
464 gal->SetFillColor( m_color );
465 gal->SetLineWidth( w );
466 gal->DrawArc( arc->GetCenter(), arc->GetRadius(), start_angle, angle );
467 break;
468 }
469
470 case SH_COMPOUND:
471 wxFAIL_MSG( wxT( "Router preview item: nested compound shapes not supported" ) );
472 break;
473
474 case SH_POLY_SET:
475 wxFAIL_MSG( wxT( "Router preview item: SHAPE_POLY_SET not supported" ) );
476 break;
477
478 case SH_NULL:
479 break;
480 }
481
482 if( m_hole && !holeDrawn )
483 {
484 gal->SetLayerDepth( m_depth );
485 gal->SetIsStroke( true );
486 gal->SetIsFill( false );
487 gal->SetStrokeColor( m_color );
488 gal->SetLineWidth( 1 );
489
490 SHAPE_CIRCLE* circle = dynamic_cast<SHAPE_CIRCLE*>( m_hole );
491 SHAPE_SEGMENT* slot = dynamic_cast<SHAPE_SEGMENT*>( m_hole );
492
493 if( circle )
494 gal->DrawCircle( circle->GetCenter(), circle->GetRadius() );
495 else if( slot )
496 gal->DrawSegment( slot->GetSeg().A, slot->GetSeg().B, slot->GetWidth() );
497 }
498}
499
500
501void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
502{
503 GAL* gal = aView->GetGAL();
504 //col.Brighten(0.7);
505
506 if( m_type == PR_SHAPE )
507 {
508 if( !m_shape )
509 return;
510
511 // N.B. The order of draw here is important
512 // Cairo doesn't current support z-ordering, so we need
513 // to draw the clearance first to ensure it is in the background
515
516 //TODO(snh) Add configuration option for the color/alpha here
517 gal->SetStrokeColor( COLOR4D( DARKDARKGRAY ).WithAlpha( 0.9 ) );
518 gal->SetFillColor( COLOR4D( DARKDARKGRAY ).WithAlpha( 0.7 ) );
519 gal->SetIsStroke( m_width ? true : false );
520 gal->SetIsFill( true );
521
522 // Semi-solids (ie: rule areas) which are not in collision are sketched (ie: outline only)
523 if( ( m_flags & PNS_SEMI_SOLID ) > 0 && ( m_flags & PNS_COLLISION ) == 0 )
524 gal->SetIsFill( false );
525
526 if( m_shape->HasIndexableSubshapes() )
527 {
528 std::vector<const SHAPE*> subshapes;
529 m_shape->GetIndexableSubshapes( subshapes );
530
531 for( const SHAPE* shape : subshapes )
532 drawShape( shape, gal );
533 }
534 else
535 {
536 drawShape( m_shape, gal );
537 }
538 }
539}
540
541
543{
544 auto settings = static_cast<PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
545
546 COLOR4D color = settings->GetLayerColor( aLayer );
547
548 if( m_flags & PNS_HEAD_TRACE )
549 return color.Saturate( 1.0 );
550 else if( m_flags & PNS_HOVER_ITEM )
551 return color.Brightened( 0.7 );
552
553 return color;
554}
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition board_item.h:319
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:558
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition box2.h:658
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:41
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:105
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
Definition color4d.h:269
COLOR4D & Saturate(double aFactor)
Saturates the color to a given factor (in HSV model)
Definition color4d.cpp:517
Abstract interface for drawing on a 2D-surface.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList)
Draw a polyline.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle)
Draw an arc.
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
Draw a rounded segment.
float GetLineWidth() const
Get the line width.
PCB specific render settings.
Definition pcb_painter.h:82
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:67
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition view.cpp:671
GAL * GetGAL() const
Return the GAL this view is using to draw graphical primitives.
Definition view.h:203
const SHAPE * Shape(int aLayer) const override
Return the geometrical shape of the item.
Definition pns_hole.h:69
Base class for PNS router board items.
Definition pns_item.h:98
virtual const SHAPE * Shape(int aLayer) const
Return the geometrical shape of the item.
Definition pns_item.h:242
const PNS_LAYER_RANGE & Layers() const
Definition pns_item.h:212
PnsKind Kind() const
Return the type (kind) of the item.
Definition pns_item.h:173
virtual HOLE * Hole() const
Definition pns_item.h:304
virtual bool HasHole() const
Definition pns_item.h:303
virtual BOARD_ITEM * BoardItem() const
Definition pns_item.h:207
virtual int Marker() const
Definition pns_item.h:263
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition pns_line.h:62
int Start() const
ROUTER_PREVIEW_ITEM(const SHAPE &aShape, PNS::ROUTER_IFACE *aIface, KIGFX::VIEW *aView)
static constexpr double LayerDepthFactor
We draw this item on a single layer, but we stack up all the layers from the various components that ...
void Update(const PNS::ITEM *aItem)
const KIGFX::COLOR4D getLayerColor(int aLayer) const
virtual void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
void drawLineChain(const SHAPE_LINE_CHAIN_BASE *aL, KIGFX::GAL *aGal) const
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void drawShape(const SHAPE *aShape, KIGFX::GAL *aGal) const
PNS::ROUTER_IFACE * m_iface
Definition seg.h:42
VECTOR2I A
Definition seg.h:49
VECTOR2I B
Definition seg.h:50
EDA_ANGLE GetCentralAngle() const
Get the "central angle" of the arc - this is the angle at the point of the "pie slice".
int GetWidth() const override
Definition shape_arc.h:215
double GetRadius() const
EDA_ANGLE GetStartAngle() const
const VECTOR2I & GetCenter() const
SHAPE_TYPE Type() const
Return the type of the shape.
Definition shape.h:98
int GetRadius() const
const VECTOR2I GetCenter() const
virtual size_t GetSegmentCount() const =0
virtual bool IsClosed() const =0
virtual const SEG GetSegment(int aIndex) const =0
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const std::vector< SHAPE_ARC > & CArcs() const
size_t ArcCount() const
const VECTOR2I & GetPosition() const
Definition shape_rect.h:169
const VECTOR2I GetSize() const
Definition shape_rect.h:177
const SEG & GetSeg() const
int GetWidth() const override
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
int PointCount() const
Return the number of points (vertices) in this polygon.
const VECTOR2D CDPoint(int aIndex) const
Return a given point as a vector with elements of type double.
An abstract shape on 2D plane.
Definition shape.h:126
virtual SHAPE * Clone() const
Return a dynamically allocated copy of the shape.
Definition shape.h:148
@ DARKDARKGRAY
Definition color4d.h:45
@ LAYER_SELECT_OVERLAY
Selected items overlay.
Definition layer_ids.h:280
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition layer_ids.h:232
@ Edge_Cuts
Definition layer_ids.h:112
@ PCB_LAYER_ID_COUNT
Definition layer_ids.h:171
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:33
@ MK_VIOLATION
Definition pns_item.h:44
#define PNS_HEAD_TRACE
#define PNS_SEMI_SOLID
#define PNS_HOVER_ITEM
#define PNS_COLLISION
@ SH_POLY_SET
set of polygons (with holes, etc.)
Definition shape.h:52
@ SH_RECT
axis-aligned rectangle
Definition shape.h:47
@ SH_CIRCLE
circle
Definition shape.h:50
@ SH_SIMPLE
simple polygon
Definition shape.h:51
@ SH_NULL
empty shape (no shape...),
Definition shape.h:55
@ SH_SEGMENT
line segment
Definition shape.h:48
@ SH_ARC
circular arc
Definition shape.h:54
@ SH_POLY_SET_TRIANGLE
a single triangle belonging to a POLY_SET triangulation
Definition shape.h:56
@ SH_LINE_CHAIN
line chain (polyline)
Definition shape.h:49
@ SH_COMPOUND
compound shape, consisting of multiple simple shapes
Definition shape.h:53
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
@ NOT_USED
the 3d code uses this value
Definition typeinfo.h:79
Casted dyn_cast(From aObject)
A lightweight dynamic downcast.
Definition typeinfo.h:61
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695