IPCB_ComponentPainterView interface
A preview panel that displays a single PCB component (footprint) in 2D or 3D.
public interface IPCB_ComponentPainterView
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Remarks
IPCB_ServerInterface.CreateComponentPainter creates a new preview. The preview draws the component on a board of its own (GetDummyBoard), not on an open PCB document.
The preview uses one of two views. The DirectX view shows the component in 3D (or in 2D after SetDirectXMode); it is used only when DirectX can be used. Otherwise the preview uses a standard 2D view. A button on the panel lets the user switch between 2D and 3D.
SetCamera, SetCameraAngle, SetViewRect, SetVisibleLayer, SetAllLayersVisibilityState, KeyDown, RefreshView and ClearGraphicalObjects act on the DirectX view only and do nothing in the standard 2D view. SetVariantOption acts on the standard 2D view only.
Methods
| Method | Returns | Description |
|---|---|---|
| ClearGraphicalObjects | void | Removes all graphical objects from the DirectX view of the preview. |
| ConfigView | void | Configures the preview from a string of named parameters. |
| GetDummyBoard | IPCB_Board | Returns the board on which the preview places the component it displays. |
| KeyDown | void | Passes a key press to the DirectX view of the preview, so that a host form can forward keyboard input to it. |
| RefreshView | void | Redraws the DirectX view of the preview. |
| SetAllLayersVisibilityState | void | Shows or hides all layers in the DirectX view of the preview. |
| SetCamera | void | Aims the camera of the DirectX view at a rectangle of the preview's board. |
| SetCameraAngle | void | Sets the camera of the DirectX view from a point to look at, a rotation and a zoom factor. |
| SetComponentByHandle | void | Displays a placed component in the preview. |
| SetComponentByHandle_1 | void | Displays a library component (footprint) in the preview. |
| SetComponentByPath | void | Loads a footprint from a library file and displays it in the preview. |
| SetDirectXMode | void | Switches the preview to the DirectX view in 2D. |
| SetVariantOption | void | Applies a variant option to the component displayed in the standard 2D view. |
| SetViewRect | void | Centers the DirectX view of the preview on a rectangle of the preview's board and resets the camera rotation. |
| SetVisibleLayer | void | Shows or hides a layer in the DirectX view of the preview. |
ClearGraphicalObjects
Removes all graphical objects from the DirectX view of the preview.
void ClearGraphicalObjects();
Returns: nothing (void)
ConfigView
Configures the preview from a string of named parameters.
void ConfigView(string argParameters);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argParameters | string | value | The parameters, as name and value pairs. |
Returns: nothing (void)
2DOnly=True switches the preview to the standard 2D view and hides the 2D/3D button; 3DOnly=True switches it to the DirectX view, when DirectX can be used, and hides the button. A value of False shows the button again without switching. When 2DOnly is given, 3DOnly is ignored. In the DirectX view, CameraYaw, CameraPitch and CameraRoll set the camera rotation, in degrees; angles that are not given keep their current values.
GetDummyBoard
Returns the board on which the preview places the component it displays.
IPCB_Board GetDummyBoard();
Returns: IPCB_Board
Extension method of IPCB_ComponentPainterViewHelper (using PCB;).
The board belongs to the preview; it is not an open PCB document.
KeyDown
Passes a key press to the DirectX view of the preview, so that a host form can forward keyboard input to it.
void KeyDown(ref ushort argKey, TShiftStateSet argShift);
void KeyDown(ref ushort argKey, ITransportSet argShift);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argKey | ushort | ref | The key that was pressed; the preview can change it. |
argShift | TShiftStateSet | value | The state of the modifier keys. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ComponentPainterViewHelper (using PCB;) with typed parameters; the second is declared by the interface.
RefreshView
Redraws the DirectX view of the preview.
void RefreshView();
Returns: nothing (void)
SetAllLayersVisibilityState
Shows or hides all layers in the DirectX view of the preview.
void SetAllLayersVisibilityState(bool argVisible);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argVisible | bool | value | True to show all layers, false to hide them. |
Returns: nothing (void)
SetCamera
Aims the camera of the DirectX view at a rectangle of the preview's board.
void SetCamera(int argLowX, int argLowY, int argHighX, int argHighY);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLowX | int | value | The left edge of the rectangle, in internal units (10,000 per mil). |
argLowY | int | value | The bottom edge of the rectangle, in internal units (10,000 per mil). |
argHighX | int | value | The right edge of the rectangle, in internal units (10,000 per mil). |
argHighY | int | value | The top edge of the rectangle, in internal units (10,000 per mil). |
Returns: nothing (void)
SetCameraAngle
Sets the camera of the DirectX view from a point to look at, a rotation and a zoom factor.
void SetCameraAngle(double argLookAtX, double argLookAtY, double argLookAtZ, double argRotationX, double argRotationY, double argRotationZ, double argRotationW, double argZoomMultiplier);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLookAtX | double | value | The X coordinate of the point the camera looks at. |
argLookAtY | double | value | The Y coordinate of the point the camera looks at. |
argLookAtZ | double | value | The Z coordinate of the point the camera looks at. |
argRotationX | double | value | The X component of the camera rotation, a quaternion. |
argRotationY | double | value | The Y component of the camera rotation, a quaternion. |
argRotationZ | double | value | The Z component of the camera rotation, a quaternion. |
argRotationW | double | value | The W component of the camera rotation, a quaternion. |
argZoomMultiplier | double | value | The zoom factor. |
Returns: nothing (void)
SetComponentByHandle
Displays a placed component in the preview.
void SetComponentByHandle(IPCB_Component argComponent);
void SetComponentByHandle(object argComponent);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argComponent | IPCB_Component | value | The component to display. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ComponentPainterViewHelper (using PCB;) with typed parameters; the second is declared by the interface.
The preview displays copies of the component's primitives and of its designator, placed on the preview's own board; the component itself is not changed. The copies replace the component displayed before.
SetComponentByHandle_1
Displays a library component (footprint) in the preview.
void SetComponentByHandle_1(IPCB_LibComponent argComponent);
void SetComponentByHandle_1(object argComponent);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argComponent | IPCB_LibComponent | value | The footprint to display. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ComponentPainterViewHelper (using PCB;) with typed parameters; the second is declared by the interface.
The preview displays a copy of the footprint, which replaces the component displayed before; the footprint itself is not changed. Passing null does nothing.
SetComponentByPath
Loads a footprint from a library file and displays it in the preview.
void SetComponentByPath(string argPattern, string argLibraryPath);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPattern | string | value | The name of the footprint in the library. |
argLibraryPath | string | value | The path of the library file that contains the footprint. |
Returns: nothing (void)
The footprint replaces the component displayed before.
SetDirectXMode
Switches the preview to the DirectX view in 2D.
void SetDirectXMode();
Returns: nothing (void)
The preview recreates its view and hides and disables the 2D/3D button. When DirectX cannot be used, the preview keeps the standard 2D view.
SetVariantOption
Applies a variant option to the component displayed in the standard 2D view.
void SetVariantOption(IVariantOption argVariantOption);
void SetVariantOption(object argVariantOption);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argVariantOption | IVariantOption | value | The variant option to apply. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ComponentPainterViewHelper (using PCB;) with typed parameters; the second is declared by the interface.
The standard 2D view draws the component with the variant option's PCB display settings, such as the struck-through designator, the cross or mesh graphics and the variant text. The DirectX view ignores the variant option.
SetViewRect
Centers the DirectX view of the preview on a rectangle of the preview's board and resets the camera rotation.
void SetViewRect(int argLowX, int argLowY, int argHighX, int argHighY);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLowX | int | value | The left edge of the rectangle, in internal units (10,000 per mil). |
argLowY | int | value | The bottom edge of the rectangle, in internal units (10,000 per mil). |
argHighX | int | value | The right edge of the rectangle, in internal units (10,000 per mil). |
argHighY | int | value | The top edge of the rectangle, in internal units (10,000 per mil). |
Returns: nothing (void)
SetVisibleLayer
Shows or hides a layer in the DirectX view of the preview.
void SetVisibleLayer(V7_LayerBase argLayer, bool argbState);
void SetVisibleLayer(IV7_Layer argLayer, bool argbState);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLayer | V7_LayerBase | value | The layer. |
argbState | bool | value | True to show the layer, false to hide it. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ComponentPainterViewHelper (using PCB;) with typed parameters; the second is declared by the interface.