C# Class Revit.SDK.Samples.ObjectViewer.CS.Sketch3D

provide methods to draw objects
Show file Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
Draw ( Graphics graphics ) : void

draw the line contain in m_lines in 2d Preview

MoveX ( bool left ) : void

move view in horizontal direction

MoveY ( bool up ) : void

move view in vertical direction

Sketch3D ( Graphics3DData data3D, Graphics2DData data2D ) : System

The default constructor

Zoom ( bool zoomIn ) : void

zoom the displayed drawing in canvas

Private Methods

Method Description
Calculate2DTransform ( ) : void

calculate the transform between canvas and 2D geometry objects

Calculate3DTransform ( ) : void

calculate the transform between canvas and 3D geometry objects

CalculateCanvasRegion ( float previewWidth, float previewHeigh, RectangleF bbox ) : System.Drawing.PointF[]

get the display region, adjust the proportion and location

DataUpdateViewEvent ( ) : void

update according data when 3D data is updated

DrawCurves ( Graphics graphics, List curves, Matrix transform, Pen pen ) : void

Draw curves

Initialize2DData ( ) : void

initialize 2D drawing data

Initialize3DData ( ) : void

initialize 3D drawing data

PreTreatBBox ( RectangleF bbox ) : RectangleF

pretreat BBoundingBox so that its height or width will be bigger than zero

ToBoundingBox2D ( BoundingBoxXYZ bbox3D ) : RectangleF

Get X and Y data of 3D BoundingBox to creat a 2D BoundingBox

UpdateDataAndEvent ( ) : void

update drawing data according and related Event

Method Details

Draw() public method

draw the line contain in m_lines in 2d Preview
public Draw ( Graphics graphics ) : void
graphics System.Drawing.Graphics Graphics to draw
return void

MoveX() public method

move view in horizontal direction
public MoveX ( bool left ) : void
left bool left or right
return void

MoveY() public method

move view in vertical direction
public MoveY ( bool up ) : void
up bool up or down
return void

Sketch3D() public method

The default constructor
public Sketch3D ( Graphics3DData data3D, Graphics2DData data2D ) : System
data3D Graphics3DData a list contain all the 3d data
data2D Graphics2DData a list contain all the 3d data
return System

Zoom() public method

zoom the displayed drawing in canvas
public Zoom ( bool zoomIn ) : void
zoomIn bool true for zoom in, false for zoom out
return void