Show / Hide Table of Contents

Interface IPaintTo3D

Interface to paint on a OpenGL, DirectX, GDI or some other output device. This interface may still change in future it is provided for informational purposes only.

Namespace: CADability
Assembly: CADability.dll
Syntax
public interface IPaintTo3D

Properties

| Improve this Doc View Source

Capabilities

Returns the capabilities of this implementation of the paint interface

Declaration
PaintCapabilities Capabilities { get; }
Property Value
Type Description
PaintCapabilities
| Improve this Doc View Source

DelayAll

Depricated, not implemented in any current paint interface

Declaration
bool DelayAll { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

DelayText

Depricated, not implemented in any current paint interface

Declaration
bool DelayText { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

DontRecalcTriangulation

Deprecated, currently not used

Declaration
bool DontRecalcTriangulation { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

FacesBehindEdgesOffset

Internal use only.

Declaration
IDisposable FacesBehindEdgesOffset { get; }
Property Value
Type Description
System.IDisposable
| Improve this Doc View Source

IsBitmap

Declaration
bool IsBitmap { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PaintEdges

Determins whether curves are included in painting

Declaration
bool PaintEdges { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PaintSurfaceEdges

Determins whether edges of faces should also be painted

Declaration
bool PaintSurfaceEdges { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PaintSurfaces

Determins whether surfaces (triangles) are included in painting

Declaration
bool PaintSurfaces { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PixelToWorld

Returns a factor that translates a one pixel distance into world coordinates

Declaration
double PixelToWorld { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Precision

Gets or sets the precision of the display. (used for tesselation or curve approximation)

Declaration
double Precision { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

SelectColor

Gets or sets the select color

Declaration
Color SelectColor { get; set; }
Property Value
Type Description
System.Drawing.Color
| Improve this Doc View Source

SelectMode

Gets or sets the flag whether the next objects should be painted in the "select mode"

Declaration
bool SelectMode { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

TriangulateText

Will text objects be tesselated

Declaration
bool TriangulateText { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

UseLineWidth

Should the line width be applied to painting curves

Declaration
bool UseLineWidth { get; set; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

Arc(GeoPoint, GeoVector, GeoVector, Double, Double)

Draws an (elliptical) arc according to the provided parameters. May only be used when the implementation supports arcs (see CanDoArcs.

Declaration
void Arc(GeoPoint center, GeoVector majorAxis, GeoVector minorAxis, double startParameter, double sweepParameter)
Parameters
Type Name Description
GeoPoint center

The center of the arc

GeoVector majorAxis

Major axis, also defines the radius

GeoVector minorAxis

Minor axis, also defines the radius. When painting a circular arc, minorAxis and majorAxis must have the same length

System.Double startParameter

Radian value of the starting position (0 is direction of majorAxis)

System.Double sweepParameter

Radian for the sweep angle

| Improve this Doc View Source

AvoidColor(Color)

Never use this color for drawing (because it is the background color)

Declaration
void AvoidColor(Color color)
Parameters
Type Name Description
System.Drawing.Color color

Color to avoid

| Improve this Doc View Source

Blending(Boolean)

OpenGL specific, set blending mode

Declaration
void Blending(bool on)
Parameters
Type Name Description
System.Boolean on
| Improve this Doc View Source

Clear(Color)

Clear the whole area with this color. Used before painting objects.

Declaration
void Clear(Color background)
Parameters
Type Name Description
System.Drawing.Color background

Color to clear display with

| Improve this Doc View Source

CloseFigure()

Closes a subfigure while defining a path. Subfigures are the enclosing path and the holes to be spared. Only valid after OpenPath() and before ClosePath(Color) have been called.

Declaration
void CloseFigure()
| Improve this Doc View Source

CloseList()

Close the display list OpenList().

Declaration
IPaintTo3DList CloseList()
Returns
Type Description
IPaintTo3DList

An object resembling the display list

| Improve this Doc View Source

ClosePath(Color)

Closes the path which was started with OpenPath() and fills the interior with the provided color.

Declaration
void ClosePath(Color color)
Parameters
Type Name Description
System.Drawing.Color color

Color to fill the path with.

| Improve this Doc View Source

DisplayBitmap(GeoPoint, Bitmap)

Displays the provided bitmap at the provided location. The bitmap always faces the viewer. PrepareBitmap(Bitmap, Int32, Int32) has been called or must be called prior to this method.

Declaration
void DisplayBitmap(GeoPoint p, Bitmap bitmap)
Parameters
Type Name Description
GeoPoint p

Where to Paint

System.Drawing.Bitmap bitmap

Th ebitmap to paint

| Improve this Doc View Source

DisplayIcon(GeoPoint, Bitmap)

Displays the provided icon at the provided position. PrepareIcon(Bitmap) has been called or must be called before this method is called. The icon aleasy faces the viewer, no perspective of the projection is applied.

Declaration
void DisplayIcon(GeoPoint p, Bitmap icon)
Parameters
Type Name Description
GeoPoint p

Where to draw the icon (world coordinates)

System.Drawing.Bitmap icon

The icon to draw

| Improve this Doc View Source

Dispose()

Will be called when the assoziated control is closed.

Declaration
void Dispose()
| Improve this Doc View Source

FilledPolyline(GeoPoint[])

Deprecated, will not be used from within CADability.

Declaration
void FilledPolyline(GeoPoint[] points)
Parameters
Type Name Description
GeoPoint[] points
| Improve this Doc View Source

FillRect2D(PointF, PointF)

Fill the axis oriented rectangle with the current color. Usually used for background painting.

Declaration
void FillRect2D(PointF p1, PointF p2)
Parameters
Type Name Description
System.Drawing.PointF p1

Lower left point of the rectangle

System.Drawing.PointF p2

Upper right point of the rectangle

| Improve this Doc View Source

FinishPaint()

Call when a frame is finished and the display buffers should now be switched (if using two display buffers)

Declaration
void FinishPaint()
| Improve this Doc View Source

FreeUnusedLists()

Only used internally, no need to call.

Declaration
void FreeUnusedLists()
| Improve this Doc View Source

Line2D(PointF, PointF)

Paint a 2D line in the pixel coordinates system of the display. Usually used for background painting. Currently not used.

Declaration
void Line2D(PointF p1, PointF p2)
Parameters
Type Name Description
System.Drawing.PointF p1

Start point

System.Drawing.PointF p2

End point

| Improve this Doc View Source

Line2D(Int32, Int32, Int32, Int32)

Paint a 2D line in the pixel coordinates system of the display. Usually used for background painting.

Declaration
void Line2D(int sx, int sy, int ex, int ey)
Parameters
Type Name Description
System.Int32 sx

Start x-coordinate

System.Int32 sy

Start y-coordinate

System.Int32 ex

End x-coordinate

System.Int32 ey

End y-coordinate

| Improve this Doc View Source

List(IPaintTo3DList)

Paint the provided display list.

Declaration
void List(IPaintTo3DList paintThisList)
Parameters
Type Name Description
IPaintTo3DList paintThisList

Display list to paint

| Improve this Doc View Source

MakeCurrent()

Will be called before any other paint methods are called. May be called multiple times after has been called

Declaration
void MakeCurrent()
| Improve this Doc View Source

MakeList(List<IPaintTo3DList>)

Makes a new display list as an assembly of the provided lists.

Declaration
IPaintTo3DList MakeList(List<IPaintTo3DList> sublists)
Parameters
Type Name Description
System.Collections.Generic.List<IPaintTo3DList> sublists

List to assemble

Returns
Type Description
IPaintTo3DList

Created display list

| Improve this Doc View Source

Nurbs(GeoPoint[], Double[], Double[], Int32)

Deprecated, not used anymore and not implemented by the CADability display drivers.

Declaration
void Nurbs(GeoPoint[] poles, double[] weights, double[] knots, int degree)
Parameters
Type Name Description
GeoPoint[] poles
System.Double[] weights
System.Double[] knots
System.Int32 degree
| Improve this Doc View Source

OpenList()

Opens a new display list. All subsequent calls to paint methods will be stred in the list. When CloseList() will be called the object resembling the list will be returned. Only the following method calls are allowed while a displaylist is open: Polyline(GeoPoint[]), FilledPolyline(GeoPoint[]), Points(GeoPoint[], Single, PointSymbol), Triangle(GeoPoint[], GeoVector[], Int32[]), RectangularBitmap(Bitmap, GeoPoint, GeoVector, GeoVector), Text(GeoVector, GeoVector, GeoPoint, String, String, FontStyle, Text.AlignMode, Text.LineAlignMode), DisplayIcon(GeoPoint, Bitmap), DisplayBitmap(GeoPoint, Bitmap), List(IPaintTo3DList)

Declaration
void OpenList()
| Improve this Doc View Source

OpenPath()

When the implementation supports Paths (see CanFillPaths), this call will start recording calls to Polyline(GeoPoint[]) and Arc(GeoPoint, GeoVector, GeoVector, Double, Double) until ClosePath(Color) is called.

Declaration
void OpenPath()
| Improve this Doc View Source

PaintFaces(PaintTo3D.PaintMode)

Faces are painted with a small offset to the backgroung, wheras curves are painted with a small offset to the front. This ensures proper visibility of edges that lie on faces.

Declaration
void PaintFaces(PaintTo3D.PaintMode paintMode)
Parameters
Type Name Description
PaintTo3D.PaintMode paintMode

Paint faces, curves or both (PaintTo3D.PaintMode)

| Improve this Doc View Source

Point2D(Int32, Int32)

Deprecated, currently not used and not implemented

Declaration
void Point2D(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
| Improve this Doc View Source

Points(GeoPoint[], Single, PointSymbol)

Draws simple pixel based points e.g. for background grid display.

Declaration
void Points(GeoPoint[] points, float size, PointSymbol pointSymbol)
Parameters
Type Name Description
GeoPoint[] points
System.Single size
PointSymbol pointSymbol
| Improve this Doc View Source

Polyline(GeoPoint[])

Draws a sequence of lines.

Declaration
void Polyline(GeoPoint[] points)
Parameters
Type Name Description
GeoPoint[] points

The points to connect

| Improve this Doc View Source

PopModOp()

Undoes the previously called PushMultModOp(ModOp)

Declaration
void PopModOp()
| Improve this Doc View Source

PopState()

Restores the previously saved state

Declaration
void PopState()
| Improve this Doc View Source

PrepareBitmap(Bitmap)

Similar to PrepareBitmap(Bitmap, Int32, Int32) with origin set to (0,0)

Declaration
void PrepareBitmap(Bitmap bitmap)
Parameters
Type Name Description
System.Drawing.Bitmap bitmap

The bitmap.

| Improve this Doc View Source

PrepareBitmap(Bitmap, Int32, Int32)

Assure that the bitmap will be available when DisplayIcon(GeoPoint, Bitmap) will subsequently be called. (Some implementations cache the bitmap or transform it into an convenient format)

Declaration
void PrepareBitmap(Bitmap bitmap, int xoffset, int yoffset)
Parameters
Type Name Description
System.Drawing.Bitmap bitmap

The bitmap

System.Int32 xoffset

x-component of the origin that defines the insertion point (e.g. to center the bitmap)

System.Int32 yoffset

y-component of the origin

| Improve this Doc View Source

PrepareIcon(Bitmap)

Assure that the icon will be available when DisplayIcon(GeoPoint, Bitmap) will subsequently be called. (Some implementations cache the icon or transform it into an convenient format)

Declaration
void PrepareIcon(Bitmap icon)
Parameters
Type Name Description
System.Drawing.Bitmap icon

The icon

| Improve this Doc View Source

PreparePointSymbol(PointSymbol)

Assure that the point symbol is loaded

Declaration
void PreparePointSymbol(PointSymbol pointSymbol)
Parameters
Type Name Description
PointSymbol pointSymbol
| Improve this Doc View Source

PrepareText(String, String, FontStyle)

Assure that the charactres in textString will be available when Text(GeoVector, GeoVector, GeoPoint, String, String, FontStyle, Text.AlignMode, Text.LineAlignMode) is called.

Declaration
void PrepareText(string fontName, string textString, FontStyle fontStyle)
Parameters
Type Name Description
System.String fontName

Name of the font

System.String textString

String to be painted

System.Drawing.FontStyle fontStyle

Additional font style (bold, italic, etc.)

| Improve this Doc View Source

PushMultModOp(ModOp)

Sets a matrix to multiply all objects beeing displayed with. This matrix will be applied additionally to the current matrix

Declaration
void PushMultModOp(ModOp insertion)
Parameters
Type Name Description
ModOp insertion

New matrix

| Improve this Doc View Source

PushState()

Saves the current state.

Declaration
void PushState()
| Improve this Doc View Source

RectangularBitmap(Bitmap, GeoPoint, GeoVector, GeoVector)

Draws a rectangular bitmap at the provided location with directionWidth specifying the direction of the lower edge of the bitmap and directionHeight specifying the direction of the left edge of the bitmap. PrepareBitmap(Bitmap, Int32, Int32) must be called before this method is called.

Declaration
void RectangularBitmap(Bitmap bitmap, GeoPoint location, GeoVector directionWidth, GeoVector directionHeight)
Parameters
Type Name Description
System.Drawing.Bitmap bitmap

The bitmap to draw

GeoPoint location

Location of the lower left corner of the bitmap

GeoVector directionWidth

Direction of the lower edge of the bitmap

GeoVector directionHeight

Direction of the left edge of the bitmap

| Improve this Doc View Source

Resize(Int32, Int32)

Called when the size of the container associated with this interface changes.

Declaration
void Resize(int width, int height)
Parameters
Type Name Description
System.Int32 width

New width in pixels

System.Int32 height

New height in pixels

| Improve this Doc View Source

SelectedList(IPaintTo3DList, Int32)

Paint the provided display list using the display mode.

Declaration
void SelectedList(IPaintTo3DList paintThisList, int wobbleRadius)
Parameters
Type Name Description
IPaintTo3DList paintThisList

List to paint

System.Int32 wobbleRadius

Wobble radius to paint the same list multiple times with small offsets

| Improve this Doc View Source

SetClip(Rectangle)

Sets a clip rectangle for subsequent paint commands. If clipRectangle is empty, no clipping will occur.

Declaration
void SetClip(Rectangle clipRectangle)
Parameters
Type Name Description
System.Drawing.Rectangle clipRectangle

Rectangle to use for clipping

| Improve this Doc View Source

SetColor(Color)

Sets the color for the next paint methods

Declaration
void SetColor(Color color)
Parameters
Type Name Description
System.Drawing.Color color

The color to use for drawing

| Improve this Doc View Source

SetLinePattern(LinePattern)

Sets the line pattern for subsequent curve drawing. A pattern consists of pairs of double values: stroke length followed by gap length. If the parameter is null or an empty array, solidlines or curves will be drawn.

Declaration
void SetLinePattern(LinePattern pattern)
Parameters
Type Name Description
LinePattern pattern
| Improve this Doc View Source

SetLineWidth(LineWidth)

Sets the line width for subsequent curve drawing

Declaration
void SetLineWidth(LineWidth lineWidth)
Parameters
Type Name Description
LineWidth lineWidth

Line width in world coordinates

| Improve this Doc View Source

SetProjection(Projection, BoundingCube)

Sets the projection to use in subsequent calls to paint methods.

Declaration
void SetProjection(Projection projection, BoundingCube boundingCube)
Parameters
Type Name Description
Projection projection

The projection

BoundingCube boundingCube

The bounding cube, may be used for clipping

| Improve this Doc View Source

Text(GeoVector, GeoVector, GeoPoint, String, String, FontStyle, Text.AlignMode, Text.LineAlignMode)

Draw a text with the provided parameters and the current color.

Declaration
void Text(GeoVector lineDirection, GeoVector glyphDirection, GeoPoint location, string fontName, string textString, FontStyle fontStyle, Text.AlignMode alignment, Text.LineAlignMode lineAlignment)
Parameters
Type Name Description
GeoVector lineDirection

Direction of the base line of the text

GeoVector glyphDirection

Direction of the glyph of the characters (for horizontal text this is the y-axis)

GeoPoint location

Location where to draw the text (using alignement)

System.String fontName

Name of the font

System.String textString

String to draw

System.Drawing.FontStyle fontStyle

Style of the font (e.g. bold)

Text.AlignMode alignment

Left, right or center (horizontal) alignement

Text.LineAlignMode lineAlignment

Vertical alignement

| Improve this Doc View Source

Triangle(GeoPoint[], GeoVector[], Int32[])

Draw a set of solid-filled triangles with the current color.

Declaration
void Triangle(GeoPoint[] vertex, GeoVector[] normals, int[] indextriples)
Parameters
Type Name Description
GeoPoint[] vertex

The coordinates of the vertices

GeoVector[] normals

The coordinates of the normal vectors in the vertices

System.Int32[] indextriples

Triples of indices which define traingles. Length must be a multiple of 3

| Improve this Doc View Source

UseZBuffer(Boolean)

Usually set to true, switch off to paint coordinate axis etc.

Declaration
void UseZBuffer(bool use)
Parameters
Type Name Description
System.Boolean use
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX