You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

624 lines
18 KiB

  1. /************************************/
  2. /* fonctions de la classe COTATION */
  3. /************************************/
  4. #include "fctsys.h"
  5. #include "gr_basic.h"
  6. #include "common.h"
  7. #include "pcbnew.h"
  8. #include "trigo.h"
  9. #include "wxstruct.h"
  10. COTATION::COTATION( BOARD_ITEM* StructFather ) :
  11. BOARD_ITEM( StructFather, TYPECOTATION )
  12. {
  13. m_Layer = DRAW_LAYER;
  14. m_Width = 50;
  15. m_Value = 0;
  16. m_Shape = 0;
  17. m_Unit = INCHES;
  18. m_Text = new TEXTE_PCB( this );
  19. }
  20. /* Effacement memoire de la structure */
  21. COTATION::~COTATION()
  22. {
  23. delete m_Text;
  24. }
  25. /* supprime du chainage la structure Struct
  26. * les structures arrieres et avant sont chainees directement
  27. */
  28. void COTATION::UnLink()
  29. {
  30. /* Modification du chainage arriere */
  31. if( Pback )
  32. {
  33. if( Pback->Type() != TYPEPCB )
  34. {
  35. Pback->Pnext = Pnext;
  36. }
  37. else /* Le chainage arriere pointe sur la structure "Pere" */
  38. {
  39. ( (BOARD*) Pback )->m_Drawings = (BOARD_ITEM*) Pnext;
  40. }
  41. }
  42. /* Modification du chainage avant */
  43. if( Pnext )
  44. Pnext->Pback = Pback;
  45. Pnext = Pback = NULL;
  46. }
  47. /* Setup the dimension text */
  48. void COTATION:: SetText( const wxString& NewText )
  49. {
  50. m_Text->m_Text = NewText;
  51. }
  52. /**********************************/
  53. wxString COTATION:: GetText( void )
  54. /**********************************/
  55. /* Reutun the dimension text
  56. */
  57. {
  58. return m_Text->m_Text;
  59. }
  60. /*************************************/
  61. void COTATION::Copy( COTATION* source )
  62. /*************************************/
  63. {
  64. m_Value = source->m_Value;
  65. SetLayer( source->GetLayer() );
  66. m_Width = source->m_Width;
  67. m_Pos = source->m_Pos;
  68. m_Shape = source->m_Shape;
  69. m_Unit = source->m_Unit;
  70. m_TimeStamp = GetTimeStamp();
  71. m_Text->Copy( source->m_Text );
  72. Barre_ox = source->Barre_ox; Barre_oy = source->Barre_oy;
  73. Barre_fx = source->Barre_fx; Barre_fy = source->Barre_fy;
  74. TraitG_ox = source->TraitG_ox; TraitG_oy = source->TraitG_oy;
  75. TraitG_fx = source->TraitG_fx; TraitG_fy = source->TraitG_fy;
  76. TraitD_ox = source->TraitD_ox; TraitD_oy = source->TraitD_oy;
  77. TraitD_fx = source->TraitD_fx; TraitD_fy = source->TraitD_fy;
  78. FlecheD1_ox = source->FlecheD1_ox; FlecheD1_oy = source->FlecheD1_oy;
  79. FlecheD1_fx = source->FlecheD1_fx; FlecheD1_fy = source->FlecheD1_fy;
  80. FlecheD2_ox = source->FlecheD2_ox; FlecheD2_oy = source->FlecheD2_oy;
  81. FlecheD2_fx = source->FlecheD2_fx; FlecheD2_fy = source->FlecheD2_fy;
  82. FlecheG1_ox = source->FlecheG1_ox; FlecheG1_oy = source->FlecheG1_oy;
  83. FlecheG1_fx = source->FlecheG1_fx; FlecheG1_fy = source->FlecheG1_fy;
  84. FlecheG2_ox = source->FlecheG2_ox; FlecheG2_oy = source->FlecheG2_oy;
  85. FlecheG2_fx = source->FlecheG2_fx; FlecheG2_fy = source->FlecheG2_fy;
  86. }
  87. /***************************************************************/
  88. bool COTATION::ReadCotationDescr( FILE* File, int* LineNum )
  89. /***************************************************************/
  90. {
  91. char Line[2048], Text[2048];
  92. while( GetLine( File, Line, LineNum ) != NULL )
  93. {
  94. if( strnicmp( Line, "$EndCOTATION", 4 ) == 0 )
  95. return TRUE;
  96. if( Line[0] == 'V' )
  97. {
  98. sscanf( Line + 2, " %d", &m_Value );
  99. continue;
  100. }
  101. if( Line[0] == 'G' )
  102. {
  103. int layer;
  104. sscanf( Line + 2, " %d %d %lX", &m_Shape, &layer, &m_TimeStamp );
  105. /* Mise a jour des param .layer des sous structures */
  106. if( layer < FIRST_NO_COPPER_LAYER )
  107. layer = FIRST_NO_COPPER_LAYER;
  108. if( layer > LAST_NO_COPPER_LAYER )
  109. layer = LAST_NO_COPPER_LAYER;
  110. SetLayer( layer );
  111. m_Text->SetLayer( layer );
  112. continue;
  113. }
  114. if( Line[0] == 'T' )
  115. {
  116. ReadDelimitedText( Text, Line + 2, sizeof(Text) );
  117. m_Text->m_Text = CONV_FROM_UTF8( Text );
  118. continue;
  119. }
  120. if( Line[0] == 'P' )
  121. {
  122. sscanf( Line + 2, " %d %d %d %d %d %d %d",
  123. &m_Text->m_Pos.x, &m_Text->m_Pos.y,
  124. &m_Text->m_Size.x, &m_Text->m_Size.y,
  125. &m_Text->m_Width, &m_Text->m_Orient,
  126. &m_Text->m_Miroir );
  127. m_Pos = m_Text->m_Pos;
  128. continue;
  129. }
  130. if( Line[0] == 'S' )
  131. {
  132. switch( Line[1] )
  133. {
  134. int Dummy;
  135. case 'b':
  136. sscanf( Line + 2, " %d %d %d %d %d %d",
  137. &Dummy,
  138. &Barre_ox, &Barre_oy,
  139. &Barre_fx, &Barre_fy,
  140. &m_Width );
  141. break;
  142. case 'd':
  143. sscanf( Line + 2, " %d %d %d %d %d %d",
  144. &Dummy,
  145. &TraitD_ox, &TraitD_oy,
  146. &TraitD_fx, &TraitD_fy,
  147. &Dummy );
  148. break;
  149. case 'g':
  150. sscanf( Line + 2, " %d %d %d %d %d %d",
  151. &Dummy,
  152. &TraitG_ox, &TraitG_oy,
  153. &TraitG_fx, &TraitG_fy,
  154. &Dummy );
  155. break;
  156. case '1':
  157. sscanf( Line + 2, " %d %d %d %d %d %d",
  158. &Dummy,
  159. &FlecheD1_ox, &FlecheD1_oy,
  160. &FlecheD1_fx, &FlecheD1_fy,
  161. &Dummy );
  162. break;
  163. case '2':
  164. sscanf( Line + 2, " %d %d %d %d %d %d",
  165. &Dummy,
  166. &FlecheD2_ox, &FlecheD2_oy,
  167. &FlecheD2_fx, &FlecheD2_fy,
  168. &Dummy );
  169. break;
  170. case '3':
  171. sscanf( Line + 2, " %d %d %d %d %d %d\n",
  172. &Dummy,
  173. &FlecheG1_ox, &FlecheG1_oy,
  174. &FlecheG1_fx, &FlecheG1_fy,
  175. &Dummy );
  176. break;
  177. case '4':
  178. sscanf( Line + 2, " %d %d %d %d %d %d",
  179. &Dummy,
  180. &FlecheG2_ox, &FlecheG2_oy,
  181. &FlecheG2_fx, &FlecheG2_fy,
  182. &Dummy );
  183. break;
  184. }
  185. continue;
  186. }
  187. }
  188. return FALSE;
  189. }
  190. /****************************************/
  191. void COTATION::Move(const wxPoint& offset)
  192. /****************************************/
  193. /**
  194. * Function Move
  195. * @param offset : moving vector
  196. */
  197. {
  198. m_Pos += offset;
  199. m_Text->m_Pos += offset;
  200. Barre_ox += offset.x; Barre_oy += offset.y;
  201. Barre_fx += offset.x; Barre_fy += offset.y;
  202. TraitG_ox += offset.x; TraitG_oy += offset.y;
  203. TraitG_fx += offset.x; TraitG_fy += offset.y;
  204. TraitD_ox += offset.x; TraitD_oy += offset.y;
  205. TraitD_fx += offset.x; TraitD_fy += offset.y;
  206. FlecheG1_ox += offset.x; FlecheG1_oy += offset.y;
  207. FlecheG1_fx += offset.x; FlecheG1_fy += offset.y;
  208. FlecheG2_ox += offset.x; FlecheG2_oy += offset.y;
  209. FlecheG2_fx += offset.x; FlecheG2_fy += offset.y;
  210. FlecheD1_ox += offset.x; FlecheD1_oy += offset.y;
  211. FlecheD1_fx += offset.x; FlecheD1_fy += offset.y;
  212. FlecheD2_ox += offset.x; FlecheD2_oy += offset.y;
  213. FlecheD2_fx += offset.x; FlecheD2_fy += offset.y;
  214. }
  215. /******************************************************/
  216. void COTATION::Rotate(const wxPoint& centre, int angle)
  217. /******************************************************/
  218. /**
  219. * Function Rotate
  220. * @param offset : Rotation point
  221. * @param angle : Rotation angle in 0.1 degrees
  222. */
  223. {
  224. RotatePoint( &m_Pos, centre, 900 );
  225. RotatePoint( &m_Text->m_Pos, centre, 900 );
  226. m_Text->m_Orient += 900;
  227. if( m_Text->m_Orient >= 3600 )
  228. m_Text->m_Orient -= 3600;
  229. if( (m_Text->m_Orient > 900)
  230. && (m_Text->m_Orient <2700) )
  231. m_Text->m_Orient -= 1800;
  232. RotatePoint( &Barre_ox, &Barre_oy, centre.x, centre.y, 900 );
  233. RotatePoint( &Barre_fx, &Barre_fy, centre.x, centre.y, 900 );
  234. RotatePoint( &TraitG_ox, &TraitG_oy, centre.x, centre.y, 900 );
  235. RotatePoint( &TraitG_fx, &TraitG_fy, centre.x, centre.y, 900 );
  236. RotatePoint( &TraitD_ox, &TraitD_oy, centre.x, centre.y, 900 );
  237. RotatePoint( &TraitD_fx, &TraitD_fy, centre.x, centre.y, 900 );
  238. RotatePoint( &FlecheG1_ox, &FlecheG1_oy, centre.x, centre.y, 900 );
  239. RotatePoint( &FlecheG1_fx, &FlecheG1_fy, centre.x, centre.y, 900 );
  240. RotatePoint( &FlecheG2_ox, &FlecheG2_oy, centre.x, centre.y, 900 );
  241. RotatePoint( &FlecheG2_fx, &FlecheG2_fy, centre.x, centre.y, 900 );
  242. RotatePoint( &FlecheD1_ox, &FlecheD1_oy, centre.x, centre.y, 900 );
  243. RotatePoint( &FlecheD1_fx, &FlecheD1_fy, centre.x, centre.y, 900 );
  244. RotatePoint( &FlecheD2_ox, &FlecheD2_oy, centre.x, centre.y, 900 );
  245. RotatePoint( &FlecheD2_fx, &FlecheD2_fy, centre.x, centre.y, 900 );
  246. }
  247. /**********************************************/
  248. void COTATION::Mirror(const wxPoint& axis_pos)
  249. /**********************************************/
  250. /**
  251. * Function Mirror
  252. * Mirror the Dimension , relative to a given horizontal axis
  253. * the text is not mirrored. only its position (and angle) is mirrored
  254. * the layer is not changed
  255. * @param axis_pos : vertical axis position
  256. */
  257. {
  258. #define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
  259. #define INVERT_ANGLE( phi ) (phi) = -(phi)
  260. INVERT( m_Pos.y );
  261. INVERT( m_Text->m_Pos.y );
  262. INVERT_ANGLE( m_Text->m_Orient );
  263. if( m_Text->m_Orient >= 3600 )
  264. m_Text->m_Orient -= 3600;
  265. if( (m_Text->m_Orient > 900) && (m_Text->m_Orient <2700) )
  266. m_Text->m_Orient -= 1800;
  267. INVERT( Barre_oy );
  268. INVERT( Barre_fy );
  269. INVERT( TraitG_oy );
  270. INVERT( TraitG_fy );
  271. INVERT( TraitD_oy );
  272. INVERT( TraitD_fy );
  273. INVERT( FlecheG1_oy );
  274. INVERT( FlecheG1_fy );
  275. INVERT( FlecheG2_oy );
  276. INVERT( FlecheG2_fy );
  277. INVERT( FlecheD1_oy );
  278. INVERT( FlecheD1_fy );
  279. INVERT( FlecheD2_oy );
  280. INVERT( FlecheD2_fy );
  281. }
  282. /****************************************/
  283. bool COTATION::Save( FILE* aFile ) const
  284. /****************************************/
  285. {
  286. if( GetState( DELETED ) )
  287. return true;
  288. bool rc = false;
  289. if( fprintf( aFile, "$COTATION\n" ) != sizeof("$COTATION\n")-1 )
  290. goto out;
  291. fprintf( aFile, "Ge %d %d %lX\n", m_Shape, m_Layer, m_TimeStamp );
  292. fprintf( aFile, "Va %d\n", m_Value );
  293. if( !m_Text->m_Text.IsEmpty() )
  294. fprintf( aFile, "Te \"%s\"\n", CONV_TO_UTF8( m_Text->m_Text ) );
  295. else
  296. fprintf( aFile, "Te \"?\"\n" );
  297. fprintf( aFile, "Po %d %d %d %d %d %d %d\n",
  298. m_Text->m_Pos.x, m_Text->m_Pos.y,
  299. m_Text->m_Size.x, m_Text->m_Size.y,
  300. m_Text->m_Width, m_Text->m_Orient,
  301. m_Text->m_Miroir );
  302. fprintf( aFile, "Sb %d %d %d %d %d %d\n", S_SEGMENT,
  303. Barre_ox, Barre_oy,
  304. Barre_fx, Barre_fy, m_Width );
  305. fprintf( aFile, "Sd %d %d %d %d %d %d\n", S_SEGMENT,
  306. TraitD_ox, TraitD_oy,
  307. TraitD_fx, TraitD_fy, m_Width );
  308. fprintf( aFile, "Sg %d %d %d %d %d %d\n", S_SEGMENT,
  309. TraitG_ox, TraitG_oy,
  310. TraitG_fx, TraitG_fy, m_Width );
  311. fprintf( aFile, "S1 %d %d %d %d %d %d\n", S_SEGMENT,
  312. FlecheD1_ox, FlecheD1_oy,
  313. FlecheD1_fx, FlecheD1_fy, m_Width );
  314. fprintf( aFile, "S2 %d %d %d %d %d %d\n", S_SEGMENT,
  315. FlecheD2_ox, FlecheD2_oy,
  316. FlecheD2_fx, FlecheD2_fy, m_Width );
  317. fprintf( aFile, "S3 %d %d %d %d %d %d\n", S_SEGMENT,
  318. FlecheG1_ox, FlecheG1_oy,
  319. FlecheG1_fx, FlecheG1_fy, m_Width );
  320. fprintf( aFile, "S4 %d %d %d %d %d %d\n", S_SEGMENT,
  321. FlecheG2_ox, FlecheG2_oy,
  322. FlecheG2_fx, FlecheG2_fy, m_Width );
  323. if( fprintf( aFile, "$EndCOTATION\n" ) != sizeof("$EndCOTATION\n")-1 )
  324. goto out;
  325. rc = true;
  326. out:
  327. return rc;
  328. }
  329. /************************************************************************/
  330. void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
  331. const wxPoint& offset, int mode_color )
  332. /************************************************************************/
  333. /* impression de 1 cotation : serie de n segments + 1 texte
  334. */
  335. {
  336. int ox, oy, typeaff, width, gcolor;
  337. int zoom = panel->GetScreen()->GetZoom();
  338. ox = offset.x;
  339. oy = offset.y;
  340. m_Text->Draw( panel, DC, offset, mode_color );
  341. gcolor = g_DesignSettings.m_LayerColor[m_Layer];
  342. if( (gcolor & ITEM_NOT_SHOW) != 0 )
  343. return;
  344. GRSetDrawMode( DC, mode_color );
  345. typeaff = DisplayOpt.DisplayDrawItems;
  346. width = m_Width;
  347. if( width / zoom < 2 )
  348. typeaff = FILAIRE;
  349. switch( typeaff )
  350. {
  351. case FILAIRE:
  352. width = 0;
  353. case FILLED:
  354. GRLine( &panel->m_ClipBox, DC,
  355. Barre_ox - ox, Barre_oy - oy,
  356. Barre_fx - ox, Barre_fy - oy, width, gcolor );
  357. GRLine( &panel->m_ClipBox, DC,
  358. TraitG_ox - ox, TraitG_oy - oy,
  359. TraitG_fx - ox, TraitG_fy - oy, width, gcolor );
  360. GRLine( &panel->m_ClipBox, DC,
  361. TraitD_ox - ox, TraitD_oy - oy,
  362. TraitD_fx - ox, TraitD_fy - oy, width, gcolor );
  363. GRLine( &panel->m_ClipBox, DC,
  364. FlecheD1_ox - ox, FlecheD1_oy - oy,
  365. FlecheD1_fx - ox, FlecheD1_fy - oy, width, gcolor );
  366. GRLine( &panel->m_ClipBox, DC,
  367. FlecheD2_ox - ox, FlecheD2_oy - oy,
  368. FlecheD2_fx - ox, FlecheD2_fy - oy, width, gcolor );
  369. GRLine( &panel->m_ClipBox, DC,
  370. FlecheG1_ox - ox, FlecheG1_oy - oy,
  371. FlecheG1_fx - ox, FlecheG1_fy - oy, width, gcolor );
  372. GRLine( &panel->m_ClipBox, DC,
  373. FlecheG2_ox - ox, FlecheG2_oy - oy,
  374. FlecheG2_fx - ox, FlecheG2_fy - oy, width, gcolor );
  375. break;
  376. case SKETCH:
  377. GRCSegm( &panel->m_ClipBox, DC,
  378. Barre_ox - ox, Barre_oy - oy,
  379. Barre_fx - ox, Barre_fy - oy,
  380. width, gcolor );
  381. GRCSegm( &panel->m_ClipBox, DC,
  382. TraitG_ox - ox, TraitG_oy - oy,
  383. TraitG_fx - ox, TraitG_fy - oy,
  384. width, gcolor );
  385. GRCSegm( &panel->m_ClipBox, DC,
  386. TraitD_ox - ox, TraitD_oy - oy,
  387. TraitD_fx - ox, TraitD_fy - oy,
  388. width, gcolor );
  389. GRCSegm( &panel->m_ClipBox, DC,
  390. FlecheD1_ox - ox, FlecheD1_oy - oy,
  391. FlecheD1_fx - ox, FlecheD1_fy - oy,
  392. width, gcolor );
  393. GRCSegm( &panel->m_ClipBox, DC,
  394. FlecheD2_ox - ox, FlecheD2_oy - oy,
  395. FlecheD2_fx - ox, FlecheD2_fy - oy,
  396. width, gcolor );
  397. GRCSegm( &panel->m_ClipBox, DC,
  398. FlecheG1_ox - ox, FlecheG1_oy - oy,
  399. FlecheG1_fx - ox, FlecheG1_fy - oy,
  400. width, gcolor );
  401. GRCSegm( &panel->m_ClipBox, DC,
  402. FlecheG2_ox - ox, FlecheG2_oy - oy,
  403. FlecheG2_fx - ox, FlecheG2_fy - oy,
  404. width, gcolor );
  405. break;
  406. }
  407. }
  408. // see class_cotation.h
  409. void COTATION::Display_Infos( WinEDA_DrawFrame* frame )
  410. {
  411. // for now, display only the text within the COTATION using class TEXTE_PCB.
  412. m_Text->Display_Infos( frame );
  413. }
  414. /**
  415. * Function HitTest
  416. * tests if the given wxPoint is within the bounds of this object.
  417. * @param ref_pos A wxPoint to test
  418. * @return bool - true if a hit, else false
  419. */
  420. bool COTATION::HitTest( const wxPoint& ref_pos )
  421. {
  422. int ux0, uy0;
  423. int dx, dy, spot_cX, spot_cY;
  424. if( m_Text )
  425. {
  426. // because HitTest() is present in both base classes of TEXTE_PCB
  427. // use a clarifying cast to tell compiler which HitTest()
  428. // to call.
  429. if( static_cast<EDA_TextStruct*>(m_Text)->HitTest( ref_pos ) )
  430. return true;
  431. }
  432. /* Localisation des SEGMENTS ?) */
  433. ux0 = Barre_ox;
  434. uy0 = Barre_oy;
  435. /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
  436. dx = Barre_fx - ux0;
  437. dy = Barre_fy - uy0;
  438. spot_cX = ref_pos.x - ux0;
  439. spot_cY = ref_pos.y - uy0;
  440. if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
  441. return true;
  442. ux0 = TraitG_ox;
  443. uy0 = TraitG_oy;
  444. /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
  445. dx = TraitG_fx - ux0;
  446. dy = TraitG_fy - uy0;
  447. spot_cX = ref_pos.x - ux0;
  448. spot_cY = ref_pos.y - uy0;
  449. /* detection : */
  450. if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
  451. return true;
  452. ux0 = TraitD_ox;
  453. uy0 = TraitD_oy;
  454. /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
  455. dx = TraitD_fx - ux0;
  456. dy = TraitD_fy - uy0;
  457. spot_cX = ref_pos.x - ux0;
  458. spot_cY = ref_pos.y - uy0;
  459. /* detection : */
  460. if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
  461. return true;
  462. ux0 = FlecheD1_ox;
  463. uy0 = FlecheD1_oy;
  464. /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
  465. dx = FlecheD1_fx - ux0;
  466. dy = FlecheD1_fy - uy0;
  467. spot_cX = ref_pos.x - ux0;
  468. spot_cY = ref_pos.y - uy0;
  469. /* detection : */
  470. if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
  471. return true;
  472. ux0 = FlecheD2_ox;
  473. uy0 = FlecheD2_oy;
  474. /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
  475. dx = FlecheD2_fx - ux0;
  476. dy = FlecheD2_fy - uy0;
  477. spot_cX = ref_pos.x - ux0;
  478. spot_cY = ref_pos.y - uy0;
  479. if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
  480. return true;
  481. ux0 = FlecheG1_ox;
  482. uy0 = FlecheG1_oy;
  483. /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
  484. dx = FlecheG1_fx - ux0;
  485. dy = FlecheG1_fy - uy0;
  486. spot_cX = ref_pos.x - ux0;
  487. spot_cY = ref_pos.y - uy0;
  488. if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
  489. return true;
  490. ux0 = FlecheG2_ox;
  491. uy0 = FlecheG2_oy;
  492. /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
  493. dx = FlecheG2_fx - ux0;
  494. dy = FlecheG2_fy - uy0;
  495. spot_cX = ref_pos.x - ux0;
  496. spot_cY = ref_pos.y - uy0;
  497. if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
  498. return true;
  499. return false;
  500. }
  501. /**
  502. * Function HitTest (overlayed)
  503. * tests if the given EDA_Rect intersect this object.
  504. * @param EDA_Rect : the given EDA_Rect
  505. * @return bool - true if a hit, else false
  506. */
  507. bool COTATION::HitTest( EDA_Rect& refArea )
  508. {
  509. if( refArea.Inside( m_Pos ) )
  510. return true;
  511. return false;
  512. }