KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ORCAD_PRIMITIVE Struct Reference

One graphic primitive of a symbol body or nested page graphic. More...

#include <orcad_records.h>

Public Attributes

ORCAD_PRIM_KIND kind = ORCAD_PRIM_KIND::LINE
 
int x1 = 0
 
int y1 = 0
 
int x2 = 0
 
int y2 = 0
 
std::optional< ORCAD_POINTstart
 arc start point
 
std::optional< ORCAD_POINTend
 arc end point
 
std::vector< ORCAD_POINTpoints
 polygon/polyline/bezier vertices
 
std::string text
 kind == TEXT
 
int fontIdx = 0
 
int lineStyle = 5
 0 solid, 1 dash, 2 dot, 3 dash-dot, 4 dash-dot-dot, 5 default
 
int lineWidth = 3
 Capture width enum: 0 thin, 1 medium, 2 wide, 3 default.
 
int fillStyle = 1
 0 solid, 1 none, 2 hatch pattern
 
int hatchStyle = 0
 
std::vector< uint8_t > data
 kind == IMAGE: raw embedded payload
 
std::vector< ORCAD_PRIMITIVEchildren
 kind == GROUP, translated by (x1, y1)
 

Detailed Description

One graphic primitive of a symbol body or nested page graphic.

Envelope: doubled u8 type pair, u32 byteLength, u32 zero pad, body. Two byteLength conventions exist in the wild (sometimes mixed within one file): modern records count the u32 size field + 4-byte pad and are followed by a preamble block; legacy records exclude those 8 bytes and have no trailing preamble. Detection is per record: a modern record has the preamble magic right at its claimed end. CommentText uses the exclusive convention in ALL eras (size += 8 unconditionally).

Bodies (after the pad):

  • rect/ellipse: i32 x1, y1, x2, y2 [, u32 lineStyle, u32 lineWidth [, u32 fill]]
  • line: i32 x1, y1, x2, y2
  • arc: i32 x1, y1, x2, y2 (bbox), i32 sx, sy, ex, ey (start/end points); drawn counter-clockwise in screen (Y-down) coordinates
  • polygon/polyline/bezier: u16 point count then count x (i16 y, i16 x) — the point-count offset (16, 8 or 0 bytes into the body for polygons; 8 or 0 otherwise) is found deterministically by reconciling with byteLength under one of the two length conventions
  • comment text: i32 x, y, i32 x2, y2, i32 x1, y1, u16 fontIdx, 2 bytes, lzt text
  • bitmap (47): i32 x, y, i32 x2, y2, 8 bytes duplicate corner, 8 bytes pixel width/height, u32 dataSize, dataSize bytes of raw DIB
  • OLE image (90): i32 x1, y1, x2, y2, 16 bytes crop/extent, payload to record end

Definition at line 360 of file orcad_records.h.

Member Data Documentation

◆ children

std::vector<ORCAD_PRIMITIVE> ORCAD_PRIMITIVE::children

kind == GROUP, translated by (x1, y1)

Definition at line 377 of file orcad_records.h.

Referenced by ORCAD_CONVERTER::addSymbolPrimitive(), ORCAD_CONVERTER::placeGraphics(), and v2PrimBody().

◆ data

std::vector<uint8_t> ORCAD_PRIMITIVE::data

kind == IMAGE: raw embedded payload

Definition at line 376 of file orcad_records.h.

Referenced by ORCAD_CONVERTER::placeBitmap().

◆ end

◆ fillStyle

int ORCAD_PRIMITIVE::fillStyle = 1

0 solid, 1 none, 2 hatch pattern

Definition at line 374 of file orcad_records.h.

Referenced by ORCAD_CONVERTER::addSymbolPrimitive(), and v2PrimBody().

◆ fontIdx

int ORCAD_PRIMITIVE::fontIdx = 0

◆ hatchStyle

int ORCAD_PRIMITIVE::hatchStyle = 0

Definition at line 375 of file orcad_records.h.

Referenced by ORCAD_CONVERTER::addSymbolPrimitive(), and v2PrimBody().

◆ kind

◆ lineStyle

int ORCAD_PRIMITIVE::lineStyle = 5

0 solid, 1 dash, 2 dot, 3 dash-dot, 4 dash-dot-dot, 5 default

Definition at line 372 of file orcad_records.h.

Referenced by ORCAD_CONVERTER::placeGraphics(), and v2PrimBody().

◆ lineWidth

int ORCAD_PRIMITIVE::lineWidth = 3

Capture width enum: 0 thin, 1 medium, 2 wide, 3 default.

Definition at line 373 of file orcad_records.h.

Referenced by ORCAD_CONVERTER::placeGraphics(), and v2PrimBody().

◆ points

◆ start

◆ text

std::string ORCAD_PRIMITIVE::text

◆ x1

◆ x2

◆ y1

◆ y2


The documentation for this struct was generated from the following file: