SolidKit Library Documentation
From Solid Graphics Wiki
The SolidKit Library is a programming library for development of 3D/2D graphics applications in C++ for Microsoft Windows family of operating systems using OpenGL and MFC (although using the MFC is optional). The library is a commercial product distributed under terms of proprietary license.
This article contains information about classes and types provided by the SolidKit Library and other information useful for software development with the library.
Contents |
Application Examples
Perhaps the most efficient way to learn the library capabilities and to learn how to use them - is to run sample library programs and to review their source code. The sample programs and their source code are included with all library packages including the SolidKit Library Demo.
See this article for more information about the SolidKit Library sample projects.
Namespaces
The SolidKit Library classes, structures and variables are defined in SKL namespace and SKL3D namespace. The SKL namespace contains generic purpose types, the SKL3D namespace contains 3D related types.
Classes
This section contains refence of most important SolidKit Library classes and structure types. The classes which provide most of the library features are highlighted by bold type.
View Navigation and Objects Manipulation
| Window3D class | The class provides 3D view window functionality with view navigation and scene objects manipulation using mouse and keyboard. |
| ObjectPosInfo struct | Provides information about scene object position and orientation. |
| ObjectPosInfoList class | Provides information about position and orientation of a scene object which is part of a larger object hierarchy. |
| ObjectEditOptions struct | Allows to specify editing/manipulation options for a 3D object to the Window3D class instance, such as to restrict the object movement into plane, or the object rotation to rotation around specified axis only. |
| CommandTrigger class | This class allows keyboard/mouse shortcuts customization. It triggers commands start/end events based on keyboard or mouse input. |
| Camera struct | Represents camera parameters, such us "camera eye" position, target position, up direction, view angle. |
| Window3DDefaults struct | Defines default settings for many of the Window3D class settings. |
| ViewControlInfo struct | Specifies group of parameters for Window3D class, such as mouse sensitivity, selection options, floor navigation settings. |
| ViewMovementInfo struct | Specifies group of parameters, such as rotation speed or pan speed, for Window3D class which affect view navigation and scene object manipulation when using keyboard shortcuts. |
Constructive Solid Geometry
| CSGOperation class | The class provides constructive solid geometry functionality for triangle meshes using float precision. |
| CSGOperationd class | The class provides constructive solid geometry functionality for triangle meshes using double precision. |
Basic 3D Data Types
| Point class | Specifies a (x, y, z) location in 3D space using float precision |
| PointList class | List of point class objects. |
| Vector class | Specifies (x, y, z) direction in 3D space and size using float precision |
| VectorList class | List of vector class objects. |
| TriangleByRef class | Specifies a triangle using three reference indexes into a PointList class object. |
| TriangleByRefList class | List of TriangleByRef objects. |
| Shape class | This class holds a PointList class and TriangleByRefList class instance instance, specifying a triangle mesh. |
| BoundingBox class | Defines axis aligned box. This class can be used to effectively represent approximate boundary of a 3D object, such as a Shape object. |
| Matrix3x3f class | Represents a 3x3 matrix of float values. A 3x3 matrices can be used to provide rotation-only point or vector coordinates transformations. |
| Matrix4x4f class | Represents a 4x4 matrix of float values. A 4x4 matrices can be used to provide translation & rotation point or vector coordinates transformations between two coordinate systems. |
| SpatialIndex class | Provides spatial sorting of 3D objects in 3D space using octtree. It can be used for example for purposes of efficient collision detection between 3D objects, of for spatial queries, like "find me all 3D objects in my camera view" |
| Triangle class | Specifies a triangle using three Point class objects. |
| TriangleList class | List of Triangle class objects. |
| Plane class | Defines a plane. |
| LineSegment class | Instance of the class defines a line segment by providing point coordinates of it's two endpoints. |
| LineSegmentByRef class | Defines a line segment by providing indexes to a PointList of it's two endpoints. |
OpenGL drawing and rendering support classes
| Color class | Red, green, blue alpha color values using float precision. |
| Material class | Ths class defines ambient, diffuse and specular material properties. |
| MaterialList class | List of Material class objects. |
| Texture class | Class provides functionality of loading texture image from JPEG, PNG, GIF or BMP files, and allows to use it in OpenGL renders. |
| Font class | Texture based font for using in OpenGL renders. |
| LightProperties struct | The LightProperties struct defines ambient, diffuse and specular and other light properties which can be used to define lights in OpenGL. |
Generic helpers and utility classes
| Image class | The class allows to load/save image data from/to JPEG, PNG, GIF or BMP files. |
| MemoryBuffer class | The class allows to cache chunk of binary data. |
| String class | Dynamic-size text string class. |
| StringList class | List of String class objects. |
| File class | Helper class for working with files. |
| Guid class | Provides functions for generating and working with 128-bit globally unique identifiers. |
| XmlReader class | Provides function for parsing and reading XML files content. |
Templates
The SolidKit Library makes extensive use of list and dictionary templates. The reason why the library does not use similar templates available in STL, MFC, or ATL - is that the SolidKit templates are tailored for algorithms used in the library (for performance reasons - especially for CSG algorigms). Other advantage is that the library code is more portable. Also we think that our templates are easier to use than corresponding templates available for example is STL.
| List template | A template for making dynamic-size one-dimensional arrays. |
| Dictionary template | A template for making dynamic-size key to value dictionaries. |
Functions
Geometry math functions
| TrianglesIntersect | Determines whether two triangles intersects. |
| ClosestLinePoints | Calculates positions and coordinates of closest points of two lines. |
| ClosestLinePointPosition | Calculates position of a point lying on a specified line closest to a specified point. |
| ClosestLineSegmentPoints | Calculats positions and coordinates of closest points of two line segments. |
| LinePositionToPoint | Translates point's position on a line to the point coordinates. |
| PointOnLinePosition | Calculates position on a line from given point coordinates. |
| LineTriangleIntersection | Calculates line's intersection with a triangle. |
| LinePlaneIntersection | Calculates line's intersection with a plane. |
| SquareOfPointToLineDistance | Returns square of shortest distance from line to point. |
| SquareOfPointToLineSegmentDistance | Returns square of shortest distance from line segment to point. |
| SquareOfLineSegmentsDistance | Returns square of shortest distance of two line segments. |
3D rendering functions
- All functions in this section internally use OpenGL functions for rendering.
| DrawFlatShadedShape | Draws shape using flat shading. |
| DrawSmoothShadedShape | Draws shape using smooth shading. |
| DrawSmoothCAShadedShape | Draws shape using smooth shading with crease angle. |
| DrawShapeWireframe | Draws shape's wireframe. |
| DrawShapePoints | Draws shape's mesh-points. |
| DrawShapeNormals | Draws shape's normals. |
| DrawObjectAxis | Draws specified object's axis/vector. |
Generic helper functions
| GetLastErrorInfo | Returns textual information about the last error encountered in a SolidKit library function. |
| CompressData | Compresses chunk of binary data in memory. |
| DecompressData | Uncompresses compressed memory buffer into it's original content. |
| GET_CPU_TICK_COUNT | A macro which reads current CPU tick count. |
| CpuTicksToSeconds | Converts CPU ticks to seconds. The seconds value is returned using double precision. |
| CpuTickToTimeT | Converts CPU tick number to the number of seconds elapsed since midnight (00:00:00), January 1, 1970 UTC. Decimal part is also returned using double precision. |
| ImportRegistryData | Imports registry keys and values from registry-export-file-formatted string. |
| GetRegistrySubKeyNames | Returns registry key subkey names. |
| GetRegistryValueNames | Returns registry key value names. |
| GetRegistryValue | Reads registry value into String, bool, int, or float variable. |
| SetRegistryValue | Sets registry value. |
| RegistryKeyExist | Checks whether registry key exists. |
| RegistryValueExist | Checks whether registry value exists. |
| DeleteRegistryValue | Deletes registry value. |
| DeleteRegistryKey | Deletes registry key. |
