本文整理汇总了C++中r_delete_entry函数的典型用法代码示例。如果您正苦于以下问题:C++ r_delete_entry函数的具体用法?C++ r_delete_entry怎么用?C++ r_delete_entry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了r_delete_entry函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: MoveElementName
/* ----------------------------------------------------------------------
* moves all names of an element to a new position
*/
static void *
MoveElementName (ElementTypePtr Element)
{
if (PCB->ElementOn && (FRONT (Element) || PCB->InvisibleObjectsOn))
{
EraseElementName (Element);
ELEMENTTEXT_LOOP (Element);
{
if (PCB->Data->name_tree[n])
r_delete_entry (PCB->Data->name_tree[n], (BoxType *)text);
MOVE_TEXT_LOWLEVEL (text, DeltaX, DeltaY);
if (PCB->Data->name_tree[n])
r_insert_entry (PCB->Data->name_tree[n], (BoxType *)text, 0);
}
END_LOOP;
DrawElementName (Element);
Draw ();
}
else
{
ELEMENTTEXT_LOOP (Element);
{
if (PCB->Data->name_tree[n])
r_delete_entry (PCB->Data->name_tree[n], (BoxType *)text);
MOVE_TEXT_LOWLEVEL (text, DeltaX, DeltaY);
if (PCB->Data->name_tree[n])
r_insert_entry (PCB->Data->name_tree[n], (BoxType *)text, 0);
}
END_LOOP;
}
return (Element);
}
开发者ID:fruoff,项目名称:pcb-fruoff,代码行数:35,代码来源:move.c
示例2: FreeRotateElementLowLevel
void
FreeRotateElementLowLevel (DataType *Data, ElementType *Element,
Coord X, Coord Y,
double cosa, double sina, Angle angle)
{
/* solder side objects need a different orientation */
/* the text subroutine decides by itself if the direction
* is to be corrected
*/
#if 0
ELEMENTTEXT_LOOP (Element);
{
if (Data && Data->name_tree[n])
r_delete_entry (Data->name_tree[n], (BoxType *)text);
RotateTextLowLevel (text, X, Y, Number);
}
END_LOOP;
#endif
ELEMENTLINE_LOOP (Element);
{
free_rotate (&line->Point1.X, &line->Point1.Y, X, Y, cosa, sina);
free_rotate (&line->Point2.X, &line->Point2.Y, X, Y, cosa, sina);
SetLineBoundingBox (line);
}
END_LOOP;
PIN_LOOP (Element);
{
/* pre-delete the pins from the pin-tree before their coordinates change */
if (Data)
r_delete_entry (Data->pin_tree, (BoxType *)pin);
RestoreToPolygon (Data, PIN_TYPE, Element, pin);
free_rotate (&pin->X, &pin->Y, X, Y, cosa, sina);
SetPinBoundingBox (pin);
}
END_LOOP;
PAD_LOOP (Element);
{
/* pre-delete the pads before their coordinates change */
if (Data)
r_delete_entry (Data->pad_tree, (BoxType *)pad);
RestoreToPolygon (Data, PAD_TYPE, Element, pad);
free_rotate (&pad->Point1.X, &pad->Point1.Y, X, Y, cosa, sina);
free_rotate (&pad->Point2.X, &pad->Point2.Y, X, Y, cosa, sina);
SetLineBoundingBox ((LineType *) pad);
}
END_LOOP;
ARC_LOOP (Element);
{
free_rotate (&arc->X, &arc->Y, X, Y, cosa, sina);
arc->StartAngle = NormalizeAngle (arc->StartAngle + angle);
}
END_LOOP;
free_rotate (&Element->MarkX, &Element->MarkY, X, Y, cosa, sina);
SetElementBoundingBox (Data, Element, &PCB->Font);
ClearFromPolygon (Data, ELEMENT_TYPE, Element, Element);
}
开发者ID:bgamari,项目名称:geda-pcb,代码行数:58,代码来源:buffer.c
示例3: RotateBuffer
/* ---------------------------------------------------------------------------
* rotates the contents of the pastebuffer
*/
void
RotateBuffer (BufferType *Buffer, BYTE Number)
{
/* rotate vias */
VIA_LOOP (Buffer->Data);
{
r_delete_entry (Buffer->Data->via_tree, (BoxType *)via);
ROTATE_VIA_LOWLEVEL (via, Buffer->X, Buffer->Y, Number);
SetPinBoundingBox (via);
r_insert_entry (Buffer->Data->via_tree, (BoxType *)via, 0);
}
END_LOOP;
/* elements */
ELEMENT_LOOP (Buffer->Data);
{
RotateElementLowLevel (Buffer->Data, element, Buffer->X, Buffer->Y,
Number);
}
END_LOOP;
/* all layer related objects */
ALLLINE_LOOP (Buffer->Data);
{
r_delete_entry (layer->line_tree, (BoxType *)line);
RotateLineLowLevel (line, Buffer->X, Buffer->Y, Number);
r_insert_entry (layer->line_tree, (BoxType *)line, 0);
}
ENDALL_LOOP;
ALLARC_LOOP (Buffer->Data);
{
r_delete_entry (layer->arc_tree, (BoxType *)arc);
RotateArcLowLevel (arc, Buffer->X, Buffer->Y, Number);
r_insert_entry (layer->arc_tree, (BoxType *)arc, 0);
}
ENDALL_LOOP;
ALLTEXT_LOOP (Buffer->Data);
{
r_delete_entry (layer->text_tree, (BoxType *)text);
RotateTextLowLevel (text, Buffer->X, Buffer->Y, Number);
r_insert_entry (layer->text_tree, (BoxType *)text, 0);
}
ENDALL_LOOP;
ALLPOLYGON_LOOP (Buffer->Data);
{
r_delete_entry (layer->polygon_tree, (BoxType *)polygon);
RotatePolygonLowLevel (polygon, Buffer->X, Buffer->Y, Number);
r_insert_entry (layer->polygon_tree, (BoxType *)polygon, 0);
}
ENDALL_LOOP;
/* finally the origin and the bounding box */
ROTATE (Buffer->X, Buffer->Y, Buffer->X, Buffer->Y, Number);
RotateBoxLowLevel (&Buffer->BoundingBox, Buffer->X, Buffer->Y, Number);
SetCrosshairRangeToBuffer ();
}
开发者ID:bgamari,项目名称:geda-pcb,代码行数:59,代码来源:buffer.c
示例4: GetPadMemory
/* ---------------------------------------------------------------------------
* get next slot for a pad, allocates memory if necessary
*/
PadTypePtr
GetPadMemory (ElementTypePtr Element)
{
PadTypePtr pad = Element->Pad;
bool onBoard = false;
/* realloc new memory if necessary and clear it */
if (Element->PadN >= Element->PadMax)
{
if (PCB->Data->pad_tree)
{
PAD_LOOP (Element);
{
if (r_delete_entry (PCB->Data->pad_tree, (BoxType *) pad))
onBoard = true;
}
END_LOOP;
}
Element->PadMax += STEP_PAD;
pad = MyRealloc (pad, Element->PadMax * sizeof (PadType),
"GetPadMemory()");
Element->Pad = pad;
memset (pad + Element->PadN, 0, STEP_PAD * sizeof (PadType));
if (onBoard)
{
PAD_LOOP (Element);
{
r_insert_entry (PCB->Data->pad_tree, (BoxType *) pad, 0);
}
END_LOOP;
}
}
return (pad + Element->PadN++);
}
开发者ID:bert,项目名称:pcb-update,代码行数:37,代码来源:mymem.c
示例5: GetPinMemory
/* ---------------------------------------------------------------------------
* get next slot for a pin, allocates memory if necessary
*/
PinTypePtr
GetPinMemory (ElementTypePtr Element)
{
PinTypePtr pin = Element->Pin;
bool onBoard = false;
/* realloc new memory if necessary and clear it */
if (Element->PinN >= Element->PinMax)
{
if (PCB->Data->pin_tree)
{
PIN_LOOP (Element);
{
if (r_delete_entry (PCB->Data->pin_tree, (BoxType *) pin))
onBoard = true;
}
END_LOOP;
}
Element->PinMax += STEP_PIN;
pin = MyRealloc (pin, Element->PinMax * sizeof (PinType),
"GetPinMemory()");
Element->Pin = pin;
memset (pin + Element->PinN, 0, STEP_PIN * sizeof (PinType));
if (onBoard)
{
PIN_LOOP (Element);
{
r_insert_entry (PCB->Data->pin_tree, (BoxType *) pin, 0);
}
END_LOOP;
}
}
return (pin + Element->PinN++);
}
开发者ID:bert,项目名称:pcb-update,代码行数:37,代码来源:mymem.c
示例6: InsertPointIntoLine
/* ---------------------------------------------------------------------------
* inserts a point into a line
*/
static void *
InsertPointIntoLine (LayerTypePtr Layer, LineTypePtr Line)
{
LineTypePtr line;
LocationType X, Y;
if (((Line->Point1.X == InsertX) && (Line->Point1.Y == InsertY)) ||
((Line->Point2.X == InsertX) && (Line->Point2.Y == InsertY)))
return (NULL);
X = Line->Point2.X;
Y = Line->Point2.Y;
AddObjectToMoveUndoList (LINEPOINT_TYPE, Layer, Line, &Line->Point2,
InsertX - X, InsertY - Y);
EraseLine (Line);
r_delete_entry (Layer->line_tree, (BoxTypePtr) Line);
Line->Point2.X = InsertX;
Line->Point2.Y = InsertY;
SetLineBoundingBox (Line);
r_insert_entry (Layer->line_tree, (BoxTypePtr) Line, 0);
DrawLine (Layer, Line, 0);
/* we must create after playing with Line since creation may
* invalidate the line pointer
*/
if ((line = CreateDrawnLineOnLayer (Layer, InsertX, InsertY,
X, Y,
Line->Thickness, Line->Clearance,
Line->Flags)))
{
AddObjectToCreateUndoList (LINE_TYPE, Layer, line, line);
DrawLine (Layer, line, 0);
/* creation call adds it to the rtree */
}
Draw ();
return (line);
}
开发者ID:thequux,项目名称:pcb,代码行数:38,代码来源:insert.c
示例7: MoveTextToLayerLowLevel
/* ---------------------------------------------------------------------------
* moves a text object between layers; lowlevel routines
*/
static void *
MoveTextToLayerLowLevel (LayerType *Source, TextType *text,
LayerType *Destination)
{
RestoreToPolygon (PCB->Data, TEXT_TYPE, Source, text);
r_delete_entry (Source->text_tree, (BoxType *)text);
Source->Text = g_list_remove (Source->Text, text);
Source->TextN --;
Destination->Text = g_list_append (Destination->Text, text);
Destination->TextN ++;
if (GetLayerGroupNumberByNumber (solder_silk_layer) ==
GetLayerGroupNumberByPointer (Destination))
SET_FLAG (ONSOLDERFLAG, text);
else
CLEAR_FLAG (ONSOLDERFLAG, text);
/* re-calculate the bounding box (it could be mirrored now) */
SetTextBoundingBox (&PCB->Font, text);
if (!Destination->text_tree)
Destination->text_tree = r_create_tree (NULL, 0, 0);
r_insert_entry (Destination->text_tree, (BoxType *)text, 0);
ClearFromPolygon (PCB->Data, TEXT_TYPE, Destination, text);
return text;
}
开发者ID:fruoff,项目名称:pcb-fruoff,代码行数:30,代码来源:move.c
示例8: MyMoveTextLowLevel
static void *
MyMoveTextLowLevel (LayerType *Layer, TextType *Text, Coord dx, Coord dy)
{
if (Layer)
r_delete_entry (Layer->text_tree, (BoxType *) Text);
MOVE_TEXT_LOWLEVEL (Text, dx, dy);
if (Layer)
r_insert_entry (Layer->text_tree, (BoxType *) Text, 0);
return Text;
}
开发者ID:bert,项目名称:pcb-plugins,代码行数:10,代码来源:autocrop.c
示例9: DestroyArc
/* ---------------------------------------------------------------------------
* destroys an arc from a layer
*/
static void *
DestroyArc (LayerTypePtr Layer, ArcTypePtr Arc)
{
r_delete_entry (Layer->arc_tree, (BoxTypePtr) Arc);
Layer->Arc = g_list_remove (Layer->Arc, Arc);
Layer->ArcN --;
g_slice_free (ArcType, Arc);
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:15,代码来源:remove.c
示例10: DestroyVia
/* ---------------------------------------------------------------------------
* destroys a via
*/
static void *
DestroyVia (PinTypePtr Via)
{
r_delete_entry (DestroyTarget->via_tree, (BoxTypePtr) Via);
free (Via->Name);
DestroyTarget->Via = g_list_remove (DestroyTarget->Via, Via);
DestroyTarget->ViaN --;
g_slice_free (PinType, Via);
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:16,代码来源:remove.c
示例11: DestroyLine
/* ---------------------------------------------------------------------------
* destroys a line from a layer
*/
static void *
DestroyLine (LayerTypePtr Layer, LineTypePtr Line)
{
r_delete_entry (Layer->line_tree, (BoxTypePtr) Line);
free (Line->Number);
Layer->Line = g_list_remove (Layer->Line, Line);
Layer->LineN --;
g_slice_free (LineType, Line);
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:16,代码来源:remove.c
示例12: DestroyRat
/* ---------------------------------------------------------------------------
* destroys a rat
*/
static void *
DestroyRat (RatTypePtr Rat)
{
if (DestroyTarget->rat_tree)
r_delete_entry (DestroyTarget->rat_tree, &Rat->BoundingBox);
DestroyTarget->Rat = g_list_remove (DestroyTarget->Rat, Rat);
DestroyTarget->RatN --;
g_slice_free (RatType, Rat);
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:16,代码来源:remove.c
示例13: DestroyText
/* ---------------------------------------------------------------------------
* destroys a text from a layer
*/
static void *
DestroyText (LayerTypePtr Layer, TextTypePtr Text)
{
free (Text->TextString);
r_delete_entry (Layer->text_tree, (BoxTypePtr) Text);
Layer->Text = g_list_remove (Layer->Text, Text);
Layer->TextN --;
g_slice_free (TextType, Text);
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:16,代码来源:remove.c
示例14: DestroyPolygon
/* ---------------------------------------------------------------------------
* destroys a polygon from a layer
*/
static void *
DestroyPolygon (LayerTypePtr Layer, PolygonTypePtr Polygon)
{
r_delete_entry (Layer->polygon_tree, (BoxTypePtr) Polygon);
FreePolygonMemory (Polygon);
Layer->Polygon = g_list_remove (Layer->Polygon, Polygon);
Layer->PolygonN --;
g_slice_free (PolygonType, Polygon);
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:16,代码来源:remove.c
示例15: RemovePolygonPoint
/* ---------------------------------------------------------------------------
* removes a polygon-point from a polygon
*/
static void *
RemovePolygonPoint (LayerTypePtr Layer,
PolygonTypePtr Polygon, PointTypePtr Point)
{
Cardinal point_idx;
Cardinal i;
Cardinal contour;
Cardinal contour_start, contour_end, contour_points;
point_idx = polygon_point_idx (Polygon, Point);
contour = polygon_point_contour (Polygon, point_idx);
contour_start = (contour == 0) ? 0 : Polygon->HoleIndex[contour - 1];
contour_end = (contour == Polygon->HoleIndexN) ? Polygon->PointN :
Polygon->HoleIndex[contour];
contour_points = contour_end - contour_start;
if (contour_points <= 3)
return RemovePolygonContour (Layer, Polygon, contour);
if (Layer->On)
ErasePolygon (Polygon);
/* insert the polygon-point into the undo list */
AddObjectToRemovePointUndoList (POLYGONPOINT_TYPE, Layer, Polygon, point_idx);
r_delete_entry (Layer->polygon_tree, (BoxType *) Polygon);
/* remove point from list, keep point order */
for (i = point_idx; i < Polygon->PointN - 1; i++)
Polygon->Points[i] = Polygon->Points[i + 1];
Polygon->PointN--;
/* Shift down indices of any holes */
for (i = 0; i < Polygon->HoleIndexN; i++)
if (Polygon->HoleIndex[i] > point_idx)
Polygon->HoleIndex[i]--;
SetPolygonBoundingBox (Polygon);
r_insert_entry (Layer->polygon_tree, (BoxType *) Polygon, 0);
RemoveExcessPolygonPoints (Layer, Polygon);
InitClip (PCB->Data, Layer, Polygon);
/* redraw polygon if necessary */
if (Layer->On)
{
DrawPolygon (Layer, Polygon);
if (!Bulk)
Draw ();
}
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:53,代码来源:remove.c
示例16: MoveLinePoint
/* ---------------------------------------------------------------------------
* moves one end of a line
*/
static void *
MoveLinePoint (LayerTypePtr Layer, LineTypePtr Line, PointTypePtr Point)
{
if (Layer)
{
if (Layer->On)
EraseLine (Line);
RestoreToPolygon (PCB->Data, LINE_TYPE, Layer, Line);
r_delete_entry (Layer->line_tree, &Line->BoundingBox);
MOVE (Point->X, Point->Y, DeltaX, DeltaY);
SetLineBoundingBox (Line);
r_insert_entry (Layer->line_tree, &Line->BoundingBox, 0);
ClearFromPolygon (PCB->Data, LINE_TYPE, Layer, Line);
if (Layer->On)
{
DrawLine (Layer, Line);
Draw ();
}
return (Line);
}
else /* must be a rat */
{
if (PCB->RatOn)
EraseRat ((RatTypePtr) Line);
r_delete_entry (PCB->Data->rat_tree, &Line->BoundingBox);
MOVE (Point->X, Point->Y, DeltaX, DeltaY);
SetLineBoundingBox (Line);
r_insert_entry (PCB->Data->rat_tree, &Line->BoundingBox, 0);
if (PCB->RatOn)
{
DrawRat ((RatTypePtr) Line);
Draw ();
}
return (Line);
}
}
开发者ID:fruoff,项目名称:pcb-fruoff,代码行数:39,代码来源:move.c
示例17: DestroyElement
/* ---------------------------------------------------------------------------
* destroys a element
*/
static void *
DestroyElement (ElementTypePtr Element)
{
if (DestroyTarget->element_tree)
r_delete_entry (DestroyTarget->element_tree, (BoxType *) Element);
if (DestroyTarget->pin_tree)
{
PIN_LOOP (Element);
{
r_delete_entry (DestroyTarget->pin_tree, (BoxType *) pin);
}
END_LOOP;
}
if (DestroyTarget->pad_tree)
{
PAD_LOOP (Element);
{
r_delete_entry (DestroyTarget->pad_tree, (BoxType *) pad);
}
END_LOOP;
}
ELEMENTTEXT_LOOP (Element);
{
if (DestroyTarget->name_tree[n])
r_delete_entry (DestroyTarget->name_tree[n], (BoxType *) text);
}
END_LOOP;
FreeElementMemory (Element);
DestroyTarget->Element = g_list_remove (DestroyTarget->Element, Element);
DestroyTarget->ElementN --;
g_slice_free (ElementType, Element);
return NULL;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:39,代码来源:remove.c
示例18: InsertPointIntoPolygon
/* ---------------------------------------------------------------------------
* inserts a point into a polygon
*/
static void *
InsertPointIntoPolygon (LayerTypePtr Layer, PolygonTypePtr Polygon)
{
PointType save;
Cardinal n;
LineType line;
if (!Forcible)
{
/*
* first make sure adding the point is sensible
*/
line.Thickness = 0;
line.Point1 = Polygon->Points[prev_contour_point (Polygon, InsertAt)];
line.Point2 = Polygon->Points[InsertAt];
if (IsPointOnLine ((float) InsertX, (float) InsertY, 0.0, &line))
return (NULL);
}
/*
* second, shift the points up to make room for the new point
*/
ErasePolygon (Polygon);
r_delete_entry (Layer->polygon_tree, (BoxTypePtr) Polygon);
save = *CreateNewPointInPolygon (Polygon, InsertX, InsertY);
for (n = Polygon->PointN - 1; n > InsertAt; n--)
Polygon->Points[n] = Polygon->Points[n - 1];
/* Shift up indices of any holes */
for (n = 0; n < Polygon->HoleIndexN; n++)
if (Polygon->HoleIndex[n] > InsertAt ||
(InsertLast && Polygon->HoleIndex[n] == InsertAt))
Polygon->HoleIndex[n]++;
Polygon->Points[InsertAt] = save;
SetChangedFlag (true);
AddObjectToInsertPointUndoList (POLYGONPOINT_TYPE, Layer, Polygon,
&Polygon->Points[InsertAt]);
SetPolygonBoundingBox (Polygon);
r_insert_entry (Layer->polygon_tree, (BoxType *) Polygon, 0);
InitClip (PCB->Data, Layer, Polygon);
if (Forcible || !RemoveExcessPolygonPoints (Layer, Polygon))
{
DrawPolygon (Layer, Polygon, 0);
Draw ();
}
return (&Polygon->Points[InsertAt]);
}
开发者ID:thequux,项目名称:pcb,代码行数:51,代码来源:insert.c
示例19: MoveArcToLayerLowLevel
/* ---------------------------------------------------------------------------
* moves an arc between layers; lowlevel routines
*/
static void *
MoveArcToLayerLowLevel (LayerType *Source, ArcType *arc,
LayerType *Destination)
{
r_delete_entry (Source->arc_tree, (BoxType *)arc);
Source->Arc = g_list_remove (Source->Arc, arc);
Source->ArcN --;
Destination->Arc = g_list_append (Destination->Arc, arc);
Destination->ArcN ++;
if (!Destination->arc_tree)
Destination->arc_tree = r_create_tree (NULL, 0, 0);
r_insert_entry (Destination->arc_tree, (BoxType *)arc, 0);
return arc;
}
开发者ID:fruoff,项目名称:pcb-fruoff,代码行数:19,代码来源:move.c
示例20: MoveLineToLayerLowLevel
/* ---------------------------------------------------------------------------
* moves a line between layers; lowlevel routines
*/
static void *
MoveLineToLayerLowLevel (LayerType *Source, LineType *line,
LayerType *Destination)
{
r_delete_entry (Source->line_tree, (BoxType *)line);
Source->Line = g_list_remove (Source->Line, line);
Source->LineN --;
Destination->Line = g_list_append (Destination->Line, line);
Destination->LineN ++;
if (!Destination->line_tree)
Destination->line_tree = r_create_tree (NULL, 0, 0);
r_insert_entry (Destination->line_tree, (BoxType *)line, 0);
return line;
}
开发者ID:fruoff,项目名称:pcb-fruoff,代码行数:19,代码来源:move.c
注:本文中的r_delete_entry函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论