Home Page > KernelCAD Components > Data Types
DI Types
Basic data types
Note: All elements of data structures below declared with struct keyword must be initialised before any use. Failing to do so may lead to unpredictable behaiviour as structures do not have a constructor, so have random values by default
3D vector
struct DIVect {
double v[3];
};
DIVect is used to represent a 3D vector.
3D point
struct DIPoint {
double x[3];
};
DIPont is a 3D point.
2D Point or Vector
struct KC2D {
double x[2];
};
Color_KC
struct Color_KC_ {
float red;
float green;
float blue;
} Color_KC;
typedef struct KCRange_ {
double min;
double max;
} KCRange;
typedef struct KCBox_ {
KCRange range[3];
} KCBox;
KCN3 Srtucture
typedef struct KCN3_ {
int n[3];
} KCN3;
typedef struct PairInt_ {
int x;
int y
} PairInt;
ECoordinatesType enumeration
typedef enum ECoordinatesType_ {
eCoordTypeCartesian = 1,
eCoordTypePolar = 2,
} ECoordinatesType;
EPatchType enumeration
typedef enum EPatchType_ {
ePatchTypeCurvature = 1,
ePatchTypeRadius = 2,
} EPatchType;
The enumeration used for selection between Standard (Curvature) and Radial
Arc Patch types. (See Radial Patches)
Segment Type enumeration
enum ESegmentType { eSegmTypeLine = 1, eSegmTypeArc = 2 }
Segment Type enumeration may be expanded in future versions of software by
adding new types.
DISectInfo Structure
typedef struct DISectInfo_ {
- bool
closed;
- int
segments;
- double
radius;
- ESegmentType segmentType;
- bool
regularJoints
} DISectInfo;
DISectInfo structure is used to specify common parameters of a new object
in DInsight model.
closed - If true surface strip in the new object will be
closed.
segments - specifies number of surface segments in the strip,
which constitutes the surface of the Generic 3D object (See Patch Strips and Surfaces
). In case of an SOR this is the number of 2D segments in
the generating line strip.
radius - specifies approximate maximal dimension of the object.
In case of a short cylinder it will be equal to the radius of the cyliner.
segmentType - if segmentType is eSegmTypeArc (see above) than
all surface patches in the object will be of arc type (See Patch Types),
otherwise all patches will be linear.
regularJoints - if true all surface joints will be rendered
smooth in 3D.
DI3DSectInfo Structure
typedef struct DI3DSectInfo_ {
-
DISectInfo
sectInfo;
-
int
knots;
-
ESegmentType
axialSegmType;
-
ECoordinatesType
edgeCoordType;
-
EPatchType
patchType
} DI3DSectInfo;
DISectInfo structure contains parameters for creation of a new Generic 3D
Section object.
sectInfo - structure which contains parameters common to all
types of objects (See above).
knots - Number of knots in the base.
axialSegmType - if true all edges in the object will be curved
lines and straight lines otherwise.
edgeCoordType - a member of ECoordinatesType
enumeration. If it is set to
eCoordTypePolar than all 3D lines representing edges of the object will be
defined in Cylindrical coordinates. Otherwise standard Cartesian coordinates
will be used.
patchType - if patchType is ePatchTypeRadius (See EPatchType enumeration)
than all arc patches in the object will be of radial type (See Radial Patches).
Otherwise all arc patches in the object will be standard.
Used to pass additional parameters to
IGraphicItem.DrawEx method.
typedef struct RenderContext_
{
VARIANT_BOOL surface; // If false wire frame will be rendered. Default: true
VARIANT_BOOL normals; // Draw normals? Default: false
} RenderContext;
Used to pass search criteria to IModel2.FindItem method.
typedef struct KCSceneItemInfo_
{
KC3State hasChildren;
KC3State hasParent;
KC3State isEmpty;
BSTR name;
KC3State hasLocalFrame;
int hashItemStartAfter;
} KCSceneItemInfo;
Draw Primitive Enumeration
typedef enum EDrawPrimitive_ {
ePoints,
eLines,
eLineStrip,
eLineLoop,
eTriangles,
eTriangleStrip,
eTriangleFan,
eQuads,
eQuadStrip,
ePolygon,
} EDrawPrimitive;
KC3State Enumeration
typedef enum KC3State_ {
kcUnknown = -1,
kcFalse = 0,
kcTrue = 1,
} KC3State;
Data Type Enumeration
typedef enum EDataType_ {
eDataTypeNULL,
eDataTypeDouble,
eDataTypeSingle,
eDataTypeLong,
eDataTypeShort,
eDataTypeString
} EDataType;
EKCType Enumeration
typedef enum EKCType_ {
eKCTypeNULL,
eKCTypeDouble,
eKCTypeSingle,
// (32 bit floating)
eKCTypeLong,
// 32 bit signed integer
eKCTypeShort,
// 16 bit signed integer
eKCTypeString,
eKCTypeBool, eKCTypeIUnknown,
eKCTypeColor,
} EKCType;
EDictionaryType_KC Enumeration
Enumerates types in dictionaries
typedef enum EDictionaryType_KC_ {
eKDUnknown, // Any
type (or unknown)
eKDInt,
/ 32 bit signed integer
eKDDouble,
// (64 bit floating)
eKDBool,
// Boolean
eKDString,
// String
eKDVariant,
// VARIANT. Interpreted as Object in many environments
eKDInterface,
// Interface
} EDictionaryType_KC;
typedef enum EEnableBit_ {
eEnablePan = 1,
eEnableZoom = 2,
eEnableRotate = 4,
eEnableHighLightPoint = 128,
eEnableHighLightLine = 256,
eEnableHighLightSurface = 512,
eEnableTransparency = 1024,
eEnablePerspectiveProjection = 2048,
eEnableNormals = 4096,
} EEnableBit;
EEnableBit enumeration can be used in calls to IView2.Enable() and
IView2.GetEnableFlag() methods.
EEnableBit enumeration may be expanded in future versions of software by
adding new types.
ESymmType Enumeration
typedef enum ESymmType_ {
eSymmTypeNULL,
eSymmTypeAxial,
eSymmTypeMirror,
eSymmTypeTranslation,
} ESymmType;
EElemTypeKC Enumeration
typedef enum EElemTypeKC_ {
eElTypeVertex,
eElTypeSegment,
eElTypeSimplex,
eElTypeSection,
} EElemTypeKC;
EDIEvent Enumeration
typedef enum EDIEvent_ {
eEventMouseHover,
eEventClientDraw,
eEventCollision,
eEventUICommand, //Context menu item selected
eEventSelection,
eEventExplorerSelection, //Selection changed in Model Explorer
eEvent2DEditor,
// Events from overlay or other 2D editor. The param0 parameter of KernelCADEvent is an integer with value one of EEditorEvent_KC below
eEventMouseSimple, //For RequestEvent. All button down/up etc apart from intesive mouse move
eEventMouseMove,
eEventMouseLButtonDown,
eEventMouseRButtonDown,
eEventModelStructureChanged, //Object hierarchy has changed
eEventMouseRButtonDown,
eEventMouseRButtonMove,
eEventMouseRButtonUp,
eEventCount,
} EDIEvent;
EEditorEvent_KC Enumeration
typedef enum EEditorEvent_KC_ {
eEditEventUnknown,
eEditEventActivated,
// The editor has been activated
eEditEventModelStructureChanged, // A new item aded to the 2D model or
deleted
eEditEventItemStructureChanged, // Number of
elements in an item has chanded. New element added or deleted
eEditEventClosing,
// The editor is about to be closed
} EEditorEvent_KC;
EItemType Enumeration
typedef enum EItemType_ {
eItemTypeSection,
eItemTypeLabel,
eItemTypeViewPoint,
} EItemType;
EPointLocation2D Enumeration
typedef enum EItemType_ {
ePointLocation2DUnknown,
ePointLocation2DInterval, // On a segment in open interval
ePointLocation2DPoint, // At a point
ePointLocation2DInside, // Inside of a closed strip or on the left of an infinitely long strip obtained by extending end lines as rays
ePointLocation2DOutsnside, // Outside of a closed strip or on the right of an infinitely long strip obtained by extending end lines as rays
} EPointLocation2D;
typedef enum EModelViewFrame_ {
eModelViewFrameGlobal,
eModelViewFrameEye
} EModelViewFrame;
typedef enum EModelEntity_ {
eModelEntityUnknown,
eModelEntityObject,
eModelEntityModel,
} EModelEntity;
It is recommended to use mnemonic members of this enumeration as opposed to
hard coded values as it may be expanded in future releases
typedef enum ESTLAnalysis_ {
eStlAnalysAuto,
eStlAnalysPerform,
eStlAnalysSkip,
} ESTLAnalysis;
typedef enum EViewReset_ {
eViewResetAll,
eViewResetVolume,
} EViewReset;
This enumeration is likely to be expanded in future releases
typedef enum EModifResult_ {
eModifResInvalid = -1,
eModifResNoChange = 0,
eModifResModified = 1
} EModifResult;
typedef enum ECADFormat_ {
eCADFormatGLM,
eCADFormatVRML,
eCADFormatSTL,
eCADFormatAutoCADDXF,
eCADFormatAutoCADDWG,
eCADFormatSAT,
} ECADFormat;
Enumerates CAD formats supported by the software. This enumeration will be expanded in future releases
EPageOrientation Enumeration
typedef enum EPageOrientation_ {
eOrientAuto,
eOrientPortrait,
eOrientLandscape,
} EPageOrientation;
EPaperSize Enumeration
typedef enum EPaperSize_ {
ePaperSizeUnknown,
ePaperSizeA4,
ePaperSizeA3,
} EPaperSize;
typedef struct PrintContext_KC_ {
VARIANT_BOOL validOrientation;
EPageOrientation orientation;
VARIANT_BOOL validPaperSize;
EPaperSize paperSize;
VARIANT_BOOL validMargin;
float marginHorizontal;
float marginVertical;
VARIANT_BOOL validScale;
float scale;
} PrintContext_KC;
typedef struct KCBitmap_ {
int type;
int width;
int height;
int widthBytes;
short planes;
short bitsPixel;
} KCBitmap;
typedef enum EViewType_ {
eViewType2D = 2,
eViewType3D = 3,
} EViewType
typedef enum E3DViewProjectionType {
e3DViewProjectionTypeOrthographic,
e3DViewProjectionTypePerspective
} E3DViewProjectionType
typedef enum E2DViewGeometryType_ {
e2DViewGeometryTypeProjection,
e2DViewGeometryTypeIntersection,
} E2DViewGeometryType;
typedef struct PathDetectorContext_ {
VARIANT_BOOL decreasingStart;
double minDistToler;
double precision;
} PathDetectorContext;
PathDetectorContext structure is used in
IKCPathCollisionDetector.Detect method to specify additional parameters for
the operation.
typedef enum EBooleanOperation_ {
eBoolOpUnknown = 0,
eBoolOpSubtract = 1,
eBoolOpUnion = 2,
eBoolOpInters = 3,
eBoolOpClip = 4,
} EBooleanOperation;
EBoolOpContext Structure
typedef struct EBoolOpContext_ {
EBooleanOperation operation;
// The operation
VARIANT_BOOL execute;
// If false only intersection curve is calculated
VARIANT_BOOL intersectionLine;
// Calculate intersection curve(s) of two surfaces
VARIANT_BOOL needEdges;
// If true edges array is calculated (contains information about
normals along intersection)
IUnknown* edges;
// Vertices of intersection arranged in linked loops. Actual type
IArray. elements are IArray of IVertex one per loop
VARIANT_BOOL separateComponents; // If the first object becomes
divided into several isolated pieces, separate the objects and make
it a group.
} EBoolOpContext;
typedef enum EMenuCommand_KC_ {
eMenuCommandSaveAs,
eMenuCommandSeparator1,
eMenuCommandFullScreen,
eMenuCommandSeparator3,
eMenuCommandSurface,
eMenuCommandWireFrame,
eMenuCommandSeparator6,
eMenuCommandGlobalFrame,
eMenuCommandSeparator8,
eMenuCommandHelp,
eMenuCommandAbout,
eMenuCommandSeparator9,
eMenuCommandCustomItem0,
eMenuCommandCustomItem1,
eMenuCommandCustomItem2,
eMenuCommandCustomItem3,
eMenuCommandCustomItem4,
} EMenuCommand_KC;
typedef enum EMeshModsAction_ {
eMeshActionNone = 0,
eMeshActionNormalsFastApprox = 1,
eMeshActionNormalsMedium = 2,
eMeshActionNormalsFull = 4,
eMeshActionNormalsAuto = 8,
} EMeshModsAction;
EDwgVersion Enumeration
typedef enum EDwgVersion_
{
kc_vAC14 = 21, // R14 release
kc_vAC15 = 23, // R15 (2000) release
kc_vAC18 = 25, // R18 (2004) release
kc_vAC21 = 27, // R21 (2007) release
kc_vAC24 = 29, // R24 (2010) release
kc_vAC27 = 31, // R27 (2013) release
}
EDwgVersion;
EDXFVersion Enumeration
typedef enum EDXFVersion_ {
kc_vACdxf12 = 16, // R11 and R12
kc_vACdxf15 = 23, // R15 (2000) release
kc_vACdxf18 = 25, // R18 (2004) release
kc_vACdxf21 = 27, // R21 (2007) release
kc_vACdxf24 = 29, // R24 (2010) release
kc_vACdxf27 = 31, // R27 (2013) release
} EDXFVersion;
ESatVersion Enumeration
typedef enum ESatVersion_ {
kc_ASCII_106 = 0x01000000|106,
kc_ASCII_400 = 0x01000000|400,
kc_ASCII_500 = 0x01000000|500,
kc_ASCII_600 = 0x01000000|600,
kc_ASCII_700 = 0x01000000|700,
kc_ASCII_20800 = 0x01000000|20800,
kc_ASCII_21200 = 0x01000000|21200,
kc_ASCII_21500 = 0x01000000|21500,
} ESatVersion;
EPointInSimplexLocation Enumeration
typedef enum EPointInSimplexLocation_ {
eSimplexPointLocationUnknown,
eSimplexPointLocationInside,
eSimplexPointLocationEdge,
eSimplexPointLocationVertex,
eSimplexPointLocationOutside,
eSimplexPointLocationNotInPlane,
} EPointInSimplexLocation;
TopAbs_ShapeEnumKO enumeration
typedef enum TopAbs_ShapeEnumKO_ {
eShTop_COMPOUND ,
eShTop_COMPSOLID,
eShTop_SOLID ,
eShTop_SHELL,
eShTop_FACE,
eShTop_WIRE,
eShTop_EDGE,
eShTop_VERTEX,
eShTop_SHAPE,
eShTop_UNKNOWN,
} TopAbs_ShapeEnumKO;
Enumerates topological types of geometry of bspline brep sections
EStringSource Enumeration
typedef enum EStringSource_ {
eStringSourceUnknown,
eStringSourceObjectName,
eStringSourceLayerName,
eStringSourceTemplate,
} EStringSource;
EMeshRefineType Enumeration
typedef enum EMeshRefineType_ {
eMeshRefineTypeFlat,
eMeshRefineTypeButterfly,
eMeshRefineTypeLoop,
eMeshRefineTypeCatmull,
eMeshRefineTypeONE_QUAD_X_EDGE,
} EMeshRefineType;
|