Show / Hide Table of Contents

Class OpenGlCustomize

This class defines static events that can be used to customize the OpenGL implementation

Inheritance
System.Object
OpenGlCustomize
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CADability
Assembly: CADability.dll
Syntax
public class OpenGlCustomize

Methods

| Improve this Doc View Source

PaintToBitmap(GeoObjectList, GeoVector, Int32, Int32, Nullable<BoundingCube>)

Paint the provided IGeoObjects onto a bitmap with the help form OpenGL. The viewDirection specifies in which direction the objects are projected (e.g. (0,0,-1) is from top) the objects fill the bitmap and leave a 10% empty frame.

Declaration
public static Bitmap PaintToBitmap(GeoObjectList list, GeoVector viewDirection, int width, int height, BoundingCube? extent = default(BoundingCube? ))
Parameters
Type Name Description
GeoObjectList list

objects to paint

GeoVector viewDirection

direction of view

System.Int32 width

of the bitmap

System.Int32 height

of the bitmap

System.Nullable<BoundingCube> extent
Returns
Type Description
System.Drawing.Bitmap

Events

| Improve this Doc View Source

SetProjectionEvent

Event that is raised when the projection of the OpenGL view was changed. You can modify the light sources and direction. The original code for setting the light model is:

Gl.glLightModeli(Gl.GL_LIGHT_MODEL_TWO_SIDE, Gl.GL_TRUE);
Gl.glEnable(Gl.GL_LIGHTING);
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_POSITION, new float[] { (float)v.x, (float)v.y, (float)v.z, 0.0f });
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_AMBIENT, new float[] { 0.2f, 0.2f, 0.2f, 1.0f });
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_DIFFUSE, new float[] { 1.0f, 1.0f, 1.0f, 1.0f });
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_SPECULAR, new float[] { 1.0f, 1.0f, 1.0f, 1.0f });
Gl.glEnable(Gl.GL_LIGHT0);
Declaration
public static event OpenGlCustomize.SetProjectionDelegate SetProjectionEvent
Event Type
Type Description
OpenGlCustomize.SetProjectionDelegate
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX